/* =========================================================
   Benna — mint & apricot style
   Colors are tokens: change them here, dark mode is below.
   ========================================================= */

/* Country flags that look the same everywhere (Windows has no flag emojis).
   Twemoji graphics © Twitter, CC-BY 4.0; font packaged by country-flag-emoji-polyfill (MIT).
   unicode-range: the font is only downloaded and used for flag characters. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}

:root {
  /* Theme "mint & apricot". The token names come from the first (terracotta) theme:
     --terracotta is the main color (mint green), --honey the accent (apricot). */
  --cream: #f3f8f6;            /* always light (logo, text on the main color) */
  --bg: #f3f8f6;
  --surface: #ffffff;
  --surface-2: #e8f1ee;
  --text: #14231f;
  --muted: #596b65;
  --line: #d8e8e2;

  --terracotta: #1d7566;
  --terracotta-dark: #13564b;
  --honey: #f0a052;
  --honey-dark: #c07730;
  --olive: #5e7b3a;
  --green: #2f7d4f;
  --wa: #1f9d55;
  --blue: #1f5fa8;
  --danger: #b3261e;
  --heart: #d6336c;

  --tint-terracotta: #dcefe9;
  --tint-honey: #fdeedd;
  --tint-green: #e6f3ea;
  --tint-blue: #e3eefb;
  --tint-red: #fdeceb;
  --tint-gray: #e7eeeb;
  --honey-text: #8a4c12;
  --art-plate: #d9e7e2;

  --primary: var(--terracotta);
  --primary-dark: var(--terracotta-dark);
  /* Home page banner (same in light and dark mode) */
  --hero-from: rgba(19, 86, 75, 0.93);
  --hero-to: rgba(29, 117, 102, 0.8);

  /* "Twemoji Country Flags" (see the @font-face below) only draws flags; all other text uses the next fonts */
  --font-body: "Twemoji Country Flags", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-title: "Twemoji Country Flags", "Fraunces", Georgia, "Times New Roman", serif;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 45, 38, 0.06), 0 6px 20px rgba(15, 45, 38, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 45, 38, 0.14);
  --header-h: 64px;
  --tabbar-h: 64px;
  color-scheme: light;
}

/* Dark colors: used automatically when the phone is in dark mode (unless the person
   chose "Light" in My account), or always when they chose "Dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1715;
    --surface: #15211e;
    --surface-2: #1b2a26;
    --text: #e4efeb;
    --muted: #9cb0a9;
    --line: #293a35;
    --terracotta: #2a9783;
    --terracotta-dark: #1d7566;
    --honey: #f2ad66;
    --honey-dark: #cc8640;
    --green: #5fbf86;
    --blue: #7fb1ec;
    --danger: #f08178;
    --heart: #f06a95;
    --tint-terracotta: #163a33;
    --tint-honey: #3a2a1a;
    --tint-green: #1b3324;
    --tint-blue: #172a40;
    --tint-red: #3d1a17;
    --tint-gray: #22302c;
    --honey-text: #f5c493;
    --art-plate: #24332f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1715;
  --surface: #15211e;
  --surface-2: #1b2a26;
  --text: #e4efeb;
  --muted: #9cb0a9;
  --line: #293a35;
  --terracotta: #2a9783;
  --terracotta-dark: #1d7566;
  --honey: #f2ad66;
  --honey-dark: #cc8640;
  --green: #5fbf86;
  --blue: #7fb1ec;
  --danger: #f08178;
  --heart: #f06a95;
  --tint-terracotta: #163a33;
  --tint-honey: #3a2a1a;
  --tint-green: #1b3324;
  --tint-blue: #172a40;
  --tint-red: #3d1a17;
  --tint-gray: #22302c;
  --honey-text: #f5c493;
  --art-plate: #24332f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
[dir="rtl"] body { font-family: "Twemoji Country Flags", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif; }

h1, h2, h3 { font-family: var(--font-title); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: "Twemoji Country Flags", "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif; letter-spacing: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }

a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 600px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon {
  width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
[dir="rtl"] .icon.chev { transform: scaleX(-1); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.logo { width: 38px; height: 38px; }
.brand-name { font-family: var(--font-title); font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font-body); font-size: 0.72rem; font-weight: 400; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--tint-terracotta); color: var(--primary); }
.nav-icon { position: relative; display: inline-flex; }
.nav-icon .count { position: absolute; top: -6px; inset-inline-end: -10px; }

.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--text); text-decoration: none;
}
.icon-btn:hover, .icon-btn.active { background: var(--surface-2); color: var(--primary); }
.icon-btn .count { position: absolute; top: 2px; inset-inline-end: 0; }
.lang select { width: auto; min-height: 36px; padding: 4px 28px 4px 10px; border-radius: 999px; font-size: 0.85rem; }
[dir="rtl"] .lang select { padding: 4px 10px 4px 28px; }

.count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1;
  font-family: var(--font-body);
}

/* Phone tab bar (hidden on large screens) */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: none;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(15, 45, 38, 0.06);
}
.tab-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tabbar-h); color: var(--muted); text-decoration: none; font-size: 0.7rem; font-weight: 600;
}
.tab-link .icon { width: 24px; height: 24px; }
.tab-link.active { color: var(--primary); }
.tab-link.active .icon { stroke-width: 2.2; }
.tab-link .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--cream);
  background-color: var(--terracotta-dark);
  /* Eight-pointed star tile (zellige-like), drawn as an SVG */
  background-image:
    linear-gradient(120deg, var(--hero-from), var(--hero-to)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fbf5ec' stroke-opacity='.35' stroke-width='1.2'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3Cpath d='M0 0l8 8M64 0l-8 8M0 64l8-8M64 64l-8-8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, 64px 64px;
  padding: 44px 0 36px;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4.5vw, 2.7rem); max-width: 720px; }
