/* ==========================================================================
   CHOUFLEURS - Pages Livraison (Perreux & Gournay & pages communes SEO)
   ========================================================================== */

/* --------------------------------------------------------------------------
   NEAREST-SHOP — mention de la boutique la plus proche sous le lead hero
   (pages communes SEO)
   -------------------------------------------------------------------------- */
.nearest-shop {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  margin-bottom: var(--space-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-secondary);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.nearest-shop-icon {
  width: 18px;
  height: 18px;
  color: var(--color-secondary);
  flex-shrink: 0;
}

.nearest-shop strong {
  color: var(--color-text);
  font-weight: 700;
}

.nearest-shop a {
  color: var(--color-secondary);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.nearest-shop a:hover {
  color: var(--color-secondary-dark);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   SEO PROSE — paragraphes d'intro long-tail (pages communes)
   -------------------------------------------------------------------------- */
.seo-prose {
  max-width: 820px;
  margin: 0 auto;
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--color-text);
}

.seo-prose p {
  margin-bottom: var(--space-md);
}

.seo-prose p:last-child {
  margin-bottom: 0;
}

.seo-prose strong {
  color: var(--color-text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   LIEUX-GRID — cards des lieux clés de la commune (cimetière, mairie…)
   -------------------------------------------------------------------------- */
.lieux-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* Card orpheline centrée sur la dernière rangée
   (utilisée quand le nombre de cards est impair, ex. 7 cards en grille 3 cols) */
.lieu-card-centered {
  grid-column-start: 2;
}

.lieu-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) ease,
              box-shadow var(--duration-base) ease;
}

.lieu-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-secondary);
  box-shadow: 0 14px 32px var(--color-shadow);
}

.lieu-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(212, 145, 0, 0.12);
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lieu-icon svg {
  width: 24px;
  height: 24px;
}

.lieu-card h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0;
}

.lieu-card p {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.lieu-card strong {
  color: var(--color-text);
  font-weight: 600;
}

.lieu-link {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-secondary);
  text-decoration: none;
  margin-top: 0.25rem;
  transition: color var(--duration-fast) ease;
}

.lieu-link:hover {
  color: var(--color-secondary-dark);
}

@media (max-width: 1024px) {
  .lieux-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Sur 2 cols, on étend la card sur toute la largeur et on la centre
     en limitant à la largeur d'une seule colonne (avec compensation du gap). */
  .lieu-card-centered {
    grid-column: 1 / -1;
    max-width: calc(50% - var(--space-lg) / 2);
    justify-self: center;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .lieux-grid {
    grid-template-columns: 1fr;
  }

  /* Sur mobile (1 col) tout est déjà aligné — on annule le centrage. */
  .lieu-card-centered {
    grid-column: auto;
    max-width: none;
    width: auto;
    justify-self: stretch;
  }
}

/* --------------------------------------------------------------------------
   FAQ-LIST — questions/réponses dépliantes (SEO + UX)
   -------------------------------------------------------------------------- */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  transition: border-color var(--duration-base) ease;
}

.faq-item:hover {
  border-color: var(--color-secondary);
}

.faq-item[open] {
  border-color: var(--color-secondary);
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-secondary);
  transition: transform var(--duration-base) ease;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  margin: var(--space-sm) 0 0;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.faq-item strong {
  color: var(--color-text);
}


/* --------------------------------------------------------------------------
   1. HERO LIVRAISON — split layout avec carte stylisée
   -------------------------------------------------------------------------- */
.livraison-hero {
  position: relative;
  padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-2xl);
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  overflow: hidden;
}

.livraison-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 66, 66,0.18), transparent 65%);
  pointer-events: none;
}

.livraison-hero::after {
  content: '';
  position: absolute;
  bottom: -160px;
  left: -100px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 145, 0,0.18), transparent 65%);
  pointer-events: none;
}

[data-theme="dark"] .livraison-hero::before { opacity: 0.5; }
[data-theme="dark"] .livraison-hero::after  { opacity: 0.4; }

