/**
 * Styles de la page d'accueil Babeth (template-babeth-homepage.php).
 * Tout est scopé sous .babeth-home pour ne pas impacter le thème Neve.
 */

.babeth-home {
  --navy: #293152;
  --navy-700: #1c2240;
  --ink: #14171c;
  --paper: #ffffff;
  --paper-soft: #f7f4ef;
  --sand: #efe7de;
  --rule: rgba(41, 49, 82, .1);
  --terracotta: #c8472e;
  --coral: #f37262;
  --muted: #615c58;
  --maxw: 1280px;
  --radius: 4px;
  --shadow: 0 22px 54px rgba(20, 23, 28, .08);

  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #fff 46%, #faf8f5 100%);
}

.babeth-home * { box-sizing: border-box; }
.babeth-home img { max-width: 100%; display: block; }
.babeth-home a { color: inherit; text-decoration: none; }

.babeth-home .wrap {
  width: min(var(--maxw), calc(100% - 56px));
  margin: 0 auto;
}

.babeth-home h1,
.babeth-home h2,
.babeth-home h3,
.babeth-home h4 {
  margin: 0;
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--navy);
  letter-spacing: .02em;
}

.babeth-home p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.babeth-home .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.babeth-home .eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.babeth-home .section { padding: 64px 0; }

.babeth-home .section--tinted { background: var(--navy); }
.babeth-home .section--tinted .section-head h2 { color: #fff; }
.babeth-home .section--tinted .section-head p { color: #fff; }
.babeth-home .section--tinted .product-card { border: none; }

.babeth-home .section-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.babeth-home .section-head h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.25;
  margin: 16px 0 14px;
}

.babeth-home .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.babeth-home .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.babeth-home .btn:hover { transform: translateY(-2px); }
.babeth-home .btn-primary { background: var(--navy); color: #fff; }
.babeth-home .btn-primary:hover { background: var(--navy-700); }
.babeth-home .btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.babeth-home .btn-ghost:hover { background: var(--navy); color: #fff; }
.babeth-home .btn-light { background: #fff; color: var(--navy); }

/* ---------------- HERO ---------------- */
.babeth-home .hero {
  position: relative;
  min-height: calc(100vh - 86px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--sand);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.babeth-home .hero-panel {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100% - 56px));
  margin: 0 auto;
  text-align: center;
}

.babeth-home .hero-panel .btn-row { justify-content: center; }

.babeth-home .hero-panel h1 {
  font-size: clamp(3rem, 6.5vw, 5.4rem);
  line-height: 1.15;
  margin: 18px auto 44px;
  max-width: 16ch;
  color: #fff;
}

/* ---------------- HERO CARROUSEL ---------------- */
.babeth-home .hero--carousel {
  display: block;
  align-items: stretch;
  justify-content: stretch;
}

/* Les slides sont empilées : hauteur = plus grande slide, fondu enchaîné. */
.babeth-home .hero-slides { display: grid; }

.babeth-home .hero-slide {
  grid-area: 1 / 1;
  min-height: calc(100vh - 86px);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--navy);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  visibility: hidden;
  z-index: 0;
  transition: opacity .8s ease;
}

/* Slide entrante : par-dessus, en fondu. */
.babeth-home .hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* Slide sortante : reste totalement opaque EN DESSOUS pendant que l'entrante
   se révèle, pour qu'il n'y ait jamais de trou laissant voir le fond (flash). */
.babeth-home .hero-slide.is-leaving {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition: none;
}

.babeth-home .hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(41, 49, 82, .35);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.babeth-home .hero-nav:hover { background: #fff; color: var(--navy); border-color: #fff; }
.babeth-home .hero-nav--prev { left: 20px; }
.babeth-home .hero-nav--next { right: 20px; }

.babeth-home .hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.babeth-home .hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #fff;
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.babeth-home .hero-dot.is-active { background: #fff; transform: scale(1.2); }

/* ---------------- CARTES PRODUITS ---------------- */
.babeth-home .product-card {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.babeth-home .product-card .card-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.babeth-home .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.babeth-home .product-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform .45s ease;
}

.babeth-home .editorial-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.babeth-home .product-card:hover .product-image {
  transform: scale(1.06);
}

.babeth-home .product-card .content {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.babeth-home .product-card h3 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.babeth-home .product-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-left: 0;
  padding: 4px var(--gutter, 28px) 14px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.babeth-home .product-slider::-webkit-scrollbar { display: none; width: 0; height: 0; }

.babeth-home .product-slider .product-card {
  flex: 0 0 clamp(240px, 26vw, 320px);
  scroll-snap-align: start;
}

.babeth-home .carousel {
  --gutter: max(28px, calc((100vw - var(--maxw)) / 2));
  position: relative;
}

.babeth-home .carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.96);
  color: var(--navy);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(20,23,28,.1);
  transition: background .18s ease, color .18s ease;
}

.babeth-home .carousel-btn:hover { background: var(--navy); color: #fff; }
.babeth-home .carousel-btn:disabled { opacity: .35; cursor: default; }
.babeth-home .carousel-btn:disabled:hover { background: rgba(255,255,255,.96); color: var(--navy); }
.babeth-home .carousel-btn--prev { left: 12px; }
.babeth-home .carousel-btn--next { right: calc(var(--gutter, 28px) - 54px); }

.babeth-home .badge {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--terracotta);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.babeth-home .product-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.babeth-home .product-brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.babeth-home .price {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

/* Prix WooCommerce (get_price_html) */
.babeth-home .price del {
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: line-through;
}
.babeth-home .price ins { text-decoration: none; }
.babeth-home .price .woocommerce-Price-currencySymbol { font-weight: 700; }

/* ---------------- BLOCS EDITORIAUX ---------------- */
.babeth-home .editorial-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.babeth-home .editorial-card.giftcard {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.babeth-home .editorial-card--plain {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.babeth-home #apropos { padding-bottom: 120px; }

.babeth-home .editorial-body p + p { margin-top: 14px; }

.babeth-home .editorial-copy--split {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 32px;
}

.babeth-home .editorial-heading h2 { margin-top: 16px; }

.babeth-home .editorial-copy {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.babeth-home .editorial-copy h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.25;
  margin: 16px 0 16px;
}

.babeth-home .editorial-copy p + p { margin-top: 14px; }

/* ---------------- GRILLE DE CATEGORIES ---------------- */
.babeth-home #categories { padding-top: 0; }

.babeth-home .category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.babeth-home .category-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  text-decoration: none;
  background: var(--sand);
}

.babeth-home .category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,23,28,0) 45%, rgba(20,23,28,.6) 100%);
  z-index: 1;
}

.babeth-home .category-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.babeth-home .category-tile:hover .category-image { transform: scale(1.06); }

.babeth-home .category-label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------------- BANDEAU DEFILANT ---------------- */
.babeth-home .topbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 18px 0;
  font-size: 12.8px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--navy);
  background: #fff;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.babeth-home .topbar-track {
  display: flex;
  width: max-content;
  animation: babeth-topbar-scroll 38s linear infinite;
}

.babeth-home .topbar-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 28px;
  white-space: nowrap;
}

