/* =============================================================================
   موقع الزبون — نفس لغة تصميم تطبيق users (Material 2، Cairo، الأزرق #04A1FD)
   -----------------------------------------------------------------------------
   الألوان من lib/const.dart، والأحجام والزوايا من الويدجتات نفسها:
   بطاقة المتجر 10px + ظل رمادي خفيف، صورة الصنف 20px، مربعات الأقسام
   grey[200] بزاوية 20، أزرار الشريط دوائر على grey[200] أو أزرق 10%.
   ========================================================================== */

@font-face { font-family: "Cairo"; src: url("../assets/fonts/Cairo-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("../assets/fonts/Cairo-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("../assets/fonts/Cairo-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --primary: #04A1FD;          /* primaryblue */
  --primary-10: rgba(4, 161, 253, .1);
  --primary-dark: #0288D1;
  --ink2: #2E3337;             /* primaryblue2 */
  --blue3: #368BD1;            /* primaryblue3 */
  --grey: #7A7A7A;             /* primarygrey */
  --red-soft: #DA7D7D;         /* primaryred */
  --pink: #E858ED;             /* primarypink */
  --whatsapp: #015E53;

  --text: rgba(0, 0, 0, .87);
  --text-2: rgba(0, 0, 0, .6);
  --g50: #FAFAFA;
  --g100: #F5F5F5;
  --g200: #EEEEEE;
  --g300: #E0E0E0;
  --g400: #BDBDBD;
  --g500: #9E9E9E;
  --g600: #757575;
  --bg: #FAFAFA;               /* Scaffold في Material 2 = grey[50] */
  --error-bg: #F4F6F9;
  --red: #F44336;
  --green: #4CAF50;
  --orange: #FF9800;

  --r-card: 10px;
  --r-img: 20px;
  --shadow-card: 0 1px 1px 1px rgba(158, 158, 158, .3);
  --shadow-tile: 1px 1px 10px rgba(0, 0, 0, .26);
  --shadow-2: 0 3px 6px rgba(0, 0, 0, .16), 0 3px 6px rgba(0, 0, 0, .23);

  --maxw: 640px;               /* الموقع بعرض تطبيق الجوال حتى على الشاشات الكبيرة */
  --nav-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #F2F2F2;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }

/* أيقونات Material — نفس مجموعة Icons في فلاتر */
.mi {
  font-family: "Material Icons";
  font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1;
  display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow: hidden; width: 1em; height: 1em; /* لا يظهر اسم الأيقونة قبل تحميل الخط */
}
.mi.o { font-family: "Material Icons Outlined"; }
.mi.sm { font-size: 20px; }
.mi.xs { font-size: 16px; }
[dir="rtl"] .mi.flip { transform: scaleX(-1); }

/* ---- الهيكل ---------------------------------------------------------------- */

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 24px rgba(0, 0, 0, .06);
}
.page { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(24px + var(--safe-b)); }
.page.has-nav { padding-bottom: calc(var(--nav-h) + 24px + var(--safe-b)); }
.page.has-bottombar { padding-bottom: calc(50px + 24px + var(--safe-b)); }
.pad { padding: 0 10px; }
.center-pad { display: flex; justify-content: center; padding: 40px 0; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.gap5 { gap: 5px; } .gap10 { gap: 10px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--g600); }
.bold { font-weight: 700; }
.blue { color: var(--primary); }
.red { color: var(--red); }
.green { color: var(--green); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

/* ---- شريط التطبيق الأبيض (MyAppBarHome) ----------------------------------- */

.appbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
  position: sticky; top: 0; z-index: 20;
}
.appbar .side { display: flex; align-items: center; min-width: 0; }
.circle-btn {
  width: 48px; height: 48px; margin: 10px;
  border-radius: 100px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--g200);
  color: rgba(0, 0, 0, .54);
  flex: none;
  transition: background .15s;
}
.circle-btn:active { background: var(--g300); }
.circle-btn.blue { background: var(--primary-10); color: var(--primary); }
.appbar .username { color: var(--primary); font-size: 16px; font-weight: 700; }
.appbar .login-link { color: var(--text); }
.circle-btn .badge, .fab .badge, .nav-item .badge {
  position: absolute; top: 2px; inset-inline-end: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}
.circle-btn { position: relative; }

/* شريط Material الأزرق (شاشات الدخول) */
.mat-appbar {
  height: 56px; background: var(--primary); color: #fff;
  display: flex; align-items: center; gap: 8px; padding: 0 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  position: sticky; top: 0; z-index: 20;
}
.mat-appbar h1 { font-size: 20px; font-weight: 600; flex: 1; padding: 0 12px; }
.mat-appbar .icon-btn { color: #fff; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:active { background: rgba(0, 0, 0, .08); }

/* ---- العناوين ------------------------------------------------------------- */

.title-blue { color: var(--primary); font-weight: 700; font-size: 18px; padding: 10px; margin-top: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 10px; }
.section-head h2 { color: var(--primary); font-size: 18px; font-weight: 700; }

/* ---- قوائم أفقية ---------------------------------------------------------- */

.hscroll {
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; padding: 5px 10px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

/* مربع قسم الخدمات (buildImageTalabHome) */
.cat-tile { width: calc(min(100vw, var(--maxw)) / 5.8); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cat-tile .box {
  width: 100%; height: 80px; padding: 10px;
  background: var(--g200); border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
}
.cat-tile .box img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.cat-tile span { font-weight: 700; font-size: 12px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* بطاقة نوع الخدمة (buildImageTalab) */
.type-tile {
  width: 150px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-tile);
  margin-bottom: 10px; overflow: hidden; text-align: center;
}
.type-tile img { width: 150px; height: 100px; object-fit: cover; border-radius: 10px; display: block; }
.type-tile span { display: block; font-weight: 700; padding: 15px 4px 6px; }

/* ---- بطاقة المتجر (ServicesList) ------------------------------------------ */

.service-card {
  width: 250px; height: 210px; margin: 10px 0;
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  text-align: start;
}
.service-card .cover { width: 100%; height: 110px; object-fit: cover; border-radius: 10px 10px 0 0; display: block; background: var(--g200); }
.service-card .name { font-weight: 700; padding: 10px 10px 0; }
.service-card .desc { font-size: 13px; padding: 0 10px; color: var(--text-2); }
.service-card .foot { margin-top: auto; border-top: 1px dashed var(--g400); display: flex; align-items: center; gap: 4px; padding: 0 4px 2px; font-size: 13px; }
.service-card .foot .type-ic { width: 32px; height: 32px; flex: none; }
.service-card .foot .time { margin-inline-start: 6px; }
.service-card .foot .mi { color: var(--g500); }
.service-card .foot .all { color: var(--primary); }
.service-card .foot .time { color: var(--g600); direction: ltr; }
.service-card .loc {
  position: absolute; top: 18px; inset-inline-start: 18px;
  width: 36px; height: 36px; border-radius: 20px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.service-card.wide { width: 100%; height: auto; min-height: 210px; margin: 0; }
.service-card.wide .cover { height: 150px; }
.service-card.closed .cover { filter: grayscale(.8); }
.service-card .closed-tag { position: absolute; top: 12px; inset-inline-end: 12px; background: rgba(0,0,0,.65); color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 12px; }

.grid-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 10px; }

/* ---- السلايدر ------------------------------------------------------------- */

.slider { position: relative; margin-top: 10px; }
.slider .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.slider .track::-webkit-scrollbar { display: none; }
.slider .slide { flex: 0 0 100%; scroll-snap-align: center; padding: 0 15px 20px; position: relative; display: flex; justify-content: center; }
.slider .slide .frame { width: 100%; height: 240px; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,.25); background: var(--g300); }
.slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider .slide .cap { position: absolute; left: 30px; right: 30px; font-weight: 700; color: #fff; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.slider .slide .cap.top { top: 14px; } .slider .slide .cap.center { top: 50%; transform: translateY(-60%); } .slider .slide .cap.bottom { bottom: 34px; }
.slider .dots { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.slider .dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--g400); transition: width .2s; }
.slider .dots i.on { width: 16px; background: var(--primary); }

/* ---- صفحة المتجر ---------------------------------------------------------- */

.store-head { position: relative; }
.store-head .cover { width: 100%; height: 200px; object-fit: cover; display: block; background: var(--g200); }
.store-info { padding: 10px; }
.store-info h1 { font-size: 20px; color: var(--primary); font-weight: 700; }
.store-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--g600); font-size: 13px; margin-top: 4px; }
.store-meta span { display: inline-flex; align-items: center; gap: 4px; }
.store-meta .mi { color: var(--primary); font-size: 18px; }

.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px; position: sticky; top: 68px; z-index: 15; background: #fff; scrollbar-width: none; border-bottom: 1px solid var(--g200); }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab { flex: none; padding: 6px 16px; border-radius: 20px; background: var(--g200); font-weight: 600; font-size: 13px; white-space: nowrap; }
.cat-tab.active { background: var(--primary); color: #fff; }

/* صف الصنف (ItemsList) */
.item-row {
  display: flex; gap: 0; align-items: center;
  background: var(--g50); border-radius: 4px;
  margin: 4px; cursor: pointer;
  transition: transform .7s ease;
}
.item-row.bump { transform: translateX(-30px); transition: transform .35s ease; }
[dir="ltr"] .item-row.bump { transform: translateX(30px); }
.item-row .thumb { width: 150px; height: 100px; border-radius: 20px; overflow: hidden; flex: none; background: var(--g200); position: relative; }
.item-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-row .in-cart { position: absolute; top: 6px; inset-inline-start: 6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 22px; padding: 0 6px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.item-row .body { flex: 1; min-width: 0; padding: 8px 16px; overflow: hidden; }
.item-row .name { font-size: 14px; color: var(--text); }
.item-row .cat { font-size: 14px; color: var(--text-2); }
.item-row .prices { display: flex; flex-direction: column; align-items: center; width: fit-content; }
.item-row .p { font-size: 15px; font-weight: 600; color: var(--primary); }
.item-row .p.strike { text-decoration: line-through; }
.item-row .p.final { color: var(--green); }
.qty-ctl { display: inline-flex; align-items: center; gap: 8px; }
.qty-ctl .q { min-width: 18px; text-align: center; font-weight: 700; }
.round-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #fff; flex: none;
}
.round-btn .mi { font-size: 20px; }
.round-btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.round-btn:disabled { opacity: .4; }
.discount-tag { background: var(--red); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 8px; font-weight: 700; }

/* ---- تفاصيل الصنف --------------------------------------------------------- */

.gallery { position: relative; height: 330px; background: var(--g200); }
.gallery .track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gallery .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gallery .dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.6); }
.gallery .dots i.on { background: #fff; width: 18px; }
.gallery .float-back { position: absolute; top: 0; inset-inline-start: 0; }

.card { background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.14); margin: 4px 0 8px; overflow: hidden; }
.card-title { text-align: center; padding: 6px 10px; }
.divider { height: 1px; background: rgba(0,0,0,.12); }
.tile { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 56px; cursor: pointer; }
.tile .grow { font-size: 14px; }
.tile .trail { color: var(--primary); direction: ltr; }
.tile input[type=checkbox], .tile input[type=radio] { width: 20px; height: 20px; accent-color: var(--primary); margin: 0 6px; flex: none; }