.livraison-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.livraison-hero h1 {
  font-size: clamp(2.4rem, 1.8rem + 3.5vw, 4.5rem);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

.livraison-hero .lead {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  max-width: 500px;
}

.hero-stats-inline {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.hero-stat-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1;
}

.hero-stat-item span {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* Carte dynamique stylisée (pas une vraie map ici, juste illustration) */
.zone-illustration {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.zone-illustration::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 24px, rgba(255,255,255,0.04) 24px 25px),
    repeating-linear-gradient(-45deg, transparent 0 24px, rgba(255,255,255,0.04) 24px 25px);
}

.zone-illustration-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-lg);
  color: white;
}

.zone-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-secondary);
  box-shadow: 0 0 0 6px rgba(212, 145, 0,0.3), 0 4px 12px rgba(0,0,0,0.3);
  z-index: 2;
}

.zone-pin::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-secondary);
  animation: ping 2.5s var(--ease-out) infinite;
}

@keyframes ping {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  80%, 100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.zone-pin-1 { top: 32%; left: 28%; }
.zone-pin-2 { top: 50%; left: 60%; }
.zone-pin-3 { top: 68%; left: 35%; }

.zone-illustration-label {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.85;
}

.zone-illustration-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.05;
}

.zone-illustration-title small {
  display: block;
  font-style: normal;
  font-size: 0.45em;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.zone-illustration-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.2);
}

.zone-illustration-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--color-secondary);
}

.zone-illustration-stats div span {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .livraison-hero-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .zone-illustration { aspect-ratio: 4 / 3; }
  .hero-stats-inline { flex-wrap: wrap; gap: var(--space-md); }
}

/* --------------------------------------------------------------------------
   2. COMMUNES COUVERTES — grille de chips
   -------------------------------------------------------------------------- */
/* Flex au lieu de grid : permet à la dernière ligne (3 chips) d'être centrée
   au lieu d'être collée à gauche avec un trou à droite. */
.communes-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

.commune-chip {
  flex: 0 0 calc((100% - 3 * var(--space-sm)) / 4);  /* 4 par ligne desktop */
}

@media (max-width: 1024px) {
  .commune-chip {
    flex-basis: calc((100% - 2 * var(--space-sm)) / 3);  /* 3 par ligne */
  }
}

@media (max-width: 700px) {
  .commune-chip {
    flex-basis: calc((100% - var(--space-sm)) / 2);  /* 2 par ligne */
  }
}

@media (max-width: 480px) {
  .commune-chip {
    flex-basis: 100%;
  }
}

.commune-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  /* Hauteur uniforme pour toutes les chips, quel que soit le contenu */
  min-height: 58px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text);
  transition: all var(--duration-base) var(--ease-out);
}

.commune-chip:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-alt);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Chip rendue cliquable (lien vers la page commune SEO) — reset de
   l'affichage anchor + indication visuelle au hover. */
a.commune-chip {
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}

a.commune-chip:hover {
  border-color: var(--color-secondary);
  background: var(--color-bg-card);
  color: var(--color-text);
}

/* Chips "featured" = lieu où Choufleurs est présent (boutique ou Lock'heure) :
   fond doré, texte blanc — pour les distinguer des communes simplement livrées. */
.commune-chip.featured {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  border-color: transparent;
  color: white;
}

.commune-chip.featured:hover {
  background: linear-gradient(135deg, var(--color-secondary-dark) 0%, #6B4500 100%);
  border-color: transparent;
}

.commune-chip svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.commune-chip.featured svg { color: white; }

.commune-distance {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}

.commune-chip.featured .commune-distance { color: rgba(255,255,255,0.9); }

/* --------------------------------------------------------------------------
   3. PROCESS — 3 étapes horizontales
   -------------------------------------------------------------------------- */
.delivery-process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  position: relative;
}

.delivery-step {
  position: relative;
  padding: var(--space-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-base) var(--ease-out);
}

