/* ==========================================================================
   Market storefront — marka renkleri
   Lacivert (#263389) eylemler ve marka için, kırmızı (#E41B12) indirim ve uyarılar için.
   ========================================================================== */
:root {
  --paper: #F3F4F8;
  --card: #FFFFFF;
  --ink: #1A1E33;
  --ink-2: #575C70;
  --ink-3: #8A8EA1;
  --line: #E1E3EC;
  --olive: #263389;
  --olive-hi: #3242A6;
  --olive-lo: #1B2466;
  --leaf: #E8EBF7;
  --blossom: #FDE3E1;
  --blossom-ink: #D3180F;
  --sand: #F1EAD9;
  --sky: #DCE8EC;
  /* Reyon kartları: bilerek sabit tutulan renkler */
  --aisle-1: #E5ECDD;
  --aisle-2: #F7DCE2;
  --aisle-3: #F1EAD9;
  --aisle-4: #DCE8EC;
  --amber: #8A5A00;
  --amber-bg: #FBEFD3;

  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --brand: "Fraunces", Georgia, serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --wrap: 1240px;
  --top-h: 72px;
  --lift: 0 1px 2px rgba(26, 30, 51, .05), 0 6px 20px -8px rgba(26, 30, 51, .14);
  --float: 0 18px 50px -12px rgba(20, 26, 70, .32);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
html.no-scroll { overflow: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
:focus-visible { outline: 2.5px solid var(--olive-hi); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--olive); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 24px 24px 120px; }
.wrap-narrow { max-width: 760px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--olive); color: #fff; }
.btn-primary:hover { background: var(--olive-hi); }
.btn-primary:disabled { background: #9CA2C2; cursor: not-allowed; }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--olive); color: var(--olive); }
.btn-block { width: 100%; }
.btn-wa { background: #1FAF55; color: #fff; margin-top: 20px; }
.btn-wa:hover { background: #17964A; }
.btn-lg { min-height: 54px; font-size: 16px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink); }
.icon-btn:hover { background: var(--leaf); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--olive); color: #fff; box-shadow: 0 4px 18px -8px rgba(20, 26, 70, .45); }
.topbar-in { max-width: var(--wrap); margin: 0 auto; height: var(--top-h); padding: 0 24px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; flex: none; color: #fff; }
.brand-name { position: relative; display: block; font: 800 21px/1 var(--display); letter-spacing: -.03em; color: #fff; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0 8px; }
/* logodaki gülümseme: adın altında kırmızı bir yay */
.brand-name::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 46%; min-width: 34px; height: 9px; transform: translateX(-50%); border-bottom: 3.5px solid #E41B12; border-radius: 0 0 50% 50% / 0 0 100% 100%; transition: width .25s ease; }
.brand:hover .brand-name::after { width: 62%; }
.search { flex: 1; max-width: 600px; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-radius: 999px; background: #fff; border: 0; color: var(--ink-3); box-shadow: 0 1px 0 rgba(0, 0, 0, .04); transition: box-shadow .15s; }
.search:focus-within { color: var(--olive); box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topnav-link { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 999px; font-weight: 600; color: #fff; opacity: .9; }
.topnav-link:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 7px 0 18px; border-radius: 999px; background: #E41B12; color: #fff; font-weight: 700; box-shadow: 0 6px 16px -6px rgba(228, 27, 18, .7); transition: background .15s; }
.cart-btn:hover { background: #C9150D; }
.cart-badge { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 999px; display: grid; place-items: center; background: #fff; color: #E41B12; font: 750 14px/1 var(--display); }
.cart-badge.is-empty { background: rgba(255, 255, 255, .22); color: #fff; }
.bump { animation: bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 40% { transform: scale(1.08); } }

/* ---------- Home: hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--leaf); color: var(--ink); padding: 44px 48px 36px; margin-bottom: 40px; }
.hero-copy { max-width: 640px; }
.hero-hi { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: var(--olive); }
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 750; letter-spacing: -.035em; line-height: 1.04; color: var(--olive-lo); }
.hero-sub { margin: 14px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.hero-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.hero-quick a { padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid #D5DAF0; color: var(--olive); font-weight: 600; font-size: 14px; transition: background .15s, color .15s, border-color .15s; }
.hero-quick a:hover { background: var(--olive); border-color: var(--olive); color: #fff; }

/* ---------- Shelves ---------- */
.shelf { margin-bottom: 44px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.shelf-head h2 { font-size: 26px; }
.more { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--olive); }
.more .ico { width: 18px; height: 18px; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 196px; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 14px; margin: 0 -2px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail > * { scroll-snap-align: start; }

.aisles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.aisle { position: relative; min-height: 150px; border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: var(--aisle-1); transition: transform .2s ease; }
.aisle:nth-child(4n+2) { background: var(--aisle-2); }
.aisle:nth-child(4n+3) { background: var(--aisle-3); }
.aisle:nth-child(4n+4) { background: var(--aisle-4); }
.aisle:hover { transform: translateY(-3px); }
.aisle-text { position: relative; z-index: 1; max-width: 70%; }
.aisle-name { display: block; font: 650 19px/1.15 var(--display); letter-spacing: -.02em; }
.aisle-count { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.aisle-pic { position: absolute; right: -22px; bottom: -26px; width: 132px; height: 132px; border-radius: 50%; overflow: hidden; background: #fff; border: 5px solid rgba(255, 255, 255, .7); display: grid; place-items: center; color: #2F4A2B; transition: transform .3s ease; }
.aisle-pic img { width: 100%; height: 100%; object-fit: cover; }
.aisle:hover .aisle-pic { transform: rotate(-6deg) scale(1.04); }
.aisle-pic .ico { width: 40px; height: 40px; opacity: .5; }

/* ---------- Product card ---------- */
.pcard { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-md); border: 1px solid var(--line); overflow: hidden; min-width: 0; transition: border-color .15s, box-shadow .2s; }
.pcard:hover { border-color: #C6CBE0; box-shadow: var(--lift); }
.pcard-media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; padding: 0; border: 0; overflow: hidden; background: #F7F8FB; width: 100%; }
.pcard-media img { position: absolute; top: 14px; left: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; border-radius: 10px; mix-blend-mode: multiply; transition: transform .3s ease; }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-noimg { color: #B3B8CC; }
.pcard-noimg .ico { width: 44px; height: 44px; }
.pcard.is-out .pcard-media img { opacity: .45; filter: grayscale(.8); }
.tag { position: absolute; z-index: 1; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.3; }
.tag-sale { background: var(--blossom); color: var(--blossom-ink); }
.tag-low { background: var(--amber-bg); color: var(--amber); }
.pcard-body { flex: 1; display: flex; flex-direction: column; padding: 12px 14px 14px; }
.pcard-title { font: 600 15px/1.3 var(--text); letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard-unit { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 0 8px; min-height: 1.5em; }
.pcard-unit span { color: var(--ink-3); }
.pcard-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price { display: flex; flex-direction: column; line-height: 1.1; }
.price s { font-size: 13px; color: var(--ink-3); }
.price strong { font: 750 18px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price strong.is-sale { color: var(--blossom-ink); }
.price-lg strong { font-size: 30px; }
.price-lg s { font-size: 15px; }
.soldout { font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 7px 0; }

/* Stepper: a single + until the product is in the cart, then − qty + */
.stepper { display: inline-flex; align-items: center; height: 40px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--olive); color: var(--olive); transition: background .18s, color .18s; flex: none; }
.stepper button { width: 37px; height: 37px; display: grid; place-items: center; border: 0; background: transparent; color: inherit; border-radius: 50%; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper .ico { width: 19px; height: 19px; }
.stepper output { min-width: 18px; text-align: center; font: 750 15px/1 var(--display); font-variant-numeric: tabular-nums; }
.stepper:not(.has-qty) .step-dec, .stepper:not(.has-qty) output { display: none; }
.stepper:not(.has-qty):hover { background: var(--olive); color: #fff; }
.stepper.has-qty { background: var(--olive); color: #fff; }
.stepper.has-qty button:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.stepper.is-busy { opacity: .7; pointer-events: none; }
.step-label { display: none; }
.stepper-lg { height: 52px; }
.stepper-lg button { width: 50px; height: 50px; }
.stepper-lg:not(.has-qty) { padding: 0 18px 0 6px; background: var(--olive); color: #fff; }
.stepper-lg:not(.has-qty) .step-inc { width: auto; gap: 8px; display: inline-flex; font-weight: 600; }
.stepper-lg:not(.has-qty) .step-label { display: inline; font-size: 16px; }
.stepper-lg output { min-width: 36px; font-size: 18px; }

/* ---------- Listing ---------- */
.list-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
.aisle-nav { position: sticky; top: calc(var(--top-h) + 24px); }
.aisle-nav h2 { font-size: 15px; font-family: var(--text); font-weight: 700; color: var(--ink-2); letter-spacing: 0; margin: 4px 0 10px 12px; }
.aisle-nav ul { list-style: none; margin: 0; padding: 0; }
.aisle-nav a { display: block; padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500; color: var(--ink-2); }
.aisle-nav a:hover { background: var(--card); color: var(--ink); }
.aisle-nav a.is-active { background: var(--card); color: var(--olive); font-weight: 700; box-shadow: inset 3px 0 0 var(--olive); }
.aisle-nav ul ul { margin: 2px 0 8px 12px; padding-left: 10px; border-left: 1px solid var(--line); }
.aisle-nav ul ul a { padding: 6px 10px; font-size: 14px; box-shadow: none; }
.aisle-nav ul ul a.is-active { background: transparent; }

.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 14px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); font-weight: 500; }
.crumbs a:hover { color: var(--olive); }
.crumbs .ico { width: 15px; height: 15px; }
.crumbs span { color: var(--ink); font-weight: 600; }
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.list-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.back-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s, color .15s, transform .15s; }
.back-btn:hover { border-color: var(--olive); color: var(--olive); transform: translateX(-2px); }
.list-head h1 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 750; letter-spacing: -.03em; }
.list-head p { margin: 4px 0 0; font-size: 14px; }
.sort { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.sort select { height: 40px; padding: 0 36px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A645D' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; appearance: none; font-weight: 600; color: var(--ink); }

.chips { position: sticky; top: var(--top-h); z-index: 20; display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 14px; margin-bottom: 4px; background: var(--paper); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: var(--olive); color: var(--olive); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 14px; }

/* ---------- Empty / alerts ---------- */
.empty { text-align: center; padding: 48px 24px; border-radius: var(--r-lg); background: var(--card); border: 1px dashed #C8CDE0; }
.empty h3 { font-size: 22px; }
.empty p { margin: 8px auto 20px; max-width: 42ch; color: var(--ink-2); }
.empty-lg { padding: 72px 24px; }
.empty-ico { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--leaf); color: var(--olive); margin-bottom: 18px; }
.empty-ico .ico { width: 32px; height: 32px; }
.alert { padding: 12px 14px; border-radius: var(--r-sm); background: var(--blossom); color: var(--blossom-ink); font-weight: 600; font-size: 14px; margin: 0 0 16px; }
.alert-soft { background: var(--amber-bg); color: var(--amber); }

/* ---------- Floating cart bar ---------- */
.cartbar { position: fixed; z-index: 35; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(520px, calc(100% - 24px)); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 22px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--float); transition: transform .3s cubic-bezier(.2, .9, .3, 1.2), opacity .2s; }
.cartbar.is-hidden { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.cartbar.bump { animation: none; }
.cartbar-count { font-size: 14px; color: #C3C8E0; }
.cartbar-count b { color: #fff; font: 750 16px var(--display); }
.cartbar-total { font: 750 18px var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cartbar-go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px 0 20px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; }
.cartbar-go .ico { width: 18px; height: 18px; }
@media (min-width: 900px) { .cartbar { display: none; } }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; pointer-events: none; visibility: hidden; transition: visibility 0s .32s; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(18, 22, 50, .38); opacity: 0; transition: opacity .25s; }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(440px, 100%); background: var(--card); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--float); }
.drawer.open { pointer-events: auto; visibility: visible; transition: none; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 24px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.drawer-foot { padding: 16px 20px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.drawer-sum { display: flex; justify-content: space-between; align-items: baseline; }
.drawer-sum strong { font: 750 24px var(--display); letter-spacing: -.02em; }
.drawer-note { margin: 2px 0 14px; font-size: 13px; color: var(--ink-3); }
.drawer-empty { text-align: center; padding: 64px 0; color: var(--ink-2); }
.drawer-empty .ico { width: 40px; height: 40px; color: var(--ink-3); margin: 0 auto 8px; }

/* Cart line (drawer + cart page) */
.line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line-pic { width: 64px; height: 64px; border-radius: 12px; background: #F5F6FA; display: grid; place-items: center; padding: 6px; color: var(--ink-3); }
.line-pic img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; mix-blend-mode: multiply; }
.line-info h3 { font: 600 15px/1.3 var(--text); letter-spacing: 0; }
.line-info p { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); }
.line-warn { color: var(--amber) !important; font-weight: 600; }
.line.has-issue .line-pic { outline: 2px solid var(--amber-bg); }
.line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.line-side strong { font: 750 16px var(--display); font-variant-numeric: tabular-nums; }
.line .stepper { height: 34px; }
.line .stepper button { width: 32px; height: 31px; }
.line .stepper .ico { width: 16px; height: 16px; }

/* ---------- Quick view ---------- */
.qv { width: min(820px, calc(100% - 24px)); max-height: calc(100% - 40px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--card); color: var(--ink); box-shadow: var(--float); overflow: auto; }
.qv::backdrop { background: rgba(18, 22, 50, .45); }
.qv[open] { animation: qv-in .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes qv-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.qv-close { position: absolute; right: 14px; top: 14px; z-index: 2; }
.qv-grid { display: grid; grid-template-columns: 1fr 1fr; }
.qv-media { position: relative; overflow: hidden; background: #F5F6FA; aspect-ratio: 1; display: grid; place-items: center; color: var(--ink-3); }
.qv-media img { position: absolute; top: 32px; left: 32px; width: calc(100% - 64px); height: calc(100% - 64px); object-fit: contain; border-radius: 14px; mix-blend-mode: multiply; }
.qv-media .ico { width: 64px; height: 64px; }
.qv-info { padding: 40px 32px 32px; display: flex; flex-direction: column; gap: 10px; }
.qv-info h2 { font-size: 30px; font-weight: 750; padding-right: 30px; }
.qv-unit { margin: 0; color: var(--ink-2); }
.qv-desc { margin: 6px 0 0; color: var(--ink-2); line-height: 1.6; }
.qv-desc:empty, .qv-stock:empty, .qv-unit:empty { display: none; }
.qv-stock { margin: 0; color: var(--amber); font-weight: 600; font-size: 14px; }
.qv-actions { margin-top: auto; padding-top: 18px; }

/* ---------- Cart page / checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; align-items: start; }
.checkout-items { background: var(--card); border-radius: var(--r-lg); padding: 24px 28px; border: 1px solid var(--line); }
.checkout-items .lines { margin-bottom: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-weight: 600; color: var(--olive); }
.back-link .ico { width: 18px; height: 18px; }
.checkout-form { position: sticky; top: calc(var(--top-h) + 20px); background: var(--card); border-radius: var(--r-lg); padding: 24px; border: 1px solid var(--line); }
.checkout-form h2 { font-size: 22px; margin-bottom: 16px; }
.field { margin: 0 0 14px; border: 0; padding: 0; }
.field label, .field legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.field .opt { font-weight: 400; color: var(--ink-3); }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid #D3D7E4; background: #fff; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 48px; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(38, 51, 137, .14); }
.field.has-err input, .field.has-err textarea { border-color: var(--blossom-ink); }
.field-err { margin: 6px 0 0; font-size: 13px; color: var(--blossom-ink); font-weight: 600; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay legend { grid-column: 1 / -1; }
.pay-opt { position: relative; display: block !important; margin: 0 !important; cursor: pointer; }
.pay-opt input { position: absolute; opacity: 0; }
.pay-opt span { display: block; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid #D3D7E4; transition: border-color .15s, background .15s; }
.pay-opt b { display: block; font-size: 15px; }
.pay-opt small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-2); margin-top: 1px; }
.pay-opt input:checked + span { border-color: var(--olive); background: var(--leaf); }
.pay-opt input:focus-visible + span { outline: 2.5px solid var(--olive-hi); outline-offset: 2px; }
.summary { margin: 18px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.summary-total { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); align-items: baseline; font-weight: 600; }
.summary-total strong { font: 750 26px var(--display); letter-spacing: -.02em; }
.fine { font-size: 12.5px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.5; }

/* ---------- Order tracking ---------- */
.order-hero { text-align: center; padding: 28px 8px 8px; }
.order-check { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--olive); color: #fff; margin-bottom: 18px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.order-check .ico { width: 38px; height: 38px; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.order-hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 750; letter-spacing: -.03em; }
.order-hero p { color: var(--ink-2); margin: 10px auto 0; max-width: 52ch; }
.order-hero.is-cancelled h1 { color: var(--blossom-ink); }
.order-no { font-size: 14px; }
.order-no b { font: 700 15px var(--display); color: var(--ink); letter-spacing: .02em; }
.track { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 32px 0 6px; padding: 0; counter-reset: s; }
.track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.track li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 3px; background: var(--line); z-index: -1; }
.track li:first-child::before { display: none; }
.track-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 3px solid var(--line); display: grid; place-items: center; color: #fff; }
.track-dot .ico { width: 15px; height: 15px; stroke-width: 3; }
.track li.done, .track li.now { color: var(--ink); }
.track li.done::before, .track li.now::before { background: var(--olive); }
.track li.done .track-dot { background: var(--olive); border-color: var(--olive); }
.track li.now .track-dot { border-color: var(--olive); box-shadow: 0 0 0 5px rgba(38, 51, 137, .16); }
.track li.now .track-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--olive); }
.receipt { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 28px; }
.receipt h2 { font-size: 20px; margin-bottom: 8px; }
.receipt-lines { list-style: none; margin: 0; padding: 0; }
.receipt-lines li { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rq { font: 700 15px var(--display); color: var(--olive); }
.rt small { display: block; color: var(--ink-3); font-size: 13px; }
.rp { font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.receipt-meta dt { font-size: 13px; color: var(--ink-3); }
.receipt-meta dd { margin: 2px 0 0; font-weight: 500; }
.order-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.order-list a { display: grid; grid-template-columns: 1fr auto auto 20px; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.order-list a:hover { border-color: var(--olive); }
.ol-main b { display: block; font-family: var(--display); font-size: 16px; }
.ol-main small { color: var(--ink-2); font-size: 13px; }
.ol-total { font: 700 16px var(--display); font-variant-numeric: tabular-nums; }
.status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--leaf); color: var(--olive); white-space: nowrap; }
.status-new { background: var(--sky); color: #1F4E5F; }
.status-preparing { background: var(--amber-bg); color: var(--amber); }
.status-delivered { background: var(--olive); color: #fff; }
.status-cancelled { background: var(--blossom); color: var(--blossom-ink); }

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 80; left: 50%; top: calc(var(--top-h) + 14px); transform: translate(-50%, -10px); padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--float); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--blossom-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .aisles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .checkout { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 900px) {
  :root { --top-h: 64px; }
  .list-layout { grid-template-columns: 1fr; gap: 0; }
  .aisle-nav { display: none; }
  .checkout { grid-template-columns: 1fr; }
  .checkout-form { position: static; }
  .topnav-link span { display: none; }
}
@media (max-width: 640px) {
  :root { --top-h: 118px; }
  .wrap { padding: 16px 16px 120px; }
  .topbar-in { height: auto; flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px 12px; }
  .brand-name { font-size: 19px; max-width: 58vw; }
  .search { order: 3; flex-basis: 100%; max-width: none; height: 44px; }
  .cart-btn { height: 42px; padding: 0 6px 0 14px; gap: 8px; }
  .cart-btn-label { display: none; }
  .cart-badge { min-width: 28px; height: 28px; }
  .topnav-link { padding: 0 10px; }
  .hero { padding: 26px 20px 22px; border-radius: 18px; margin-bottom: 30px; }
      .hero-sub { font-size: 15px; }
  .hero-quick { flex-wrap: nowrap; overflow-x: auto; margin: 20px -20px 0; padding: 0 20px; scrollbar-width: none; }
  .hero-quick::-webkit-scrollbar { display: none; }
  .hero-quick a { flex: none; }
  .shelf { margin-bottom: 34px; }
  .shelf-head h2 { font-size: 22px; }
  .rail { grid-auto-columns: 158px; gap: 10px; margin: 0 -16px; padding: 2px 16px 12px; scroll-padding: 0 16px; }
  .aisles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .aisle { min-height: 124px; padding: 14px; }
  .aisle-name { font-size: 16px; }
  .aisle-pic { width: 96px; height: 96px; right: -16px; bottom: -18px; border-width: 4px; }
  .aisle-text { max-width: 78%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard-body { padding: 10px 12px 12px; }
  .pcard-title { font-size: 14px; }
  .price strong { font-size: 17px; }
  .stepper { height: 36px; }
  .stepper button { width: 33px; height: 33px; }
  .pcard-foot { flex-wrap: wrap; row-gap: 10px; }
  .price strong { white-space: nowrap; }
  .pcard .stepper.has-qty { flex: 1 1 100%; justify-content: space-between; }
  .chips { margin: 0 -16px 4px; padding: 10px 16px 12px; }
  .list-head { margin-bottom: 10px; }
  .sort label { display: none; }
  .checkout-items, .checkout-form, .receipt { padding: 18px 16px; border-radius: 18px; }
  .qv-grid { grid-template-columns: 1fr; }
  .qv-media { aspect-ratio: auto; height: 280px; }
  .qv-media img { top: 20px; left: 20px; width: calc(100% - 40px); height: calc(100% - 40px); }
  .back-btn { width: 40px; height: 40px; }
  .list-title { gap: 10px; }
  .qv-info { padding: 20px; }
  .qv-info h2 { font-size: 24px; }
  .qv { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92%; border-radius: 22px 22px 0 0; }
  .receipt-meta { grid-template-columns: 1fr; }
  .track li { font-size: 11.5px; }
  .order-list a { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .order-list a .ico { display: none; }
  .ol-total { grid-row: 1; grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
