/* ================================================================
   NOTTURÉ V2 — Améliorations conversion
   Hero galerie · PDP bundle · Panier cross-sell · Post-achat
   Charge APRÈS style.css → peut surcharger sans toucher l'original
   ================================================================ */

/* ==================== FIX OVERFLOW MOBILE ==================== */
/* Empêche les enfants de forcer le parent grid/flex à dépasser le viewport
   (problème classique : grid items ont min-width: auto = min-content par défaut) */
html, body { overflow-x: hidden; }
@media (max-width: 900px) {
  main.product-page,
  main.cart-page,
  .checkout-page,
  .hero,
  .hero > *,
  .product-page > *,
  .product-info,
  .product-image-wrap,
  .product-info > *,
  .pdp-bundle,
  .pdp-bundle-items,
  .pdp-bundle-item,
  .pdp-momme,
  .pdp-momme-bars,
  .pdp-momme-row,
  .pdp-reviews,
  .specs,
  .cart-grid,
  .cart-grid > *,
  .cart-item,
  .cart-summary,
  .xsell-v2-grid,
  .xsell-v2-card {
    min-width: 0;
    max-width: 100%;
  }
  /* Long product names / text shouldn't break out of containers */
  .pdp-bundle-item-name,
  .pdp-bundle-item-meta,
  .cart-item-info .name,
  .cart-item-info .meta,
  .xsell-v2-name,
  .xsell-v2-soustitre {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* ==================== HERO V2 ==================== */
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 1.6px; color: var(--terracotta);
  text-transform: uppercase; font-weight: 500;
  margin-bottom: 22px;
  padding: 6px 12px;
  background: rgba(200, 85, 61, 0.08);
  border: 1px solid rgba(200, 85, 61, 0.22);
}
.he-dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--terracotta); border-radius: 50%;
  animation: he-pulse 2s ease-in-out infinite;
}
@keyframes he-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}

.hero-price-row {
  display: flex; align-items: center; gap: 24px;
  margin: 6px 0 26px;
  padding: 14px 18px;
  background: var(--paper);
  border-left: 3px solid var(--terracotta);
}
.hero-price-block {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--rule);
  padding-right: 22px;
}
.hpb-from {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.2px; color: var(--ink-soft);
  text-transform: uppercase; margin-bottom: 4px;
}
.hpb-amount {
  font-family: var(--serif); font-size: 26px;
  font-weight: 500; color: var(--ink); line-height: 1;
}
.hero-price-perks {
  list-style: none; display: flex; flex-direction: column; gap: 4px;
  font-size: 12.5px; color: var(--ink-soft);
}
.hero-price-perks li { display: flex; align-items: center; gap: 8px; }
.hp-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  font-size: 11px; color: var(--terracotta); font-weight: 600;
}

.hero-cta-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 8px;
}
.hero-btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; padding: 17px 36px;
  text-decoration: none;
}
.hero-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 28px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.hero-btn-ghost:hover {
  background: var(--ink); color: var(--paper);
}
.hero-fineprint {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-soft); letter-spacing: 1.1px;
  text-transform: uppercase; margin-top: 14px;
}

