/* =========================================================
   Hayati Mart — shared design system (RTL/LTR aware)
   ========================================================= */
:root {
  --brand: #009599;
  --brand-600: #00858a;
  --brand-700: #006b6f;
  --brand-900: #053b3d;
  --brand-50: #e6f5f5;
  --brand-100: #c4e8e9;
  --leaf: #5abb54;
  --leaf-700: #3a8f36;
  --cream: #ffe5b2;
  --accent: #ffdfa2;
  --accent-600: #b47a16;
  --accent-50: #fff6e3;
  --on-accent: #4a3200;
  --ink: #0f2526;
  --ink-2: #374a4b;
  --muted: #687b7c;
  --line: #e2eaea;
  --bg: #f5f8f8;
  --card: #ffffff;
  --success: #15803d; --success-bg: #e7f6ec;
  --info: #1d4ed8;    --info-bg: #e8efff;
  --warning: #b45309; --warning-bg: #fff4e0;
  --danger: #b91c1c;  --danger-bg: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(18, 32, 27, .06);
  --shadow: 0 6px 24px -8px rgba(18, 32, 27, .14);
  --shadow-lg: 0 20px 50px -18px rgba(0, 107, 111, .35);
  --font: "TheSans", "Gibson", "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.7; font-size: 15px; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; color: var(--ink); }
p { margin: 0 0 1em; }
.ic { flex-shrink: 0; vertical-align: middle; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-end { text-align: end; }
.center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 36px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s ease; line-height: 1.2; white-space: nowrap; background: none; color: inherit; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px -6px rgba(0,149,153,.6); }
.btn-primary:hover { background: var(--brand-600); color: #fff; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-600); color: var(--on-accent); }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: rgba(0,0,0,.04); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-white { background: #fff; color: var(--brand-700); }
.btn-white:hover { background: var(--accent); color: var(--on-accent); }
.btn-outline-white { border-color: rgba(255,255,255,.45); color: #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 13px; }
.btn-icon { padding: 8px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink-2); }
.label .req { color: var(--danger); }
.input, .select, .textarea { width: 100%; padding: 11px 14px; border: 1px solid #d5dfdb; border-radius: var(--radius-sm); font: inherit; font-size: 14.5px; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0,149,153,.14); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a74' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 36px; }
[dir="ltr"] .select { background-position: right 14px center; padding-left: 14px; padding-right: 36px; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 720px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } }

/* ---------- Alerts / badges ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 500; font-size: 14px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef2f0; color: var(--ink-2); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #eef2f0; color: var(--muted); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-accent { background: var(--accent); color: var(--on-accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcfc; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 12px 16px; background: #fafbfb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .name { font-weight: 600; line-height: 1.3; }
.person .sub { font-size: 12px; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; list-style: none; padding: 0; margin: 24px 0 0; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.pagination .active span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled span { opacity: .45; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { color: #b9c6c0; margin-bottom: 10px; }

/* =========================================================
   PUBLIC SITE
   ========================================================= */
.topbar { background: var(--brand-900); color: #cfeaea; font-size: 13px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar a { color: #fff; }
.topbar .items { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar .items span { display: inline-flex; align-items: center; gap: 6px; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 28px; min-height: 74px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.18)); }
.logo-mark { width: 42px; height: 42px; border-radius: 12px; background: none; display: grid; place-items: center; }
.logo img { height: 46px; width: auto; }
.logo .wm { font-family: "TheSans", "Tajawal", sans-serif; font-weight: 800; letter-spacing: -.2px; }
[lang="en"] .logo .wm { font-family: "Gibson", "Figtree", sans-serif; text-transform: uppercase; letter-spacing: 1.2px; }
.logo small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 9px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav a.active { color: var(--brand); background: var(--brand-50); }
.nav-cta { display: flex; gap: 8px; }
.nav-toggle { display: none; margin-inline-start: auto; }
.nav .mobile-only { display: none; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav, .nav-cta { display: none; }
  .site-header.open .nav { display: flex; flex-direction: column; position: absolute; inset-inline: 0; top: 74px; background: #fff; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav .mobile-only { display: block; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
  .topbar .items span:nth-child(n+2) { display: none; }
}

/* Hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(1100px 520px at 85% -10%, rgba(255,229,178,.22), transparent 60%), radial-gradient(700px 400px at 0% 110%, rgba(90,187,84,.25), transparent 60%), linear-gradient(135deg, #006b6f 0%, #009599 55%, #10aeb0 100%); color: #fff; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(to bottom, #000, transparent); pointer-events: none; }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-block: 72px 84px; }
.hero h1 { color: var(--cream); font-size: clamp(30px, 4.4vw, 50px); font-weight: 800; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: #fff; }
.hero p.lead { font-size: 18px; color: #dff4f4; max-width: 540px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.hero-visual { position: relative; }
.hero-visual .frame { border-radius: 26px; overflow: hidden; aspect-ratio: 4/3.4; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); display: grid; place-items: center; }
.hero-visual .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual .float { position: absolute; background: #fff; color: var(--ink); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; font-size: 13px; }
.hero-visual .float strong { display: block; font-size: 16px; }
.hero-visual .float .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent-600); }
.hero-visual .f1 { bottom: -18px; inset-inline-start: -22px; }
.hero-visual .f2 { top: 26px; inset-inline-end: -18px; }
.hero-art { width: 70%; color: rgba(255,255,255,.9); }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; padding-block: 48px 64px; } .hero-visual { display: none; } }

/* Features strip */
.features { margin-top: -38px; position: relative; z-index: 2; }
.features .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: #fff; border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); border: 1px solid var(--line); }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.feature strong { display: block; font-size: 15px; }
.feature span { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .features .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features .grid { gap: 10px; } .feature { flex-direction: column; text-align: center; padding: 14px 10px; gap: 8px; } .feature span { font-size: 12px; } }

/* Sections */
.section { padding-block: 72px; }
.section-alt { background: #fff; border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { color: var(--leaf-700); font-weight: 700; font-size: 13px; letter-spacing: .4px; display: inline-flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }

.page-hero { background: linear-gradient(135deg, #006b6f, #009599); color: #fff; padding-block: 52px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(26px, 3.6vw, 38px); margin: 0 0 6px; }
.page-hero p { color: #d5f0f0; margin: 0; }
.crumbs { font-size: 13px; color: #b5e3e4; margin-bottom: 8px; display: flex; gap: 8px; }
.crumbs a { color: var(--brand); }
.page-hero .crumbs a { color: #fff; }

/* Category chips */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 14px; text-align: center; transition: .2s; color: var(--ink); }
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-100); color: var(--ink); }
.cat .emoji { font-size: 34px; line-height: 1; display: block; margin-bottom: 10px; }
.cat strong { display: block; font-size: 14.5px; }
.cat span { font-size: 12px; color: var(--muted); }

/* Product card */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.product { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: .2s; position: relative; color: var(--ink); }
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--ink); }
.product .thumb { aspect-ratio: 1/1; background: linear-gradient(135deg, #f0f8f8, #e0f1f1); display: grid; place-items: center; overflow: hidden; }
.product .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product:hover .thumb img { transform: scale(1.05); }
.product .ph { font-size: 64px; filter: saturate(1.1); }
.product .body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.product .cat-name { font-size: 12px; color: var(--muted); font-weight: 600; }
.product h3 { font-size: 15.5px; margin: 4px 0 10px; font-weight: 700; }
.product .price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 19px; color: var(--brand-700); }
.price small { font-size: 12px; font-weight: 600; color: var(--muted); }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 13.5px; }
.product .flag { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 1; }

/* Offer card */
.offers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.offer { background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: .2s; }
.offer:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.offer .media { aspect-ratio: 16/9; position: relative; background: linear-gradient(135deg, #ffe9bf, #ffd58a); display: grid; place-items: center; overflow: hidden; }
.offer .media img { width: 100%; height: 100%; object-fit: cover; }
.offer .media .big { font-size: 46px; font-weight: 800; color: var(--on-accent); text-align: center; padding: 20px; line-height: 1.2; }
.offer .media .badge { position: absolute; top: 14px; inset-inline-start: 14px; background: var(--danger); color: #fff; font-size: 13px; padding: 5px 12px; }
.offer .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.offer h3 { font-size: 18px; margin: 0; }
.offer .meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }

/* CTA band */
.cta-band { background: linear-gradient(120deg, #ffe5b2, #ffd48a); border-radius: 22px; padding: 38px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: var(--on-accent); position: relative; overflow: hidden; }
.cta-band h2 { color: var(--on-accent); margin: 0 0 6px; font-size: 26px; }
.cta-band p { margin: 0; color: #6b4b0e; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-media { border-radius: 22px; overflow: hidden; aspect-ratio: 5/4; background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); display: grid; place-items: center; color: var(--brand); }
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.vm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vm { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.vm .ico { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.info-list { display: grid; gap: 14px; }
.info-item { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.info-item .ico { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.info-item strong { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.info-item span { font-weight: 600; white-space: pre-line; }
.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/9; background: #e9efec; }
.map-embed iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 900px) { .about-grid, .vm-grid { grid-template-columns: 1fr; } }

/* Product page */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.product-page .gallery { border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, #f0f8f8, #e0f1f1); aspect-ratio: 1/1; display: grid; place-items: center; border: 1px solid var(--line); }
.product-page .gallery img { width: 100%; height: 100%; object-fit: cover; }
.product-page .gallery .ph { font-size: 140px; }
.product-page h1 { font-size: clamp(24px, 3vw, 34px); }
.product-page .price { font-size: 30px; }
@media (max-width: 900px) { .product-page { grid-template-columns: 1fr; } }

/* Filters bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.chip { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.chip:hover { border-color: var(--brand-100); color: var(--brand-700); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-box .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-inline-start: 40px; }

/* Footer */
.site-footer { background: var(--brand-900); color: #a9c7c7; padding-top: 60px; margin-top: 0; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.site-footer a { color: #d6ecec; }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: 14px; }
.footer-grid li { display: flex; gap: 8px; align-items: flex-start; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 44px; padding-block: 18px; font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.socials { display: flex; gap: 8px; margin-top: 14px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.07); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.socials a:hover { background: var(--accent); color: var(--on-accent); }
.site-footer .logo { color: #fff; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.wa-float { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -6px rgba(37,211,102,.6); }
.wa-float:hover { color: #fff; transform: scale(1.06); }

/* =========================================================
   AUTH
   ========================================================= */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(140deg, #006b6f, #009599 60%, #12b0b2); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { color: var(--cream); font-size: 34px; }
.auth-side .logo { color: #fff; }
.auth-side ul { list-style: none; padding: 0; display: grid; gap: 14px; }
.auth-side li { display: flex; gap: 12px; align-items: center; color: #dff4f4; }
.auth-side li .ic { color: var(--accent); }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* =========================================================
   PANEL
   ========================================================= */
.panel { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand-900); color: #a9c7c7; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { padding: 20px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar .logo { color: #fff; font-size: 17px; }
.sidebar .logo small { color: #7fa3a4; }
.side-nav { padding: 14px 12px; flex: 1; }
.side-nav .group { font-size: 11.5px; font-weight: 700; color: #5f8a8b; padding: 16px 12px 6px; letter-spacing: .4px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #c3dcdc; font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(0,149,153,.9); }
.side-nav a .count { margin-inline-start: auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.sidebar .me { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.sidebar .me .name { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.3; }
.sidebar .me .role { font-size: 12px; color: #7fa3a4; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topnav { height: 66px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding-inline: 28px; position: sticky; top: 0; z-index: 30; }
.topnav .title { font-weight: 700; font-size: 17px; }
.topnav .tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.side-toggle { display: none; }
.content { padding: 28px; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.backdrop { display: none; }
@media (max-width: 1000px) {
  .panel { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 80; transform: translateX(100%); transition: transform .25s; }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  body.side-open .sidebar { transform: none; }
  body.side-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 70; }
  .side-toggle { display: inline-flex; }
  .content { padding: 18px; }
  .topnav { padding-inline: 16px; }
}

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow-sm); color: var(--ink); }
a.kpi:hover { border-color: var(--brand-100); box-shadow: var(--shadow); color: var(--ink); }
.kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; margin: 0; }
.kpi .value { font-size: 26px; font-weight: 800; line-height: 1.2; margin-top: 2px; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.tone-brand .ico { background: var(--brand-50); color: var(--brand); }
.tone-accent .ico { background: var(--accent-50); color: var(--accent-600); }
.tone-info .ico { background: var(--info-bg); color: var(--info); }
.tone-danger .ico { background: var(--danger-bg); color: var(--danger); }
.tone-success .ico { background: var(--success-bg); color: var(--success); }
.tone-warning .ico { background: var(--warning-bg); color: var(--warning); }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.grid-1-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; }
.stack { display: grid; gap: 20px; }
@media (max-width: 1100px) { .grid-2, .grid-3-1, .grid-1-2 { grid-template-columns: 1fr; } }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b .fill { width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: linear-gradient(to top, var(--brand), #3cc7c4); min-height: 3px; position: relative; }
.bars .b .fill.zero { background: #e4ebe8; }
.bars .b .v { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.bars .b .l { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ""; position: absolute; inset: 22px; background: #fff; border-radius: 50%; }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; line-height: 1.2; }
.donut .center strong { display: block; font-size: 26px; }
.donut .center span { font-size: 12px; color: var(--muted); }
.legend { display: grid; gap: 10px; font-size: 14px; }
.legend div { display: flex; align-items: center; gap: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend b { margin-inline-start: auto; padding-inline-start: 20px; }

/* Progress */
.progress { height: 8px; background: #edf2f0; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.progress.success > span { background: var(--success); }
.progress.info > span { background: var(--info); }
.progress.warning > span { background: var(--accent); }
.progress.danger > span { background: var(--danger); }
.progress.muted > span { background: #c5d0cb; }

/* Score ring */
.ring { --v: 0; --c: var(--brand); width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--v) * 1%), #edf2f0 0); display: grid; place-items: center; position: relative; flex-shrink: 0; }
.ring::after { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.ring > div { position: relative; z-index: 1; text-align: center; line-height: 1.15; }
.ring strong { font-size: 28px; display: block; }
.ring span { font-size: 11.5px; color: var(--muted); }
.ring.sm { width: 54px; height: 54px; } .ring.sm::after { inset: 6px; } .ring.sm strong { font-size: 14px; }
.ring.success { --c: var(--success); } .ring.info { --c: var(--info); } .ring.warning { --c: var(--accent); } .ring.danger { --c: var(--danger); } .ring.muted { --c: #c5d0cb; }

/* Stars / rating input */
.stars { color: var(--accent); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d6dfdb; }
.rate { display: flex; gap: 6px; flex-wrap: wrap; }
.rate input { position: absolute; opacity: 0; pointer-events: none; }
.rate label { min-width: 46px; text-align: center; padding: 8px 10px; border: 1px solid #d5dfdb; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--ink-2); font-size: 14px; transition: .12s; }
.rate label:hover { border-color: var(--brand); }
.rate input:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; }
.crit { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.crit:last-child { border-bottom: 0; }
.crit .t strong { display: block; }
.crit .t span { font-size: 12.5px; color: var(--muted); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { min-width: 0; }
.list .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .s { font-size: 12.5px; color: var(--muted); }

.rank { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; background: #eef2f0; color: var(--ink-2); flex-shrink: 0; }
.rank.r1 { background: #fde68a; color: #7c5300; } .rank.r2 { background: #e5e7eb; color: #374151; } .rank.r3 { background: #fed7aa; color: #8a3b00; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; padding-block: 9px; }
.toolbar .search { flex: 1; min-width: 200px; }

.detail { display: grid; grid-template-columns: 160px 1fr; gap: 12px 18px; font-size: 14.5px; }
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; white-space: pre-line; }
@media (max-width: 600px) { .detail { grid-template-columns: 1fr; gap: 2px; } .detail dd { margin-bottom: 10px; } }
.prose { white-space: pre-line; }
.thumb-sm { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #eef2f0; display: grid; place-items: center; font-size: 22px; }
.img-preview { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 10px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }

/* ---------- Brand additions ---------- */
h1, h2, h3, .kpi .value, .price { font-family: "TheSans", "Gibson", "Tajawal", sans-serif; }
[lang="en"] h1, [lang="en"] h2, [lang="en"] h3, [lang="en"] .kpi .value, [lang="en"] .price, [lang="en"] body { font-family: "Gibson", "Figtree", "Tajawal", sans-serif; }
.brand-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 20px 64px; text-align: center; }
.brand-hero img { width: 34%; max-width: 160px; margin-bottom: 8px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.25)); animation: leafFloat 6s ease-in-out infinite; }
.brand-hero .ar { font-family: "TheSans", "Tajawal", sans-serif; font-weight: 800; font-size: 38px; color: var(--cream); line-height: 1.15; }
.brand-hero .en { font-family: "Gibson", "Figtree", sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 5px; color: var(--cream); }
@keyframes leafFloat { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.feature .ico, .vm .ico { background: #eaf6e9; color: var(--leaf-700); }
.hero-kicker .ic { color: var(--cream); }
.side-nav a .count { background: var(--cream); }

/* =========================================================
   WhatsApp ordering (only rendered when enabled in settings)
   ========================================================= */
.pwrap { position: relative; display: flex; }
.pwrap > .product { flex: 1; }
.pwrap .product .price-row { padding-inline-end: 46px; }
.add-cart { position: absolute; bottom: 14px; inset-inline-end: 14px; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 14px -6px rgba(0,149,153,.8); transition: .15s; }
.add-cart:hover { background: var(--brand-700); transform: scale(1.06); }
.add-cart.added, [data-add-cart].added { background: var(--success) !important; color: #fff; }
.cart-btn { position: relative; }
.cart-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.cart-badge[hidden] { display: none; }
.cart-mobile { display: none; position: relative; }
.cart-mobile .cart-badge { position: absolute; top: -6px; inset-inline-end: -6px; }
@media (max-width: 900px) {
  .cart-mobile { display: inline-flex; margin-inline-start: auto; }
  .cart-mobile + .nav-toggle { margin-inline-start: 8px; }
}
.cart-bar { position: fixed; z-index: 65; bottom: 18px; left: 50%; transform: translate(-50%, 140%); width: min(560px, calc(100% - 28px)); display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--brand-900); color: #fff; box-shadow: 0 14px 34px -12px rgba(5,59,61,.6); transition: transform .3s ease; }
.cart-bar.show { transform: translate(-50%, 0); }
.cart-bar:hover { color: #fff; }
.cb-ico { position: relative; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.cb-ico .cart-badge { position: absolute; top: -6px; inset-inline-end: -6px; }
.cb-txt { flex: 1; font-weight: 700; }
.cb-total { font-weight: 800; color: var(--cream); white-space: nowrap; }
body.has-cart .wa-float { bottom: 92px; }
body.has-cart { padding-bottom: 80px; }
.cart-toast { position: fixed; z-index: 90; top: 18px; left: 50%; transform: translate(-50%, -150%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: transform .25s; box-shadow: var(--shadow); }
.cart-toast.show { transform: translate(-50%, 0); }

.buy-box { display: flex; gap: 12px; align-items: stretch; }
.qty { display: inline-flex; align-items: center; border: 1px solid #d5dfdb; border-radius: 13px; overflow: hidden; background: #fff; }
.qty button { width: 44px; height: 100%; min-height: 48px; border: 0; background: #f3f8f8; font-size: 20px; font-weight: 700; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--brand-50); color: var(--brand); }
.qty input { width: 48px; border: 0; text-align: center; font: inherit; font-weight: 700; font-size: 16px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty.sm button { width: 32px; min-height: 32px; font-size: 16px; }
.qty.sm input { width: 36px; font-size: 14px; }

.cart-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.cart-summary { position: sticky; top: 92px; }
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-list li { display: flex; gap: 14px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.cart-list li:last-child { border-bottom: 0; }
.ci-img { width: 68px; height: 68px; border-radius: 12px; background: linear-gradient(135deg, #f0f8f8, #e0f1f1); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-size: 30px; }
.ci-img img { width: 100%; height: 100%; object-fit: cover; }
.ci-info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ci-name { font-weight: 700; color: var(--ink); }
.ci-price { font-size: 13px; color: var(--muted); }
.ci-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ci-line { font-size: 16px; color: var(--brand-700); white-space: nowrap; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px; border: 1px solid #d5dfdb; border-radius: 11px; font-weight: 700; }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.sum-rows { border-top: 1px dashed var(--line); margin: 6px 0 14px; padding-top: 12px; display: grid; gap: 8px; }
.sum-rows > div { display: flex; justify-content: space-between; }
.sum-total { font-size: 18px; padding-top: 8px; border-top: 1px solid var(--line); }
.sum-total b { color: var(--brand-700); }
.done-card { max-width: 560px; margin-inline: auto; }
.done-ico { width: 76px; height: 76px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; margin: 4px auto 14px; }
#sendBtn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
@media (max-width: 900px) {
  .cart-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-list li { padding: 12px 14px; gap: 10px; }
  .ci-img { width: 56px; height: 56px; }
}

.ci-info .qty { justify-self: start; }
@media (max-width: 480px) { .site-header.with-cart .logo small { display: none; } }
