/* ============================================================
   YAYATO — Design System (V1)
   Cahier des charges §61. Couleur de marque : #F26522
   Approche : tokens en variables CSS + composants réutilisables.
   Sans dépendance externe (migrable vers Tailwind+Vite plus tard).
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* Marque (orange YAYATO) */
  --brand-50:  #FEF3EC;
  --brand-100: #FDE1CE;
  --brand-200: #FBC29D;
  --brand-300: #F89F6B;
  --brand-400: #F57F45;
  --brand-500: #F26522; /* principale */
  --brand-600: #D74E12;
  --brand-700: #B33D10;
  --brand-800: #8F3213;
  --brand-900: #742B13;

  /* Neutres */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Sémantiques */
  --success: #16A34A;
  --warning: #D97706;
  --danger:  #DC2626;
  --info:    #2563EB;

  /* Surfaces */
  --bg:         #FFFFFF;
  --bg-subtle:  var(--gray-50);
  --surface:    #FFFFFF;
  --border:     var(--gray-200);
  --text:       var(--gray-900);
  --text-muted: var(--gray-500);

  /* Typographie */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-xs: .75rem;   --fs-sm: .875rem;  --fs-base: 1rem;
  --fs-lg: 1.125rem; --fs-xl: 1.25rem;  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem; --fs-4xl: 2.25rem; --fs-5xl: 3rem;

  /* Espacements */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;
  --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem;

  /* Rayons & ombres */
  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow:    0 4px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.12);

  --container: 1200px;
  --header-h: 68px;
}

/* ---------- 2. Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 var(--sp-4); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
p { margin: 0 0 var(--sp-4); }
:focus-visible { outline: 3px solid var(--brand-300); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------- 3. Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-4); }
.section { padding-block: var(--sp-16); }
.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; gap: var(--sp-4); align-items: center; }
.grid { display: grid; gap: var(--sp-6); }
@media (min-width: 640px)  { .grid-sm-2 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .grid-lg-3 { grid-template-columns: repeat(3,1fr); }
                             .grid-lg-4 { grid-template-columns: repeat(4,1fr); } }

/* ---------- 4. En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
/* En-tête en 3 zones flexibles : logo | recherche | actions. Les zones logo et
   actions ont le même flex (1) → la barre de recherche reste centrée dans
   l'en-tête quelle que soit la largeur des actions, et rétrécit si besoin. */
.site-header .container { display: flex; align-items: center; gap: var(--sp-4); height: 100%; }
.brand { flex: 1 1 0; display: flex; align-items: center; gap: var(--sp-2); white-space: nowrap;
         font-weight: 800; font-size: var(--fs-xl); color: var(--brand-500); letter-spacing: -.02em; }
.brand span { flex-shrink: 0; }
.brand svg { width: 32px; height: 32px; flex-shrink: 0; }
.brand img { width: 32px; height: 32px; flex-shrink: 0; }
/* Barre de recherche : taille moyenne, centrée dans l'en-tête, sur toutes les pages. */
.header-search { flex: 0 1 400px; min-width: 0; }
.header-search .search-box { width: 100%; }
.header-nav { flex: 1 1 0; display: flex; align-items: center; gap: var(--sp-1);
  justify-content: flex-end; }

/* Boutons-icônes de l'en-tête (libèrent de l'espace pour la recherche). */
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0; border-radius: var(--radius); border: 1px solid transparent;
  background: transparent; color: var(--gray-700); cursor: pointer; flex-shrink: 0;
  transition: background .15s, color .15s, transform .05s; }
.icon-btn:hover { background: var(--gray-100); color: var(--brand-600); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.is-cart { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-200); }
.icon-btn.is-cart:hover { background: var(--brand-100); border-color: var(--brand-300); }
.icon-badge { position: absolute; top: -4px; right: -4px; background: var(--brand-500); color: #fff;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
  border: 2px solid #fff; }
.header-divider { width: 1px; height: 24px; background: var(--border); margin-inline: var(--sp-1); flex-shrink: 0; }
.lang-switch { flex-shrink: 0; }
.lang-switch a { padding: .3rem .4rem; border-radius: var(--radius); font-size: var(--fs-sm); }
.lang-switch a:hover { background: var(--gray-100); }

/* ---------- 5. Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: .625rem 1.125rem; font-size: var(--fs-sm); font-weight: 600;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-outline { background: #fff; color: var(--brand-600); border-color: var(--brand-200); }
.btn-outline:hover { background: var(--brand-50); border-color: var(--brand-300); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-lg { padding: .875rem 1.5rem; font-size: var(--fs-base); }
.btn-block { width: 100%; }

/* ---------- 6. Champs ---------- */
.input, .search-box input {
  width: 100%; padding: .625rem .875rem; font-size: var(--fs-sm);
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text);
}
.input:focus { border-color: var(--brand-400); outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-1); color: var(--gray-700); }
.search-box { display: flex; align-items: center; gap: var(--sp-2); background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-full); padding: .45rem .55rem .45rem 1.15rem;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-100); }
.search-box input { border: none; box-shadow: none; padding-left: 0; font-size: var(--fs-base); }
.search-box input:focus { box-shadow: none; }

