/* =====================================================================
   ST JUDIST S.A. — Thème « Marché » (clair, chaleureux et sobre)
   Fond crème, vert profond en couleur principale, terracotta en accent.
   Chargé après style.css et custom.css : redéfinit la palette et les
   composants (cartes, hero, rayons, compteurs, CTA, bouton WhatsApp).
   ===================================================================== */

:root {
  color-scheme: light;
  --background: 40 33% 97%;        /* crème */
  --foreground: 150 22% 12%;
  --card: 0 0% 100%;
  --card-foreground: 150 22% 12%;
  --popover: 0 0% 100%;
  --popover-foreground: 150 22% 12%;
  --primary: 152 50% 24%;          /* vert profond */
  --primary-foreground: 40 60% 98%;
  --secondary: 40 30% 93%;
  --secondary-foreground: 150 22% 12%;
  --muted: 40 22% 92%;
  --muted-foreground: 150 8% 33%;
  --accent: 145 30% 92%;
  --accent-foreground: 152 50% 20%;
  --destructive: 0 70% 45%;
  --destructive-foreground: 0 0% 100%;
  --border: 40 18% 86%;
  --input: 40 12% 76%;
  --ring: 152 50% 30%;
  --brand: 152 50% 24%;
  --brand-strong: 152 52% 18%;
  --terracotta: 16 62% 40%;        /* accent texte (contraste AA sur crème) */
  --sand: 36 80% 74%;              /* accent sur fonds foncés */
  --shadow-soft: 0 1px 2px hsl(150 20% 20% / .05), 0 8px 24px -12px hsl(150 20% 20% / .14);
  --shadow-lift: 0 2px 4px hsl(150 20% 20% / .05), 0 18px 40px -16px hsl(150 25% 20% / .22);
  --radius: 0.85rem;
}

/* ---------- Typographie ---------- */
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: hsl(var(--background)); color: hsl(var(--foreground)); line-height: 1.6; }
h1, h2, h3, h4, .font-heading { font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.02em; }
::selection { background: hsl(152 50% 24% / .18); }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

/* ---------- Classes de marque ---------- */
.text-brand, .text-brand-soft { color: hsl(var(--brand)); }
.text-accent2 { color: hsl(var(--terracotta)); }
.hover\:text-brand:hover, .group:hover .group-hover\:text-brand { color: hsl(var(--brand)); }
.hover\:text-accent2:hover { color: hsl(var(--terracotta)); }
.bg-brand { background-color: hsl(var(--brand)); }
.hover\:bg-brand-strong:hover { background-color: hsl(var(--brand-strong)); }
.bg-brand-soft { background-color: hsl(145 32% 92%); }
.border-brand-soft { border-color: hsl(145 25% 80%); }
.bg-ink { background-color: hsl(152 40% 13%); }
.text-ink { color: hsl(var(--foreground)); }
.text-gradient { color: hsl(var(--terracotta)); }

/* ---------- Surfaces, ombres, boutons ---------- */
.shadow-\[var\(--shadow-soft\)\], .shadow, .shadow-sm { box-shadow: var(--shadow-soft); }
.shadow-\[var\(--shadow-lift\)\], .hover\:shadow-\[var\(--shadow-lift\)\]:hover { box-shadow: var(--shadow-lift); }
.bg-secondary\/40 { background-color: hsl(40 30% 93% / .6); }
button.bg-primary, a.bg-primary, .bg-brand { transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease; }
button.bg-primary:hover, a.bg-primary:hover, .bg-brand:hover { transform: translateY(-1px); }
.hover\:bg-primary\/90:hover { background-color: hsl(var(--brand-strong)); }
input.border-input:focus, textarea.border-input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(152 50% 30% / .15); }
[data-filter] { transition: background-color .2s ease, color .2s ease, border-color .2s ease; }

/* Badges (« Nos rayons », « Catégories »…) */
.tracking-\[0\.08em\].uppercase.text-\[10px\].border:not(.text-white) { border-color: hsl(145 25% 82%); color: hsl(var(--brand)); background-color: hsl(145 32% 94%); border-radius: 9999px; }

/* ---------- En-tête ---------- */
.site-header { box-shadow: 0 1px 0 hsl(var(--border)), 0 6px 20px -18px hsl(150 20% 20% / .4); }
.nav-link { position: relative; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: hsl(var(--terracotta)); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- En-têtes de pages intérieures ---------- */
.hero-bg { background: linear-gradient(180deg, hsl(40 38% 94%), hsl(var(--background))); }

/* ---------- Hero d'accueil ---------- */
.hero-xl { position: relative; overflow: hidden; isolation: isolate; min-height: min(84vh, 760px); display: flex; align-items: center; }
.hero-xl__media { position: absolute; inset: 0; z-index: -1; }
.hero-xl__media img { width: 100%; height: 100%; object-fit: cover; }
.hero-xl__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, hsl(152 45% 9% / .88) 0%, hsl(152 40% 11% / .72) 48%, hsl(152 30% 12% / .3) 100%); }
.hero-xl .text-gradient, .hero-xl .text-accent2 { color: hsl(var(--sand)); }
.hero-xl button.bg-primary { background-color: hsl(var(--terracotta)); color: #fff; }
.hero-xl button.bg-primary:hover { background-color: hsl(16 64% 34%); }
.eyebrow { display: inline-flex; align-items: center; padding: .35rem .85rem; border-radius: 9999px; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: hsl(0 0% 100% / .14); border: 1px solid hsl(0 0% 100% / .25); }

/* Compteurs */
.stat-card { border-radius: 1rem; padding: 1.25rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); box-shadow: var(--shadow-soft); }
.stat-card .text-white\/60 { color: hsl(var(--muted-foreground)); }
.stat-value { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 700; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1; color: hsl(var(--brand)); font-variant-numeric: tabular-nums; }

