/* =====================================================================================
   DARAKUM · Premium design layer (loaded after app.css)
   Typeface: Readex Pro (Arabic + Latin, SIL OFL 1.1, self-hosted) with IBM Plex Sans Arabic as fallback
   ===================================================================================== */
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/readex-arabic-300.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/readex-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/readex-arabic-500.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/readex-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/readex-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/readex-latin-300.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/readex-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/readex-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/readex-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/readex-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font: 'Readex Pro', 'Plex Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --green: #1E3A2C; --green-700: #152B20; --green-500: #2E5640; --green-100: #E6EEE8; --green-ink: #1E3A2C;
  --gold: #B8924A; --gold-100: #F5ECDA; --gold-ink: #8C6A2C;
  --terra: #B8622F; --terra-600: #9C5226; --terra-100: #F7E7DB; --terra-ink: #9C5226;
  --cream: #F8F4EC; --surface: #FFFFFF; --surface-2: #FAF6EF; --card: #FFFFFF;
  --ink: #18241D; --muted: #66706A; --line: #ECE4D6; --line-2: #F2ECE2;
  --r: 18px; --r-sm: 12px; --r-lg: 26px;
  --shadow-xs: 0 1px 2px rgba(24,36,29,.05);
  --shadow: 0 1px 2px rgba(24,36,29,.04), 0 6px 24px -10px rgba(24,36,29,.14);
  --shadow-lg: 0 2px 6px rgba(24,36,29,.05), 0 24px 48px -16px rgba(24,36,29,.22);
  --hdr-bg: rgba(248,244,236,.82);
  --grad-green: linear-gradient(135deg, #24463A 0%, #1E3A2C 45%, #142A1F 100%);
  --grad-cta: linear-gradient(135deg, #C46D37 0%, #A9572A 100%);
  --ease: cubic-bezier(.2,.8,.2,1);
}
[data-theme="dark"] {
  --green: #2E5A45; --green-700: #3A6B52; --green-500: #3D6A52; --green-100: #1B2A22; --green-ink: #BFDCC9;
  --gold: #D4B06A; --gold-100: #2C2618; --gold-ink: #E2C484;
  --terra: #C9743F; --terra-600: #F0A878; --terra-100: #33241A; --terra-ink: #EBA275;
  --cream: #0D1411; --surface: #151F1A; --surface-2: #1A2620; --card: #151F1A;
  --ink: #E8EEEA; --muted: #9DA9A2; --line: #26332C; --line-2: #1F2B25;
  --hdr-bg: rgba(13,20,17,.8);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 28px 56px -18px rgba(0,0,0,.7);
  --grad-green: linear-gradient(135deg, #1D3B2D 0%, #15291F 55%, #0E1C15 100%);
}

/* ---------- base typography */
body { font-family: var(--font); font-weight: 400; line-height: 1.75; background: var(--cream); color: var(--ink); }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; color: var(--green-ink); }
h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); }
h3 { font-size: 1.08rem; }
html[lang="en"] h1, html[lang="en"] h2 { letter-spacing: -.025em; }
.btn, .chip, .tabs button, .pill { font-weight: 500; }
b, strong, .kv dd { font-weight: 600; }
::selection { background: var(--gold-100); color: var(--ink); }
.num { font-feature-settings: "tnum" 1; }

/* ---------- header */
.hdr { background: var(--hdr-bg); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.brand b { font-weight: 700; font-size: 1.3rem; }
.brand small { letter-spacing: 4px; font-weight: 500; opacity: .75; }
.brand img { border-radius: 12px; box-shadow: var(--shadow-xs); }
.hdr-search input { height: 46px; background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-xs); transition: box-shadow .2s, border-color .2s; }
.hdr-search input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }
.icon-btn { border-radius: 14px; transition: background .15s, transform .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.95); }
.badge { background: var(--terra); box-shadow: 0 0 0 2px var(--cream); font-weight: 600; }
.demo-bar { background: var(--gold-100); color: var(--gold-ink); border-bottom-color: color-mix(in srgb, var(--gold) 30%, transparent); font-weight: 500; }

