/* ===== Sourc app — أنماط الموبايل ===== */
:root {
  --navy: #0a1626;
  --navy-800: #0d2036;
  --navy-700: #12324f;
  --navy-600: #1a3a5c;
  --gold: #c9a45c;
  --gold-light: #e3c98f;
  --gold-dark: #a9853f;
  --ivory: #faf8f4;
  --sand: #f1ece3;
  --ink: #191917;
  --muted: #6d6a63;
  --line: #e6e0d4;
  --white: #fff;
  --green: #1f8a5b;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --sh-sm: 0 2px 10px rgba(13, 32, 54, .06);
  --sh-md: 0 10px 26px rgba(13, 32, 54, .10);
  --sh-lg: 0 24px 60px rgba(13, 32, 54, .18);
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: Cairo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Amiri, Cairo, serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold-light); }

.app { min-height: 100dvh; display: flex; flex-direction: column; }
.view {
  flex: 1;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  outline: none;
}
.wrap { padding: 0 14px; }

/* ===== boot splash ===== */
.boot {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity .35s ease, visibility .35s;
}
.boot img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.boot-name { color: var(--gold-light); font-family: var(--font-display); font-size: 26px; letter-spacing: .5px; }
.boot-bar { width: 96px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--gold); animation: bootslide 1.1s ease-in-out infinite; }
@keyframes bootslide { 0% { transform: translateX(-120%); } 100% { transform: translateX(260%); } }
.boot.hide { opacity: 0; visibility: hidden; }

/* ===== top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 500;
  padding-top: var(--safe-t);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-800) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(201, 164, 92, .28);
}
.topbar-in {
  height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.tb-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tb-brand img { width: 30px; height: 30px; border-radius: 8px; }
.tb-brand b { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: #fff; letter-spacing: .3px; }
.tb-title { font-size: 16px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-sub { font-size: 11.5px; color: rgba(255, 255, 255, .62); margin-top: -3px; }
.tb-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; background: rgba(255, 255, 255, .08); flex: 0 0 auto;
}
.tb-btn:active { background: rgba(255, 255, 255, .18); }
.tb-spacer { flex: 1; }
.tb-grow { flex: 1; min-width: 0; }

/* ===== home hero ===== */
.hero {
  margin: 12px 14px 6px;
  border-radius: var(--r-lg);
  padding: 20px 18px 18px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(201, 164, 92, .28) 0%, rgba(201, 164, 92, 0) 55%),
    linear-gradient(160deg, var(--navy-700) 0%, var(--navy) 70%);
  color: #fff;
  box-shadow: var(--sh-md);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset-inline-start: -30px; bottom: -50px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 164, 92, .25), transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--gold-light);
  background: rgba(201, 164, 92, .14); border: 1px solid rgba(201, 164, 92, .32);
  padding: 4px 10px; border-radius: 999px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 25px; line-height: 1.35; margin: 12px 0 8px; font-weight: 700;
}
.hero h1 span { color: var(--gold-light); }
.hero p { font-size: 13px; color: rgba(255, 255, 255, .76); margin: 0 0 16px; line-height: 1.75; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 14px;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.975); }
.btn-gold { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #241a06; box-shadow: 0 8px 18px rgba(201, 164, 92, .3); }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.btn-navy { background: var(--navy-700); color: #fff; }
.btn-wa { background: #1f8a5b; color: #fff; }
.btn-line { background: #fff; border: 1px solid var(--line); color: var(--navy-700); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.stats { display: flex; gap: 8px; margin-top: 16px; }
.stat {
  flex: 1; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px; padding: 8px 6px; text-align: center;
}
.stat b { display: block; font-size: 16px; color: var(--gold-light); }
.stat span { font-size: 10.5px; color: rgba(255, 255, 255, .66); }

/* ===== search bar ===== */
.searchbox {
  display: flex; align-items: center; gap: 9px;
  margin: 10px 14px 4px; padding: 0 14px; height: 46px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--sh-sm); color: var(--muted); font-size: 13.5px;
}
.searchbox:active { border-color: var(--gold); }
.searchbox svg { flex: 0 0 auto; color: var(--navy-600); }

/* ===== section head ===== */
.sec { margin-top: 20px; }
.sec-head { display: flex; align-items: baseline; gap: 8px; padding: 0 14px; margin-bottom: 10px; }
.sec-head h2 { font-size: 16.5px; margin: 0; font-weight: 800; color: var(--navy); }
.sec-head .more { margin-inline-start: auto; font-size: 12.5px; color: var(--gold-dark); font-weight: 700; }

/* ===== categories ===== */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 14px; }
.cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sh-sm);
  transition: transform .12s ease;
}
.cat-card:active { transform: scale(.98); }
.cat-ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(201, 164, 92, .16), rgba(201, 164, 92, .05));
  color: var(--gold-dark);
}
.cat-ico svg { width: 21px; height: 21px; }
.cat-card h3 { font-size: 13.5px; margin: 0; font-weight: 700; color: var(--navy); line-height: 1.4; }
.cat-card .cnt { font-size: 11px; color: var(--muted); margin-top: -3px; }

