/* =====================================================================
   3 Fruits & Légumes — thème beige / blanc, accents bleu-blanc-rouge
   Mobile d'abord : téléphone -> tablette (≥ 720px) -> ordinateur (≥ 1024px)
   ===================================================================== */
:root {
  --bleu: #000091;          /* bleu France */
  --bleu-hover: #1212ff;
  --bleu-soft: #e8edff;
  --rouge: #e1000f;         /* rouge Marianne */
  --rouge-soft: #fde8e9;
  --beige: #f6efe2;
  --beige-2: #ece0c8;
  --sable: #d9c7a3;
  --blanc: #fffdf8;
  --ink: #26241f;
  --muted: #6a6457;
  --line: #e3d7bf;
  --vert: #18753c;
  --vert-soft: #e3f3e8;
  --orange: #b34000;
  --orange-soft: #fff1e5;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 6px 18px rgba(60, 45, 20, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --tricolore: linear-gradient(90deg, var(--bleu) 0 33.33%, #fff 33.33% 66.66%, var(--rouge) 66.66% 100%);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55;
  color: var(--ink); background: var(--beige);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bleu); text-underline-offset: 2px; }
a:hover { color: var(--bleu-hover); }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.2; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--bleu); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { top: 8px; color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section { padding: 32px 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 48px 0; }
}

/* ---------- Bandeau tricolore & annonce ---------- */
.tricolore { height: 6px; background: var(--tricolore); }
.announce { background: var(--bleu); color: #fff; text-align: center; font-size: .9rem; padding: 8px 16px; }

/* ---------- En-tête ---------- */
.site-header { background: var(--blanc); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font); font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px;
  padding: 0 10px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--ink);
  text-decoration: none; font: inherit; cursor: pointer;
}
.icon-btn:hover { background: var(--beige); color: var(--ink); }
.cart-count { background: var(--rouge); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.nav-toggle { display: inline-flex; }
.main-nav { display: none; width: 100%; padding: 8px 0 14px; }
.main-nav.open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.main-nav a { display: block; padding: 12px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.main-nav a:hover, .main-nav a.active { background: var(--beige); color: var(--bleu); }
.header-inner { flex-wrap: wrap; }
.label-desktop { display: none; }
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .main-nav { display: block; width: auto; padding: 0; order: 0; }
  .main-nav ul { flex-direction: row; gap: 4px; }
  .main-nav a { padding: 8px 12px; }
  .header-inner { flex-wrap: nowrap; }
  .label-desktop { display: inline; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 2px solid var(--bleu);
  background: var(--bleu); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s; text-align: center;
}
.btn:hover { background: var(--bleu-hover); border-color: var(--bleu-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--bleu); }
.btn-outline:hover { background: var(--bleu-soft); color: var(--bleu); }
.btn-red { background: var(--rouge); border-color: var(--rouge); }
.btn-red:hover { background: #b60010; border-color: #b60010; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--beige); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--bleu); text-decoration: underline; cursor: pointer; }
.link-danger { color: var(--rouge); }

/* ---------- Cartes ---------- */
.card { background: var(--blanc); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; }
.card + .card { margin-top: 20px; }

/* ---------- Héros ---------- */
.hero { background: linear-gradient(180deg, var(--blanc), var(--beige)); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; gap: 24px; padding: 36px 0; align-items: center; }
.hero h1 span { color: var(--bleu); }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 46ch; }
.hero-visual { font-size: clamp(4rem, 16vw, 7.5rem); text-align: center; line-height: 1; letter-spacing: -.05em; user-select: none; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
@media (min-width: 720px) { .hero-inner { grid-template-columns: 1.3fr 1fr; padding: 56px 0; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--blanc); border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; font-weight: 600; }
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: 1fr; }
.step { position: relative; padding-left: 56px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--bleu); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Catégories ---------- */
.cat-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; background: var(--blanc); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 700; text-align: center; }
.cat-tile .emoji { font-size: 2.2rem; }
.cat-tile:hover { border-color: var(--bleu); color: var(--bleu); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--blanc); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.chip.active, .chip:hover { background: var(--bleu); border-color: var(--bleu); color: #fff; }

/* ---------- Produits ---------- */
.products { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.product { background: var(--blanc); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.product-media { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--beige), var(--beige-2)); display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-title { font-family: var(--font-title); font-size: 1.15rem; font-weight: 700; margin: 0; }
.product-title a { color: var(--ink); text-decoration: none; }
.product-title a::after { content: ""; position: absolute; inset: 0; }
.product { position: relative; }
.product form, .product .btn { position: relative; z-index: 2; }
.product-meta { font-size: .88rem; color: var(--muted); }
.product-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 8px; }
.tags { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 1; }
.tag { padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--blanc); border: 1px solid var(--line); }
.tag-promo { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.tag-fr { background: #fff; border-color: var(--bleu); color: var(--bleu); }
.tag-out { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag-low { background: var(--orange-soft); color: var(--orange); border-color: #f3c9a6; }

.price { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .9rem; font-weight: 500; margin-left: 6px; }
.price-kg { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; }
.price-promo { color: var(--rouge); }

.product-page { display: grid; gap: 24px; }
.product-page .product-media { border-radius: var(--radius); border: 1px solid var(--line); font-size: 7rem; }
@media (min-width: 860px) { .product-page { grid-template-columns: 1fr 1fr; align-items: start; } }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0; font-size: .95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- Quantité ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--blanc); }
.qty button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--bleu); border-radius: 50%; }
.qty input { width: 46px; text-align: center; border: 0; background: transparent; font: inherit; font-weight: 700; -moz-appearance: textfield; padding: 0; min-height: 40px; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; position: relative; }
.field label, .label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], input[type=file], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--sable); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 16px; /* 16px : évite le zoom iOS */
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--bleu); outline: 3px solid var(--bleu-soft); outline-offset: 0; }
.field-error { color: var(--rouge); font-size: .85rem; margin: 0; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--bleu); }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row-3 { grid-template-columns: 2fr 1fr 2fr; } }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }

/* Autocomplétion d'adresse */
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 40; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--sable); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.ac-list li { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: .95rem; }
.ac-list li[aria-selected=true], .ac-list li:hover { background: var(--bleu-soft); }
.ac-list small { display: block; color: var(--muted); }

/* Choix retrait / livraison */
.choice-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--bleu); background: var(--bleu-soft); }
.choice input { width: 22px; height: 22px; accent-color: var(--bleu); margin-top: 2px; }
.slots { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); max-height: 360px; overflow-y: auto; padding: 2px; }
.slot { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: .92rem; }
.slot:has(input:checked) { border-color: var(--bleu); background: var(--bleu-soft); font-weight: 700; }
.slot input { accent-color: var(--bleu); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--blanc); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--beige); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--beige); }

/* Tableau "cartes" sur mobile */
@media (max-width: 719px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border-bottom: 1px solid var(--line); padding: 10px 4px; }
  .table-cards td { border: 0; padding: 4px 10px; text-align: left !important; }
  .table-cards td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: .85rem; }
  .table-wrap:has(.table-cards) { overflow-x: visible; }
}

/* ---------- Badges de statut ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--beige); color: var(--ink); }
.badge-pending_payment { background: var(--orange-soft); color: var(--orange); }
.badge-paid, .badge-preparing { background: var(--bleu-soft); color: var(--bleu); }
.badge-ready, .badge-shipped { background: #fff4d1; color: #7a5300; }
.badge-completed { background: var(--vert-soft); color: var(--vert); }
.badge-cancelled, .badge-refunded, .badge-expired { background: #eee; color: #555; }

/* ---------- Alertes ---------- */
.flashes { display: grid; gap: 10px; margin: 16px 0; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border-left: 5px solid var(--bleu); background: var(--bleu-soft); }
.alert-success { border-color: var(--vert); background: var(--vert-soft); }
.alert-error { border-color: var(--rouge); background: var(--rouge-soft); }
.alert-warning { border-color: var(--orange); background: var(--orange-soft); }

/* ---------- Récap / totaux ---------- */
.summary { display: grid; gap: 8px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; }
.summary-total { font-size: 1.2rem; font-weight: 800; border-top: 2px solid var(--line); padding-top: 10px; margin-top: 4px; }
.layout-checkout { display: grid; gap: 20px; }
@media (min-width: 960px) { .layout-checkout { grid-template-columns: 1.5fr 1fr; align-items: start; } .sticky { position: sticky; top: 90px; } }
.legal-pay { font-size: .85rem; color: var(--muted); }
.pay-obligation { font-weight: 800; text-align: center; margin: 10px 0; color: var(--ink); }
#paypal-buttons { min-height: 50px; }