.hero p { margin: 0 0 20px; max-width: 640px; opacity: 0.92; }
.search {
  display: flex; align-items: center; gap: 10px; max-width: 620px;
  background: var(--surface); color: var(--muted); border-radius: 999px; padding: 4px 6px 4px 18px;
  box-shadow: var(--shadow-lg);
}
[dir="rtl"] .search { padding: 4px 18px 4px 6px; }
.search input { border: 0; background: transparent; min-height: 48px; padding: 0; font-size: 1rem; box-shadow: none; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--honey); }

/* ---------- chips & filters ---------- */
.chip-row { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.cat-chip, .filter-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; white-space: nowrap;
}
.cat-chip:hover, .filter-toggle:hover { border-color: var(--primary); }
.cat-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-toggle.active { border-color: var(--primary); color: var(--primary); }

/* Legal pages and footer links */
.legal-tabs { margin: 16px 0 12px; flex-wrap: wrap; }
.legal-tabs .tab { text-decoration: none; }
.legal article h1 { margin-bottom: 4px; }
.legal article h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.legal article p { line-height: 1.65; margin: 0; }
.legal article .hint { margin-top: 24px; }
/* Shop link (getbenna.com/@username) for sellers to share */
.shop-link { display: grid; gap: 6px; margin: 4px 0 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--tint-terracotta); }
.shop-link-url { font-weight: 700; word-break: break-all; }
.shop-link-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shop-link .btn-wa { display: inline-flex; align-items: center; gap: 6px; }
.panel > .shop-link { margin: 0; }

