/* ============================================================
   Pizza73 Marketplace — Core design system
   Pure CSS3. No frameworks. CSS custom properties + utilities.
   Palette (max 5): deep red, charcoal, cream, orange accent, neutral
   ============================================================ */

:root {
  /* Brand palette */
  --red: #b51c1c;          /* deep red (primary) */
  --red-dark: #8c1414;
  --red-deep: #6a0f0f;
  --charcoal: #1c1715;     /* near-black warm charcoal */
  --charcoal-soft: #2a2320;
  --cream: #fbf6ee;        /* cream background */
  --cream-2: #f4ebdc;
  --orange: #f08a24;       /* orange accent */
  --orange-soft: #fbb867;

  /* Neutrals derived */
  --ink: #221d1a;
  --muted: #7a6f66;
  --line: #e7dccb;
  --white: #ffffff;

  /* Semantic tokens */
  --bg: var(--cream);
  --surface: var(--white);
  --surface-2: #fff9f0;
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
  --primary: var(--red);
  --primary-ink: #fff4ef;
  --accent: var(--orange);

  /* Typography */
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Radius & shadows */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(28, 23, 21, 0.06), 0 2px 8px rgba(28, 23, 21, 0.05);
  --shadow: 0 8px 24px rgba(28, 23, 21, 0.10);
  --shadow-lg: 0 24px 60px rgba(28, 23, 21, 0.18);
  --shadow-red: 0 14px 36px rgba(181, 28, 28, 0.28);

  /* Layout */
  --container: 1200px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #15110f;
  --surface: #1f1916;
  --surface-2: #241d19;
  --text: #f6ece0;
  --text-muted: #b6a99c;
  --border: #34291f;
  --primary: #e23b3b;
  --primary-ink: #fff4ef;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
img { background: var(--surface-2); }
.mobile-nav img, svg image, .brand img, .footer-brand img { background: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; color: var(--text); letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.section-sm { padding-block: clamp(2rem, 4vw, 3rem); }
.center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.hidden { display: none !important; }
.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: 1rem; top: -100px; z-index: 2000;
  background: var(--primary); color: var(--primary-ink); padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm); transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.display { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.02; }
.h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--text-muted); max-width: 60ch; }
.muted { color: var(--text-muted); }
.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.85rem 1.5rem; border-radius: 999px; font-weight: 700; font-size: 0.96rem;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap; border: 1.5px solid transparent;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-red); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #2a1602; box-shadow: 0 12px 30px rgba(240,138,36,0.32); }
.btn-accent:hover { background: var(--orange-soft); transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-light { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.28); backdrop-filter: blur(6px); }
.btn-light:hover { background: rgba(255,255,255,0.24); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.85rem; }
.btn .icon { width: 18px; height: 18px; }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  overflow: hidden;
}
.glass {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.28rem 0.7rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--red-dark);
}
.badge-veg { background: #e6f4e1; color: #2f6d28; }
.badge-spicy { background: #fde3df; color: var(--red); }
.badge-new { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #8a4a06; }
.divider { height: 1px; background: var(--border); border: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 900; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.brand svg, .brand img { height: 38px; width: auto; background: transparent; }
.nav { display: flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; }
.nav > li { position: relative; }
.has-mega { display: flex; align-items: center; }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.55rem 0.85rem;
  border-radius: 999px; font-weight: 600; font-size: 0.94rem; color: var(--text);
  transition: background 0.18s, color 0.18s;
}
.nav-link:hover, .nav-link[aria-current="page"] { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.has-mega .chev { width: 14px; height: 14px; margin-left: -0.45rem; color: var(--text-muted); transition: transform 0.2s; pointer-events: none; flex-shrink: 0; }
.has-mega:hover .chev { transform: rotate(180deg); color: var(--primary); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

/* Mega menu */
.mega {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(8px);
  width: min(680px, 90vw); padding: 1.25rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem;
  opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.22s var(--ease);
}
.has-mega:hover .mega, .has-mega:focus-within .mega {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.mega-item { display: flex; gap: 0.8rem; padding: 0.7rem; border-radius: var(--radius-sm); transition: background 0.16s; }
.mega-item:hover { background: var(--surface-2); }
.mega-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--red); flex-shrink: 0; }
.mega-ico svg { width: 22px; height: 22px; }
.mega-item h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; }
.mega-item p { font-size: 0.82rem; color: var(--text-muted); }

/* Lang switch + icon buttons */
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); transition: all 0.18s var(--ease); position: relative;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--primary); color: #fff; font-size: 0.68rem; font-weight: 800; border-radius: 999px;
  display: grid; place-items: center; transform: scale(0); transition: transform 0.25s var(--ease);
}
.cart-count.show { transform: scale(1); }
.cart-count.bump { animation: bump 0.4s var(--ease); }
@keyframes bump { 0%{transform:scale(1)} 40%{transform:scale(1.4)} 100%{transform:scale(1)} }

.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; }
.lang-switch button { padding: 0.34rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); transition: color 0.2s; z-index: 1; }
.lang-switch button.active { color: var(--primary-ink); }
.lang-thumb { position: absolute; top: 3px; bottom: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--primary); transition: transform 0.32s var(--ease); }
.lang-switch[data-lang="fr"] .lang-thumb { transform: translateX(100%); }