/* Timeline (historique de commande) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 10px; }
.timeline li::before { content: ""; position: absolute; left: -31px; top: 4px; width: 15px; height: 15px; border-radius: 50%; background: var(--bleu); border: 3px solid var(--blanc); box-shadow: 0 0 0 1px var(--line); }
.timeline time { display: block; font-size: .85rem; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 24px 0 0; list-style: none; padding: 0; }
.pagination a, .pagination span { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); background: var(--blanc); text-decoration: none; color: var(--ink); padding: 0 10px; }
.pagination .current { background: var(--bleu); color: #fff; border-color: var(--bleu); }

/* ---------- Compte ---------- */
.account-nav { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 4px; }
.account-nav a { flex: 0 0 auto; padding: 10px 14px; border-radius: 999px; background: var(--blanc); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.account-nav a.active { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.stat { background: var(--blanc); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat strong { display: block; font-size: 1.5rem; font-family: var(--font-title); }
.stat span { color: var(--muted); font-size: .9rem; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }

/* ---------- Texte riche / pages légales ---------- */
.prose { max-width: 75ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.35rem; }
.prose ul { padding-left: 1.2em; }
.story-quote { border-left: 6px solid; border-image: linear-gradient(180deg, var(--bleu) 0 33%, #fff 33% 66%, var(--rouge) 66%) 1; padding: 6px 0 6px 18px; font-family: var(--font-title); font-size: 1.25rem; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--blanc); border-top: 1px solid var(--line); margin-top: 40px; font-size: .92rem; }
.footer-grid { display: grid; gap: 24px; padding: 32px 0; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h3 { font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.footer-bottom a { color: var(--bleu); font-weight: 700; }
.flag { display: inline-block; width: 24px; height: 16px; background: var(--tricolore); border: 1px solid var(--line); border-radius: 2px; vertical-align: -3px; }

/* ---------- Bandeau cookies (CNIL : 3 choix de même poids) ---------- */
.cookie-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 900; max-width: 720px; margin: 0 auto; background: var(--blanc); border: 1px solid var(--line); border-top: 5px solid; border-image: var(--tricolore) 1; box-shadow: 0 10px 40px rgba(0,0,0,.18); padding: 18px; border-radius: 4px; }
.cookie-banner[hidden] { display: none; }
.cookie-banner h2 { font-size: 1.1rem; margin-bottom: .4em; }
.cookie-banner p { font-size: .92rem; }
.cookie-actions { display: grid; gap: 8px; grid-template-columns: 1fr; }
.cookie-actions .btn { width: 100%; }
.cookie-actions[hidden] { display: none; }
@media (min-width: 600px) { .cookie-actions { grid-template-columns: repeat(3, 1fr); } }
.cookie-prefs { display: grid; gap: 10px; margin: 12px 0; }
.cookie-prefs[hidden] { display: none; }
.cookie-pref { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.switch { position: relative; width: 50px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #bbb; border-radius: 999px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--bleu); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:disabled + span { background: var(--vert); opacity: .7; }
.switch input:focus-visible + span { outline: 3px solid var(--bleu); outline-offset: 2px; }

/* =====================================================================
   ADMINISTRATION
   ===================================================================== */
.admin-body { background: #f3ede1; }
.admin-shell { display: flex; flex-direction: column; min-height: 100vh; }
.admin-top { background: var(--bleu); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; min-height: 56px; position: sticky; top: 0; z-index: 60; }
.admin-top a, .admin-top button { color: #fff; }
.admin-top .brand-name small { color: #dfe4ff; }
.admin-side { display: none; background: var(--blanc); border-right: 1px solid var(--line); }
.admin-side.open { display: block; }
.admin-side nav { padding: 12px; }
.admin-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.admin-side a:hover, .admin-side a.active { background: var(--bleu-soft); color: var(--bleu); }
.admin-side .count { margin-left: auto; background: var(--rouge); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 7px; }
.admin-side hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.admin-main { flex: 1; padding: 20px 16px 40px; min-width: 0; }
.admin-main h1 { font-size: 1.6rem; }
@media (min-width: 1024px) {
  .admin-shell { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto 1fr; }
  .admin-top { grid-column: 1 / -1; }
  .admin-side { display: block !important; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
  .admin-main { padding: 28px 32px 48px; }
  .admin-menu-btn { display: none !important; }
}
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin-bottom: 20px; }
.kpi { background: var(--blanc); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .v { font-size: 1.6rem; font-weight: 800; font-family: var(--font-title); }
.kpi .l { color: var(--muted); font-size: .88rem; }
.kpi.alert-kpi { border-color: var(--rouge); }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; flex: 0 0 auto; }
.tabs a:hover, .tabs a.active { color: var(--bleu); border-color: var(--bleu); }
.tab-panel { scroll-margin-top: 80px; }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--beige); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input[type=number] { width: 80px; min-height: 36px; padding: 4px 8px; }
.stock-low { color: var(--orange); font-weight: 800; }
.stock-out { color: var(--rouge); font-weight: 800; }
.danger-zone { border: 2px solid var(--rouge-soft); }

/* ---------- Impression (factures, bons de préparation) ---------- */
.print-page { background: #fff; max-width: 800px; margin: 0 auto; padding: 24px; }
.print-actions { margin-bottom: 16px; }
@media print {
  body { background: #fff; }
  .no-print, .site-header, .site-footer, .cookie-banner, .admin-top, .admin-side, .print-actions { display: none !important; }
  .print-page { padding: 0; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