.delivery-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.delivery-step-num {
  position: absolute;
  top: -16px;
  left: var(--space-lg);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-secondary);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(212, 145, 0,0.4);
}

.delivery-step-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.delivery-step-icon svg { width: 28px; height: 28px; }

.delivery-step h3 {
  font-size: var(--fs-xl);
  margin-bottom: 0.5rem;
}

.delivery-step p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.delivery-step-time {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-md);
  padding: 0.4rem 0.875rem;
  background: rgba(61, 66, 66,0.1);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.delivery-step-time svg { width: 12px; height: 12px; }

@media (max-width: 1024px) {
  .delivery-process { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   4. TARIFS — table moderne
   -------------------------------------------------------------------------- */
.pricing-table {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pricing-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-fast) ease;
}

.pricing-row:last-child { border-bottom: none; }

.pricing-row:hover { background: var(--color-bg-alt); }

.pricing-row.head {
  background: var(--color-primary);
  color: white;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pricing-row.head:hover { background: var(--color-primary); }

.pricing-zone {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-base);
}

.pricing-time,
.pricing-price {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pricing-price.free {
  color: var(--color-primary);
  font-weight: 700;
}

@media (max-width: 640px) {
  .pricing-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: var(--space-sm) var(--space-md);
  }
  .pricing-row.head { display: none; }
  .pricing-time, .pricing-price { text-align: left; }
  .pricing-time::before { content: 'Délai : '; color: var(--color-text-muted); font-size: var(--fs-xs); }
  .pricing-price::before { content: 'Tarif : '; color: var(--color-text-muted); font-size: var(--fs-xs); }
}

/* --------------------------------------------------------------------------
   5. PARTENAIRES TRANSMISSIONS FLORALES
   -------------------------------------------------------------------------- */
.partners-strip {
  margin: var(--space-xl) auto 0;
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  max-width: 720px;
  position: relative;
  overflow: hidden;
}

/* Petit marqueur doré vertical à gauche, façon "tip" éditorial */
.partners-strip::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-secondary), var(--color-primary));
}

.partners-strip-icon {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: rgba(212, 145, 0, 0.12);
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.partners-strip-icon svg {
  width: 30px;
  height: 30px;
}

.partners-strip-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.partners-strip-label {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.partners-strip-body p {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  line-height: 1.5;
  text-align: left;
}

@media (max-width: 640px) {
  .partners-strip {
    flex-direction: column;
    text-align: center;
    padding: var(--space-lg);
  }
  .partners-strip-body p {
    text-align: center;
  }
}

/* Emplacement photo qui remplace l'illustration de zone dans le hero */
.livraison-hero-photo {
  position: relative;
  z-index: 1;
  margin: 0;
  aspect-ratio: 4 / 5;
  max-width: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18), 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: rotate(-1.5deg);
  transition: transform 0.5s var(--ease-out);
  animation: hero-sway-a 5s linear 1.2s infinite;
  will-change: transform;
}

.livraison-hero-photo:hover {
  transform: rotate(0deg);
}

.livraison-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Paragraphe simple à la place de la table tarifs */
.pricing-prose {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  line-height: 1.7;
  color: var(--color-text);
}

.pricing-prose p { margin: 0; }

.pricing-prose strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   PRICING — Présentation en 2 tuiles (Bouquet 29€ / Livraison 8€)
   -------------------------------------------------------------------------- */
.pricing-cards {
  max-width: 880px;
  margin: 0 auto;
}

.pricing-cards-intro {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 auto var(--space-lg);
  max-width: 640px;
}

.pricing-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.pricing-tile {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) ease,
              box-shadow var(--duration-base) ease;
}

.pricing-tile:hover {
  transform: translateY(-4px);
  border-color: var(--color-secondary);
  box-shadow: 0 14px 32px var(--color-shadow);
}

.pricing-tile-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(212, 145, 0, 0.12);
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.pricing-tile-icon svg {
  width: 28px;
  height: 28px;
}

