/* ============================================================
   BOCAL — Épicerie fine alsacienne
   Design system : scandinave-premium, géométrique, asymétrique
   Titres : Space Grotesk · Corps : Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Palette */
  --white: #FFFFFF;
  --black: #1A1A1A;
  --green: #2C4A3E;
  --green-deep: #21392F;
  --terracotta: #C4704A;
  --terracotta-deep: #AC5E3B;

  /* Neutres dérivés */
  --paper: #FBFBF9;
  --line: #E7E7E2;
  --line-strong: #D8D8D1;
  --muted: #6F726C;
  --muted-light: #9A9C96;
  --green-tint: #EEF2F0;
  --terra-tint: #F6ECE6;

  /* Type */
  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Rythme */
  --maxw: 1320px;
  --gut: clamp(20px, 5vw, 64px);
  --section: clamp(72px, 11vw, 150px);
  --radius: 2px;

  /* Élévation */
  --shadow-sm: 0 1px 2px rgba(26,26,26,.04), 0 2px 8px rgba(26,26,26,.04);
  --shadow-md: 0 8px 30px rgba(26,26,26,.08);
  --shadow-lg: 0 24px 60px rgba(26,26,26,.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--black);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
ul { list-style: none; }
::selection { background: var(--terracotta); color: var(--white); }

/* ---------- Typographie ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--black);
}
.display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.96;
  font-size: clamp(3rem, 9vw, 7.5rem);
}
.eyebrow {
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  display: inline-block;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); line-height: 1.55; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.section { padding: var(--section) 0; }
.section--tight { padding: clamp(48px, 7vw, 90px) 0; }
.bg-green { background: var(--green); color: var(--white); }
.bg-green h1,.bg-green h2,.bg-green h3 { color: var(--white); }
.bg-paper { background: var(--paper); }
.bg-tint { background: var(--green-tint); }

/* ---------- Header ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--gut);
  height: 74px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  display: flex; align-items: center; gap: 0.55rem;
}
.brand__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); }
.nav__links { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 40px); }
.nav__link {
  font-size: 0.92rem; font-weight: 500; color: var(--black);
  position: relative; padding: 4px 0;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1.5px; background: var(--terracotta);
  transition: width .28s cubic-bezier(.4,0,.2,1);
}
.nav__link:hover::after, .nav__link[aria-current="page"]::after { width: 100%; }
.nav__right { display: flex; align-items: center; gap: 16px; }

.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 500; font-size: 0.9rem;
  padding: 10px 16px; border: 1.5px solid var(--black); border-radius: 100px;
  transition: all .22s ease;
}
.cart-btn:hover { background: var(--black); color: var(--white); }
.cart-btn__count {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 100px;
  background: var(--terracotta); color: var(--white);
  font-size: 0.72rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-btn:hover .cart-btn__count { background: var(--white); color: var(--terracotta); }

.nav__burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav__burger span { width: 24px; height: 2px; background: var(--black); transition: .25s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display); font-weight: 500; font-size: 0.98rem;
  padding: 16px 30px; border-radius: 100px;
  transition: transform .22s ease, background .22s ease, color .22s ease, box-shadow .22s ease;
  letter-spacing: -0.01em; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--terracotta); color: var(--white); }
.btn--primary:hover { background: var(--terracotta-deep); box-shadow: 0 10px 24px rgba(196,112,74,.32); }
.btn--dark { background: var(--black); color: var(--white); }
.btn--dark:hover { background: #000; box-shadow: 0 10px 24px rgba(26,26,26,.22); }
.btn--green { background: var(--green); color: var(--white); }
.btn--green:hover { background: var(--green-deep); }
.btn--ghost { background: transparent; color: var(--black); border: 1.5px solid var(--black); }
.btn--ghost:hover { background: var(--black); color: var(--white); }
.btn--ghost-light { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.55); }
.btn--ghost-light:hover { background: var(--white); color: var(--green); border-color: var(--white); }
.btn--block { width: 100%; }
.btn--lg { padding: 19px 38px; font-size: 1.05rem; }
.btn .arr { transition: transform .25s ease; }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(40px, 6vw, 80px); }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px); align-items: end;
}
.hero__title { margin: 22px 0 0; }
.hero__title .accent { color: var(--terracotta); }
.hero__sub { max-width: 30ch; margin-top: 28px; }
.hero__cta { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero__media {
  position: relative; aspect-ratio: 4/5; border-radius: var(--radius);
  overflow: hidden;
}
.hero__badge {
  position: absolute; bottom: 22px; left: 22px;
  background: var(--white); color: var(--black);
  border-radius: 100px; padding: 12px 20px;
  font-family: var(--display); font-weight: 500; font-size: 0.85rem;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-md);
}
.hero__metrics {
  display: flex; gap: clamp(24px,4vw,56px);
  margin-top: clamp(48px,7vw,84px); padding-top: 34px;
  border-top: 1px solid var(--line);
}
.metric__num { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem,3vw,2.6rem); letter-spacing: -0.03em; }
.metric__label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* Decorative circle */
.deco-circle {
  position: absolute; border-radius: 50%; pointer-events: none;
}

