/* ============================================================
   DETAIL — Vue détaillée d'un appartement
   ============================================================ */

/* Visibilité des vues */
.detail-view {
  display: none;
}

.detail-view.active {
  display: block;
}

.home-view {
  display: block;
}

.home-view.hidden {
  display: none;
}

/* Bouton retour */
.detail-back {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 52px 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.back-btn:hover,
.back-btn:focus-visible {
  color: var(--gold);
}

/* En-tête détail (au-dessus de la galerie) */
.detail-header {
  max-width: 900px;
  margin: 24px auto 16px;
  padding: 0 52px;
}

.detail-header .detail-metas {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .detail-header {
    padding: 0 16px;
    margin: 16px auto 12px;
  }
}

/* Galerie principale */
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 24px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.detail-gallery-main,
.detail-gallery-thumb {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.detail-gallery-main img,
.detail-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.detail-gallery-main:hover img,
.detail-gallery-thumb:hover img {
  transform: scale(1.04);
}

/* Bande de photos secondaires */
.detail-gallery-strip {
  padding: 3px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.detail-gallery-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Contenu principal + sidebar */
.detail-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 52px 80px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
}

.detail-eyebrow {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 10px;
}

.detail-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 16px;
}

.detail-title em {
  font-style: italic;
  color: var(--gold-text);
}

.detail-metas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.detail-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.detail-meta strong {
  color: var(--ink);
  font-weight: 500;
}

.detail-desc-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.detail-desc {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.85;
  margin-bottom: 28px;
}

/* Équipements */
.detail-amen-title {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 14px;
}

.detail-amen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
}

.detail-amen {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--ink2);
}

.detail-amen:nth-child(even) {
  border-right: none;
}

.detail-amen:nth-last-child(-n+2) {
  border-bottom: none;
}

/* Sidebar réservation */
.detail-price-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 28px;
  margin-bottom: 14px;
}

.detail-price-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-price-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 52px;
  color: var(--gold-text);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.detail-price-unit {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.detail-price-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--cream2);
}

.detail-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}

.detail-price-row span {
  color: var(--muted);
}

.detail-price-row strong {
  color: var(--ink);
  font-weight: 500;
}

/* Boutons réservation */
.btn-reserve-wa {
  width: 100%;
  background: var(--green);
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-reserve-wa:hover,
.btn-reserve-wa:focus-visible {
  background: #1eb856;
}

.btn-reserve-airbnb {
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-reserve-airbnb:hover,
.btn-reserve-airbnb:focus-visible {
  background: var(--gold);
  color: var(--ink);
}

.btn-reserve-disabled {
  width: 100%;
  background: var(--cream2);
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px;
  border: 1px solid var(--rule);
  text-align: center;
}

/* Encart WhatsApp */
.detail-wa-card {
  background: var(--ink);
  padding: 22px;
  text-align: center;
}

.detail-wa-text {
  font-size: 12px;
  color: rgba(250, 247, 242, 0.85);
  line-height: 1.7;
  margin-bottom: 12px;
}

.detail-wa-text strong {
  color: var(--gold2);
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}


/* ── Responsive detail ── */
@media (max-width: 960px) {
  .detail-back {
    padding: 20px 16px 0;
  }

  .detail-content {
    grid-template-columns: 1fr;
    padding: 28px 16px 52px;
    gap: 32px;
  }
}

@media (max-width: 600px) {
  /* Galerie principale → slider pleine largeur */
  .detail-gallery {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    gap: 0;
    margin-top: 16px;
    max-width: 100%;
  }

  .detail-gallery::-webkit-scrollbar {
    display: none;
  }

  .detail-gallery-main,
  .detail-gallery-thumb {
    flex: 0 0 100%;
    aspect-ratio: 4 / 3;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Strip → miniatures horizontales défilables */
  .detail-gallery-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 0;
    gap: 4px;
    max-width: 100%;
  }

  .detail-gallery-strip::-webkit-scrollbar {
    display: none;
  }

  .detail-gallery-strip img {
    flex: 0 0 38%;
    aspect-ratio: 4 / 3;
    scroll-snap-align: start;
    object-fit: cover;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn-reserve-wa,
  .btn-reserve-airbnb {
    min-height: 44px;
  }
}

/* ── Curseur zoom sur les images de galerie ── */
.detail-gallery-main img,
.detail-gallery-thumb img,
.detail-gallery-strip img {
  cursor: zoom-in;
}

/* ── Lightbox ── */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 5, 0.97);
  z-index: 9999;
  flex-direction: column;
}

#lightbox-overlay.active {
  display: flex;
}

/* En-tête : compteur + bouton fermer */
.lightbox-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
}

.lightbox-counter {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.4);
}

.lightbox-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 6px;
  margin-left: auto;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: #fff;
}

/* Piste de défilement avec scroll-snap */
.lightbox-track {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.lightbox-track::-webkit-scrollbar {
  display: none;
}

/* Chaque slide = une image centrée */
.lightbox-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  padding: 0 12px;
}

.lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* laisse le slide capter le swipe */
}

/* Pied de page : flèches + points de pagination */
.lightbox-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
}

.lightbox-prev,
.lightbox-next {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  padding: 11px 17px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Indicateurs de pagination */
.lightbox-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 200px;
}

.lightbox-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  flex-shrink: 0;
}

.lightbox-dot.active {
  background: var(--gold2);
  transform: scale(1.5);
}

@media (max-width: 600px) {
  .lightbox-footer {
    gap: 14px;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .lightbox-prev,
  .lightbox-next {
    padding: 9px 13px;
    font-size: 16px;
  }
}