.bottom-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  height: calc(50px + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 15px;
  box-shadow: 0 0 3px var(--g500); z-index: 30; font-size: 18px;
}
.bottom-bar .count { background: var(--green); color: #fff; border-radius: 10px; min-width: 20px; padding: 0 6px; font-size: 12px; text-align: center; }
.bottom-bar.disabled { background: var(--g500); }

/* ---- الأزرار والحقول ------------------------------------------------------ */

.btn-primary {
  background: var(--primary); color: #fff; border-radius: 4px;
  height: 44px; padding: 0 18px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 2px 2px rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.12), 0 1px 5px rgba(0,0,0,.2);
}
.btn-primary.block { width: 100%; }
.btn-primary.round { border-radius: 25px; }
.btn-primary.sm { height: 36px; font-size: 13px; padding: 0 14px; }
.btn-primary:disabled { background: var(--g400); box-shadow: none; }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); border-radius: 4px; height: 40px; padding: 0 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; background: #fff; }
.btn-text { color: var(--primary); padding: 8px 12px; border-radius: 4px; font-weight: 600; }
.btn-text.grey { color: var(--g500); }
.btn-elev { color: #fff; padding: 8px 16px; border-radius: 4px; font-weight: 600; box-shadow: 0 2px 2px rgba(0,0,0,.2); }

.field { display: block; margin: 10px 0; }
.field label { display: block; font-size: 13px; color: var(--g600); margin-bottom: 4px; }
.input {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1px solid var(--g400); border-radius: 10px; background: #fff;
  outline: none; transition: border-color .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--primary); border-width: 2px; padding: 0 13px; }
