:root {
  --primary: #0f3d2e;
  --primary-light: #175945;
  --secondary: #7a1f2b;
  --secondary-light: #9c2c3a;
  --gold: #b8912f;
  --gold-light: #d4af5a;
  --cream: #faf3e7;
  --cream-dark: #f0e6d2;
  --ink: #241d14;
  --muted: #6b6354;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(15, 61, 46, 0.25);
  --shadow-sm: 0 4px 14px -6px rgba(15, 61, 46, 0.18);
  font-family: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[dir="rtl"] body { font-family: "Tajawal", "Segoe UI", sans-serif; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  padding: 7px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.topbar-links { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar-links a { display: inline-flex; align-items: center; gap: 6px; opacity: .92; }
.topbar-links a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 243, 231, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cream-dark);
}
.site-header .container { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-badge {
  width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(from 180deg, var(--primary) 0deg 180deg, var(--secondary) 180deg 360deg);
  border: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.brand-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.brand-name { font-weight: 800; font-size: 16px; line-height: 1.15; color: var(--primary); }
.brand-sub { font-size: 11px; color: var(--muted); }

.main-nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--primary);
}
.main-nav a:hover { background: var(--cream-dark); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; border: none; background: var(--cream-dark); color: var(--primary);
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background .15s;
}
.icon-btn:hover { background: var(--gold-light); color: #fff; }
.cart-badge {
  position: absolute; top: -4px; inset-inline-end: -4px;
  background: var(--secondary); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.lang-select {
  border: none; background: var(--cream-dark); color: var(--primary); font-weight: 700;
  border-radius: 12px; padding: 0 10px; height: 42px; font-size: 14px; cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(184,145,47,.18), transparent),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 55%, var(--secondary) 130%);
  color: #fff;
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 90% 100%, rgba(255,255,255,.08), transparent);
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 14px; font-weight: 800; letter-spacing: -0.5px; }
.hero p { font-size: 16px; opacity: .92; max-width: 46ch; margin: 0 0 26px; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: #2a1d00; font-weight: 800; padding: 13px 26px;
  border-radius: 999px; box-shadow: 0 14px 30px -10px rgba(184,145,47,.6); font-size: 15px;
}
.hero-cta:hover { background: var(--gold-light); }
.hero-visual {
  display: flex; align-items: center; justify-content: center;
}
.hero-badge-lg {
  width: min(260px, 60vw); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 180deg, var(--primary-light) 0deg 180deg, var(--secondary-light) 180deg 360deg);
  border: 8px solid var(--gold);
  display: flex; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
  color: #fff; font-weight: 800; font-size: 22px; padding: 20px; overflow: hidden;
}
.hero-badge-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
@media (max-width: 820px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-visual { order: -1; }
  .hero p { margin-inline: auto; }
}

/* ---------- Search & categories ---------- */
.toolbar { padding: 22px 0 6px; position: sticky; top: 64px; z-index: 40; background: var(--cream); }
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap input {
  width: 100%; padding: 13px 44px; border-radius: 14px; border: 1.5px solid var(--cream-dark);
  background: #fff; font-size: 15px; outline: none;
}
.search-wrap input:focus { border-color: var(--gold); }
.search-icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); opacity: .5; }

.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.cat-pill {
  flex-shrink: 0; display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid var(--cream-dark); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.cat-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Product grid ---------- */
.cat-section { padding: 26px 0 8px; scroll-margin-top: 150px; }
.cat-title { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; color: var(--primary); margin: 0 0 14px; }
.cat-title .count { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--cream-dark); padding: 3px 10px; border-radius: 999px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.p-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; position: relative; transition: transform .15s, box-shadow .15s;
}
.p-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.p-img { aspect-ratio: 1.1; background: var(--cream-dark); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-img .ph { font-size: 32px; opacity: .35; }
.p-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.p-name { font-size: 14px; font-weight: 700; line-height: 1.4; min-height: 2.6em; }
.p-note { font-size: 12px; color: var(--muted); }
.p-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.p-price { font-weight: 800; color: var(--secondary); font-size: 15px; }
.p-add {
  border: none; background: var(--primary); color: #fff; width: 38px; height: 38px; border-radius: 10px;
  font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.p-add:hover { background: var(--primary-light); }
.p-unavail {
  position: absolute; inset: 0; background: rgba(250,243,231,.94);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px;
  font-size: 12.5px; font-weight: 700; color: var(--secondary);
}

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------- Cart drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,15,10,.45); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 100%);
  background: #fff; z-index: 95; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  box-shadow: -20px 0 40px rgba(0,0,0,.2);
}
[dir="rtl"] .cart-drawer { transform: translateX(-100%); }
.cart-drawer.open { transform: translateX(0); }
.cart-head { padding: 18px; border-bottom: 1px solid var(--cream-dark); display: flex; justify-content: space-between; align-items: center; }
.cart-head h3 { margin: 0; color: var(--primary); }
.cart-items { flex: 1; overflow-y: auto; padding: 10px 18px; }
.cart-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--cream-dark); align-items: center; }
.cart-item .ci-img { width: 54px; height: 54px; border-radius: 10px; background: var(--cream-dark); overflow: hidden; flex-shrink: 0; display:flex; align-items:center; justify-content:center; font-size: 20px; }
.cart-item .ci-img img { width: 100%; height: 100%; object-fit: cover; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: 13.5px; font-weight: 700; }
.ci-price { font-size: 12.5px; color: var(--muted); }
.ci-qty { display: flex; align-items: center; gap: 8px; }
.ci-qty button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--cream-dark); background: var(--cream); font-weight: 700; }
.ci-remove { color: var(--secondary); font-size: 12px; font-weight: 700; margin-top: 4px; }

.cart-summary { padding: 16px 18px; border-top: 1px solid var(--cream-dark); }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: var(--muted); }
.sum-row.total { font-size: 17px; font-weight: 800; color: var(--ink); border-top: 1px dashed var(--cream-dark); margin-top: 6px; padding-top: 10px; }
.sum-row.discount { color: var(--secondary); }
.checkout-btn {
  width: 100%; margin-top: 12px; border: none; background: #25d366; color: #fff; font-weight: 800;
  padding: 14px; border-radius: 12px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.checkout-btn:disabled { opacity: .5; }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary); color: #f1ebe0; margin-top: 50px; padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; margin-bottom: 26px; }
.footer-col h4 { font-size: 14px; letter-spacing: .5px; text-transform: uppercase; color: var(--gold-light); margin: 0 0 12px; }
.footer-col a, .footer-col p { display: block; font-size: 14px; opacity: .85; margin-bottom: 8px; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; font-size: 13px; opacity: .8;
}
.footer-bottom a { font-weight: 700; color: var(--gold-light); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--primary); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 120; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
[dir="rtl"] .toast { transform: translate(50%, 10px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
[dir="rtl"] .toast.show { transform: translate(50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .main-nav { display: none; }
  .hero { padding: 40px 0 46px; }
  .toolbar { top: 62px; }
}
.skeleton { background: linear-gradient(90deg, var(--cream-dark) 25%, #f7f0e1 37%, var(--cream-dark) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); height: 220px; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