.pricing-tile-label {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
}

.pricing-tile-amount {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.1;
}

.pricing-tile-amount strong {
  color: var(--color-secondary);
  font-weight: 600;
}

.pricing-tile-note {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  max-width: 220px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .pricing-cards-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ==========================================================================
   GALERIE PHOTOS — 6 photos en grille 2×3 (Livraison Perreux/Gournay)
   ========================================================================== */
.livraison-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* Pages à 6 photos : grille 3×2 équilibrée (au lieu d'un vilain 4+2).
   3 colonnes → emplacements un peu plus grands (~395px vs ~290px) pour
   compenser les 2 photos manquantes vs les pages à 8 photos (4×2).
   Ciblage : galerie dont le 6e enfant est le dernier = exactement 6 items. */
.livraison-gallery:has(> .livraison-gallery-item:nth-child(6):last-child) {
  grid-template-columns: repeat(3, 1fr);
}

.livraison-gallery-item {
  margin: 0;
  aspect-ratio: 5 / 6;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-alt);
  position: relative;
  cursor: pointer;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.livraison-gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(61, 66, 66, 0.22), 0 8px 16px rgba(0, 0, 0, 0.10);
}

.livraison-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

.livraison-gallery-item:hover img {
  transform: scale(1.05);
}

/* Tablette : 3 colonnes pour rester compact sans écraser les photos */
@media (max-width: 1024px) {
  .livraison-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .livraison-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .livraison-gallery-item {
    aspect-ratio: 4 / 5;
  }
}

/* ==========================================================================
   GALERIE VERTICAL STACK — 6 photos empilées, animation spring
   Adapté du composant React "Vertical Image Stack" en vanilla CSS/JS.
   Le progressive-blur au hover (overlay + caption) est préservé sur la
   carte centrale via pointer-events (les autres cartes sont bloquées).
   ========================================================================== */
.stack-wrapper {
  position: relative;
  margin: var(--space-2xl) 0;
  padding: var(--space-2xl) 0;
  min-height: 920px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
  perspective-origin: center center;
  outline: none;
  /* Empêche le scroll horizontal généré par les cartes voisines dont le
     translateX/translateY dépasse le container (surtout stack horizontal
     Courtry où up-2/down-2 vont à ±450px). Fallback overflow-x: hidden
     pour navigateurs qui ne supportent pas overflow: clip (< Safari 15.4). */
  overflow-x: hidden;
  overflow-x: clip;
}

/* ==========================================================================
   FOUC PREVENTION — Anti-flash de la grille classique avant le stack.
   Les .lieux-grid marquées data-stack-items sont invisibles jusqu'à ce que
   le JS ajoute la classe --stack (qui remet opacity: 1 via la CSS ci-dessous).
   Évite ainsi qu'on voie la grille 3-cols pendant ~200ms avant le stack.
   ========================================================================== */
.lieux-grid[data-stack-items]:not(.lieux-grid--stack),
.livraison-gallery[data-stack-items]:not(.livraison-gallery--stack) {
  opacity: 0;
}
.lieux-grid[data-stack-items].lieux-grid--stack,
.livraison-gallery[data-stack-items].livraison-gallery--stack {
  opacity: 1;
}

/* Aire centrale qui contient les 5 cartes visibles (2 haut, 1 centre, 2 bas).
   Sélecteurs groupés : même mécanique pour la galerie photos (livraison-gallery)
   et pour la grille lieux du patrimoine (lieux-grid, page Gournay). */
.livraison-gallery.livraison-gallery--stack,
.lieux-grid.lieux-grid--stack {
  display: block;
  position: relative;
  width: min(94%, 580px);
  height: 720px;
  transform-style: preserve-3d;
  gap: 0;
}

/* Chaque carte devient absolue et se positionne via data-stack-pos. */
.livraison-gallery--stack .livraison-gallery-item,
.lieux-grid--stack .lieu-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  transition:
    transform 0.55s cubic-bezier(0.34, 1.36, 0.64, 1),
    opacity 0.4s ease-out,
    box-shadow 0.4s ease-out;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
  cursor: grab;
}