/* Autocomplétion de recherche (§77) */
.ac-panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md, 0 12px 34px -14px rgba(0,0,0,.28));
  z-index: 60; overflow: hidden auto; max-height: 70vh; }
.ac-head { padding: 9px 14px 5px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; text-decoration: none; color: var(--text); font-size: 14px; }
.ac-item:hover, .ac-item.is-active { background: var(--gray-100); }
.ac-item img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--gray-100); }
.ac-ic { width: 34px; text-align: center; flex-shrink: 0; }
.header-search .search-box svg { flex-shrink: 0; }

/* ---------- 7. Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: var(--sp-5); }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.product-card .thumb { aspect-ratio: 4/3; background: var(--gray-100); object-fit: cover; width: 100%; }
.price { font-weight: 700; color: var(--gray-900); }
.price-old { color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-left: var(--sp-2); }

/* ---------- 8. Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: .2rem .55rem;
  font-size: var(--fs-xs); font-weight: 600; border-radius: var(--radius-full); }
.badge-brand   { background: var(--brand-50);  color: var(--brand-700); }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-muted   { background: var(--gray-100); color: var(--gray-600); }

/* Avantages de formule (§46) : badges distinctifs premium. */
.badge-premium { display: inline-flex; align-items: center; gap: 3px; padding: .15rem .5rem;
  font-size: var(--fs-xs); font-weight: 700; border-radius: var(--radius-full);
  background: linear-gradient(135deg, #7C3AED, #4F46E5); color: #fff; }
.ribbon-featured { position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 11px; font-weight: 700; padding: .2rem .55rem; border-radius: var(--radius-full);
  background: linear-gradient(135deg, #FFB800, #FF8A00); color: #fff; box-shadow: var(--shadow-sm); }
.ribbon-discount { position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 12px; font-weight: 800; padding: .2rem .5rem; border-radius: var(--radius-full);
  background: var(--danger); color: #fff; box-shadow: var(--shadow-sm); }

/* ---------- 9. Utilitaires ---------- */
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand-500); }
.text-center { text-align: center; }
.text-sm { font-size: var(--fs-sm); } .text-lg { font-size: var(--fs-lg); }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.mt-2{margin-top:var(--sp-2)} .mt-4{margin-top:var(--sp-4)} .mt-8{margin-top:var(--sp-8)}
.mb-4{margin-bottom:var(--sp-4)} .mb-8{margin-bottom:var(--sp-8)}
.hidden { display: none; }
@media (min-width: 768px) { .md\:flex { display: flex; } .md\:hidden { display: none; } }

/* ---------- 10. Pied de page ---------- */
.site-footer { background: var(--gray-900); color: var(--gray-300); padding-block: var(--sp-12) var(--sp-8); margin-top: var(--sp-20); }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; }
.footer-cols { display: grid; gap: var(--sp-8); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-bottom { border-top: 1px solid var(--gray-700); margin-top: var(--sp-8); padding-top: var(--sp-6);
  font-size: var(--fs-sm); color: var(--gray-400); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-4); }
.footer-social { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid var(--gray-700); border-radius: 999px; color: var(--gray-300); text-decoration: none;
  transition: border-color .15s, color .15s, background .15s; }
.footer-social:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.footer-social.is-placeholder { opacity: .4; cursor: default; }

/* ---------- Pages de contenu (À propos, légal, FAQ…) ---------- */
.content-page { max-width: 820px; padding-block: var(--sp-10) var(--sp-16); }
.prose { color: var(--text); line-height: 1.7; }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { font-size: var(--fs-xl); margin-top: var(--sp-8); margin-bottom: var(--sp-2); }
.prose h3 { font-size: var(--fs-lg); margin-top: var(--sp-6); margin-bottom: var(--sp-1); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: var(--sp-1); }
.prose a { color: var(--brand-600); text-decoration: underline; }
.legal-note { background: var(--brand-50); border: 1px solid var(--brand-200); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); }
.faq-item { border-bottom: 1px solid var(--border); padding: var(--sp-4) 0; }
.faq-item > summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item[open] > summary { color: var(--brand-600); }

/* ---------- Contenu d'accueil administrable (carrousel, pub, promo) ---------- */
.home-block-inner { position: relative; height: 100%; border-radius: var(--radius-lg, 14px); overflow: hidden;
  display: flex; align-items: flex-end; min-height: 180px; background: var(--gray-100); }
.home-block-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.home-block-text { position: relative; z-index: 1; padding: var(--sp-6); color: #fff; width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0)); }
.home-block-inner:not(:has(.home-block-media)) .home-block-text { background: none; color: var(--text); }
.home-block-title { color: inherit; font-size: var(--fs-xl); margin: 0; }
.home-block-subtitle { margin: var(--sp-1) 0 0; opacity: .95; }
.home-block-body { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); opacity: .9; }

/* Carrousel */
.home-carousel { position: relative; }
.home-carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; }
.home-carousel-track::-webkit-scrollbar { display: none; }
.home-carousel-slide { flex: 0 0 100%; scroll-snap-align: start; }
.home-carousel-slide .home-block-inner { min-height: 340px; border-radius: 0; }
.home-carousel-slide .home-block-title { font-size: var(--fs-3xl, 2rem); }
.home-carousel-dots { position: absolute; bottom: var(--sp-4); left: 0; right: 0; display: flex; gap: 8px;
  justify-content: center; z-index: 2; }