textarea.input:focus { padding: 9px 13px; }
.input-icon { position: relative; }
/* اتجاه صريح لا inset-inline: ‎.mi‎ نفسها direction:ltr فتنقلب الخاصية المنطقية */
.input-icon .mi { position: absolute; top: 13px; right: 12px; color: var(--g500); pointer-events: none; }
[dir="ltr"] .input-icon .mi { right: auto; left: 12px; }
.input-icon .input { padding-inline-start: 44px; }
.input-icon .input:focus { padding-inline-start: 43px; }
.field .err { color: var(--red); font-size: 12px; margin-top: 2px; }

/* ---- القائمة السفلية ------------------------------------------------------ */

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; display: flex; z-index: 30;
  box-shadow: 0 -1px 8px rgba(0,0,0,.12);
}
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--g600); font-size: 12px; position: relative; }
.nav-item.active { color: var(--primary); font-size: 14px; }
.nav-item .badge { top: 4px; inset-inline-end: calc(50% - 22px); }

.fab {
  position: fixed; z-index: 29;
  bottom: calc(var(--nav-h) + 16px + var(--safe-b));
  inset-inline-end: max(16px, calc((100vw - var(--maxw)) / 2 + 16px));
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-2);
}
.fab.low { bottom: calc(16px + var(--safe-b)); }
.fab.above-bar { bottom: calc(50px + 16px + var(--safe-b)); }