.livraison-gallery--stack .livraison-gallery-item:active,
.lieux-grid--stack .lieu-card:active {
  cursor: grabbing;
}

/* Override du lift au hover natif de .lieu-card : le stack gère les transforms. */
.lieux-grid--stack .lieu-card:hover {
  transform: none;
}
.lieux-grid--stack .lieu-card[data-stack-pos="center"]:hover {
  transform: translate3d(0, 0, 0) scale(1) rotateX(0);
}

/* .lieu-card contient beaucoup de texte : scrollable si nécessaire.
   Scrollbar grise discrète (Firefox + WebKit). */
.lieux-grid--stack .lieu-card {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 160, 160, 0.55) transparent;
}
.lieux-grid--stack .lieu-card::-webkit-scrollbar {
  width: 6px;
}
.lieux-grid--stack .lieu-card::-webkit-scrollbar-track {
  background: transparent;
}
.lieux-grid--stack .lieu-card::-webkit-scrollbar-thumb {
  background: rgba(160, 160, 160, 0.55);
  border-radius: 3px;
}
.lieux-grid--stack .lieu-card::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 120, 0.75);
}

/* Overrides spécifiques Gournay : cartes patrimoine plus PETITES que la
   galerie photos. Les transforms sont placées PLUS BAS après les règles
   groupées communes pour l'emporter dans la cascade. */
.lieux-grid.lieux-grid--stack {
  width: min(90%, 480px);
  height: 480px;
}

/* Wrapper plus compact quand il contient un lieux-grid stack. */
.stack-wrapper:has(.lieux-grid--stack) {
  min-height: 660px;
}

/* Positions dans la pile. translate3d + rotateX pour effet 3D subtil.
   Sélecteurs groupés pour partager entre galerie photos et grille lieux. */
.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="center"],
.lieux-grid--stack .lieu-card[data-stack-pos="center"] {
  transform: translate3d(0, 0, 0) scale(1) rotateX(0);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.08);
}

.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="up-1"],
.lieux-grid--stack .lieu-card[data-stack-pos="up-1"] {
  transform: translate3d(0, -210px, -70px) scale(0.85) rotateX(10deg);
  opacity: 0.6;
  z-index: 4;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="up-2"],
.lieux-grid--stack .lieu-card[data-stack-pos="up-2"] {
  transform: translate3d(0, -370px, -160px) scale(0.72) rotateX(18deg);
  opacity: 0.28;
  z-index: 3;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="down-1"],
.lieux-grid--stack .lieu-card[data-stack-pos="down-1"] {
  transform: translate3d(0, 210px, -70px) scale(0.85) rotateX(-10deg);
  opacity: 0.6;
  z-index: 4;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="down-2"],
.lieux-grid--stack .lieu-card[data-stack-pos="down-2"] {
  transform: translate3d(0, 370px, -160px) scale(0.72) rotateX(-18deg);
  opacity: 0.28;
  z-index: 3;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

/* Hover sur cartes non-centrales : opacité remonte pour signaler cliquables. */
.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="up-1"]:hover,
.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="down-1"]:hover,
.lieux-grid--stack .lieu-card[data-stack-pos="up-1"]:hover,
.lieux-grid--stack .lieu-card[data-stack-pos="down-1"]:hover {
  opacity: 0.9;
}
.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="up-2"]:hover,
.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="down-2"]:hover,
.lieux-grid--stack .lieu-card[data-stack-pos="up-2"]:hover,
.lieux-grid--stack .lieu-card[data-stack-pos="down-2"]:hover {
  opacity: 0.55;
}

.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="hidden"],
.lieux-grid--stack .lieu-card[data-stack-pos="hidden"] {
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transform: translate3d(0, 540px, -220px) scale(0.6);
}