@keyframes babeth-topbar-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1100px) {
  .babeth-home .editorial-card { grid-template-columns: 1fr 1fr; }
  .babeth-home .product-slider .product-card { flex-basis: clamp(220px, 32vw, 300px); }
}

@media (max-width: 860px) {
  .babeth-home .hero {
    min-height: auto;
    padding: 110px 0 36px;
    align-items: flex-start;
  }
  .babeth-home .hero-slide { min-height: auto; padding: 110px 0 56px; align-items: flex-start; }
  .babeth-home .hero-nav { width: 40px; height: 40px; font-size: 20px; }
  .babeth-home .hero-nav--prev { left: 10px; }
  .babeth-home .hero-nav--next { right: 10px; }
  .babeth-home .hero-panel { width: calc(100% - 36px); margin: 0 auto; }
  .babeth-home .editorial-card,
  .babeth-home .editorial-copy--split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .babeth-home .wrap { width: calc(100% - 36px); }
  .babeth-home .section { padding: 48px 0; }
  .babeth-home .hero-panel,
  .babeth-home .editorial-copy,
  .babeth-home .product-card .content { padding: 24px 20px; }
  .babeth-home .category-grid { grid-template-columns: repeat(2, 1fr); }
  .babeth-home .product-slider .product-card { flex-basis: 78vw; }
  .babeth-home .carousel-btn { display: none; }
  .babeth-home .btn { width: 100%; }
}

/* ---------------- ANIMATIONS D'APPARITION AU SCROLL ---------------- */
/* État masqué appliqué uniquement quand le JS est actif (classe ajoutée au conteneur). */
.babeth-home.babeth-reveal-ready .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-shift, 34px));
  will-change: opacity, transform;
}

/* Le hero entre de plus haut : on ne change QUE la variable de distance,
   jamais la propriété transform, pour ne pas entrer en conflit de spécificité
   avec l'état révélé ci-dessous. */
.babeth-home.babeth-reveal-ready .hero-panel h1.reveal,
.babeth-home.babeth-reveal-ready .hero-panel .btn-row.reveal {
  --reveal-shift: 48px;
}

/* La transition est portée par l'état révélé : l'état masqué s'applique
   instantanément (pas d'animation de disparition), seul le 0 → 1 est animé. */
.babeth-home.babeth-reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .85s cubic-bezier(.22, .61, .36, 1),
              transform .85s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .babeth-home.babeth-reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .babeth-home .hero-slide { transition: none; }
}

/* Bandeau réassurance (livraison / délai / paiement) */
.babeth-home .trust-bar {
  background: var(--paper-soft);
  padding: 56px 0;
}

.babeth-home .trust-bar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.babeth-home .trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 0 32px;
  border-left: 1px solid var(--rule);
}

.babeth-home .trust-item:first-child {
  border-left: 0;
}

.babeth-home .trust-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  color: var(--navy-700);
}

.babeth-home .trust-icon svg {
  width: 100%;
  height: 100%;
}

.babeth-home .trust-item h3 {
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--navy-700);
}

.babeth-home .trust-item p {
  font-size: 14px;
  max-width: 320px;
}

@media (max-width: 780px) {
  .babeth-home .trust-bar-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .babeth-home .trust-item {
    border-left: 0;
    padding: 0;
  }
}