/* ---------- Cartes ---------- */
.card-soft { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card-soft:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: hsl(145 20% 80%); }
.product-media { position: relative; overflow: hidden; background: hsl(var(--secondary)); }
.product-media img { transition: transform .5s ease; }
.group:hover .product-media img { transform: scale(1.04); }
.product-badge { background: hsl(0 0% 100% / .94) !important; color: hsl(var(--brand)) !important; border-color: hsl(145 20% 85%) !important; z-index: 2; }

/* Tuiles rayons */
.rayon-tile { position: relative; display: block; overflow: hidden; border-radius: 1rem; aspect-ratio: 4 / 5; isolation: isolate; box-shadow: var(--shadow-soft); transition: box-shadow .25s ease, transform .25s ease; }
.rayon-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s ease; }
.rayon-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, hsl(150 30% 8% / .82)); }
.rayon-tile:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.rayon-tile:hover img { transform: scale(1.05); }
.rayon-tile .rayon-label { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; }
.rayon-tile .rayon-line { display: block; height: 2px; width: 1.75rem; margin-top: .45rem; border-radius: 2px; background: hsl(var(--sand)); transition: width .3s ease; }
.rayon-tile:hover .rayon-line { width: 3rem; }
@media (min-width: 1024px) {
  .rayon-tile { aspect-ratio: 3 / 4; }
  .rayon-tile .rayon-label { left: .7rem; right: .7rem; bottom: .8rem; }
  .rayon-tile .rayon-label > span:first-child { font-size: .8rem; }
}

/* Logos marques */
.brand-logo-grayscale { filter: grayscale(1); opacity: .7; }
.brand-logo-grayscale:hover { filter: none; opacity: 1; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 3rem; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Blocs d'appel à l'action ---------- */
.cta-panel { position: relative; overflow: hidden; border-radius: 1.5rem; background: radial-gradient(600px 300px at 90% 0%, hsl(152 40% 30%), transparent 70%), hsl(var(--brand)); box-shadow: var(--shadow-lift); }
.cta-panel .text-gradient { color: hsl(var(--sand)); }
.cta-panel .text-white\/75 { color: hsl(40 40% 96% / .88); }
.btn-light { background: hsl(40 60% 98%); color: hsl(var(--brand)); transition: transform .2s ease, background-color .2s ease; }
.btn-light:hover { background: #fff; transform: translateY(-1px); }
.cta-soft { border-radius: 1.5rem; background: hsl(145 30% 94%); border: 1px solid hsl(145 22% 84%); }

/* ---------- Pied de page ---------- */
footer.bg-ink .text-accent2, footer.bg-ink .hover\:text-accent2:hover { color: hsl(var(--sand)); }
footer.bg-ink a { transition: color .2s ease; }
footer.bg-ink a:hover { color: hsl(var(--sand)); }

/* ---------- Bouton WhatsApp flottant ---------- */
.wa-float {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 45;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  width: 3.5rem; height: 3.5rem; border-radius: 9999px;
  background: #117A40; color: #fff; font-weight: 600; font-size: .9rem;
  box-shadow: 0 10px 24px -8px hsl(150 50% 15% / .45);
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.wa-float img { width: 1.75rem; height: 1.75rem; }
.wa-float__label { display: none; }
.wa-float:hover { background: #0D6233; transform: translateY(-2px); box-shadow: 0 14px 28px -10px hsl(150 50% 15% / .55); }
.wa-float:focus-visible { outline: 3px solid hsl(var(--foreground)); outline-offset: 3px; }
@media (min-width: 768px) {
  .wa-float { width: auto; padding: 0 1.15rem 0 .95rem; right: 1.5rem; bottom: 1.5rem; }
  .wa-float__label { display: inline; }
}
/* Les notifications s'affichent au-dessus du bouton pour ne jamais être masquées */
.toast-region { bottom: 5.5rem; }
@media (min-width: 768px) { .toast-region { bottom: 6rem; right: 1.5rem; } }
/* Espace en bas du pied de page pour que le bouton ne masque pas les liens légaux */
footer[data-testid="site-footer"] > div { padding-bottom: 6rem; }

/* Apparition au scroll : fondu léger */
.reveal-up { transform: translateY(12px); transition-duration: .6s; }

/* Crédits photos (mentions légales) */
.credits-details summary { cursor: pointer; color: hsl(var(--brand)); list-style: revert; }
.credits-details ul { max-height: 420px; overflow: auto; padding-right: .5rem; word-break: break-word; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .hero-xl { min-height: auto; }
  .hero-xl__media::after { background: linear-gradient(180deg, hsl(152 45% 9% / .86), hsl(152 40% 10% / .8)); }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none !important; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee__track [aria-hidden="true"] { display: none; }
  .reveal-up { opacity: 1 !important; transform: none !important; }
  .card-soft:hover, .rayon-tile:hover, .rayon-tile:hover img, .group:hover .product-media img,
  .wa-float:hover, .btn-light:hover, button.bg-primary:hover, a.bg-primary:hover, .bg-brand:hover { transform: none; }
}

/* Cartes catégories de même hauteur */
[data-testid="home-categories"] .grid > div > .card-soft { height: 100%; }
footer.bg-ink [data-testid="site-logo"] img { border-radius: 12px; box-shadow: 0 0 0 1.5px hsl(40 60% 98% / .45); }