/* Installable app: banner on the home page and the "how to install" page */
.install-banner {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; padding: 10px 12px;
  background: var(--tint-terracotta); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.install-banner img { border-radius: 10px; flex: none; }
.install-banner p { margin: 0; flex: 1; min-width: 0; line-height: 1.35; }
.install-banner small { display: block; color: var(--muted); }
.install-close { border: 0; background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px 6px; }
.install-page { text-align: center; }
.install-icon { border-radius: 18px; box-shadow: var(--shadow); }
.install-page h1 { margin: 12px 0 6px; }
.install-page > p { color: var(--muted); line-height: 1.6; }
.install-way { text-align: start; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 6px; }
.install-way h2 { font-size: 1.05rem; margin: 10px 0 6px; }
.install-way ol { margin: 0; padding-inline-start: 22px; line-height: 1.7; }
.site-header { padding-top: env(safe-area-inset-top); }

/* Contact form: the field robots fill in stays out of sight */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#contact-form .btn-block + .hint { margin-top: 14px; }

/* Home page: how it works and the questions people ask */
.how { padding-bottom: 8px; }
.how-title { margin: 32px 0 4px; font-size: 1.35rem; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.how-card h3 { margin: 0 0 12px; }
.how-card .btn { margin-top: 4px; }
.how-steps { list-style: none; counter-reset: step; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.how-steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; }
.how-steps li::before {
  content: counter(step); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: var(--cream); background: var(--terracotta);
}
.how-steps span { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.faq { padding: 6px 22px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 2px; color: var(--muted); line-height: 1.6; }
.how-contact { text-align: center; }
.welcome-empty { grid-column: 1 / -1; text-align: center; padding: 32px 22px; }
.welcome-empty h2 { margin-top: 0; }
.welcome-empty p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; line-height: 1.6; }

/* Owner page: messages from the Contact page */
.inbox-text { white-space: pre-wrap; margin: 6px 0 10px; line-height: 1.5; }
.inbox-item.is-done { opacity: 0.65; }
.count-pill { font-size: 0.8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; vertical-align: middle; color: var(--cream); background: var(--terracotta); }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 10px 0 4px; }
.footer-links a { color: inherit; font-weight: 600; }
.site-footer p { margin: 4px 0; }
.accept-terms { align-items: flex-start; margin: 6px 0 12px; line-height: 1.5; }
.accept-terms input { margin-top: 3px; flex: none; }

/* Pre-order form while online payment is off */
.pay-cash-only { display: grid; gap: 2px; margin: 4px 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); }
.pay-cash-only .pay-note { color: var(--muted); }