/* ---- القائمة الجانبية (Drawer) -------------------------------------------- */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.54); z-index: 60; opacity: 0; transition: opacity .2s; }
.drawer-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 304px; max-width: 85vw;
  background: #fff; z-index: 61; overflow-y: auto;
  transform: translateX(100%); transition: transform .22s ease-out;
  box-shadow: 0 8px 10px rgba(0,0,0,.2);
}
[dir="ltr"] .drawer { transform: translateX(-100%); }
.drawer.open { transform: none !important; }
/* هيدر cDrawerUsers: أبيض بظل خفيف، صورة دائرية بإطار أزرق، كبسولة الرصيد */
.drawer-head { background: #fff; padding: 40px 20px 20px; display: flex; align-items: center; gap: 15px; box-shadow: 0 5px 10px rgba(0,0,0,.05); margin-bottom: 10px; }
.drawer-head .avatar { width: 68px; height: 68px; border-radius: 50%; border: 2px solid rgba(4,161,253,.5); background: var(--primary); color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.drawer-head .avatar img { width: 100%; height: 100%; object-fit: cover; }
.drawer-head .n { font-weight: 700; font-size: 18px; color: rgba(0,0,0,.87); }
.drawer-head .e { font-size: 13px; color: var(--g600); }
.drawer-head .bal { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 20px; background: var(--primary-10); color: var(--primary); font-weight: 700; }
.drawer-item { display: flex; align-items: center; gap: 24px; padding: 0 16px; height: 52px; margin: 4px 16px; border-radius: 12px; color: #616161; font-size: 15px; font-weight: 500; width: calc(100% - 32px); text-align: start; }
.drawer-item .mi { font-size: 28px; }
.drawer-item.active { background: var(--primary-10); color: var(--primary); font-weight: 700; }
.drawer-item.danger { color: #EF5350; }

/* ---- الحوارات والتحميل ---------------------------------------------------- */

#overlay-root { position: relative; z-index: 100; }
.dlg-backdrop, .loading-backdrop, .sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.54); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .15s ease-out;
}
.dlg-backdrop.out, .sheet-backdrop.out { opacity: 0; transition: opacity .15s; }
.dlg { background: #fff; border-radius: 15px; width: 100%; max-width: 340px; padding: 20px 24px 8px; box-shadow: 0 11px 15px rgba(0,0,0,.2); animation: pop .18s ease-out; }
.dlg-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.dlg-body { color: var(--text-2); font-size: 15px; white-space: pre-line; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 0 8px; }
.loading-backdrop { background: rgba(0,0,0,.25); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--primary-10); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.sheet-backdrop { align-items: flex-end; padding: 0; }
.sheet { background: #fff; width: 100%; max-width: var(--maxw); border-radius: 16px 16px 0 0; max-height: 85vh; overflow-y: auto; padding: 8px 16px calc(16px + var(--safe-b)); animation: up .2s ease-out; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--g300); margin: 4px auto 12px; }

#snackbar {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + var(--safe-b));
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #323232; color: #fff; border-radius: 4px; padding: 12px 16px;
  min-width: 260px; max-width: min(92vw, 560px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: all .2s; z-index: 120; box-shadow: 0 3px 5px rgba(0,0,0,.2);
}
#snackbar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#snackbar button { color: #FFC107; font-weight: 700; }

.empty { text-align: center; padding: 48px 20px; color: var(--g600); }
.empty .mi { font-size: 56px; color: var(--g400); }
.empty p { margin: 8px 0 14px; }

.img { opacity: 0; transition: opacity .25s; }
.img.ok { opacity: 1; }
.shimmer { background: linear-gradient(90deg, var(--g200) 25%, var(--g100) 37%, var(--g200) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- التبويبات (TabBar) --------------------------------------------------- */

.tabs { display: flex; background: var(--primary); position: sticky; top: 0; z-index: 18; }
.tabs button { flex: 1; color: rgba(255,255,255,.7); height: 46px; font-weight: 600; border-bottom: 2px solid transparent; }
.tabs button.active { color: #fff; border-bottom-color: #fff; }
.tabs.light { background: #fff; border-bottom: 1px solid var(--g200); }
.tabs.light button { color: var(--g600); }
.tabs.light button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- جدول المبالغ (buildcartprice) ---------------------------------------- */

.price-box { background: #fff; margin: 10px; border-radius: 10px; box-shadow: var(--shadow-card); padding: 6px 14px; }
.price-box .line { display: flex; justify-content: space-between; padding: 6px 0; }
.price-box .line + .line { border-top: 1px solid var(--g200); }
.price-box .line.total { font-weight: 700; color: var(--primary); font-size: 16px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 14px; font-size: 12px; font-weight: 600; background: var(--g200); }
.chip.blue { background: var(--primary-10); color: var(--primary); }
.chip.green { background: #E8F5E9; color: #2E7D32; }
.chip.orange { background: #FFF3E0; color: #E65100; }
.chip.red { background: #FFEBEE; color: #C62828; }

/* ---- شاشات واسعة ---------------------------------------------------------- */
@media (min-width: 700px) {
  body { background: #E9EDF2; }
}
/* iOS يكبّر الصفحة تلقائياً عند لمس حقل خطه أصغر من 16px، ويبقى التكبير بعد
   الانتقال — فتظهر الرئيسية «مأكولاً» طرفها بعد التسجيل/الدخول حتى يُعاد فتح
   الصفحة. على iOS فقط (لا يتغير شكل سطح المكتب)، وimportant لتغلب الحقول
   ذات الخط المحدد (.af-signup 15px، co-field 14px، …). */
@supports (-webkit-touch-callout: none) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- دكاكين المشاهير (celebrityshop.dart) ---------------------------------
   نسب التصميم إلى عرض الشاشة (863px في لقطة التصميم): البطاقة 198×316،
   الفاصل 13، الهامش 19، والعرض بين 82 و132. داخل البطاقة cqw = 1% من عرضها،
   والمواضع الرأسية % من ارتفاعها — نفس كسور CelebrityShopCard. */

.shops { --sw: min(100vw, var(--maxw)); padding-top: 14px; }
.shops-head { display: flex; align-items: center; gap: 6px; padding: 0 14px; height: 24px; }
.shops-head .star { color: #FFB300; font-size: 22px; }
.shops-head h2 { font-size: 17px; line-height: 1.2; font-weight: 700; color: #1E1A2E; }
.see-all { color: var(--primary); font-size: 14px; line-height: 1.2; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; padding: 0 2px; }
.see-all .mi { font-size: 14px; }
[dir="ltr"] .flip-ltr { transform: scaleX(-1); }
.shops-row { padding: 5px calc(var(--sw) * 19 / 863) 6px; gap: calc(var(--sw) * 13 / 863); scroll-snap-type: none; }
/* بطاقة التصميم المعتمد (1024×1536): إطار أبيض مدوّر — أعلى 32، جانبان 48،
   أسفل 64 — وبداخله صورة الدكان (928×1437) بزوايا مدوّرة. */
.shop-card {
  --w: clamp(82px, calc(var(--sw) * 198 / 863), 132px);
  --px: calc(var(--w) * 48 / 1024);
  width: var(--w); height: calc((var(--w) - 2 * var(--px)) * 1437 / 928 + var(--w) * 96 / 1024);
  padding: calc(var(--w) * 32 / 1024) var(--px) calc(var(--w) * 64 / 1024);
  border-radius: calc(var(--w) * .07);
  background: #fff; position: relative; display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
}
.shop-in {
  position: relative; display: block; width: 100%; height: 100%;
  border-radius: calc(var(--w) * .045); overflow: hidden;
  background: url("../assets/img/celebrity_shop.jpg") center / 100% 100% no-repeat;
  container-type: inline-size; direction: ltr;
}
.shop-card:active { filter: brightness(.95); }
.shop-in .fit { position: absolute; left: calc(36.1cqw - 28cqw); width: 56cqw; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.shop-in .fit b { display: block; white-space: nowrap; line-height: 1; font-weight: 700; transform-origin: center; }
.shop-title { top: calc(24.2% - 11cqw); height: 22cqw; }
.shop-title b { font-size: 15cqw; color: #2A1A10; }
.shop-name { top: calc(35.6% - 7.5cqw); height: 15cqw; }
.shop-name b { font-size: 8.8cqw; color: #1E140C; }
.shop-ava {
  position: absolute; left: calc(79.9cqw - 20cqw); top: calc(28.85% - 20cqw);
  width: 40cqw; height: 40cqw; border-radius: 50%; overflow: hidden;
  border: clamp(1px, .7cqw, 3px) solid #C9A45C;
  background: var(--cgrad, linear-gradient(225deg, #7B2FF7, #F107A3));
}
.shop-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
