:root {
  --brand: #C65801;
  --brand-d: #9A4300;
  --brand-s: #F4E4D4;
  --ink: #1C1410;
  --muted: #6B5E55;
  --line: #EDE4DB;
  --bg: #F7F2EC;
  --card: #FFFFFF;
  --sale: #C62828;
  --ok: #1B8A4A;
  --wa: #25D366;
  --shadow: 0 8px 28px rgba(80, 40, 10, 0.08);
  --r: 16px;
  --tab: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", "Cairo", system-ui, sans-serif;
  --ar: "Cairo", "Plus Jakarta Sans", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { overflow-x: hidden; }
body {
  font-family: var(--font);
  background: #F7F2EC;
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

#app {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  background: var(--bg);
  display: block;
  position: relative;
  overflow: visible;
  box-shadow: 0 0 80px rgba(198, 88, 1, 0.15);
}

#topbar {
  position: sticky;
  top: 0;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  min-height: calc(56px + var(--safe-t));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}
#topbar .brand-lock {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
#topbar .brand-lock img {
  width: 36px; height: 36px; border-radius: 10px;
}
#topbar h1 {
  margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#topbar .sub {
  font-size: 11px; color: var(--muted); font-weight: 600; margin-top: -1px;
}
.icon-btn {
  width: 40px; height: 40px; border: 0; background: var(--bg);
  border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--ink);
  position: relative; flex: 0 0 auto;
}
.icon-btn svg { width: 20px; height: 20px; }
.badge {
  position: absolute; top: 4px; right: 4px; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 99px;
  display: grid; place-items: center; padding: 0 4px;
}

#main {
  display: block;
  overflow: visible;
  padding-bottom: calc(var(--tab) + var(--safe-b) + 16px);
  min-height: calc(100vh - 120px);
}

#tabbar {
  position: fixed; left: 50%; right: auto; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 460px;
  height: calc(var(--tab) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  z-index: 30;
}
#tabbar button {
  border: 0; background: none; color: #9A8B80; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 10px; font-weight: 700;
  cursor: pointer; position: relative;
}
#tabbar button svg { width: 22px; height: 22px; }
#tabbar button.active { color: var(--brand); }
#tabbar .tb-badge {
  position: absolute; top: 6px; right: calc(50% - 18px);
  background: var(--brand); color: #fff; font-size: 9px; min-width: 15px; height: 15px;
  border-radius: 99px; display: grid; place-items: center; padding: 0 3px; font-weight: 800;
}

/* Home */
.hero {
  margin: 14px 16px 8px;
  background: linear-gradient(135deg, #C65801 0%, #E0892A 55%, #9A4300 100%);
  border-radius: 22px; padding: 22px 20px 20px; color: #fff; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -30px; bottom: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.hero .kicker { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; opacity: .9; }
.hero h2 { margin: 6px 0 4px; font-size: 24px; line-height: 1.15; font-weight: 800; }
.hero p { margin: 0 0 14px; font-size: 13px; opacity: .92; }
.hero .ar { font-family: var(--ar); font-size: 18px; font-weight: 700; opacity: .95; margin-bottom: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 800; border-radius: 999px;
  padding: 11px 16px; font-size: 13px;
}
.btn-light { background: #fff; color: var(--brand); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-ghost { background: var(--brand-s); color: var(--brand-d); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 15px; border-radius: 14px; }
.btn:active { transform: scale(.98); }

.search-wrap { padding: 12px 16px 4px; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; height: 46px;
}
.search-box input {
  border: 0; outline: 0; flex: 1; font-size: 14px; background: transparent; color: var(--ink);
}
.search-box svg { color: var(--muted); width: 18px; height: 18px; flex: 0 0 auto; }

.section { padding: 8px 0 4px; }
.section-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
}
.section-h h3 { margin: 0; font-size: 16px; font-weight: 800; }
.section-h .see { color: var(--brand); font-size: 12px; font-weight: 800; background: none; border: 0; cursor: pointer; }

.cats {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 10px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; width: 76px; text-align: center; cursor: pointer; background: none; border: 0; padding: 0; color: inherit;
}
.cat .av {
  width: 64px; height: 64px; border-radius: 20px; background: var(--card);
  box-shadow: var(--shadow); overflow: hidden; margin: 0 auto 6px;
  display: grid; place-items: center; border: 1px solid var(--line);
}
.cat .av img { width: 100%; height: 100%; object-fit: cover; }
.cat .av .emoji { font-size: 26px; }
.cat span { font-size: 11px; font-weight: 700; display: block; line-height: 1.2; color: var(--ink); }


/* Uniform app category image icons — app-only, not website homepage */
.cat .av.cat-av {
  background: linear-gradient(145deg, #FFFFFF 0%, #FFF8F1 100%);
  border: 1px solid #F1E3D7;
  box-shadow: 0 10px 24px rgba(92, 47, 13, .10);
}
.cat .av.cat-av img.cat-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(198,88,1,.10));
}
.cat:active .cat-img { transform: scale(.96); }
.row-link .ic.cat-list-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  overflow: hidden;
  background: #FFF8F1;
  color: var(--brand);
  border: 1px solid #F1E3D7;
  box-shadow: 0 6px 18px rgba(92,47,13,.08);
}
.row-link .ic.cat-list-icon img.cat-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}