/* Galerie hero */
.hero-right { position: relative; }
.hero-gallery {
  position: relative;
  width: 100%; aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--paper);
}
.hero-slides {
  position: relative; width: 100%; height: 100%;
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.hero-dots {
  position: absolute; bottom: 16px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px;
  z-index: 2;
}
.hero-dot {
  width: 28px; height: 3px;
  background: rgba(250, 245, 234, 0.45);
  border: none; padding: 0; cursor: pointer;
  transition: background 0.3s;
}
.hero-dot.is-active { background: var(--paper); }
.hero-dot:hover { background: rgba(250, 245, 234, 0.85); }

/* Mobile hero v2 */
@media (max-width: 900px) {
  .hero-price-row {
    flex-direction: column; align-items: flex-start; gap: 14px;
    padding: 14px;
  }
  .hero-price-block {
    border-right: none; border-bottom: 1px solid var(--rule);
    padding-right: 0; padding-bottom: 12px; width: 100%;
  }
  .hero-cta-row { flex-direction: column; align-items: stretch; }
  .hero-btn-primary, .hero-btn-ghost {
    width: 100%; justify-content: center;
  }
  .hero-eyebrow { font-size: 9.5px; letter-spacing: 1.2px; }

  /* Mobile reorder : galerie photos juste après l'eyebrow, avant le H1.
     On utilise display:contents sur les wrappers pour aplatir la structure
     et ordonner toutes les pieces en flex order. */
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .hero-grid > div:first-child,
  .hero-grid > .hero-right {
    display: contents;
  }
  /* Default order: tout le reste en DOM order après les deux pieces priorisées */
  .hero-eyebrow   { order: 1; margin-bottom: 0; }
  .hero-gallery   { order: 2; }
  .hero h1        { order: 3; margin-top: 4px; }
  .hero .lede     { order: 4; }
  .hero-price-row { order: 5; margin: 0; }
  .hero-cta-row   { order: 6; margin-top: 0; }
  .hero-fineprint { order: 7; margin-top: 0; }
  .quote-stamp    { order: 99; display: none; }
  /* Espace galerie un peu plus aéré sur mobile */
  .hero-gallery { aspect-ratio: 4/5; }
}

/* Quote-stamp doit toujours être au-dessus des slides (desktop) */
.quote-stamp { z-index: 5; }
.hero-right { position: relative; }
.hero-gallery { z-index: 1; }

/* ==================== PDP V2 ==================== */
/* Quand la galerie v2 est active, on retire le carré terracotta du wrap original
   (sinon l'image principale aspect 4/5 déborde sous le carré). La galerie elle-même
   gère son fond et ses dimensions. */
.product-image-wrap:has(.pdp-gallery) {
  aspect-ratio: auto;
  padding: 0;
  background: transparent;
  display: block;
}
.product-image-wrap:has(.pdp-gallery) > .marker { display: none; }
.pdp-gallery {
  display: grid; gap: 10px;
  grid-template-columns: 90px 1fr;
}
.pdp-thumbs {
  display: flex; flex-direction: column; gap: 8px;
}
.pdp-thumb {
  width: 90px; height: 110px;
  border: 1px solid var(--rule); padding: 0;
  background: var(--paper); cursor: pointer;
  overflow: hidden; transition: border-color 0.2s;
}
.pdp-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.pdp-thumb.is-active { border-color: var(--terracotta); border-width: 2px; }
.pdp-thumb:hover { border-color: var(--ink); }
.pdp-main-image {
  position: relative; width: 100%; aspect-ratio: 4/5;
  overflow: hidden; background: var(--paper);
}
.pdp-main-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.pdp-main-image .marker {
  position: absolute; top: 18px; left: 18px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--paper);
  background: rgba(31, 27, 22, 0.78);
  padding: 6px 10px; z-index: 2;
}
@media (max-width: 700px) {
  .pdp-gallery { grid-template-columns: 1fr; }
  .pdp-thumbs {
    flex-direction: row; overflow-x: auto;
    order: 2; padding-bottom: 4px;
  }
  .pdp-thumb { width: 70px; height: 86px; flex-shrink: 0; }
}

/* Reviews mock (PDP) */
.pdp-rating-row {
  display: flex; align-items: center; gap: 12px;
  margin: -6px 0 10px;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-soft); letter-spacing: 0.5px;
}
.pdp-rating-stars {
  display: inline-flex; gap: 2px; color: var(--terracotta);
}
.pdp-rating-link {
  color: var(--ink-soft); text-decoration: underline;
  text-underline-offset: 3px;
}

