* { margin: 0; padding: 0; box-sizing: border-box; }

/* l'attribut hidden doit toujours gagner, même si un display: est défini plus bas
   (sinon un overlay caché continue de couvrir l'écran et bloque les clics) */
[hidden] { display: none !important; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  cursor: default;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: none;
}
.stage-video.active { display: block; }

/* fiche verre ouverte : l'image figée derrière est un peu floutée
   (léger zoom pour masquer le bord clair créé par le flou) */
.stage-video { transition: filter 350ms ease, transform 350ms ease; }
body.verre-open .stage-video.active {
  filter: blur(7px) brightness(0.85);
  transform: scale(1.04);
}

#hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.55);
  opacity: 0;
  animation: hotspot-in 180ms ease forwards;
  pointer-events: none;
}
@keyframes hotspot-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

body.scrubbing #scene { cursor: ew-resize; }

/* consigne en haut de l'écran dans les salles à panneaux cliquables
   (disparaît après le premier clic sur un produit) */
#room-hint {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
  padding: 8px 22px;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 999px;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: opacity 400ms ease;
}
#room-hint.on { opacity: 1; }

#hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  transition: opacity 400ms ease;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
#hint.gone { opacity: 0; }

/* ---- Mobile : portrait bloqué (l'expérience est pensée paysage) ---- */
#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0d0d0f;
  align-items: center;
  justify-content: center;
}
#rotate-msg {
  text-align: center;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0 36px;
  line-height: 1.5;
}
#rotate-icon {
  font-size: 3rem;
  margin-bottom: 18px;
  animation: rotate-wiggle 2s ease-in-out infinite;
}
@keyframes rotate-wiggle {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-90deg); }
}
/* uniquement sur écrans tactiles tenus en portrait */
@media (pointer: coarse) and (orientation: portrait) {
  #rotate-overlay { display: flex; }
}
/* en mode intégré (iframe), la fenêtre est déjà paysage : jamais d'écran rotation */
body.embed #rotate-overlay { display: none !important; }

/* bouton plein écran : visible seulement en mode intégré */
#fullscreen-btn {
  display: none;
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 45;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 200ms ease;
}
#fullscreen-btn:hover { background: rgba(0, 0, 0, 0.7); }
body.embed #fullscreen-btn { display: block; }



/* ---- fiche verre imprimé (salle Nos produits) ---- */
#verre-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  background: rgba(0, 0, 0, 0);
  transition: backdrop-filter 350ms ease, -webkit-backdrop-filter 350ms ease,
              background 350ms ease;
  cursor: pointer;
}
#verre-overlay.open {
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  background: rgba(0, 0, 0, 0.25);
}

#verre-card {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform-origin: center center;
  transition: transform 350ms cubic-bezier(0.22, 0.8, 0.3, 1), opacity 250ms ease;
  will-change: transform;
  pointer-events: none;
}

/* média = image + nom superposé en bas */
#verre-media {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

#verre-img {
  max-width: 50vw;
  max-height: 50vh;
  background: #1c1c1e;
  display: block;
}
#verre-img.absente {          /* numéro sans photo : carte neutre */
  width: 34vw;
  height: 44vh;
}

/* nom de la céramique/produit, superposé en bas de l'image, plus gros */
#verre-nom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  padding: 42px 18px 16px;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0) 100%);
}

/* petit cadre « formats disponibles » sous l'image */
#verre-formats {
  align-self: center;
  max-width: 50vw;
  padding: 9px 16px 11px;
  border: 1px solid rgba(201, 162, 75, 0.75);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.62);
  text-align: center;
  line-height: 1.45;
}
#verre-formats .vf-titre {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #c9a24b;
  margin-bottom: 4px;
}
#verre-formats .vf-row {
  font-size: 0.8rem;
  color: #f0f0f0;
  white-space: nowrap;
}
#verre-formats .vf-row .vf-size { font-weight: 700; }
#verre-formats .vf-row .vf-sep  { color: #9a9a9a; margin: 0 7px; }
#verre-formats .vf-row .vf-th   { color: #c7c7c7; }

/* ---- Logo Sodiver ---- */
/* intro : gros, centré sur la page d'accueil FLOUTÉE ; le logo et le flou
   disparaissent ensemble en fondu (piloté par script.js qui pose .gone) */
#logo-intro {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
  pointer-events: none;
  transition: background 600ms ease,
              backdrop-filter 600ms ease, -webkit-backdrop-filter 600ms ease;
}
#logo-intro img {
  width: min(46vw, 520px);
  height: auto;
  opacity: 0;
  transition: opacity 500ms ease;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.5));
}
#logo-intro.in img { opacity: 1; }              /* fondu d'entrée */
#logo-intro.gone {                               /* fondu de sortie : flou + logo ensemble */
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}
#logo-intro.gone img { opacity: 0; }
/* permanent : petit, en bas à gauche, toujours visible */
#logo-corner {
  position: absolute;
  left: 18px;
  bottom: 14px;
  width: 92px;
  height: auto;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
  transition: opacity 700ms ease;
}
#logo-corner.on { opacity: 0.92; }