/* Cuisine (country) choice on the home page */
.cuisine-btn {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 8px 14px 8px 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer; text-align: start; max-width: 100%;
}
.cuisine-btn:hover { border-color: var(--primary); }
.cuisine-btn.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cuisine-btn > span:not(.cuisine-flag) { display: grid; line-height: 1.2; min-width: 0; }
.cuisine-btn small { color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.cuisine-btn strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuisine-flag { font-size: 1.5rem; line-height: 1; }
.cuisine-chevron { width: 16px; height: 16px; transform: rotate(90deg); color: var(--muted); flex: none; }
.chip-row { margin-top: 12px; }
.card-cuisine { color: var(--muted); font-weight: 500; }
.seller-cuisines { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.seller-cuisines .chip { font-size: 0.82rem; padding: 3px 10px; margin: 0; cursor: default; }
.map-popup .seller-cuisines .chip { color: #15241f; background: #e8f1ee; border-color: #d8e8e2; }
p.card-cuisine { margin: 0 0 8px; }

.picker-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 20, 17, 0.55);
}
.picker {
  width: min(460px, 100%); max-height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; font-size: 1.1rem; }
.picker-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.picker-close:hover { background: var(--bg); color: var(--text); }
.picker-search { margin: 6px 16px 10px; box-shadow: none; border: 1px solid var(--line); }
.picker-body { overflow-y: auto; padding: 0 8px 12px; }
.picker-group { margin: 12px 8px 4px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cuisine-list { list-style: none; margin: 0; padding: 0; }
.cuisine-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.cuisine-item:hover, .cuisine-item:focus-visible { background: var(--bg); }
.cuisine-item.active { background: var(--bg); font-weight: 700; color: var(--primary); }
.cuisine-item .cuisine-flag { font-size: 1.3rem; width: 1.6em; text-align: center; }
.cuisine-item small { margin-inline-start: auto; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
@media (max-width: 720px) {
  .picker-backdrop { place-items: end stretch; padding: 0; }
  .picker { width: 100%; max-height: 85vh; border-radius: 18px 18px 0 0; }
  .cuisine-btn { width: 100%; }
}

/* List / map switch on the home page */
.view-switch { flex: none; display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.view-switch button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; white-space: nowrap;
}
.view-switch button.active { background: var(--primary); color: #fff; }

/* Map of sellers */
.map-box { position: relative; }
.map {
  height: min(68vh, 620px); min-height: 360px; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; z-index: 0; background: var(--surface);
}
.map-empty {
  position: absolute; inset-inline: 50%; top: 16px; transform: translateX(-50%); width: max-content; max-width: 90%;
  margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); z-index: 500; font-weight: 600; font-size: 0.9rem;
}
.map-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.map-status {
  position: absolute; z-index: 500; bottom: 16px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  margin: 0; padding: 8px 14px; border-radius: 12px; background: var(--surface); color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); font-size: 0.88rem; font-weight: 600; text-align: center;
}
.map-status.is-error { color: var(--danger); }
.map-locate {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  background: #fff; color: #333; border: 2px solid rgba(0, 0, 0, 0.2); border-radius: 4px; background-clip: padding-box;
}
.map-locate:hover { background: #f4f4f4; color: var(--primary); }
.map-locate .icon { width: 18px; height: 18px; }
.map-note .icon { width: 16px; height: 16px; flex: none; }
.map-pin-wrap { background: none; border: 0; }
.map-pin {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--primary);
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.map-pin > span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 0.95rem; font-family: "Fraunces", Georgia, serif; }
.map-pin small {
  position: absolute; top: -8px; right: -8px; transform: rotate(45deg); min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: #fff; color: var(--primary); font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: 12px 14px; }
.map-popup { display: grid; gap: 6px; color: #15241f; }
.map-popup p { margin: 0; }
.map-popup-head a { color: inherit; text-decoration: none; font-size: 1rem; }
.map-products { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 6px; }
.map-products a { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 4px; border-radius: 10px; }
.map-products a:hover { background: rgba(0, 0, 0, 0.05); }
.map-products img, .map-products .photo-placeholder { width: 46px; height: 46px; flex: none; border-radius: 8px; object-fit: cover; overflow: hidden; }
.map-products .photo-placeholder svg { width: 100%; height: 100%; }
.map-products a > span { display: grid; min-width: 0; }
.map-products strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-products small { color: #5a6b66; }
.map-popup .btn { justify-self: start; color: #fff; }

.filters {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 10px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.near { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; color: var(--muted); }
.near select { color: var(--text); }

/* ---------- forms & buttons ---------- */
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--honey); outline-offset: 0; border-color: var(--honey); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--primary); }
select:disabled { opacity: 0.5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  text-align: center; text-decoration: none; cursor: pointer;
  background: var(--primary); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 8px 16px; font: inherit; font-weight: 600;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 34px; padding: 4px 12px; font-size: 0.88rem; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-wa { background: var(--wa); }
.btn-wa:hover { background: #17804a; }
.btn.icon-only { width: 42px; padding: 0; flex: none; }
.btn-pay { background: var(--blue); }
.btn-pay:hover { filter: brightness(0.9); background: var(--blue); }
.btn-delete { background: var(--danger); }
.btn-delete:hover { background: var(--danger); filter: brightness(0.9); }
.btn-danger {
  display: inline-flex; align-items: center; gap: 4px; min-height: 34px;
  background: none; border: 1px solid var(--danger); color: var(--danger);
  border-radius: var(--radius-sm); padding: 4px 12px; cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 600;
}
.btn-danger:hover { background: var(--tint-red); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 4px 12px; cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 600;
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.linklike { background: none; border: 0; padding: 4px 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin: 20px 0;
}
.panel h1, .panel h2 { margin-top: 0; }
.panel.is-editing { border: 2px solid var(--honey); }
.page-title { margin: 24px 0 8px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.field small { display: block; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.roles, .checks { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.roles legend, .checks legend { font-weight: 600; margin-bottom: 8px; }
.role {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.role:has(input:checked) { border-color: var(--primary); background: var(--tint-terracotta); }
.toggle { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; margin: 4px 0; }
.panel .toggle { margin-inline-end: 16px; }
.geo { margin: -4px 0 14px; font-size: 0.9rem; color: var(--green); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.alt { text-align: center; margin: 12px 0 0; }
.hint { margin: -6px 0 14px; font-size: 0.85rem; color: var(--muted); }
.total { font-size: 1.1rem; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; grid-column: 1 / -1; }
.back { margin: 0 0 6px; font-size: 0.9rem; }
.back a { text-decoration: none; }

.flash { padding: 12px 14px; border-radius: var(--radius-sm); margin: 0 0 14px; font-weight: 500; }
.flash-error { background: var(--tint-red); color: var(--danger); }
.flash-ok { background: var(--tint-green); color: var(--green); }
.flash-info { background: var(--tint-honey); color: var(--honey-text); }
.test-banner {
  background: var(--tint-honey); color: var(--honey-text); border: 1px dashed var(--honey);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.9rem;
}

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; padding-bottom: 32px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card.is-off .card-photo { filter: grayscale(0.7); opacity: 0.8; }
.card-media { position: relative; }
.card-photo { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media .fav-btn { position: absolute; top: 10px; inset-inline-end: 10px; }
.card-media .dist, .photo-count {
  position: absolute; bottom: 10px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(10, 25, 21, 0.62); color: #fff; font-size: 0.75rem; font-weight: 600; border-radius: 999px; padding: 3px 9px;
}
.card-media .dist { inset-inline-start: 10px; }
.card-media .dist .icon { width: 13px; height: 13px; }
.photo-count { inset-inline-end: 10px; }
.card-body { display: flex; flex-direction: column; gap: 5px; flex: 1; padding: 12px 14px 14px; }
.card-tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--olive); }
[dir="rtl"] .card-tag { letter-spacing: 0; }
.card-body h3 { margin: 0; font-size: 1.12rem; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover { color: var(--primary); }
.price { margin: 0; font-weight: 700; color: var(--primary); font-size: 1.02rem; }
.price span { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
.seller { margin: 0; font-size: 0.88rem; color: var(--muted); }
.card-meta { margin: 0; font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desc { margin: 0; font-size: 0.9rem; }
.delivery-badge { margin: 0; font-size: 0.82rem; color: var(--green); font-weight: 600; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.card-actions .btn:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-off {
  display: inline-block; background: var(--tint-gray); color: var(--muted); font-family: var(--font-body);
  border-radius: 8px; padding: 2px 8px; font-size: 0.72rem; font-weight: 600; vertical-align: middle;
}

/* Drawing shown when a product has no photo */
.photo-placeholder { width: 100%; height: 100%; display: grid; place-items: center; }
.photo-placeholder svg { width: 70%; max-width: 180px; height: auto; }
.photo-placeholder.cat-sweets { background: radial-gradient(circle at 50% 40%, var(--tint-honey), var(--surface-2)); }
.photo-placeholder.cat-breads { background: radial-gradient(circle at 50% 40%, var(--tint-terracotta), var(--surface-2)); }
.photo-placeholder.cat-dishes { background: radial-gradient(circle at 50% 40%, var(--tint-green), var(--surface-2)); }

/* ---------- favorites ---------- */
.fav-btn {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.fav-btn .icon { width: 20px; height: 20px; }
.fav-btn:hover { color: var(--heart); }
.fav-btn.is-on { color: var(--heart); }
.fav-btn.is-on .icon { fill: currentColor; }
.summary-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---------- photos ---------- */
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.thumb {
  position: relative; display: block; width: 76px; height: 76px; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: none;
}
.thumb-lg { width: 120px; height: 120px; }
.thumb.active { border-color: var(--primary); }
.thumb.is-main { border-color: var(--honey); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 3px; inset-inline-end: 3px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; line-height: 1; font-size: 16px;
}
.thumb .make-main, .thumb .main-label {
  position: absolute; bottom: 3px; inset-inline-start: 3px; top: auto; inset-inline-end: auto;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.thumb .make-main { background: rgba(0, 0, 0, 0.45); color: #fff; border: 0; cursor: pointer; }
.thumb .main-label { background: var(--honey); color: #fff; }
.photo-add { margin: 4px 0; cursor: pointer; }
.gallery { margin: -2px 0 12px; }
.gallery > img { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.mini-photo { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface-2); }
.mini-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-photo .photo-placeholder { font-size: 1.4rem; }
.mini-photo .photo-placeholder svg { width: 90%; }

/* ---------- shop ---------- */
.shop-head { margin-top: 24px; }
.shop-head h1 { margin-bottom: 4px; }
.shop-head p { margin: 0; color: var(--muted); }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.shop-grid .panel { margin-top: 16px; }
.mylist, .order-list { list-style: none; padding: 0; margin: 0; }
.mylist li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.mylist li strong { display: block; }
.mylist-item { display: flex; gap: 10px; align-items: center; }
.mylist-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mylist .status { display: inline-block; margin-top: 4px; }
.reject-reason { display: block; color: var(--danger); }
.promo-form { flex-basis: 100%; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; margin-top: 8px; }
.promo-form .field { margin-bottom: 8px; }

/* ---------- pre-order & orders ---------- */
.summary { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; }
.summary > strong, .summary-title strong { display: block; }
.summary p { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }
.dist-inline { color: var(--green); font-weight: 600; }
.order-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.order-list li:last-child { border-bottom: 0; }
.order-list li.is-hidden { opacity: 0.6; }
.order-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.order-meta { margin: 4px 0 0; font-size: 0.88rem; color: var(--muted); }
.order-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.reason { flex: 1; min-width: 180px; min-height: 34px; padding: 6px 10px; }

.status, .pay-badge {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; font-weight: 700;
  background: var(--tint-gray); color: var(--muted);
}
.status-pending { background: var(--tint-honey); color: var(--honey-text); }
.status-accepted { background: var(--tint-blue); color: var(--blue); }
.status-ready, .status-approved { background: var(--tint-green); color: var(--green); }
.status-done { background: var(--tint-gray); color: var(--muted); }
.status-declined, .status-cancelled, .status-rejected { background: var(--tint-red); color: var(--danger); }
.pay-badge.is-paid { background: var(--tint-green); color: var(--green); }
.pay-badge.is-waiting { background: var(--tint-blue); color: var(--blue); }
.pay-note { display: block; color: var(--muted); font-size: 0.8rem; }
.pay-amount { font-size: 1.2rem; margin: 14px 0 4px; }
.pay-amount strong { font-size: 1.6rem; color: var(--primary); font-family: var(--font-title); }

/* ---------- sign-up ---------- */
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 16px; }
.role-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px;
  border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface-2);
  transition: border-color 0.15s, transform 0.15s;
}
.role-card:hover { border-color: var(--primary); background: var(--tint-terracotta); transform: translateY(-2px); }
.role-card strong { font-size: 1.15rem; font-family: var(--font-title); }
.role-card span:last-child { color: var(--muted); font-size: 0.9rem; }
.role-icon { font-size: 2rem; }
.sell-intro { text-align: center; background: var(--tint-terracotta); border-color: transparent; }
.sell-intro h1 { margin: 6px 0 8px; }
.sell-intro p { margin: 0; color: var(--muted); }
.check-group { margin-bottom: 10px; }
.check-group > span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 6px 0;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 0.9rem; background: var(--surface);
}
[dir="rtl"] .chip { margin: 0 0 6px 6px; }
.chip:has(input:checked) { border-color: var(--primary); background: var(--tint-terracotta); }

/* ---------- team area ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tab {
  font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; min-height: 34px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px;
}
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- ratings ---------- */
.stars { color: var(--honey); letter-spacing: 1px; white-space: nowrap; }
.stars-off { color: var(--line); }
.rating-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--honey-text); font-family: var(--font-body);
  background: var(--tint-honey); border-radius: 999px; padding: 1px 8px; vertical-align: middle;
}
.rating-badge small { font-weight: 400; }
.rating-badge.is-new { color: var(--green); background: var(--tint-green); font-weight: 600; }
.reviews { margin-top: 12px; }
.reviews h3 { font-size: 1rem; margin: 0 0 8px; }
.reviews blockquote { margin: 0 0 10px; font-size: 0.9rem; padding-inline-start: 10px; border-inline-start: 3px solid var(--line); }
.reviews footer { color: var(--muted); font-size: 0.8rem; }
.order-rating { margin: 8px 0 0; font-size: 0.9rem; }
.rate-form { margin-top: 12px; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.rate-form h3 { margin: 0 0 6px; font-size: 1rem; }
.rate-form textarea { margin: 6px 0 8px; }
/* Stars are listed 5→1 and shown reversed, so "this star and all before it" light up on hover/check */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
[dir="rtl"] .star-input { flex-direction: row-reverse; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2rem; color: var(--line); cursor: pointer; padding: 0 2px; line-height: 1; }
.star-input input:checked ~ label,
.star-input label:hover, .star-input label:hover ~ label { color: var(--honey); }
.star-input input:focus-visible + label { outline: 2px solid var(--honey); border-radius: 4px; }

/* ---------- notifications ---------- */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { display: flex; gap: 12px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li.is-unread { background: var(--tint-honey); }
.notif-list p { margin: 0; }
.new-dot {
  display: inline-block; background: var(--primary); color: #fff; font-size: 0.68rem; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; vertical-align: middle;
}

/* ---------- chat ---------- */
.chat-cta { margin: 10px 0 0; }
.chat-list { list-style: none; padding: 0; margin: 0; }
.chat-list a {
  display: flex; gap: 12px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; border-radius: 10px;
}
.chat-list a:hover { background: var(--surface-2); }
.chat-list a.is-unread { background: var(--tint-honey); }
.chat-list a.is-unread .chat-last { color: var(--text); font-weight: 600; }
.chat-summary { flex: 1; min-width: 0; }
.chat-last { display: block; color: var(--muted); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--muted); }
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-head { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.chat-who { flex: 1; min-width: 0; }
.chat-who small { display: block; }
.back-link { text-decoration: none; font-size: 1.3rem; color: var(--text); }
[dir="rtl"] .back-link { transform: scaleX(-1); }
.chat-product {
  display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.chat-product .mini-photo { width: 40px; height: 40px; }
.chat-thread { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; min-height: 220px; overflow-y: auto; padding: 4px 2px; }
.chat-empty { margin: auto; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 18px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble small { display: block; font-size: 0.7rem; opacity: 0.75; margin-top: 2px; }
.bubble.mine { align-self: flex-end; background: var(--primary); color: #fff; border-end-end-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-end-start-radius: 4px; }
.bubble.has-photo { padding: 4px; }
.bubble.has-photo small { padding: 0 6px 2px; }
.bubble-photo { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.bubble-photo img { display: block; max-width: 240px; max-height: 240px; width: 100%; border-radius: 14px; object-fit: cover; }
.chat-photo-btn { font-size: 1.3rem; padding: 6px 10px; min-height: 44px; }
.chat-safety { margin: 0; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; }
.report-thread { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 8px; font-size: 0.9rem; }
.report-thread p { margin: 4px 0; }
.report-thread .thumb { display: inline-block; vertical-align: middle; width: 56px; height: 56px; }
/* "New message from …" popup inside the app */
.chat-toast {
  position: fixed; z-index: 900; bottom: 24px; inset-inline-end: 24px; max-width: min(360px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); text-decoration: none; animation: toast-in 0.25s ease-out;
}
.chat-toast > span:last-child { display: grid; min-width: 0; }
.chat-toast small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 720px) {
  .chat-toast { bottom: calc(76px + env(safe-area-inset-bottom)); inset-inline: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .chat-toast { animation: none; } }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.85);
  display: grid; place-items: center; padding: 16px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.2); color: #fff; font-size: 24px; cursor: pointer;
}

/* ---------- discounts & allergens ---------- */
.old-price { color: var(--muted); font-weight: 400; }
.promo-badge {
  display: inline-block; background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 700;
  border-radius: 6px; padding: 1px 6px; vertical-align: middle;
}
.allergens-line { margin: 0; font-size: 0.8rem; color: var(--honey-text); }
.allergens-line.is-none { color: var(--green); }
/* Pickup place of a product: the seller's address or another town */
.pickup-place { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.pickup-place legend { font-weight: 600; margin-bottom: 8px; }
.pickup-place .toggle { margin-bottom: 6px; }
.pickup-place #place-fields { margin: 8px 0 4px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg); }
.pickup-place > small { display: block; margin-top: 4px; }
.checks.allergens { margin-top: 12px; }
.checks.allergens small { display: block; margin-top: 4px; }

/* ---------- account ---------- */
.verified { color: var(--green); font-weight: 600; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone h2 { color: var(--danger); }
.panel.account-head { padding: 0; overflow: hidden; }
.account-who { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--tint-terracotta); }
.account-who strong { font-size: 1.1rem; }
.account-who small { display: block; }
.account-who .seller-avatar { width: 52px; height: 52px; font-size: 1.4rem; }
.menu-links { display: flex; flex-direction: column; }
.menu-link {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--text); text-decoration: none; font: inherit; font-weight: 500; cursor: pointer; text-align: start; width: 100%;
}
.menu-link:hover { background: var(--surface-2); }
.menu-link span:first-of-type { flex: 1; }
.menu-link .chev { color: var(--muted); }
.menu-link[data-action="logout"] { color: var(--danger); }
.theme-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.theme-row > span { flex: 1; font-weight: 500; }
.theme-row .tabs { margin: 0; }

/* ---------- seller page ---------- */
.seller-link { color: inherit; text-decoration: none; }
.seller-link:hover strong { text-decoration: underline; }
.seller-head { display: flex; gap: 16px; align-items: center; }
.seller-head h1 { margin: 0 0 4px; font-size: 1.5rem; }
.seller-head p { margin: 2px 0; }
.seller-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-size: 1.8rem; font-weight: 700; font-family: var(--font-title);
}
.seller-avatar.small { width: 40px; height: 40px; font-size: 1.1rem; }

.site-footer { color: var(--muted); font-size: 0.82rem; padding: 28px 0; text-align: center; }

.loading { text-align: center; color: var(--muted); padding: 80px 16px; font-weight: 500; }

/* ---------- super admin page ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.kpi strong { font-family: var(--font-title); font-size: 2rem; color: var(--primary); line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 0.88rem; font-weight: 500; }
.kpi small { color: var(--muted); font-size: 0.78rem; }
.panel h3 { font-size: 1rem; margin: 18px 0 8px; }

/* Owner page: visitors per day */
.visits-chart { margin: 0 0 6px; }
.visits-chart svg { display: block; width: 100%; height: 140px; }
.visits-chart .bar { fill: var(--primary); opacity: 0.55; }
.visits-chart .bar.today { opacity: 1; }
.visits-chart .bar:hover { opacity: 0.85; }
.visits-chart .axis { stroke: var(--line); stroke-width: 1; }
.visits-chart figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.sa-sales { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); }
.sa-sales span { color: var(--muted); }
.sa-toolbar { display: grid; grid-template-columns: 1fr 200px auto; gap: 10px; margin-bottom: 14px; }
.sa-table-wrap { overflow-x: auto; }
.sa-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.sa-table th { text-align: start; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.sa-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sa-table td small { display: block; }
.sa-table tr.is-blocked td { opacity: 0.75; }
@media (max-width: 760px) {
  .sa-toolbar { grid-template-columns: 1fr; }
  /* The table becomes one card per member on phones */
  .sa-table thead { display: none; }
  .sa-table, .sa-table tbody, .sa-table tr, .sa-table td { display: block; width: 100%; }
  .sa-table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 10px; }
  .sa-table td { border: 0; padding: 4px 0; }
  .sa-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
}

/* ---------- tablets ---------- */
@media (max-width: 980px) {
  .nav-link .nav-label { display: none; }
  .nav-link { padding: 10px; }
  .brand-name small { display: none; }
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .nav { display: none; }
  .header-tools { margin-inline-start: auto; }
  .tabbar { display: flex; }
  .logo { width: 32px; height: 32px; }
  .brand-name { font-size: 1.2rem; }

  .hero { padding: 26px 0 22px; }
  .hero p { font-size: 0.9rem; margin-bottom: 16px; }
  .chip-row { margin-top: 14px; }
  .filter-toggle span:not(.count) { display: none; }
  .filter-toggle { padding: 0 12px; }
  .view-switch button span { display: none; }
  .view-switch button { padding: 0 9px; }
  .map { height: 62vh; min-height: 320px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .near { grid-column: 1 / -1; }

  /* Two products per row, compact */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-photo { aspect-ratio: 1 / 1; }
  .card-body { padding: 10px; gap: 3px; }
  .card-body h3 { font-size: 0.98rem; }
  .price { font-size: 0.92rem; }
  .seller, .delivery-badge, .allergens-line, .card-meta { font-size: 0.75rem; }
  .card-actions .btn { min-height: 38px; font-size: 0.85rem; padding: 4px 8px; }
  .card-actions .btn.icon-only { width: 38px; }
  .card-media .fav-btn { width: 34px; height: 34px; top: 8px; inset-inline-end: 8px; }

  .panel { padding: 16px; border-radius: 16px; }
  .shop-grid { grid-template-columns: 1fr; }
  .bubble { max-width: 88%; }
}
@media (max-width: 480px) {
  .row, .role-cards { grid-template-columns: 1fr; }
  .card-meta, .card-tag { display: none; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}

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