/* Bundle upsell */
.pdp-bundle {
  margin: 24px 0;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(200, 85, 61, 0.06), rgba(200, 85, 61, 0.02));
  border: 1px solid rgba(200, 85, 61, 0.28);
  position: relative;
}
.pdp-bundle-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px; gap: 12px;
}
.pdp-bundle-title {
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  color: var(--ink); line-height: 1.2;
}
.pdp-bundle-title i {
  font-family: var(--serif2); font-style: italic; color: var(--terracotta);
}
.pdp-bundle-save {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 1px; color: var(--terracotta);
  background: var(--paper); padding: 4px 8px;
  border: 1px solid var(--terracotta);
  white-space: nowrap;
}
.pdp-bundle-items {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 14px;
}
.pdp-bundle-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px; background: var(--paper);
  border: 1px solid var(--rule);
}
.pdp-bundle-item input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--terracotta);
  cursor: pointer; flex-shrink: 0;
}
.pdp-bundle-item img {
  width: 50px; height: 50px; object-fit: cover; flex-shrink: 0;
}
.pdp-bundle-item-info {
  flex: 1; min-width: 0;
}
.pdp-bundle-item-name {
  font-size: 13px; color: var(--ink); font-weight: 500;
  margin-bottom: 2px;
}
.pdp-bundle-item-meta {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-soft); letter-spacing: 0.5px;
}
.pdp-bundle-item-price {
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  white-space: nowrap;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.pdp-bundle-item-price s {
  color: var(--ink-soft); font-size: 10.5px;
}
@media (max-width: 480px) {
  /* Bundle compact sur très petit écran : image plus petite, info wrap, prix sur 2 lignes */
  .pdp-bundle { padding: 14px 12px; }
  .pdp-bundle-item { gap: 8px; padding: 8px 6px; }
  .pdp-bundle-item img { width: 42px; height: 42px; }
  .pdp-bundle-item input[type="checkbox"] { width: 16px; height: 16px; }
  .pdp-bundle-item-name { font-size: 12.5px; line-height: 1.25; }
  .pdp-bundle-item-meta { font-size: 9.5px; }
  .pdp-bundle-item-price { font-size: 12px; }
  .pdp-bundle-item-price s { font-size: 10px; }
  .pdp-bundle-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pdp-bundle-title { font-size: 17px; line-height: 1.25; }
  .pdp-bundle-total-amount { font-size: 15px; }
  .pdp-bundle-total-amount s { font-size: 11px; }
  .pdp-bundle-total { font-size: 10.5px; flex-wrap: wrap; gap: 6px; }
  /* Bundle CTA button : laisse le texte wrapper si nécessaire au lieu de couper */
  #pdp-bundle-add {
    padding: 14px 16px;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: normal;
    line-height: 1.3;
  }
  /* Add-to-cart principal : pareil — laisse wrapper plutôt que couper */
  #add-to-cart {
    padding: 16px 18px;
    font-size: 12.5px;
    letter-spacing: 0.5px;
    white-space: normal;
    line-height: 1.3;
  }
}
.pdp-bundle-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 12px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  letter-spacing: 0.5px;
}
.pdp-bundle-total-amount {
  font-family: var(--serif); font-size: 18px; color: var(--terracotta);
  font-weight: 500;
}
.pdp-bundle-total-amount s {
  color: var(--ink-soft); font-size: 13px; font-weight: 400;
  margin-right: 8px; font-family: var(--mono);
}

/* Comparatif 22 momme */
.pdp-momme {
  margin: 28px 0; padding: 22px 24px;
  background: var(--paper); border: 1px solid var(--rule);
}
.pdp-momme-head {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--terracotta);
  text-transform: uppercase; margin-bottom: 12px;
}
.pdp-momme-title {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  color: var(--ink); margin-bottom: 16px; line-height: 1.2;
}
.pdp-momme-title i { font-family: var(--serif2); font-style: italic; }
.pdp-momme-bars {
  display: grid; gap: 12px;
}
.pdp-momme-row {
  display: grid; grid-template-columns: 90px 1fr 60px;
  align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11.5px;
}
.pdp-momme-label { color: var(--ink-soft); letter-spacing: 0.5px; }
.pdp-momme-bar {
  height: 8px; background: rgba(31, 27, 22, 0.08);
  position: relative; overflow: hidden;
}
.pdp-momme-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--ink-soft);
  transition: width 0.6s ease;
}
.pdp-momme-row.is-us .pdp-momme-fill { background: var(--terracotta); }
.pdp-momme-row.is-us .pdp-momme-label { color: var(--terracotta); font-weight: 500; }
.pdp-momme-value {
  text-align: right; font-weight: 500; color: var(--ink);
}

/* Reviews list (mock honnête : 3-4 reviews avec mention "verificate") */
.pdp-reviews {
  margin: 28px 0; padding: 22px 24px;
  background: var(--paper); border: 1px solid var(--rule);
}
.pdp-reviews-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.pdp-reviews-meta {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--ink-soft);
  text-transform: uppercase;
}
.pdp-reviews-avg {
  display: flex; align-items: baseline; gap: 10px;
}
.pdp-reviews-avg-num {
  font-family: var(--serif); font-size: 28px; font-weight: 500;
  color: var(--ink); line-height: 1;
}
.pdp-review {
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.pdp-review:first-of-type { border-top: none; padding-top: 0; }
.pdp-review-stars {
  display: inline-flex; gap: 2px; color: var(--terracotta);
  margin-bottom: 6px;
}
.pdp-review-text {
  font-size: 14px; line-height: 1.55; color: var(--ink);
  margin-bottom: 6px;
}
.pdp-review-author {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.5px; color: var(--ink-soft);
}

/* ==================== PANIER V2 ==================== */
.cart-progress {
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.cart-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-soft); letter-spacing: 0.5px;
}
.cart-progress-head strong { color: var(--ink); font-weight: 500; }
.cart-progress-bar {
  height: 6px; background: rgba(31, 27, 22, 0.08);
  overflow: hidden; position: relative;
}
.cart-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--terracotta);
  transition: width 0.5s ease;
}
.cart-progress-fill.is-complete { background: var(--olive); }
.cart-progress-msg {
  margin-top: 8px;
  font-size: 12.5px; color: var(--ink);
}
.cart-progress-msg strong { color: var(--terracotta); }
.cart-progress-msg.is-complete strong { color: var(--olive); }