/* ---------- Section heads ---------- */
.shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(36px, 5vw, 60px); flex-wrap: wrap; }
.shead__title { font-size: clamp(2rem, 4vw, 3.4rem); max-width: 16ch; }
.shead__aside { max-width: 34ch; color: var(--muted); padding-bottom: 6px; }

/* ---------- Categories ---------- */
.cats { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.cat {
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  padding: 30px 24px 34px; min-height: 230px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; transition: background .3s ease; overflow: hidden;
}
.cat:first-child { border-left: 1px solid var(--line); }
.cat:hover { background: var(--green); color: var(--white); }
.cat:hover .cat__num, .cat:hover .cat__name { color: var(--white); }
.cat:hover .cat__arrow { color: var(--terracotta); transform: translate(4px,-4px); }
.cat__num { font-family: var(--display); font-size: 0.8rem; color: var(--muted-light); letter-spacing: 0.05em; }
.cat__name { font-family: var(--display); font-weight: 600; font-size: 1.55rem; letter-spacing: -0.03em; }
.cat__arrow { position: absolute; top: 26px; right: 22px; font-size: 1.1rem; color: var(--muted-light); transition: .3s ease; }

/* ---------- Product grid + cards ---------- */
.pgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
}
.card {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__media {
  position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--paper);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,0,.1,1); }
.card:hover .card__media img { transform: scale(1.05); }
.card__cat {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  font-family: var(--display); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 100px; color: var(--green);
}
.card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; gap: 7px; }
.card__name { font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.02em; }
.card__desc { font-size: 0.88rem; color: var(--muted); flex: 1; }
.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.card__price { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; }
.card__price .cents { font-size: 0.85em; }
.card__add {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem; transition: background .2s ease, transform .2s ease; flex-shrink: 0;
}
.card__add:hover { background: var(--terracotta); transform: rotate(90deg); }
.card__add:disabled { background: var(--line-strong); cursor: not-allowed; transform: none; }
.card__soldout { font-family: var(--display); font-size: 0.78rem; color: var(--terracotta); font-weight: 500; }

/* Placeholder media (no image) */
.ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background-image:
    repeating-linear-gradient(135deg, rgba(0,0,0,.025) 0 1px, transparent 1px 11px);
}
.ph__mark { width: 38px; height: 38px; opacity: .55; }
.ph__label {
  position: absolute; bottom: 12px; left: 0; right: 0; text-align: center;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.62rem;
  letter-spacing: 0.05em; color: rgba(26,26,26,.4); text-transform: uppercase;
}