.hscroll {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 14px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 16px 18px;
}

.pcard {
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); position: relative;
  cursor: pointer; text-align: left; padding: 0; color: inherit;
  display: flex; flex-direction: column;
}
.pcard.h {
  flex: 0 0 168px; width: 168px;
}
.pcard .img {
  aspect-ratio: 1; background: #F3EDE6; position: relative; overflow: hidden;
}
.pcard .img img { width: 100%; height: 100%; object-fit: cover; }
.pcard .body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard .name {
  font-size: 12.5px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px;
}
.pcard .prices { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pcard .now { font-size: 13.5px; font-weight: 800; color: var(--brand); }
.pcard .was { font-size: 11px; color: #A39890; text-decoration: line-through; }
.sale-tag {
  position: absolute; top: 8px; left: 8px; background: var(--sale); color: #fff;
  font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 999px; z-index: 2;
}
.wish {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center;
  cursor: pointer; z-index: 2; color: #9A8B80;
}
.wish.on { color: var(--sale); }
.wish svg { width: 16px; height: 16px; }

/* Product */
.gallery { position: relative; background: #fff; }
.gallery .slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery .slides::-webkit-scrollbar { display: none; }
.gallery .slides img { min-width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; scroll-snap-align: start; }
.dots-row { display: flex; gap: 6px; justify-content: center; padding: 10px 0 4px; }
.dots-row i { width: 7px; height: 7px; border-radius: 50%; background: #D9CFC6; }
.dots-row i.on { background: var(--brand); width: 18px; border-radius: 99px; }

.p-info { background: var(--card); padding: 16px 16px 8px; }
.p-info .cat-chip { font-size: 11px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .4px; }
.p-info h2 { margin: 6px 0 8px; font-size: 20px; line-height: 1.25; font-weight: 800; }
.p-info .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stars { color: #E0A100; font-size: 13px; font-weight: 700; }
.muted { color: var(--muted); font-size: 12px; }
.price-lg { font-size: 26px; font-weight: 800; color: var(--brand); margin: 10px 0 4px; }
.price-lg .was { font-size: 15px; color: #A39890; text-decoration: line-through; font-weight: 600; margin-left: 8px; }
.save { display: inline-block; background: #FDECEC; color: var(--sale); font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }

.block { background: var(--card); margin-top: 8px; padding: 16px; }
.block h3 { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.desc { font-size: 13.5px; line-height: 1.65; color: #3A322C; }
.desc ul { padding-left: 18px; }
.desc img { border-radius: 10px; margin: 8px 0; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink);
}
.chip.on { border-color: var(--brand); background: var(--brand-s); color: var(--brand-d); }

.qty {
  display: inline-flex; align-items: center; background: var(--bg); border-radius: 12px; overflow: hidden;
}
.qty button {
  width: 38px; height: 38px; border: 0; background: transparent; font-size: 18px; font-weight: 700; cursor: pointer;
}
.qty span { min-width: 28px; text-align: center; font-weight: 800; }

.sticky-buy {
  position: sticky; bottom: calc(var(--tab) + var(--safe-b));
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 10px 16px;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px;
}

/* Cart */
.cart-item {
  display: grid; grid-template-columns: 78px 1fr auto; gap: 10px;
  background: var(--card); border-radius: 16px; padding: 10px; margin: 0 16px 10px;
  border: 1px solid var(--line);
}
.cart-item img { width: 78px; height: 78px; object-fit: cover; border-radius: 12px; background: #F3EDE6; }
.cart-item .n { font-size: 13px; font-weight: 800; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item .pr { color: var(--brand); font-weight: 800; font-size: 13px; margin-top: 4px; }
.cart-item .rm { border: 0; background: none; color: var(--sale); font-size: 16px; cursor: pointer; }

.summary {
  margin: 8px 16px 16px; background: var(--card); border-radius: 16px; padding: 14px 16px; border: 1px solid var(--line);
}
.summary .line { display: flex; justify-content: space-between; margin: 6px 0; font-size: 13.5px; }
.summary .total { font-weight: 800; font-size: 16px; padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 8px; }

.form { padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 800; color: var(--muted); }
.field input, .field textarea, .field select {
  border: 1px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 12px 12px; font-size: 14px; outline: none; color: var(--ink);
}
.field input:focus, .field textarea:focus { border-color: var(--brand); }

.empty {
  text-align: center; padding: 48px 24px;
}
.empty .big { font-size: 48px; margin-bottom: 8px; }
.empty h3 { margin: 0 0 6px; }
.empty p { color: var(--muted); margin: 0 0 16px; font-size: 13.5px; }

.account-card {
  margin: 12px 16px; background: var(--card); border-radius: 18px; padding: 6px 0; border: 1px solid var(--line);
}
.row-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%;
  border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font-size: 14px; font-weight: 700;
}
.row-link .ic {
  width: 38px; height: 38px; border-radius: 12px; background: var(--brand-s); color: var(--brand);
  display: grid; place-items: center; flex: 0 0 auto;
}
.row-link .ic svg { width: 18px; height: 18px; }
.row-link .go { margin-left: auto; color: #C4B8AE; }

.profile-hero {
  margin: 14px 16px 4px; background: linear-gradient(135deg, #C65801, #9A4300);
  border-radius: 20px; padding: 20px; color: #fff; display: flex; gap: 14px; align-items: center;
}
.profile-hero img { width: 56px; height: 56px; border-radius: 16px; }
.profile-hero h2 { margin: 0 0 2px; font-size: 18px; }
.profile-hero p { margin: 0; opacity: .9; font-size: 12px; }

.webframe { height: 100%; display: flex; flex-direction: column; }
.webframe iframe { flex: 1; width: 100%; border: 0; background: #fff; min-height: 70vh; }

.skel {
  background: linear-gradient(90deg, #EFE7DF 25%, #F7F2EC 50%, #EFE7DF 75%);
  background-size: 200% 100%; animation: shine 1.2s infinite; border-radius: 12px;
}
@keyframes shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.toast-pop {
  position: fixed; left: 50%; bottom: calc(var(--tab) + var(--safe-b) + 18px);
  transform: translateX(-50%) translateY(20px); background: #1C1410; color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; z-index: 80; transition: .25s; white-space: nowrap;
  max-width: 90%;
}
.toast-pop.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[hidden] { display: none !important; }
.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed; inset: 0; background: rgba(20,10,0,.45); z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet .panel {
  width: 100%; max-width: 460px; background: #fff; border-radius: 22px 22px 0 0;
  padding: 12px 16px calc(18px + var(--safe-b));
}
.sheet .handle { width: 40px; height: 4px; background: #E5DBD2; border-radius: 99px; margin: 4px auto 12px; }
.install-banner {
  margin: 10px 16px 0; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; display: flex; align-items: center; gap: 10px;
}
.install-banner p { margin: 0; font-size: 12.5px; font-weight: 700; }
.install-banner .x { margin-left: auto; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }

.notice {
  margin: 8px 16px; background: #FFF6EC; border: 1px solid #F0D7B8; color: #7A4A12;
  border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
}

.filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.stock { font-size: 12px; font-weight: 800; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--sale); }

.fab-wa {
  position: fixed; right: calc(50% - 230px + 14px); bottom: calc(var(--tab) + var(--safe-b) + 16px);
  width: 52px; height: 52px; border-radius: 50%; background: var(--wa); color: #fff;
  border: 0; box-shadow: 0 10px 24px rgba(37,211,102,.4); display: grid; place-items: center;
  cursor: pointer; z-index: 25;
}
@media (max-width: 500px) {
  .fab-wa { right: 14px; }
}
.fab-wa svg { width: 26px; height: 26px; }

.back-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.back-title h1 { font-size: 16px; margin: 0; }

.order-card {
  margin: 0 16px 10px; background: var(--card); border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line);
}
.order-card .oh { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 700; }
.order-card .ot { font-weight: 800; margin-top: 4px; }

@media (min-width: 700px) {
  body { background: radial-gradient(1200px 600px at 50% -10%, #3a2416, #120c08); }
}



/* Live order, email and tracking upgrade — app-only */
.track-box {
  margin: 12px 16px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(80,40,10,.06);
}
.track-box h3 { margin: 0 0 4px; font-size: 16px; }
.track-box p { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.track-form { display:grid; grid-template-columns: 1fr 1fr auto; gap: 7px; align-items:center; }
.track-form input {
  width: 100%; border: 1px solid var(--line); background: #FFFDFB; border-radius: 12px;
  padding: 11px 10px; font-size: 12px; outline: 0;
}
.track-form .btn { padding: 11px 12px; border-radius: 12px; white-space: nowrap; }
.live-order .status-pill {
  background: #FFF2E5;
  border: 1px solid #F5D2AC;
  color: var(--brand-d);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}
.tracking-line {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #FFF8F0;
  color: #3C2A1B;
  font-size: 12px;
  line-height: 1.35;
}
.notice.error { border-color:#F3B0B0; background:#FFF1F1; color:#8A1F1F; }
button[disabled] { opacity: .68; cursor: not-allowed; }
@media (max-width: 390px) { .track-form { grid-template-columns: 1fr; } }