.cart-countdown {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: rgba(74, 93, 58, 0.08);
  border-left: 3px solid var(--olive);
  font-family: var(--mono); font-size: 12px;
  color: var(--ink); letter-spacing: 0.3px;
}
.cart-countdown-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; color: var(--olive);
}
.cart-countdown strong { color: var(--olive); font-weight: 500; }

/* Cross-sell V2 - cards plus grosses avec bouton inline */
.xsell-v2 {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.xsell-v2-head {
  margin-bottom: 24px;
}
.xsell-v2-meta {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--terracotta);
  text-transform: uppercase; margin-bottom: 8px;
}
.xsell-v2-title {
  font-family: var(--serif); font-size: 30px; font-weight: 400;
  color: var(--ink); line-height: 1.1;
}
.xsell-v2-title i { font-family: var(--serif2); font-style: italic; }
.xsell-v2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.xsell-v2-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.xsell-v2-card:hover {
  border-color: var(--terracotta);
  transform: translateY(-2px);
}
.xsell-v2-img {
  width: 100%; aspect-ratio: 4/3;
  overflow: hidden; background: var(--bg);
}
.xsell-v2-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.xsell-v2-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.xsell-v2-name {
  font-family: var(--serif2); font-style: italic;
  font-size: 19px; color: var(--ink);
}
.xsell-v2-soustitre {
  font-size: 12px; color: var(--ink-soft); line-height: 1.4;
  min-height: 32px;
}
.xsell-v2-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.xsell-v2-price {
  font-family: var(--mono); font-size: 14px; color: var(--ink);
  font-weight: 500;
}
.xsell-v2-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--paper); background: var(--ink);
  border: none; cursor: pointer;
  transition: background 0.2s;
}
.xsell-v2-add:hover { background: var(--terracotta); }
.xsell-v2-add.is-added { background: var(--olive); }

/* ==================== POST-ACHAT V2 ==================== */
.merci-upsell {
  max-width: 760px; margin: 32px auto 0;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--terracotta);
  border-radius: 0;
}
.merci-upsell-eyebrow {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 1.5px; color: var(--terracotta);
  text-transform: uppercase; margin-bottom: 10px;
}
.merci-upsell-title {
  font-family: var(--serif); font-size: 26px; font-weight: 400;
  color: var(--ink); line-height: 1.2; margin-bottom: 6px;
}
.merci-upsell-title i { font-family: var(--serif2); font-style: italic; }
.merci-upsell-sub {
  font-size: 14px; color: var(--ink-soft); margin-bottom: 18px;
}
.merci-upsell-card {
  display: flex; align-items: center; gap: 16px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
}
.merci-upsell-card img {
  width: 80px; height: 80px; object-fit: cover; flex-shrink: 0;
}
.merci-upsell-card-info { flex: 1; min-width: 0; }
.merci-upsell-card-name {
  font-family: var(--serif2); font-style: italic;
  font-size: 18px; color: var(--ink); margin-bottom: 3px;
}
.merci-upsell-card-meta {
  font-size: 12px; color: var(--ink-soft);
}
.merci-upsell-card-price {
  font-family: var(--mono); font-size: 14px; color: var(--ink);
  margin-top: 6px;
}
.merci-upsell-card-price s {
  color: var(--ink-soft); margin-right: 6px;
}
.merci-upsell-cta {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 16px; padding: 14px 22px;
  width: 100%;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--paper); background: var(--terracotta);
  border: none; cursor: pointer;
  transition: background 0.2s;
}
.merci-upsell-cta:hover { background: var(--terracotta-dark); }
.merci-upsell-cta.is-disabled {
  background: var(--olive); cursor: default;
}
.merci-upsell-fineprint {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.8px; color: var(--ink-soft);
  text-align: center; margin-top: 12px;
}

@media (max-width: 600px) {
  .merci-upsell-card { flex-direction: column; align-items: flex-start; }
  .merci-upsell-card img { width: 100%; height: 200px; }
}