/* ---------- buttons */
.btn { min-height: 46px; padding: 0 20px; border-radius: 14px; background: var(--grad-green); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 6px 16px -8px rgba(20,42,31,.6); transition: transform .15s var(--ease), box-shadow .2s, filter .2s; }
.btn:hover { background: var(--grad-green); filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 10px 22px -10px rgba(20,42,31,.7); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.accent { background: var(--grad-cta); box-shadow: 0 6px 18px -8px rgba(169,87,42,.7); }
.btn.accent:hover { background: var(--grad-cta); }
.btn.gold { background: linear-gradient(135deg, #CFAE6B, #A9843F); color: #1b1408; }
.btn.ghost { background: var(--surface); color: var(--green-ink); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.btn.ghost:hover { background: var(--surface-2); color: var(--green-ink); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); filter: none; }
.btn.light { background: #fff; color: #1E3A2C; border: 0; }
.btn.light:hover { background: #fff; filter: brightness(.97); }
.btn.danger { background: var(--surface); color: var(--err); border: 1px solid var(--err-line); box-shadow: none; }
.btn.danger:hover { background: var(--err-bg); filter: none; }
.btn.sm { min-height: 38px; padding: 0 14px; border-radius: 11px; }
.btn.lg { min-height: 54px; padding: 0 26px; font-size: 1.05rem; border-radius: 16px; }
.btn:disabled { opacity: .5; transform: none; filter: grayscale(.3); }
.link { color: var(--terra-ink); font-weight: 600; }

/* ---------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h3 { margin-bottom: .7em; }
.section { padding: 36px 0; }
.section-h { margin-bottom: 18px; align-items: center; }
.section-h h2 { position: relative; padding-inline-start: 14px; }
.section-h h2::before { content: ''; position: absolute; inset-inline-start: 0; top: .25em; bottom: .25em; width: 4px; border-radius: 4px; background: linear-gradient(var(--gold), var(--terra)); }
.section-h > a { font-weight: 500; font-size: .92rem; color: var(--terra-ink); display: inline-flex; align-items: center; gap: 4px; }
.grid { gap: 18px; }

/* store card */
.scard { border-radius: var(--r); border-color: var(--line); box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s; }
.scard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.scard .cover { aspect-ratio: 16/8; overflow: hidden; }
.scard .cover img { transition: transform .6s var(--ease); }
.scard:hover .cover img { transform: scale(1.05); }
.scard .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.28), transparent 55%); pointer-events: none; }
.scard .logo { z-index: 1; border-radius: 16px; width: 60px; height: 60px; }
.scard .body { padding: 32px 16px 16px; }
.scard h3 { font-weight: 600; }

/* product card */
.pcard { border-radius: var(--r); border-color: var(--line); box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pcard .img { overflow: hidden; }
.pcard .img img { transition: transform .6s var(--ease); }
.pcard:hover .img img { transform: scale(1.06); }
.pcard .body { padding: 12px 14px 14px; }
.pcard h4 { font-weight: 500; font-size: .96rem; }
.price { font-weight: 600; color: var(--green-ink); }
.add-btn { width: 42px; height: 42px; border-radius: 14px; background: var(--grad-cta); box-shadow: 0 6px 14px -6px rgba(169,87,42,.7); display: grid; place-items: center; transition: transform .15s; }
.add-btn:hover { transform: scale(1.06); }
.add-btn:active { transform: scale(.94); }
.fav { backdrop-filter: blur(6px); box-shadow: var(--shadow-xs); display: grid; place-items: center; color: var(--terra); }

/* pills / chips */
.pill { padding: 3px 11px; font-size: .76rem; }
.chip { padding: 9px 16px; border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-xs); font-weight: 500; transition: all .2s var(--ease); }
.chip .ico { color: var(--terra-ink); }
.chip.on, .chip:hover { background: var(--green); border-color: var(--green); color: #fff; }
.chip.on .ico, .chip:hover .ico { color: var(--gold-100); }

/* ---------- hero (home) */
.hero2 { position: relative; overflow: hidden; background: var(--grad-green); color: #EAF1EC; border-radius: 0 0 var(--r-lg) var(--r-lg); margin-bottom: 8px; }
.hero2::before { content: ''; position: absolute; inset: 0; background:
  radial-gradient(600px 300px at 85% 10%, rgba(212,176,106,.22), transparent 60%),
  radial-gradient(500px 280px at 0% 100%, rgba(196,109,55,.25), transparent 60%); pointer-events: none; }
.hero2::after { content: ''; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 22px 22px; }
.hero2 .container { position: relative; z-index: 1; display: grid; gap: 28px; align-items: center; padding-top: 40px; padding-bottom: 44px; }
.hero2 .kick { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: .85rem; font-weight: 500; color: #F3E5C8; }
[dir=rtl] .hero2 .kick { padding: 5px 6px 5px 14px; }
.hero2 .kick i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1b1408; font-style: normal; }
.hero2 h1 { color: #fff; font-size: clamp(1.9rem, 5.4vw, 3.3rem); line-height: 1.2; margin: 16px 0 12px; max-width: 16ch; font-weight: 700; }
.hero2 h1 em { font-style: normal; background: linear-gradient(90deg, #E8C98A, #D89363); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero2 p.lead { color: rgba(234,241,236,.82); font-size: 1.05rem; max-width: 46ch; margin-bottom: 22px; }
.hero2 .hero-search { background: #fff; border: 0; border-radius: 18px; padding: 7px; box-shadow: 0 20px 40px -18px rgba(0,0,0,.55); max-width: 560px; align-items: center; }
.hero2 .hero-search .s-ico { color: #8a948e; display: flex; padding-inline-start: 10px; }
.hero2 .hero-search input { color: #18241D; height: 46px; font-size: 1rem; }
.hero2 .hero-search input::placeholder { color: #8a948e; }
.hero2 .hero-search .btn { min-height: 46px; background: var(--grad-cta); }
.hero2 .trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; }
.hero2 .trust div { display: flex; align-items: center; gap: 10px; }
.hero2 .trust b { display: block; font-size: 1.35rem; color: #fff; line-height: 1.1; }
.hero2 .trust span { font-size: .8rem; color: rgba(234,241,236,.7); }
.hero2 .trust .ti { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: var(--gold); font-size: 1.25rem; }
.hero-collage { display: none; position: relative; height: 380px; }
.hero-collage .ph1, .hero-collage .ph2, .hero-collage .ph3 { position: absolute; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); border: 4px solid rgba(255,255,255,.9); background: #2a4436; }
.hero-collage img { width: 100%; height: 100%; object-fit: cover; }
.hero-collage .ph1 { width: 62%; height: 72%; top: 0; inset-inline-end: 0; transform: rotate(3deg); }
.hero-collage .ph2 { width: 48%; height: 52%; bottom: 0; inset-inline-start: 4%; transform: rotate(-4deg); }
.hero-collage .ph3 { width: 34%; height: 36%; bottom: 8%; inset-inline-end: 12%; transform: rotate(2deg); }
.hero-collage .float { position: absolute; z-index: 2; background: #fff; color: #18241D; border-radius: 16px; padding: 10px 14px; box-shadow: 0 18px 36px -14px rgba(0,0,0,.5); display: flex; align-items: center; gap: 10px; font-size: .85rem; animation: hfloat 5s ease-in-out infinite; }
.hero-collage .float b { display: block; font-size: .92rem; }
.hero-collage .float .fi { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #E6EEE8; color: #1E3A2C; font-size: 1.2rem; }
.hero-collage .f1 { top: 12%; inset-inline-start: 0; }
.hero-collage .f2 { bottom: 26%; inset-inline-end: -10px; animation-delay: -2.5s; }
.hero-collage .f2 .fi { background: #F7E7DB; color: #A9572A; }
@keyframes hfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (min-width: 960px) { .hero2 .container { grid-template-columns: 1.1fr .9fr; padding-top: 64px; padding-bottom: 72px; } .hero-collage { display: block; } }

/* category tiles */
.cat-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.cat-tiles::-webkit-scrollbar { display: none; }
.cat-tile { display: grid; justify-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); color: var(--ink); text-align: center; font-size: .84rem; font-weight: 500; line-height: 1.35; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); color: var(--ink); }
.cat-tile .ci { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; color: var(--green-ink); background: linear-gradient(145deg, var(--green-100), var(--gold-100)); }
.cat-tile:nth-child(3n+2) .ci { color: var(--terra-ink); background: linear-gradient(145deg, var(--terra-100), var(--gold-100)); }
@media (min-width: 900px) { .cat-tiles { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); overflow: visible; } }

/* how it works */
.how { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); counter-reset: how; }
.how > div { position: relative; padding: 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); counter-increment: how; }
.how > div::before { content: counter(how); position: absolute; top: 16px; inset-inline-end: 18px; font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--line); }
.how .hi { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem; background: var(--green); color: var(--gold-100); margin-bottom: 12px; }
.how h3 { margin: 0 0 4px; } .how p { margin: 0; color: var(--muted); font-size: .92rem; }

/* banners */
.banner { border-radius: var(--r-lg); background: var(--grad-green); box-shadow: var(--shadow); }
.banner.terra { background: linear-gradient(130deg, #C46D37, #8E4720); }
.seller-cta { display: grid; gap: 14px; align-items: center; padding: 28px; border-radius: var(--r-lg); background: linear-gradient(130deg, #C46D37 0%, #8E4720 100%); color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.seller-cta::after { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; inset-inline-end: -90px; top: -120px; background: rgba(255,255,255,.08); }
.seller-cta h2 { color: #fff; margin: 0; } .seller-cta p { margin: 0; color: rgba(255,255,255,.85); position: relative; z-index: 1; }
.seller-cta .row { position: relative; z-index: 1; }
@media (min-width: 760px) { .seller-cta { grid-template-columns: 1fr auto; padding: 36px 40px; } }

/* ---------- forms */
.field > span { font-weight: 500; font-size: .88rem; color: var(--ink); }
.input, select.input, textarea.input { min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }
.opt { border-radius: 14px; padding: 14px; transition: border-color .15s, background .15s; }
.opt:has(input:checked) { border-color: var(--green-ink); background: var(--green-100); box-shadow: 0 0 0 1px var(--green-ink) inset; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-inline-end: 50px; }
.pw-eye { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 1.15rem; }
.pw-eye:hover { background: var(--surface-2); color: var(--green-ink); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 2px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }

/* ---------- auth pages */
.auth-shell { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 460px; padding: 32px 28px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }

/* ---------- modal */
.modal-bg { background: rgba(10,18,14,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { background: var(--surface); border-radius: 26px 26px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
.modal-h { background: var(--surface); top: -20px; padding: 8px 0; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; }
.modal-h .icon-btn { background: var(--surface-2); width: 40px; min-width: 40px; height: 40px; border-radius: 50%; }
@media (min-width: 700px) { .modal { border-radius: 26px; padding: 24px 26px; } }
.modal::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: -8px auto 10px; }
@media (min-width: 700px) { .modal::before { display: none; } }

/* ---------- toasts */
.toast { background: var(--green); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 13px 18px; font-weight: 500; }

/* ---------- tables, kpis, tabs */
.tbl-wrap { border-radius: var(--r); box-shadow: var(--shadow-xs); }
.tbl th { background: var(--surface-2); font-weight: 500; font-size: .84rem; color: var(--muted); }
.tbl td { border-bottom-color: var(--line-2); }
.kpi { border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-xs); background: var(--surface); }
.kpi .v { font-weight: 600; font-size: 1.45rem; }
.kpi.accent { background: var(--grad-green); border-color: transparent; }
.tabs { gap: 6px; border-bottom: 0; background: var(--surface); padding: 5px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.tabs button { border-radius: 10px; border-bottom: 0; padding: 8px 14px; font-weight: 500; }
.tabs button.on { background: var(--green); color: #fff; }

/* ---------- dashboard shell */
.side { background: var(--grad-green); padding: 16px 12px; }
.side a { border-radius: 12px; font-weight: 500; transition: background .15s; }
.side a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
[dir=rtl] .side a.on { box-shadow: inset -3px 0 0 var(--gold); }
.side a.on .ico { color: var(--gold); }
.side .grp { color: rgba(233,239,233,.5); letter-spacing: .5px; font-weight: 500; }
.mnav { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.mnav a { color: var(--muted); font-weight: 500; }
.mnav a.on { background: var(--green); color: #fff; }
.main > h1 { margin-bottom: 18px; }

/* ---------- order stepper (store & customer) */
.stepper { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 4px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper .s { flex: 1 0 84px; display: grid; justify-items: center; gap: 6px; text-align: center; position: relative; font-size: .78rem; color: var(--muted); }
.stepper .s::before { content: ''; position: absolute; top: 17px; inset-inline-start: calc(-50% + 20px); inset-inline-end: calc(50% + 20px); height: 3px; border-radius: 3px; background: var(--line); }
.stepper .s:first-child::before { display: none; }
.stepper .s .d { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); color: var(--muted); position: relative; z-index: 1; font-weight: 600; font-size: .85rem; }
.stepper .s.done { color: var(--green-ink); } .stepper .s.done::before { background: var(--green); }
.stepper .s.done .d { background: var(--green); border-color: var(--green); color: #fff; }
.stepper .s.cur { color: var(--terra-ink); font-weight: 600; } .stepper .s.cur::before { background: linear-gradient(90deg, var(--green), var(--terra)); }
.stepper .s.cur .d { background: var(--terra); border-color: var(--terra); color: #fff; box-shadow: 0 0 0 6px var(--terra-100); }
.next-step { display: grid; gap: 12px; padding: 18px; border-radius: var(--r); background: linear-gradient(135deg, var(--gold-100), var(--terra-100)); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); }
.next-step .ns-l { font-size: .82rem; color: var(--muted); } .next-step .ns-t { font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.next-step .btn { width: 100%; }
@media (min-width: 640px) { .next-step { grid-template-columns: 1fr auto; align-items: center; } .next-step .btn { width: auto; min-width: 220px; } }

/* ---------- checkout window */
.co-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.co-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; font-style: normal; }
.co-steps i.on { background: linear-gradient(90deg, var(--green), var(--terra)); }
.co-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.co-title .ct-i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--green-100); color: var(--green-ink); font-size: 1.25rem; }
.co-title h3 { margin: 0; } .co-title small { display: block; color: var(--muted); font-size: .8rem; }
.co-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--surface); margin: 18px -18px calc(-20px - env(safe-area-inset-bottom)); padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; z-index: 3; }
@media (min-width: 700px) { .co-foot { bottom: -24px; margin: 20px -26px -24px; padding: 16px 26px; border-radius: 0 0 26px 26px; } }
.co-foot .btn.main { flex: 1; }
.co-foot .tot { display: grid; line-height: 1.2; } .co-foot .tot small { color: var(--muted); font-size: .76rem; } .co-foot .tot b { font-size: 1.1rem; }
.addr-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.addr-card:has(input:checked) { border-color: var(--green-ink); background: var(--green-100); box-shadow: 0 0 0 1px var(--green-ink) inset; }
.addr-card .ai { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--terra-100); color: var(--terra-ink); flex-shrink: 0; font-size: 1.2rem; }
.addr-card input { margin-inline-start: auto; accent-color: var(--green-ink); width: 20px; height: 20px; flex-shrink: 0; }
.addr-card .ad { flex: 1; min-width: 0; } .addr-card .ad span { display: block; font-size: .85rem; color: var(--muted); }
.review-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.review-list > div:last-child { border-bottom: 0; }

/* ---------- map picker */
.mp { position: fixed; inset: 0; z-index: 150; background: var(--cream); display: flex; flex-direction: column; animation: fade .2s; }
.mp-map { flex: 1; position: relative; min-height: 0; }
.mp-map .leaflet-container { width: 100%; height: 100%; background: #e9e5dc; font-family: var(--font); }
[data-theme="dark"] .mp-map .leaflet-container { background: #1b1f1c; }
.mp-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); inset-inline: 12px; z-index: 500; display: flex; gap: 8px; }
.mp-top .icon-btn { background: var(--surface); box-shadow: var(--shadow); flex-shrink: 0; width: 48px; height: 48px; }
.mp-search { flex: 1; position: relative; }
.mp-search input { width: 100%; height: 48px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); padding-inline: 44px 14px; color: var(--ink); }
.mp-search .s-ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.mp-results { position: absolute; top: 54px; inset-inline: 0; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: 50vh; overflow-y: auto; }
.mp-results button { display: flex; gap: 10px; width: 100%; text-align: start; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: none; cursor: pointer; color: var(--ink); font-size: .9rem; }
.mp-results button:hover { background: var(--surface-2); }
.mp-results .ico { color: var(--terra-ink); margin-top: 3px; }
.mp-pin { position: absolute; left: 50%; top: 50%; z-index: 450; pointer-events: none; transform: translate(-50%, -100%); transition: transform .2s var(--ease); }
.mp-pin svg { width: 46px; height: 58px; display: block; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.mp-pin.lift { transform: translate(-50%, calc(-100% - 14px)); }
.mp-shadow { position: absolute; left: 50%; top: 50%; z-index: 440; width: 14px; height: 6px; margin: -3px 0 0 -7px; border-radius: 50%; background: rgba(0,0,0,.35); pointer-events: none; transition: transform .2s; }
.mp-pin.lift + .mp-shadow { transform: scale(1.6); opacity: .6; }
.mp-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(-100% - 70px)); z-index: 460; background: #18241D; color: #fff; font-size: .78rem; padding: 6px 12px; border-radius: 10px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
.mp-hint::after { content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #18241D; }
.mp-loc { position: absolute; inset-inline-end: 14px; bottom: 18px; z-index: 500; width: 50px; height: 50px; border-radius: 50%; background: var(--surface); color: var(--green-ink); border: 0; box-shadow: var(--shadow-lg); cursor: pointer; display: grid; place-items: center; font-size: 1.4rem; }
.mp-sheet { background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px -12px rgba(0,0,0,.25); padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px; position: relative; z-index: 600; margin-top: -18px; }
.mp-addr { display: flex; gap: 12px; align-items: flex-start; }
.mp-addr .ai { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--terra-100); color: var(--terra-ink); font-size: 1.3rem; flex-shrink: 0; }
.mp-addr b { display: block; font-size: 1.02rem; } .mp-addr span { color: var(--muted); font-size: .88rem; }
.mp-warn { font-size: .82rem; color: var(--warn); display: flex; gap: 6px; align-items: center; }
@media (min-width: 900px) { .mp { inset: 24px; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); } .mp-sheet { margin-top: 0; border-radius: 0; } .mp-bg { position: fixed; inset: 0; z-index: 149; background: rgba(10,18,14,.5); backdrop-filter: blur(6px); } }
.leaflet-control-attribution { font-size: 10px !important; background: rgba(255,255,255,.7) !important; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; width: 38px !important; height: 38px !important; line-height: 38px !important; }
.mini-map { height: 140px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.mini-map .leaflet-container { height: 100%; width: 100%; }
.mini-map .mp-pin svg { width: 30px; height: 38px; }
.chips-sel { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-sel label { cursor: pointer; } .chips-sel input { position: absolute; opacity: 0; }
.chips-sel span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 500; }
.chips-sel input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.chips-sel input:focus-visible + span { outline: 3px solid var(--terra); outline-offset: 2px; }

/* ---------- install prompt */
.pwa { position: fixed; inset-inline: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 120; max-width: 460px; margin: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 16px; display: grid; gap: 12px; animation: up .3s var(--ease); }
.pwa .row { flex-wrap: nowrap; align-items: flex-start; }
.pwa img { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; box-shadow: var(--shadow-xs); }
.pwa b { display: block; font-size: 1rem; } .pwa p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.pwa .ios { display: grid; gap: 8px; font-size: .88rem; background: var(--surface-2); border-radius: 14px; padding: 12px; }
.pwa .ios div { display: flex; align-items: center; gap: 8px; } .pwa .ios .ico { color: var(--terra-ink); font-size: 1.2em; }
.pwa .acts { display: flex; gap: 8px; } .pwa .acts .btn { flex: 1; }
@media (min-width: 900px) { .pwa { bottom: 20px; inset-inline-start: auto; inset-inline-end: 20px; margin: 0; } }

/* ---------- footer */
.ftr { background: var(--grad-green); border-radius: var(--r-lg) var(--r-lg) 0 0; margin-top: 56px; padding: 44px 0 26px; }
.ftr h4 { color: #F3E5C8; font-weight: 600; }
.ftr a:hover { color: var(--gold); }
.ftr-logo { border-radius: 18px; }

/* ---------- misc polish */
.notice { border-radius: 14px; font-weight: 500; }
.empty .e-ico { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(145deg, var(--green-100), var(--gold-100)); color: var(--green-ink); font-size: 2.4rem; }
.empty h2, .empty h3 { color: var(--ink); }
.bnav { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top-color: var(--line); box-shadow: 0 -6px 20px -12px rgba(0,0,0,.15); }
.bnav a.on { color: var(--terra-ink); }
.bnav a.on .i { position: relative; }
.bnav a.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--terra); }
.cartbar { background: var(--grad-green); border-radius: 18px; box-shadow: var(--shadow-lg); }
.msg.internal { background: var(--warn-bg); border-style: dashed; }
.info-strip > div { border-radius: 14px; box-shadow: var(--shadow-xs); }
.store-hero .cover { position: relative; }
.store-hero .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), transparent 60%); }
.store-head .logo { border-radius: 22px; box-shadow: var(--shadow-lg); }
.sticky-tabs { background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.timeline .st.done .dot { background: var(--green); } .timeline .st.cur .dot { background: var(--terra); }
.skel { border-radius: var(--r); }
.qty { border-radius: 14px; }
.avatar { background: linear-gradient(145deg, var(--gold-100), var(--terra-100)); }

/* map tiles: soften in light mode, night style in dark mode */
.dk-tiles { filter: saturate(.85) contrast(.96); }
[data-theme="dark"] .dk-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
.money { white-space: nowrap; display: inline-block; }
.mini-map, .mp-map { isolation: isolate; z-index: 0; }
/* small phones: keep the header inside the screen */
@media (max-width: 430px) {
  .hdr .container { gap: 6px; padding: 0 10px; }
  .hdr-actions { gap: 0; }
  .icon-btn { min-width: 38px; height: 40px; padding: 0 5px; }
  .brand { gap: 6px; } .brand img { height: 38px; } .brand b { font-size: 1.12rem; } .brand small { font-size: .55rem; letter-spacing: 2.5px; }
  .hdr-actions .btn.sm { padding: 0 10px; }
}
html, body { overflow-x: clip; }
h1, h2 { overflow-wrap: anywhere; }