/* ===== product grid ===== */
.p-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 14px; }
.p-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--sh-sm); position: relative;
}
.p-card:active { transform: scale(.985); }
.p-media {
  position: relative; background: #fff; aspect-ratio: 1 / 1; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.p-media img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .35s ease; }
.p-media img.ready { opacity: 1; }
.p-media::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, #f4f1ea 20%, #fbf9f5 40%, #f4f1ea 60%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.p-media.ready::before { display: none; }
@keyframes shimmer { 0% { background-position: 140% 0; } 100% { background-position: -40% 0; } }
.p-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.p-name { font-size: 12.5px; font-weight: 600; line-height: 1.45; color: var(--ink); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.p-meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-add {
  position: absolute; inset-inline-end: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line); color: var(--navy-700);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(13, 32, 54, .12); z-index: 2;
}
.p-add:active { background: var(--gold); color: #241a06; }
.p-add.in { background: var(--green); border-color: var(--green); color: #fff; }

/* ===== chips / filters ===== */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 14px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 34px; padding: 0 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600;
  color: var(--navy-700); display: inline-flex; align-items: center; gap: 5px;
}
.chip b { font-weight: 600; font-size: 10.5px; color: var(--muted); }
.chip.on { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.chip.on b { color: rgba(255, 255, 255, .7); }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px 4px; }
.toolbar .count { font-size: 12px; color: var(--muted); }
.toolbar .spacer { flex: 1; }
.tool-btn {
  height: 34px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--navy-700); display: inline-flex; align-items: center; gap: 6px;
}
.tool-btn.on { border-color: var(--gold); color: var(--gold-dark); background: rgba(201, 164, 92, .08); }

/* ===== product detail ===== */
.gallery { position: relative; background: #fff; }
.gal-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; display: grid; place-items: center; background: #fff; }
.gal-slide img { width: 100%; height: 100%; object-fit: contain; }
.gal-dots { position: absolute; inset-inline: 0; bottom: 10px; display: flex; gap: 5px; justify-content: center; }
.gal-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(13, 32, 54, .22); }
.gal-dots i.on { background: var(--gold); width: 16px; border-radius: 4px; }

.pd { padding: 14px 14px 0; }
.pd-brand {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  color: var(--gold-dark); background: rgba(201, 164, 92, .1); border: 1px solid rgba(201, 164, 92, .3);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 8px;
}
.pd h1 { font-size: 18px; line-height: 1.5; margin: 0 0 6px; color: var(--navy); font-weight: 800; }
.pd-cat { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.specs { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px; }
.specs .row { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.specs .row:last-child { border-bottom: 0; }
.specs .k { color: var(--muted); flex: 0 0 96px; font-size: 12.5px; }
.specs .v { color: var(--ink); font-weight: 600; }
.note {
  display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--navy-700);
  background: rgba(31, 138, 91, .07); border: 1px solid rgba(31, 138, 91, .2);
  border-radius: var(--r-md); padding: 10px 12px; line-height: 1.6; margin-bottom: 14px;
}
.note svg { flex: 0 0 auto; margin-top: 1px; color: var(--green); }
.desc { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 0 0 14px; }

.stickybar {
  position: fixed; inset-inline: 0; bottom: calc(var(--tab-h) + var(--safe-b));
  display: flex; gap: 8px; padding: 9px 12px; z-index: 400;
  background: rgba(250, 248, 244, .94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.stickybar .btn { flex: 1; height: 48px; }
.stickybar .btn.icon { flex: 0 0 52px; }

/* ===== cart / quote ===== */
.q-item { display: flex; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px; margin: 0 14px 9px; }
.q-thumb { width: 74px; height: 74px; border-radius: 10px; background: #fff; border: 1px solid var(--line); overflow: hidden; flex: 0 0 auto; }
.q-thumb img { width: 100%; height: 100%; object-fit: contain; }
.q-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.q-name { font-size: 12.5px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-sub { font-size: 11px; color: var(--muted); }
.q-row { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.qty button { width: 30px; height: 30px; display: grid; place-items: center; color: var(--navy-700); font-size: 16px; font-weight: 700; }
.qty button:active { background: var(--sand); }
.qty span { min-width: 26px; text-align: center; font-size: 12.5px; font-weight: 700; }
.q-del { margin-inline-start: auto; color: #b4483c; font-size: 11.5px; font-weight: 700; padding: 4px 2px; }

.field { margin: 0 14px 10px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--navy-700); margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: #fff; font-size: 13.5px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { min-height: 74px; resize: vertical; }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

.summary { margin: 6px 14px 14px; background: #fff; border: 1px dashed var(--gold); border-radius: var(--r-md); padding: 12px; font-size: 12.5px; color: var(--navy-700); line-height: 1.9; }
.summary b { color: var(--navy); }

/* ===== empty state ===== */
.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .ico { width: 62px; height: 62px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; margin: 0 auto 14px; color: var(--gold-dark); }
.empty h3 { font-size: 15px; color: var(--navy); margin: 0 0 6px; }
.empty p { font-size: 12.5px; margin: 0 0 16px; line-height: 1.7; }

/* ===== tab bar ===== */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 600;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--navy-700); }
.tab.on svg { color: var(--gold-dark); }
.tab .badge {
  position: absolute; top: 5px; inset-inline-start: 50%; margin-inline-start: 6px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold);
  color: #241a06; font-size: 10px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ===== bottom sheet ===== */
.sheetwrap { position: fixed; inset: 0; z-index: 800; }
.sheetbg { position: absolute; inset: 0; background: rgba(10, 22, 38, .48); animation: fadein .2s ease; }
.sheet {
  position: absolute; inset-inline: 0; bottom: 0; max-height: 82dvh; overflow-y: auto;
  background: var(--ivory); border-radius: 22px 22px 0 0; padding: 8px 0 calc(14px + var(--safe-b));
  animation: sheetup .26s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -12px 40px rgba(10, 22, 38, .2);
}
.sheet::before { content: ""; display: block; width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 10px; }
@keyframes sheetup { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.sheet h3 { font-size: 15px; margin: 0 16px 10px; color: var(--navy); }
.facet { padding: 0 16px 12px; }
.facet h4 { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.facet .opts { display: flex; flex-wrap: wrap; gap: 7px; }
.sheet-actions { display: flex; gap: 8px; padding: 12px 16px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.sheet-actions .btn { flex: 1; }

/* ===== toast ===== */
.toast {
  position: fixed; inset-inline: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 70px);
  margin: 0 auto; width: max-content; max-width: 88%;
  background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px; z-index: 900;
  opacity: 0; transform: translateY(10px); transition: opacity .22s, transform .22s;
  pointer-events: none; box-shadow: var(--sh-lg); text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== to top ===== */
.totop {
  position: fixed; inset-inline-end: 14px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  width: 42px; height: 42px; border-radius: 50%; z-index: 450;
  background: rgba(13, 32, 54, .9); color: #fff; display: grid; place-items: center;
  box-shadow: var(--sh-md); backdrop-filter: blur(6px);
}
.totop[hidden] { display: none; }

/* ===== loader ===== */
.loader { display: flex; justify-content: center; padding: 26px 0; color: var(--muted); font-size: 12.5px; }
.spin { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== more page ===== */
.mlist { margin: 10px 14px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.mitem { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--navy); width: 100%; text-align: start; }
.mitem:last-child { border-bottom: 0; }
.mitem .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sand); color: var(--gold-dark); flex: 0 0 auto; }
.mitem .sub { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: -2px; }
.mitem .arrow { margin-inline-start: auto; color: var(--muted); }
.about { padding: 14px; font-size: 13px; color: var(--muted); line-height: 1.9; }
.about b { color: var(--navy); }
.steps { display: flex; flex-direction: column; gap: 9px; padding: 0 14px; }
.step { display: flex; gap: 11px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.step .num { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-700); color: var(--gold-light); display: grid; place-items: center; font-size: 12.5px; font-weight: 800; flex: 0 0 auto; }
.step h4 { margin: 0 0 2px; font-size: 13.5px; color: var(--navy); }
.step p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }

.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 22px 20px 8px; line-height: 1.8; }