/* ---- Panneau générique (verres déco / nuancier / impression) ---- */
#panel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 300ms ease, backdrop-filter 300ms ease,
              -webkit-backdrop-filter 300ms ease;
  cursor: pointer;
  z-index: 30;
}
#panel-overlay.open {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
#panel-content {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 300ms ease, transform 300ms cubic-bezier(0.22, 0.8, 0.3, 1);
}
#panel-overlay.open #panel-content { opacity: 1; transform: scale(1); }

/* grille de vignettes (verres décoratifs) : 3 en haut, 2 en bas centrés */
.pnl-deco { display: flex; flex-direction: column; gap: 22px; }
.pnl-row  { display: flex; gap: 24px; justify-content: center; }
.pnl-item { text-align: center; }
.pnl-item img {
  width: min(22vw, 230px);
  height: min(22vw, 230px);
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  display: block;
}
.pnl-item figcaption {
  margin-top: 9px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* nuancier : grille de pastilles, même disposition que « Couleurs de nuancier »
   (9 colonnes x 13 lignes, cases un peu plus larges que hautes comme l'image) */
.pnl-nuancier {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  width: min(72vw, 680px);
  padding: 16px;
  background: rgba(20, 20, 22, 0.55);
  border-radius: 12px;
}
.pnl-nuancier .swatch {
  aspect-ratio: 3 / 2;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.pnl-nuancier .swatch:hover {
  transform: scale(1.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

/* photo de verre décoratif agrandie (clic à côté -> retour grille) */
.pnl-zoom img {
  width: min(62vh, 58vw);
  height: min(62vh, 58vw);
}
.pnl-zoom figcaption { font-size: 1.4rem; margin-top: 12px; }

/* couleur agrandie (nuancier) : sans nom */
.pnl-couleur {
  width: min(46vw, 460px);
  height: min(46vh, 460px);
  border-radius: 10px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6);
  border: 3px solid rgba(255, 255, 255, 0.85);
}

/* encadré impression numérique (bleu clair) */
.pnl-info {
  max-width: min(80vw, 460px);
  padding: 30px 40px;
  background: rgba(20, 20, 22, 0.85);
  border: 1px solid rgba(126, 208, 245, 0.85);
  border-radius: 14px;
  text-align: center;
  color: #f2f2f2;
}
.pnl-info .pnl-info-t {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
}
.pnl-info a {
  color: #7ed0f5;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid #7ed0f5;
  pointer-events: auto;
}
.pnl-title {
  text-align: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 18px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* ---- Mobile : téléphone en paysage (hauteur d'écran réduite) ---- */
@media (max-height: 520px) {
  /* fiche produit : occupe mieux le petit écran */
  #verre-img { max-width: 62vw; max-height: 62vh; }
  #verre-nom { font-size: 1.05rem; padding: 24px 12px 9px; }
  #verre-formats { max-width: 84vw; padding: 6px 12px 8px; }
  #verre-formats .vf-titre { font-size: 0.58rem; margin-bottom: 2px; }
  #verre-formats .vf-row { font-size: 0.68rem; }

  /* panneaux */
  .pnl-item img { width: min(23vh, 140px); height: min(23vh, 140px); }
  .pnl-item figcaption { font-size: 0.75rem; margin-top: 5px; }
  .pnl-deco { gap: 10px; }
  .pnl-row { gap: 12px; }
  .pnl-zoom img { width: min(58vh, 50vw); height: min(58vh, 50vw); }
  .pnl-zoom figcaption { font-size: 1rem; margin-top: 8px; }
  .pnl-nuancier {
    height: 68vh;
    width: calc(68vh * 27 / 26);   /* 9 colonnes x 13 lignes de cases 3:2 */
    gap: 3px;
    padding: 10px;
  }
  .pnl-nuancier .swatch { aspect-ratio: auto; }
  .pnl-couleur { width: min(52vh, 300px); height: min(52vh, 300px); }
  .pnl-info { padding: 16px 22px; max-width: 84vw; }
  .pnl-info .pnl-info-t { font-size: 1.05rem; }
  .pnl-title { margin-bottom: 8px; }

  /* textes d'aide et logo */
  #hint { font-size: 0.6rem; bottom: 8px; }
  #room-hint { top: 8px; font-size: 0.82rem; padding: 6px 16px; }
  #logo-corner { width: 60px; left: 10px; bottom: 8px; }
  #logo-intro img { width: min(38vw, 340px); }
}
