/* Carosello 360° Centauri: visualizzatore a schermo pieno, pensato per
   aprirsi dentro il tour 3DVista (finestra/iframe) o da solo nel browser. */

:root {
  --sfondo: #1c1c1d;
  --testo: #f2f2f2;
  --comandi: rgba(20, 20, 22, 0.62);
  --comandi-hover: rgba(255, 255, 255, 0.16);
  --accento: #f39200;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--sfondo);
  color: var(--testo);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

.carosello {
  position: fixed;
  inset: 0;
  background: var(--sfondo);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.carosello canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.carosello.trascina canvas {
  cursor: grabbing;
}

.carosello.zoom canvas {
  cursor: move;
}

.carosello-titolo {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--comandi);
  pointer-events: none;
  transition: opacity 0.3s;
}

.carosello.zoom .carosello-titolo {
  opacity: 0;
}

.carosello-suggerimento {
  position: absolute;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 60px);
  transform: translateX(-50%);
  white-space: nowrap;
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--comandi);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s;
}

.carosello-suggerimento.nascosto {
  opacity: 0;
}

.carosello-avanzamento {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: opacity 0.6s;
}

.carosello-avanzamento > div {
  height: 100%;
  width: 0;
  background: var(--accento);
  transition: width 0.2s;
}

.carosello-avanzamento.finito {
  opacity: 0;
}

.carosello-comandi {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--comandi);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.carosello-comandi button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--testo);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.carosello-comandi button:hover {
  background: var(--comandi-hover);
}

.carosello-comandi button:focus-visible {
  outline: 2px solid var(--accento);
  outline-offset: -2px;
}

.carosello-comandi button:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}

.carosello-comandi button[hidden] {
  display: none;
}

.carosello-comandi svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carosello-noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
}