/* ---------- Skeleton ---------- */
.skeleton .card__media,
.skeleton .sk-line { position: relative; overflow: hidden; background: #EFEFEC; }
.sk-line { height: 12px; border-radius: 3px; margin-top: 9px; }
.sk-line.w70 { width: 70%; } .sk-line.w40 { width: 40%; } .sk-line.w90 { width: 90%; }
.skeleton .card__media::after,
.sk-line::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.filter {
  font-family: var(--display); font-weight: 500; font-size: 0.9rem;
  padding: 10px 20px; border-radius: 100px; border: 1.5px solid var(--line-strong);
  color: var(--black); transition: all .2s ease; background: var(--white);
}
.filter:hover { border-color: var(--black); }
.filter.is-active { background: var(--black); color: var(--white); border-color: var(--black); }

/* ---------- Cart drawer ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(26,26,26,.4); z-index: 200;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.scrim.is-open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--white); z-index: 210; transform: translateX(100%);
  transition: transform .38s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 26px var(--gut); border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: 1.35rem; }
.drawer__close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: .2s; }
.drawer__close:hover { background: var(--paper); border-color: var(--line-strong); }
.drawer__body { flex: 1; overflow-y: auto; padding: 8px var(--gut); }
.drawer__empty { text-align: center; color: var(--muted); padding: 80px 20px; }
.drawer__foot { border-top: 1px solid var(--line); padding: 22px var(--gut) calc(22px + env(safe-area-inset-bottom)); }

.citem { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.citem__media { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.citem__media img { width: 100%; height: 100%; object-fit: cover; }
.citem__name { font-family: var(--display); font-weight: 600; font-size: 0.98rem; letter-spacing: -0.01em; }
.citem__price { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.citem__qty { display: inline-flex; align-items: center; gap: 0; margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 100px; overflow: hidden; }
.citem__qty button { width: 28px; height: 28px; font-size: 1rem; color: var(--black); transition: background .15s; }
.citem__qty button:hover { background: var(--paper); }
.citem__qty span { min-width: 28px; text-align: center; font-size: 0.85rem; font-weight: 500; }
.citem__right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.citem__line { font-family: var(--display); font-weight: 600; }
.citem__rm { font-size: 0.74rem; color: var(--muted-light); text-decoration: underline; }
.citem__rm:hover { color: var(--terracotta); }

.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.cart-total span:first-child { color: var(--muted); }
.cart-total .amt { font-family: var(--display); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.03em; }
.cart-note { font-size: 0.78rem; color: var(--muted-light); margin-top: 12px; text-align: center; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--display); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.02em; margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius); background: var(--white); color: var(--black);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(44,74,62,.1);
}
.textarea { resize: vertical; min-height: 120px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stripe-mount { padding: 15px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--white); }
.stripe-mount.StripeElement--focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(44,74,62,.1); }

/* Toggle */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle__track { width: 46px; height: 26px; border-radius: 100px; background: var(--line-strong); transition: background .22s; position: relative; }
.toggle__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); transition: transform .22s; box-shadow: var(--shadow-sm); }
.toggle input:checked + .toggle__track { background: var(--green); }
.toggle input:checked + .toggle__track::after { transform: translateX(20px); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--black); color: var(--white); padding: 14px 22px; border-radius: 100px;
  font-family: var(--display); font-weight: 500; font-size: 0.92rem; z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); }

/* ---------- Footer ---------- */
.footer { background: var(--black); color: var(--white); padding: clamp(64px,8vw,100px) 0 40px; }
.footer__top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 56px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer__brand { font-family: var(--display); font-weight: 700; font-size: 2rem; letter-spacing: -0.04em; }
.footer__tag { color: rgba(255,255,255,.6); margin-top: 14px; max-width: 30ch; }
.footer__col h5 { font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,.45); margin-bottom: 16px; }
.footer__col a { display: block; padding: 6px 0; color: rgba(255,255,255,.82); font-size: 0.94rem; transition: color .2s; }
.footer__col a:hover { color: var(--terracotta); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; flex-wrap: wrap; gap: 12px; }
.footer__bottom p { color: rgba(255,255,255,.5); font-size: 0.84rem; }

/* ---------- Story / split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px,6vw,90px); align-items: center; }
.split__media { aspect-ratio: 5/6; border-radius: var(--radius); overflow: hidden; position: relative; }
.story__list { margin-top: 34px; display: flex; flex-direction: column; gap: 2px; }
.story__item { display: flex; gap: 18px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.14); }
.story__item .n { font-family: var(--display); font-weight: 500; color: var(--terracotta); font-size: 0.85rem; min-width: 30px; }
.story__item h4 { font-size: 1.15rem; margin-bottom: 4px; }
.story__item p { color: rgba(255,255,255,.62); font-size: 0.92rem; }

/* ---------- Page hero (interior) ---------- */
.phero { padding: clamp(48px,7vw,90px) 0 clamp(36px,5vw,56px); }
.phero h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.phero__meta { display: flex; align-items: center; gap: 16px; margin-top: 18px; color: var(--muted); }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt40 { margin-top: 40px; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--line); border: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 0.74rem; font-weight: 500; padding: 5px 11px; border-radius: 100px; letter-spacing: 0.04em; }
.tag--green { background: var(--green-tint); color: var(--green); }
.tag--terra { background: var(--terra-tint); color: var(--terracotta-deep); }
.tag--gray { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { aspect-ratio: 16/11; max-height: 420px; order: -1; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .cat:nth-child(odd) { border-left: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; }
  .split__media { aspect-ratio: 16/10; max-height: 420px; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__brand-col { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__links.is-open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 74px; left: 0; right: 0; background: var(--white);
    padding: 18px var(--gut) 26px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
  }
  .nav__links.is-open .nav__link { font-size: 1.15rem; padding: 10px 0; }
  .row2 { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr; }
  .shead { flex-direction: column; align-items: flex-start; }
  .footer__top { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
}