/* Mobile nav */
.burger { display: none; }
.mobile-nav {
  position: fixed; inset: 0; z-index: 1500; background: var(--bg);
  transform: translateX(100%); transition: transform 0.34s var(--ease);
  display: flex; flex-direction: column; padding: 1.5rem; overflow-y: auto;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav a { padding: 0.9rem 0.5rem; font-size: 1.2rem; font-weight: 600; border-bottom: 1px solid var(--border); }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); color: #e9ddcf; margin-top: 4rem; position: relative; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; inset: 0; background: radial-gradient(800px 300px at 80% -10%, rgba(240,138,36,0.10), transparent 60%); pointer-events: none; }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2.5rem; padding-block: 3.5rem; position: relative; }
.footer-brand img { height: 44px; width: auto; display: block; background: transparent; }
.footer-brand p { color: #b9ac9d; max-width: 38ch; margin-top: 1rem; font-size: 0.92rem; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange-soft); margin-bottom: 1rem; }
.footer-col a { display: block; padding: 0.32rem 0; color: #cfc2b3; font-size: 0.92rem; transition: color 0.16s, padding-left 0.16s; }
.footer-col a:hover { color: #fff; padding-left: 5px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.10); padding-block: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; font-size: 0.85rem; color: #a99c8d; position: relative; }
.footer-disclaimer { background: rgba(0,0,0,0.25); border-top: 1px solid rgba(255,255,255,0.06); }
.footer-disclaimer .container { padding-block: 1rem; font-size: 0.78rem; color: #9b8e7f; line-height: 1.5; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--text-muted); padding-block: 1.2rem; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.45rem; }
.breadcrumbs li::after { content: "/"; color: var(--border); }
.breadcrumbs li:last-child::after { content: ""; }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2200; display: flex; flex-direction: column; gap: 0.6rem; max-width: 360px; }
.toast {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--charcoal); color: #fff; box-shadow: var(--shadow-lg); border-left: 4px solid var(--accent);
  transform: translateX(120%); opacity: 0; transition: transform 0.36s var(--ease), opacity 0.36s var(--ease);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left-color: #57c073; }
.toast.error { border-left-color: var(--red); }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.field .req { color: var(--primary); }
.input, .textarea, .select {
  width: 100%; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); transition: border-color 0.18s, box-shadow 0.18s; font-size: 0.96rem;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.textarea { resize: vertical; min-height: 130px; }
.field-error { display: none; color: var(--red); font-size: 0.82rem; margin-top: 0.35rem; }
.field.invalid .input, .field.invalid .textarea { border-color: var(--red); }
.field.invalid .field-error { display: block; }
.hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 2400; display: grid; place-items: center; padding: 1.5rem; background: rgba(20,15,12,0.55); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity 0.25s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 460px; width: 100%; padding: 2rem; text-align: center;
  box-shadow: var(--shadow-lg); transform: scale(0.94) translateY(10px); transition: transform 0.3s var(--ease);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--red); }
.modal-ico svg { width: 32px; height: 32px; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 800; width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff; box-shadow: var(--shadow); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: all 0.28s var(--ease);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--red-dark); transform: translateY(-3px); }

/* ---------- Skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--border) 60%, transparent), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Page transition ---------- */
.page-fade { animation: pageIn 0.5s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3.5rem 1rem; }
.empty-state .empty-ico { width: 84px; height: 84px; margin: 0 auto 1.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); }
.empty-state .empty-ico svg { width: 40px; height: 40px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 1.5rem; right: 1.5rem; bottom: 1.5rem; z-index: 2000; max-width: 540px; margin-inline: auto;
  border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-lg);
  transform: translateY(160%); transition: transform 0.5s var(--ease);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.cookie-banner p { font-size: 0.88rem; color: var(--text-muted); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.cookie-actions .btn { flex: 1; min-width: 110px; }
.cookie-prefs { margin-top: 1rem; display: none; }
.cookie-banner.customizing .cookie-prefs { display: block; }
.cookie-toggle { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.cookie-toggle:last-child { border-bottom: 0; }
.cookie-toggle small { display: block; color: var(--text-muted); font-size: 0.8rem; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background 0.2s; }
.switch .track::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.22s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:disabled + .track { opacity: 0.55; }

/* ---------- Floating decorative ingredients ---------- */
.floaties { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.floatie { position: absolute; opacity: 0.85; animation: float 9s ease-in-out infinite; will-change: transform; }
.floatie img { width: 100%; filter: drop-shadow(0 14px 24px rgba(0,0,0,0.25)); }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-22px) rotate(6deg); } }

/* ---------- Utilities ---------- */
.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}
.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}
.full{width:100%}
.tag-row{display:flex;flex-wrap:wrap;gap:.4rem}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav, .lang-switch.desktop { display: none; }
  .burger { display: grid; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .toast-wrap, .cookie-banner { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; }
  .back-to-top { bottom: 0.75rem; left: 0.75rem; }
}