/* En mode stack, on désactive le "lift + scale image" au hover (le hover
   sert uniquement à révéler l'overlay+caption progressive-blur). */
.livraison-gallery--stack .livraison-gallery-item:hover {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.08);
}
.livraison-gallery--stack .livraison-gallery-item[data-stack-pos="center"]:hover {
  transform: translate3d(0, 0, 0) scale(1) rotateX(0);
}
.livraison-gallery--stack .livraison-gallery-item:hover img {
  transform: none;
}

/* --- Overrides Gournay (lieux-grid stack) : cartes patrimoine plus PETITES
   que la galerie photos. Placées APRÈS les règles groupées pour l'emporter
   dans la cascade (même spécificité, dernière déclaration gagne). --- */
.lieux-grid--stack .lieu-card[data-stack-pos="up-1"] {
  transform: translate3d(0, -140px, -60px) scale(0.85) rotateX(10deg);
}
.lieux-grid--stack .lieu-card[data-stack-pos="down-1"] {
  transform: translate3d(0, 140px, -60px) scale(0.85) rotateX(-10deg);
}
.lieux-grid--stack .lieu-card[data-stack-pos="up-2"] {
  transform: translate3d(0, -250px, -140px) scale(0.72) rotateX(18deg);
}
.lieux-grid--stack .lieu-card[data-stack-pos="down-2"] {
  transform: translate3d(0, 250px, -140px) scale(0.72) rotateX(-18deg);
}
.lieux-grid--stack .lieu-card[data-stack-pos="hidden"] {
  transform: translate3d(0, 380px, -220px) scale(0.6);
}
.lieux-grid--stack .lieu-card[data-stack-pos="center"]:hover {
  transform: translate3d(0, 0, 0) scale(1) rotateX(0);
}

/* Flèches haut/bas (nav principale) — jaune Choufleurs, très visibles */
.stack-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  padding: 0;
  border: 2px solid var(--color-secondary);
  border-radius: 999px;
  background: var(--color-secondary);
  color: #ffffff;
  cursor: pointer;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.25s var(--ease-out),
    background 0.2s ease-out,
    border-color 0.2s ease-out,
    box-shadow 0.25s ease-out;
  box-shadow:
    0 8px 20px rgba(212, 145, 0, 0.45),
    0 3px 8px rgba(212, 145, 0, 0.25),
    0 0 0 4px rgba(212, 145, 0, 0.10);
}

.stack-arrow:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateX(-50%) translateY(-3px);
  box-shadow:
    0 12px 28px rgba(198, 143, 30, 0.55),
    0 4px 10px rgba(198, 143, 30, 0.30),
    0 0 0 6px rgba(212, 145, 0, 0.15);
}

.stack-arrow:active {
  transform: translateX(-50%) translateY(-1px);
  box-shadow:
    0 6px 16px rgba(198, 143, 30, 0.40),
    0 2px 6px rgba(198, 143, 30, 0.25);
}

.stack-arrow:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 4px;
}

/* Pulse subtil au chargement pour attirer l'œil */
@keyframes stack-arrow-pulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(212, 145, 0, 0.45), 0 3px 8px rgba(212, 145, 0, 0.25), 0 0 0 4px rgba(212, 145, 0, 0.10); }
  50%      { box-shadow: 0 8px 20px rgba(212, 145, 0, 0.55), 0 3px 8px rgba(212, 145, 0, 0.30), 0 0 0 10px rgba(212, 145, 0, 0.06); }
}

.stack-arrow {
  animation: stack-arrow-pulse 2.4s ease-in-out infinite;
}

.stack-arrow:hover,
.stack-arrow:active {
  animation: none;
}

.stack-arrow--up {
  top: 12px;
}

.stack-arrow--down {
  bottom: 12px;
}

