/* ==========================================================================
   VISUALISEUR PLEIN ÉCRAN (page isolée /maquette) — interface façon ABARI
   ========================================================================== */

html:has(body.odp-viewer-page), body.odp-viewer-page { height: 100%; margin: 0; overflow: hidden; }
body.odp-viewer-page { background: #0e0e0c; }

.vwr {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: #0e0e0c; color: #fff;
  font-family: var(--font-body);
}

/* ----- Barre supérieure ----- */
.vwr__top {
  flex: 0 0 auto; height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(255,255,255,.97); color: var(--c-ink);
  border-bottom: 1px solid var(--c-line);
  z-index: 20;
}
.vwr__brand { display: inline-flex; align-items: center; }
.vwr__logo { height: 34px; width: auto; display: block; }

.vwr__tabs { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: center; }
.vwr__tab {
  background: none; border: 0; cursor: pointer;
  padding: .55rem .95rem; border-radius: 7px;
  font: inherit; font-size: .85rem; letter-spacing: .02em;
  color: var(--c-ink-soft);
  display: inline-flex; align-items: center; gap: .4rem;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.vwr__tab:hover { color: var(--c-ink); background: rgba(28,27,24,.05); }
.vwr__tab.is-active { color: var(--c-ink); background: rgba(28,27,24,.08); font-weight: 600; }
.vwr__badge { background: var(--c-gold); color: #fff; border-radius: 999px; font-size: .7rem; min-width: 18px; height: 18px; display: inline-grid; place-content: center; padding: 0 5px; }

.vwr__actions { display: flex; align-items: center; gap: .4rem; }
.vwr__icon {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(28,27,24,.06); color: var(--c-ink);
  display: grid; place-content: center; cursor: pointer; text-decoration: none;
  font-size: 1rem; font-family: var(--font-display);
  transition: background var(--dur-fast);
}
.vwr__icon:hover { background: rgba(28,27,24,.12); }
.vwr__icon--wa { background: #25D366; color: #fff; }
.vwr__icon--wa:hover { background: #1da851; }
.vwr__icon--close { font-size: 1.3rem; }

/* ----- Recherche flottante ----- */
.vwr__search {
  position: absolute; top: 78px; left: 1.25rem; z-index: 16;
  display: flex; align-items: center; gap: .55rem;
  background: rgba(255,255,255,.96); color: var(--c-ink-soft);
  border-radius: 999px; padding: .55rem 1rem; box-shadow: var(--sh-sm);
}
.vwr__search input { border: 0; background: none; outline: none; font: inherit; width: 190px; color: var(--c-ink); }

/* ----- Scène & panneaux ----- */
.vwr__stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.vwr__panel { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity var(--dur-base) var(--ease-out); }
.vwr__panel.is-active { opacity: 1; visibility: visible; }
.vwr__panel[data-panel="maquette"] { overflow: hidden; }
.vwr__panel:not([data-panel="maquette"]) { overflow: auto; }

/* Sélecteur de niveaux */
.vwr__levels {
  position: absolute; top: 1.25rem; right: 1.25rem; z-index: 12;
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(14,14,12,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 9px; padding: 4px;
}
.vwr__levels button {
  background: none; border: 0; cursor: pointer;
  color: rgba(255,255,255,.82); padding: .5rem 1rem; border-radius: 6px;
  font: inherit; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
}
.vwr__levels button.is-active { background: rgba(255,255,255,.18); color: #fff; }
.vwr__levels button:disabled { opacity: .4; cursor: not-allowed; }

/* Plaquette / Plan / vides */
.vwr__frame, .vwr__plan { height: 100%; display: grid; place-items: center; padding: 1.5rem; background: var(--c-bg-warm); }
.vwr__frame iframe { width: 100%; max-width: 1100px; height: 100%; border: 0; border-radius: 10px; box-shadow: var(--sh-lg); background: #fff; }
.vwr__plan img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--sh-lg); }
.vwr__empty, .vwr__favwrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .6rem; padding: 2.5rem; background: var(--c-bg); color: var(--c-ink); }
.vwr__empty h2, .vwr__favwrap h2 { font-family: var(--font-display); font-weight: 400; }
.vwr__empty p, .vwr__favs-empty { color: var(--c-ink-soft); max-width: 46ch; }

/* Favoris */
.vwr__favwrap { justify-content: flex-start; padding-top: 5rem; }
.vwr__favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; width: 100%; max-width: 920px; margin-top: 1rem; }
.vwr__fav { position: relative; background: var(--c-white); border: 1px solid var(--c-line); border-radius: 10px; padding: 1.1rem; text-align: left; }
.vwr__fav strong { font-family: var(--font-display); font-size: var(--fs-h4); display: block; }
.vwr__fav a { color: var(--c-gold-dark); font-size: var(--fs-small); display: inline-block; margin-top: .5rem; }
.vwr__fav [data-remove] { position: absolute; top: .5rem; right: .5rem; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(28,27,24,.06); cursor: pointer; }

/* Onboarding */
.vwr__onboard { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(14,14,12,.55); }
.vwr__onboard[hidden] { display: none; }
.vwr__onboard-card { background: #fff; color: var(--c-ink); border-radius: 12px; padding: 1.75rem; max-width: 400px; text-align: center; box-shadow: var(--sh-lg); }
.vwr__onboard-card p { margin-bottom: 1.25rem; }
.vwr__onboard-actions { display: flex; justify-content: center; }

/* ===== SCÈNE 3D (model-viewer) ===== */
.vwr__3d { position: absolute; inset: 0; }
.vwr__3d model-viewer { width: 100%; height: 100%; --progress-bar-color: var(--c-gold); --progress-mask: transparent; }
.vwr__glbnote {
  position: absolute; left: 1.25rem; bottom: 5.4rem; z-index: 12;
  max-width: 340px; font-size: .72rem; line-height: 1.5;
  color: #fff; background: rgba(14,14,12,.72); padding: .6rem .8rem; border-radius: 8px;
  transition: opacity var(--dur-base);
}
.vwr__glbnote code { color: var(--c-gold); }

/* Onglets : icônes */
.vwr__tabicon { flex: 0 0 auto; }

/* Barre de contrôles (bas-centre), façon ABARI */
.vwr__toolbar {
  position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 14;
  display: flex; align-items: center; gap: .2rem;
  background: rgba(255,255,255,.96); border-radius: 999px; padding: .35rem .5rem;
  box-shadow: var(--sh-md);
}
.vwr__toolbar button {
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: none; color: var(--c-ink); font-size: 1.1rem; line-height: 1;
  display: grid; place-content: center; transition: background var(--dur-fast);
}
.vwr__toolbar button:hover { background: rgba(28,27,24,.08); }
.vwr__toolbar button.is-active { background: var(--c-gold); color: #fff; }
.vwr__toolbar-sep { width: 1px; height: 22px; background: var(--c-line); margin: 0 .15rem; }

/* ===== GALERIE / VIDÉOS ===== */
.vwr__media { min-height: 100%; background: var(--c-bg); color: var(--c-ink); padding: 5rem 2rem 3rem; }
.vwr__media-head { text-align: center; margin-bottom: 2rem; }
.vwr__media-head h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); }
.vwr__media-head p { color: var(--c-ink-soft); }
.vwr__grid { columns: 4; column-gap: .75rem; max-width: 1300px; margin: 0 auto; }
.vwr__tile { break-inside: avoid; margin: 0 0 .75rem; border-radius: 10px; overflow: hidden; box-shadow: var(--sh-xs); }
.vwr__tile img { width: 100%; display: block; }
.vwr__videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; max-width: 1200px; margin: 0 auto; }
.vwr__video { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; box-shadow: var(--sh-md); background: #000; }
.vwr__video iframe { width: 100%; height: 100%; border: 0; }
.vwr__video--ph { display: grid; place-content: center; background: var(--c-bg-warm); color: var(--c-ink-soft); }
.vwr__hint { text-align: center; color: var(--c-ink-soft); font-size: var(--fs-small); margin-top: 1.5rem; }

/* ===== PLAN (Google Maps) ===== */
.vwr__map { position: absolute; inset: 0; }
.vwr__map iframe { width: 100%; height: 100%; border: 0; }

/* ===== TYPES DE VILLAS (dans la Galerie) ===== */
.villatypes { max-width: 1200px; margin: 0 auto; }
.villatypes__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.villatype { background: var(--c-white); border: 1px solid var(--c-line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.villatype__media { aspect-ratio: 4/3; background: var(--c-bg-warm); display: grid; place-items: center; }
.villatype__media img { width: 100%; height: 100%; object-fit: contain; padding: .5rem; }
.villatype__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .8rem; flex: 1; }
.villatype__body h3 { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-h4); }
.villatype__specs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; font-size: .84rem; color: var(--c-ink-soft); }
.villatype__specs li { padding: .35rem 0; border-bottom: 1px solid var(--c-line); }
.villatype__specs li:last-child { border-bottom: 0; }
.villatype__plans { display: flex; gap: .4rem; margin-top: auto; flex-wrap: wrap; }
.villatype__plan { font-size: .72rem; font-weight: 600; letter-spacing: .03em; padding: .4rem .75rem; border: 1px solid var(--c-line); border-radius: 999px; color: var(--c-gold-dark); text-decoration: none; transition: background var(--dur-fast); }
.villatype__plan:hover { background: var(--c-sand); }
@media (max-width: 820px) { .villatypes__grid { grid-template-columns: 1fr; } }

/* ===== FLIP-BOOK (Plaquette, auto-hébergé) ===== */
.fb {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 1.75rem 1rem 1rem; background: var(--c-bg-warm);
}
.fb__stage { width: 100%; max-width: 1120px; flex: 1 1 auto; min-height: 0; }
.fb__stage .stf__parent { margin: 0 auto; } /* wrapper StPageFlip */
.fb__loading { position: absolute; inset: 0; display: grid; place-content: center; color: var(--c-ink-soft); pointer-events: none; }
.fb__bar {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.96); border-radius: 999px; padding: .3rem .5rem; box-shadow: var(--sh-sm);
}
.fb__nav {
  width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer;
  background: none; color: var(--c-ink); font-size: 1.2rem; line-height: 1;
  display: grid; place-content: center; transition: background var(--dur-fast);
}
.fb__nav:hover { background: rgba(28,27,24,.08); }
.fb__count { font-size: .85rem; color: var(--c-ink-soft); font-variant-numeric: tabular-nums; min-width: 58px; text-align: center; }
.fb__sep { width: 1px; height: 20px; background: var(--c-line); }
.fb__dl { font-size: .74rem; font-weight: 600; letter-spacing: .04em; color: var(--c-gold-dark); padding: .45rem .75rem; border: 1px solid var(--c-line); border-radius: 999px; text-decoration: none; }
.fb__dl:hover { background: var(--c-sand); }

@media (max-width: 820px) {
  .vwr__grid { columns: 2; }
  .vwr__toolbar { bottom: .75rem; }
  .vwr__glbnote { display: none; }
  .fb { padding: 1rem .5rem .75rem; }
}

@media (max-width: 820px) {
  .vwr__top { flex-wrap: wrap; height: auto; padding: .6rem 1rem; gap: .5rem; }
  .vwr__tabs { order: 3; width: 100%; }
  .vwr__search { top: auto; bottom: 1rem; left: 50%; transform: translateX(-50%); }
}