.home-carousel-dot { width: 10px; height: 10px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.55); }
.home-carousel-dot.is-active { background: #fff; }

/* Bannière pub & cartes promo */
.home-ad .home-block-inner { min-height: 160px; }
.home-promo { height: 100%; }
.home-promo .home-block-inner { min-height: 220px; }

/* Vignettes catégories */
.cat-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat-tile { position: relative; display: flex; align-items: flex-end; min-height: 120px; padding: var(--sp-3);
  border-radius: var(--radius-lg, 14px); overflow: hidden; text-decoration: none; color: #fff;
  background-size: cover; background-position: center; transition: transform .15s, box-shadow .15s; }
.cat-tile::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,.05)); }
/* Dégradés de secours quand aucune image n'est définie (couleur selon --i) */
.cat-tile:nth-child(6n+1) { background-color: #F26522; }
.cat-tile:nth-child(6n+2) { background-color: #2563EB; }
.cat-tile:nth-child(6n+3) { background-color: #059669; }
.cat-tile:nth-child(6n+4) { background-color: #7C3AED; }
.cat-tile:nth-child(6n+5) { background-color: #DB2777; }
.cat-tile:nth-child(6n+6) { background-color: #0891B2; }
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); }
.cat-tile-name { position: relative; z-index: 1; font-weight: 700; font-size: var(--fs-sm); line-height: 1.2; }

/* Suivi de livraison */
.delivery-tracking { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center;
  justify-content: space-between; margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  background: var(--brand-50); border-radius: var(--radius); }
.delivery-tracking-ref { font-size: var(--fs-sm); font-weight: 600; }
.delivery-tracking-link { font-size: var(--fs-sm); font-weight: 600; color: var(--brand-600); text-decoration: none; }
.delivery-tracking-link:hover { text-decoration: underline; }

/* Boutiques à la une */
.featured-store { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; display: block; }
.featured-store:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); }
.featured-store-logo { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: var(--brand-500); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--fs-lg); }
.featured-store-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 11. Hero ---------- */
.hero { background: linear-gradient(135deg, var(--brand-50), #fff 60%); padding-block: var(--sp-20); }
.hero h1 { font-size: clamp(2rem, 5vw, var(--fs-5xl)); max-width: 18ch; }
.hero .lead { font-size: var(--fs-lg); color: var(--gray-600); max-width: 52ch; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { padding: .35rem .8rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: var(--fs-sm); color: var(--gray-700); }
.chip:hover { border-color: var(--brand-300); color: var(--brand-600); }