.stack-arrow svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Dots verticaux à droite */
.stack-dots {
  position: absolute;
  right: max(1rem, calc((100% - 580px) / 2 - 48px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.stack-dot {
  width: 8px;
  height: 8px;
  border: none;
  padding: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 25%, transparent);
  cursor: pointer;
  transition: height 0.3s var(--ease-out), background 0.2s ease-out;
}

.stack-dot:hover {
  background: color-mix(in srgb, var(--color-text) 55%, transparent);
}

.stack-dot.active {
  height: 24px;
  background: var(--color-text);
}

/* Compteur à gauche */
.stack-counter {
  position: absolute;
  left: max(1rem, calc((100% - 580px) / 2 - 60px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
  pointer-events: none;
  user-select: none;
}

.stack-current {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s ease-out;
}

.stack-sep {
  width: 32px;
  height: 1px;
  background: color-mix(in srgb, var(--color-text) 20%, transparent);
}

.stack-total {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   STACK HORIZONTAL — variante utilisée sur livraison-courtry (lieux patrimoine)
   Le wrapper porte .stack-wrapper--horizontal → override des positions cartes
   (X au lieu de Y), flèches gauche/droite, dots horizontaux en bas, compteur
   centré en haut. La même mécanique JS (data-stack-pos) est réinterprétée
   par le CSS pour axer sur X plutôt que Y.
   ========================================================================== */

/* Wrapper horizontal : plus large que haut, tout est mis à l'échelle H. */
.stack-wrapper--horizontal {
  min-height: 560px;
}

/* Container : conserve la largeur mais devient plus court (les cartes ne
   sont pas empilées verticalement, mais alignées horizontalement autour du
   centre, donc on a besoin de largeur, pas de hauteur). */
.stack-wrapper--horizontal .lieux-grid.lieux-grid--stack {
  width: min(90%, 480px);
  height: 480px;
}

/* Positions cartes horizontales — X translate + rotateY (pas Y translate + rotateX) */
.stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="up-1"] {
  transform: translate3d(-260px, 0, -70px) scale(0.85) rotateY(-15deg);
}
.stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="up-2"] {
  transform: translate3d(-450px, 0, -160px) scale(0.72) rotateY(-25deg);
}
.stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="down-1"] {
  transform: translate3d(260px, 0, -70px) scale(0.85) rotateY(15deg);
}
.stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="down-2"] {
  transform: translate3d(450px, 0, -160px) scale(0.72) rotateY(25deg);
}
.stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="hidden"] {
  transform: translate3d(650px, 0, -220px) scale(0.6);
}
.stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="center"]:hover {
  transform: translate3d(0, 0, 0) scale(1) rotateY(0);
}

/* Flèches : positionnées à gauche et à droite du wrapper, centrées verticalement */
.stack-wrapper--horizontal .stack-arrow {
  top: 50%;
  bottom: auto;
  left: auto;
  right: auto;
  transform: translateY(-50%);
}
.stack-wrapper--horizontal .stack-arrow--left {
  left: max(1rem, calc((100% - 480px) / 2 - 90px));
}
.stack-wrapper--horizontal .stack-arrow--right {
  right: max(1rem, calc((100% - 480px) / 2 - 90px));
}
.stack-wrapper--horizontal .stack-arrow:hover {
  transform: translateY(-50%) translateX(0);
}
.stack-wrapper--horizontal .stack-arrow:active {
  transform: translateY(-50%);
}
.stack-wrapper--horizontal .stack-arrow--left:hover {
  transform: translateY(-50%) translateX(-3px);
}
.stack-wrapper--horizontal .stack-arrow--right:hover {
  transform: translateY(-50%) translateX(3px);
}

/* Dots : ligne horizontale en bas au lieu de colonne à droite */
.stack-wrapper--horizontal .stack-dots {
  right: auto;
  top: auto;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
}
.stack-wrapper--horizontal .stack-dot.active {
  height: 8px;
  width: 24px;
}

/* Compteur : en haut au centre au lieu de gauche */
.stack-wrapper--horizontal .stack-counter {
  left: 50%;
  top: 12px;
  bottom: auto;
  transform: translateX(-50%);
  flex-direction: row;
  gap: 8px;
}
.stack-wrapper--horizontal .stack-sep {
  width: 1px;
  height: 24px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .livraison-gallery--stack .livraison-gallery-item {
    transition-duration: 0.2s;
    transition-timing-function: ease-out;
  }
  .stack-arrow {
    transition-duration: 0.1s;
    animation: none;
  }
}

/* Mobile — stack plus compacte */
@media (max-width: 640px) {
  .stack-wrapper {
    min-height: 660px;
    padding: var(--space-lg) 0;
  }
  .livraison-gallery.livraison-gallery--stack {
    width: 82%;
    height: 500px;
  }
  .livraison-gallery--stack .livraison-gallery-item[data-stack-pos="up-1"] {
    transform: translate3d(0, -140px, -60px) scale(0.85) rotateX(10deg);
  }
  .livraison-gallery--stack .livraison-gallery-item[data-stack-pos="up-2"] {
    transform: translate3d(0, -250px, -140px) scale(0.72) rotateX(18deg);
  }
  .livraison-gallery--stack .livraison-gallery-item[data-stack-pos="down-1"] {
    transform: translate3d(0, 140px, -60px) scale(0.85) rotateX(-10deg);
  }
  .livraison-gallery--stack .livraison-gallery-item[data-stack-pos="down-2"] {
    transform: translate3d(0, 250px, -140px) scale(0.72) rotateX(-18deg);
  }
  /* Lieux-grid mobile : cartes compactes qui épousent le texte. */
  .stack-wrapper:has(.lieux-grid--stack) {
    min-height: 580px;
  }
  .lieux-grid.lieux-grid--stack {
    width: 86%;
    height: 400px;
  }
  .lieux-grid--stack .lieu-card[data-stack-pos="up-1"] {
    transform: translate3d(0, -115px, -60px) scale(0.85) rotateX(10deg);
  }
  .lieux-grid--stack .lieu-card[data-stack-pos="up-2"] {
    transform: translate3d(0, -210px, -140px) scale(0.72) rotateX(18deg);
  }
  .lieux-grid--stack .lieu-card[data-stack-pos="down-1"] {
    transform: translate3d(0, 115px, -60px) scale(0.85) rotateX(-10deg);
  }
  .lieux-grid--stack .lieu-card[data-stack-pos="down-2"] {
    transform: translate3d(0, 210px, -140px) scale(0.72) rotateX(-18deg);
  }
  /* Stack horizontal mobile : cartes plus petites + offsets X réduits */
  .stack-wrapper--horizontal {
    min-height: 500px;
  }
  .stack-wrapper--horizontal .lieux-grid.lieux-grid--stack {
    width: 86%;
    height: 400px;
  }
  .stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="up-1"] {
    transform: translate3d(-180px, 0, -60px) scale(0.85) rotateY(-15deg);
  }
  .stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="up-2"] {
    transform: translate3d(-320px, 0, -140px) scale(0.72) rotateY(-25deg);
  }
  .stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="down-1"] {
    transform: translate3d(180px, 0, -60px) scale(0.85) rotateY(15deg);
  }
  .stack-wrapper--horizontal .lieux-grid--stack .lieu-card[data-stack-pos="down-2"] {
    transform: translate3d(320px, 0, -140px) scale(0.72) rotateY(25deg);
  }
  .stack-wrapper--horizontal .stack-arrow--left {
    left: 0.4rem;
  }
  .stack-wrapper--horizontal .stack-arrow--right {
    right: 0.4rem;
  }
  .stack-dots {
    right: 0.4rem;
  }
  .stack-counter {
    left: 0.4rem;
  }
  .stack-current {
    font-size: 1.5rem;
  }
  .stack-sep {
    width: 24px;
  }
  .stack-total {
    font-size: 0.75rem;
  }
  .stack-arrow {
    width: 46px;
    height: 46px;
  }
  .stack-arrow svg { width: 22px; height: 22px; }
}
