/* =========================================================
   المنزل الذكي للتسوق — Smart Home Shopping
   Design system: premium, understated, bilingual (AR-RTL / FR-LTR)
   ========================================================= */

:root {
  --ink: #17191d;
  --ink-2: #23262b;
  --ink-3: #3a3e45;
  --paper: #f6f4f0;
  --surface: #ffffff;
  --line: #e7e2d9;
  --line-2: #efebe3;
  --text: #23262b;
  --muted: #5b5f66;
  --brass: #a9834f;
  --brass-deep: #8a6a3e;
  --brass-soft: #f3ece1;
  --wa-green: #1d9e5f;
  --wa-green-deep: #158348;
  --danger: #b4383e;
  --ok: #1d9e5f;
  --warn: #c07a1f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(23, 25, 29, .05), 0 8px 28px rgba(23, 25, 29, .07);
  --shadow-2: 0 2px 6px rgba(23, 25, 29, .08), 0 18px 48px rgba(23, 25, 29, .14);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; color: var(--ink); font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }
[dir="rtl"] .flip-icon, html[dir="rtl"] .flip-icon { transform: scaleX(-1); }
[dir="rtl"] .link-arrow svg, [dir="rtl"] .cat-content .go svg { transform: scaleX(-1); }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
@media (max-width: 640px) { .container { width: min(1200px, 100% - 32px); } }

::selection { background: var(--brass); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  font-size: .95rem; font-weight: 600; line-height: 1.2;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; flex: none; }
[data-svg] svg, .icn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.98); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); box-shadow: var(--shadow-1); }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: var(--brass-deep); box-shadow: var(--shadow-1); }
.btn-ghost { background: transparent; color: var(--ink); border-color: #cfc8bb; }
.btn-ghost:hover { border-color: var(--ink); background: #fff; }
.btn-wa { background: var(--wa-green); color: #fff; }
.btn-wa:hover { background: var(--wa-green-deep); box-shadow: 0 6px 22px rgba(29, 158, 95, .35); }
.btn-lg { padding: 16px 34px; font-size: 1.02rem; }
.btn-sm { padding: 9px 18px; font-size: .86rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Header ---------- */
.announce {
  background: var(--ink); color: #d9d4cb; font-size: .82rem; text-align: center;
  padding: 9px 16px; letter-spacing: .02em;
}
.announce b { color: #fff; font-weight: 600; }
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 22px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: var(--ink); color: var(--brass);
  display: grid; place-items: center;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 700; font-size: 1.06rem; color: var(--ink); line-height: 1.15; }
.brand-sub { font-size: .72rem; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.main-nav { display: flex; gap: 4px; margin-inline-start: 10px; }
.main-nav a {
  padding: 9px 15px; border-radius: 999px; font-size: .95rem; color: var(--muted); font-weight: 500;
  transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--ink); background: var(--line-2); }
.main-nav a.active { color: var(--ink); background: var(--line-2); }
.header-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); display: grid; place-items: center; position: relative;
  transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--brass); color: var(--brass-deep); }
.icon-btn svg { width: 20px; height: 20px; }
.cart-count {
  position: absolute; top: -5px; inset-inline-end: -5px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--brass); color: #fff; font-size: .68rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}
.lang-btn {
  height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; font-size: .88rem; color: var(--ink-2);
  transition: border-color .15s, color .15s;
}
.lang-btn:hover { border-color: var(--brass); color: var(--brass-deep); }
.menu-btn { display: none; }
.wa-header { display: inline-flex; }

/* Search overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(23, 25, 29, .5);
  backdrop-filter: blur(4px); display: none; padding: 90px 20px 20px;
}
.search-overlay.open { display: block; }
.search-panel {
  max-width: 640px; margin: 0 auto; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-2); overflow: hidden;
}
.search-row { display: flex; align-items: center; gap: 12px; padding: 6px 18px; }
.search-row svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-row input { flex: 1; border: 0; outline: 0; font-size: 1.05rem; padding: 14px 2px; background: none; color: var(--ink); }
.search-row .icon-btn { width: 36px; height: 36px; border: 0; background: var(--line-2); }
.search-hint { padding: 10px 20px 16px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line-2); }
.search-results { max-height: 320px; overflow-y: auto; }
.search-result {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  border-top: 1px solid var(--line-2); transition: background .12s;
}
.search-result:hover { background: var(--paper); }
.search-result img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--paper); }
.search-result .sr-name { font-weight: 600; font-size: .95rem; color: var(--ink); }
.search-result .sr-cat { font-size: .78rem; color: var(--muted); }
.search-result .sr-price { margin-inline-start: auto; font-weight: 700; color: var(--brass-deep); font-size: .9rem; white-space: nowrap; }

/* Mobile nav drawer */
.mobile-nav { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.mobile-nav .scrim { position: absolute; inset: 0; background: rgba(23,25,29,.45); opacity: 0; transition: opacity .2s; }
.mobile-nav .panel {
  position: absolute; inset-block: 0; inset-inline-start: 0; width: min(320px, 84vw);
  background: #fff; padding: 22px; transform: translateX(var(--nv-x, -110%));
  transition: transform .26s ease; overflow-y: auto;
}
html[dir="ltr"] .mobile-nav .panel { --nv-x: -110%; }
html[dir="rtl"] .mobile-nav .panel { --nv-x: 110%; }
.mobile-nav.open { pointer-events: auto; }
.mobile-nav.open .scrim { opacity: 1; }
.mobile-nav.open .panel { transform: translateX(0); }
.mobile-nav a.mlink {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6px; border-bottom: 1px solid var(--line-2);
  font-weight: 600; color: var(--ink-2); font-size: 1.02rem;
}
.mobile-nav .m-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--paper); }
.hero-in {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
  padding: 64px 0 72px;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brass-deep); margin-bottom: 18px;
}
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--brass); }
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 3.2rem); font-weight: 700; letter-spacing: -.01em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--brass-deep); }
.hero p.lead { font-size: 1.08rem; color: var(--muted); max-width: 52ch; margin: 0 0 30px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-media { position: relative; }
.hero-media .frame {
  border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-2);
  aspect-ratio: 4 / 4.6; background: var(--line-2);
  border: 1px solid rgba(255,255,255,.55);
}
.hero-media .frame img {
  width: 100%; height: 100%; object-fit: cover;
  animation: heroZoom 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes heroZoom {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to   { transform: scale(1.06) translate3d(0, -1.4%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media .frame img { animation: none; }
}
.hero-chip {
  position: absolute; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-1);
}
.hero-chip svg { width: 22px; height: 22px; color: var(--brass-deep); flex: none; }
.hero-chip .t1 { font-weight: 700; font-size: .9rem; color: var(--ink); line-height: 1.2; }
.hero-chip .t2 { font-size: .75rem; color: var(--muted); }
.chip-a { inset-block-end: 26px; inset-inline-start: -34px; }
.chip-b { inset-block-start: 30px; inset-inline-end: -26px; }
@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; padding: 44px 0 56px; gap: 38px; }
  .hero-media { max-width: 560px; }
  .chip-a { inset-inline-start: 16px; }
  .chip-b { inset-inline-end: 16px; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-head { display: flex; align-items: end; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head .kicker { margin-bottom: 8px; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0; }
.section-head .more { margin-inline-start: auto; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2);
  border-bottom: 1px solid transparent; transition: color .15s;
}
.link-arrow:hover { color: var(--brass-deep); }
.link-arrow svg { width: 17px; height: 17px; }

/* Trust bar */
.trust-bar { border-block: 1px solid var(--line); background: #fff; }
.trust-in { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-item {
  display: flex; align-items: center; gap: 14px; padding: 22px 10px;
  border-inline-start: 1px solid var(--line-2); padding-inline: 26px;
}
.trust-item:first-child { border-inline-start: 0; }
.trust-item svg { width: 26px; height: 26px; color: var(--brass-deep); flex: none; }
.trust-item .t1 { font-weight: 600; font-size: .95rem; color: var(--ink); }
.trust-item .t2 { font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) { .trust-in { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(3) { border-inline-start: 0; }
  .trust-item:nth-child(n+3) { border-block-start: 1px solid var(--line-2); } }
@media (max-width: 520px) { .trust-in { grid-template-columns: 1fr; }
  .trust-item { border-inline-start: 0 !important; border-block-start: 1px solid var(--line-2) !important; }
  .trust-item:first-child { border-block-start: 0 !important; } }

/* Product grid + card */
.grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 1080px) { .grid-products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .grid-products { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 420px) { .grid-products { gap: 12px; } }

.p-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.p-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-1); border-color: #ddd5c7; }
.p-media { position: relative; aspect-ratio: 4 / 3.4; background: var(--line-2); overflow: hidden; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.p-card:hover .p-media img { transform: scale(1.04); }
.p-badge {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px; color: #fff;
  background: var(--ink); box-shadow: var(--shadow-1);
}
.badge.offer { background: var(--brass); }
.badge.new { background: var(--wa-green); }
.stock-dot { position: absolute; inset-block-end: 0; inset-inline: 0; z-index: 2; }
.sd { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600;
  padding: 5px 12px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line-2); color: var(--muted); }
.sd i { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); flex: none; }
.sd.low i { background: var(--warn); } .sd.low { color: var(--warn); }
.sd.out i { background: var(--danger); } .sd.out { color: var(--danger); }
.p-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.p-cat { font-size: .74rem; color: var(--muted); letter-spacing: .06em; }
.p-name { font-weight: 600; font-size: .98rem; color: var(--ink); line-height: 1.5; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.p-name:hover { color: var(--brass-deep); }
.p-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.p-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.p-price .now { font-weight: 700; font-size: 1.08rem; color: var(--ink); }
.p-price .now small { font-size: .72rem; font-weight: 600; color: var(--muted); }
.p-price .old { font-size: .82rem; color: var(--muted); text-decoration: line-through; }
.p-actions { display: flex; gap: 8px; margin-top: 12px; }
.q-btn { flex: 1; justify-content: center; min-width: 0; }
.p-actions .btn { min-width: 0; }
.add-btn { width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  display: grid; place-items: center; color: var(--ink-2); transition: border-color .15s, color .15s, background .15s; flex: none; }
.add-btn:hover { border-color: var(--brass); color: var(--brass-deep); background: var(--brass-soft); }
.add-btn svg { width: 19px; height: 19px; }
.add-btn.added { background: var(--wa-green); border-color: var(--wa-green); color: #fff; }

/* Category cards */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 980px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
.cat-card {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4/4.6;
  background: var(--ink); box-shadow: var(--shadow-1);
  transition: transform .5s cubic-bezier(.2,.7,.3,1), box-shadow .5s;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.cat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .9; transition: transform .7s cubic-bezier(.2,.7,.3,1), opacity .3s; }
.cat-card:hover img { transform: scale(1.08); opacity: 1; }
.cat-card .veil { position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(21,23,27,.88) 0%, rgba(21,23,27,.18) 46%, rgba(21,23,27,0) 68%); }
.cat-content { position: absolute; inset-inline: 0; bottom: 0; padding: 22px; color: #fff; }
.cat-content .n { font-weight: 700; font-size: 1.15rem; margin-bottom: 2px; }
.cat-content .c { font-size: .8rem; color: #cfc9bf; }
.cat-content .go {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; font-size: .85rem;
  font-weight: 600; color: #fff; opacity: .85; transition: opacity .2s, gap .2s;
}
.cat-card:hover .go { opacity: 1; }
.cat-content .go svg { width: 16px; height: 16px; }

/* Offers strip */
.offers-strip { background: var(--ink); color: #fff; border-radius: 20px; padding: 34px 38px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.offers-strip .off-side h2 { color: #fff; font-size: 1.4rem; }
.offers-strip .off-side p { color: #b8b3aa; font-size: .92rem; margin: 0; }
.off-items { display: grid; gap: 10px; }
.off-item {
  display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 13px 18px;
  transition: background .15s;
}
.off-item:hover { background: rgba(255,255,255,.1); }
.off-item b { color: #c99f61; font-size: 1.05rem; flex: none; min-width: 52px; }
.off-item .ot { font-weight: 600; font-size: .95rem; }
.off-item .oe { font-size: .78rem; color: #b8b3aa; }
@media (max-width: 860px) { .offers-strip { grid-template-columns: 1fr; } }

/* Wholesale banner */
.ws-banner { border-radius: 20px; overflow: hidden; background: #fff; border: 1px solid var(--line);
  display: grid; grid-template-columns: 1.05fr .95fr; box-shadow: var(--shadow-1); }
.ws-text { padding: 46px 48px; }
.ws-text h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.ws-text p { color: var(--muted); }
.ws-points { display: grid; gap: 10px; margin: 22px 0 28px; }
.ws-points li { display: flex; gap: 12px; align-items: start; font-size: .95rem; color: var(--ink-2); }
.ws-points svg { width: 20px; height: 20px; color: var(--brass-deep); flex: none; margin-top: 3px; }
.ws-media { position: relative; min-height: 320px; background: var(--line-2); }
.ws-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .ws-banner { grid-template-columns: 1fr; } .ws-text { padding: 34px 28px; } }

/* CTA band */
.cta-band { background: linear-gradient(120deg, var(--ink) 0%, #2c2f35 100%); color: #fff;
  border-radius: 20px; padding: 46px 48px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #b8b3aa; max-width: 58ch; margin: 0 auto 26px; }
.cta-band .wa-num { color: var(--brass); font-weight: 700; letter-spacing: .06em; direction: ltr; unicode-bidi: embed; }
.cta-band .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfc9bf; margin-top: 72px; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 38px; padding: 58px 0 42px; }
.site-footer h3 { color: #fff; font-size: .95rem; margin-bottom: 16px; }
.site-footer .brand-sub { color: #a8a29a; }
.site-footer a:hover { color: #fff; }
.f-brand .brand-name { color: #fff; }
.f-brand p { font-size: .88rem; }
.f-links li { margin-bottom: 9px; font-size: .92rem; }
.f-contact li { display: flex; gap: 12px; margin-bottom: 12px; font-size: .92rem; align-items: start; }
.f-contact svg { width: 18px; height: 18px; color: var(--brass); flex: none; margin-top: 4px; }
.f-contact .dir { direction: ltr; unicode-bidi: embed; }
.f-social { display: flex; gap: 10px; margin-top: 18px; }
.f-social a { width: 38px; height: 38px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16);
  display: grid; place-items: center; color: #cfc9bf; transition: all .15s; }
.f-social a:hover { border-color: var(--brass); color: var(--brass); }
.f-social svg { width: 17px; height: 17px; }
.footer-bar { border-top: 1px solid rgba(255,255,255,.09); padding: 20px 0; font-size: .8rem;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 900px) { .footer-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-in { grid-template-columns: 1fr; gap: 30px; } }

/* Floating WhatsApp */
.wa-float {
  position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 70;
  width: 58px; height: 58px; border-radius: 999px; background: var(--wa-green); color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 30px rgba(29,158,95,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.wa-float:hover { transform: translateY(-3px) scale(1.04); }
.wa-float svg { width: 28px; height: 28px; }
[dir="rtl"] .wa-float { inset-inline-end: auto; inset-inline-start: 22px; }
[dir="ltr"] .wa-float, html[dir="ltr"] .wa-float { }

/* ---------- Cart drawer ---------- */
.cart-drawer { position: fixed; inset: 0; z-index: 85; pointer-events: none; }
.cart-drawer .scrim { position: absolute; inset: 0; background: rgba(23,25,29,.45); opacity: 0; transition: opacity .2s; }
.cart-drawer .panel {
  position: absolute; inset-block: 0; inset-inline-end: 0; width: min(420px, 92vw);
  background: #fff; display: flex; flex-direction: column;
  transform: translateX(var(--cd-x, 110%)); transition: transform .26s ease;
  box-shadow: var(--shadow-2);
}
html[dir="ltr"] .cart-drawer .panel { --cd-x: 110%; }
html[dir="rtl"] .cart-drawer .panel { --cd-x: -110%; }
.cart-drawer.open { pointer-events: auto; }
.cart-drawer.open .scrim { opacity: 1; }
.cart-drawer.open .panel { transform: translateX(0); }
.cd-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.cd-head h3 { margin: 0; font-size: 1.1rem; }
.cd-items { flex: 1; overflow-y: auto; padding: 14px 22px; }
.cd-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.cd-empty svg { width: 46px; height: 46px; color: var(--line); margin-bottom: 12px; }
.cd-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.cd-item img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--paper); }
.cd-item .n { font-weight: 600; font-size: .9rem; color: var(--ink); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cd-item .pr { font-size: .85rem; color: var(--brass-deep); font-weight: 700; margin-top: 3px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: #fff; color: var(--ink-2); font-size: 1rem; line-height: 1; display: grid; place-items: center; }
.qty button:hover { background: var(--line-2); }
.qty span { min-width: 34px; text-align: center; font-size: .9rem; font-weight: 600; padding-inline: 4px; }
.cd-item .rm { border: 0; background: none; color: var(--muted); padding: 4px; align-self: start; }
.cd-item .rm:hover { color: var(--danger); }
.cd-item .rm svg { width: 17px; height: 17px; }
.cd-foot { border-top: 1px solid var(--line); padding: 18px 22px; }
.cd-total { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 1rem; }
.cd-total b { font-size: 1.2rem; color: var(--ink); }
.cd-note { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 10px; }

/* ---------- Catalog page ---------- */
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 34px 0 30px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .84rem; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brass-deep); }
.breadcrumb .sep { opacity: .5; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; font-size: .95rem; }

.catalog-layout { display: grid; grid-template-columns: 262px 1fr; gap: 30px; align-items: start; padding: 36px 0 80px; }
@media (max-width: 960px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
}
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: calc(var(--header-h) + 16px); }
.f-block { padding-block: 16px; border-bottom: 1px solid var(--line-2); }
.f-block:first-child { padding-top: 0; }
.f-block:last-child { border-bottom: 0; padding-bottom: 0; }
.f-title { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.f-cat { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 9px; font-size: .93rem; color: var(--ink-2); width: 100%; text-align: start; border: 0; background: none; transition: background .12s; }
.f-cat:hover { background: var(--paper); }
.f-cat.active { background: var(--brass-soft); color: var(--brass-deep); font-weight: 600; }
.f-cat.active svg { color: var(--brass-deep); }
.f-cat svg { width: 17px; height: 17px; color: var(--muted); }
.f-cat .cnt { margin-inline-start: auto; font-size: .76rem; color: var(--muted); background: var(--paper); border-radius: 999px; padding: 1px 8px; }
.f-cat.active .cnt { background: #fff; }
.price-inputs { display: flex; gap: 10px; align-items: center; }
.price-inputs input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font-size: .9rem; outline-color: var(--brass); }
.price-inputs span { color: var(--muted); flex: none; }
.f-ranges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.f-range { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: .78rem; color: var(--ink-2); transition: all .12s; }
.f-range:hover, .f-range.active { border-color: var(--brass); color: var(--brass-deep); background: var(--brass-soft); }
.f-check { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.f-check input { accent-color: var(--brass); width: 16px; height: 16px; }
.clear-filters { margin-top: 16px; width: 100%; }

.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.result-count { color: var(--muted); font-size: .9rem; }
.sort-box { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.sort-box select { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: #fff; color: var(--ink); outline-color: var(--brass); font-size: .88rem; }
.active-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.active-chips .chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .82rem; color: var(--ink-2); }
.chip button { border: 0; background: none; color: var(--muted); font-size: .9rem; display: grid; place-items: center; padding: 0; }
.chip button:hover { color: var(--danger); }
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); background: #fff; border: 1px dashed #d8d1c4; border-radius: var(--radius); }
.empty-state svg { width: 46px; height: 46px; color: #d8d1c4; margin-bottom: 12px; }
.empty-state h3 { margin-bottom: 6px; }

/* ---------- Product page ---------- */
.product-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; padding: 40px 0 20px; align-items: start; }
@media (max-width: 900px) { .product-layout { grid-template-columns: 1fr; gap: 28px; } }
.gallery-main { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--line-2); aspect-ratio: 4/3.6; width: 100%; display: block; font: inherit; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.gallery-thumbs button { border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--line-2); aspect-ratio: 4/3; }
.gallery-thumbs button.active { border-color: var(--brass); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pi-info { position: sticky; top: calc(var(--header-h) + 16px); }
.pi-cat { color: var(--brass-deep); font-weight: 600; font-size: .82rem; letter-spacing: .08em; margin-bottom: 8px; }
.pi-info h1 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 10px; }
.pi-price-row { display: flex; align-items: center; gap: 14px; margin: 18px 0 6px; flex-wrap: wrap; }
.pi-price { font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.pi-price small { font-size: .85rem; color: var(--muted); font-weight: 600; }
.pi-old { font-size: 1.05rem; color: var(--muted); text-decoration: line-through; }
.pi-save { background: var(--brass-soft); color: var(--brass-deep); font-weight: 700; font-size: .78rem; border-radius: 999px; padding: 4px 12px; }
.pi-stock { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; margin-bottom: 18px; }
.pi-stock i { width: 9px; height: 9px; border-radius: 999px; }
.pi-stock.in i, .pi-stock.in { color: var(--ok); } .pi-stock.in i { background: var(--ok); }
.pi-stock.low i, .pi-stock.low { color: var(--warn); } .pi-stock.low i { background: var(--warn); }
.pi-stock.out i, .pi-stock.out { color: var(--danger); } .pi-stock.out i { background: var(--danger); }
.pi-actions { display: flex; gap: 12px; margin: 18px 0 8px; flex-wrap: wrap; align-items: center; }
.pi-actions .qty { height: 50px; border-radius: 999px; padding: 4px; }
.pi-actions .qty button { width: 42px; height: 42px; font-size: 1.15rem; }
.pi-actions .btn { height: 50px; }
.pi-links { display: flex; gap: 18px; margin-top: 14px; }
.pi-links button,.pi-links a { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; color: var(--muted); background: none; border: 0; padding: 0; transition: color .15s; }
.pi-links *:hover { color: var(--brass-deep); }
.pi-links svg { width: 16px; height: 16px; }
.ws-box { background: var(--brass-soft); border: 1px solid #e6d9c2; border-radius: var(--radius); padding: 18px 20px; margin-top: 22px; }
.ws-box .t { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--brass-deep); font-size: .95rem; margin-bottom: 8px; }
.ws-box .t svg { width: 20px; height: 20px; }
.ws-box p { margin: 0 0 4px; font-size: .88rem; color: var(--ink-2); }
.ws-box a { font-weight: 700; font-size: .88rem; border-bottom: 1px solid var(--brass); color: var(--brass-deep); }
.pi-perks { display: grid; gap: 9px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.pi-perks li { display: flex; gap: 11px; align-items: center; font-size: .89rem; color: var(--muted); }
.pi-perks svg { width: 18px; height: 18px; color: var(--brass-deep); flex: none; }

.pi-sections { display: grid; gap: 30px; padding: 30px 0 60px; }
.pi-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; }
.pi-card h3 { font-size: 1.15rem; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.spec-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.spec-table td { padding: 10px 2px; border-bottom: 1px solid var(--line-2); }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td:first-child { color: var(--muted); width: 42%; }
.spec-table td:last-child { font-weight: 600; color: var(--ink); }

/* ---------- Wholesale page ---------- */
.ws-hero { background: var(--ink); color: #fff; padding: 64px 0; }
.ws-hero .kicker { color: var(--brass); }
.ws-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); max-width: 22ch; }
.ws-hero p { color: #b8b3aa; max-width: 60ch; font-size: 1.02rem; }
.benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: -44px; margin-bottom: 72px; }
@media (max-width: 980px) { .benefits { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .benefits { grid-template-columns: 1fr; } }
.benefit { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-1); }
.benefit svg { width: 26px; height: 26px; color: var(--brass-deep); margin-bottom: 12px; }
.benefit h3 { font-size: 1rem; margin-bottom: 6px; }
.benefit p { font-size: .86rem; color: var(--muted); margin: 0; }
.terms-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.terms-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.terms-table th { background: var(--paper); text-align: start; padding: 14px 20px; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.terms-table td { padding: 15px 20px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.terms-table tr:last-child td { border-bottom: 0; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 17px 20px; border: 0; background: none; font-size: .98rem; font-weight: 600; color: var(--ink); text-align: start; }
.faq-q svg { width: 18px; height: 18px; color: var(--brass-deep); transition: transform .22s; flex: none; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.faq-a p { padding: 0 20px 18px; margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- Admin ---------- */
body.admin-body { background: #f1efe9; }
.adm-gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.adm-gate .card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 40px; width: min(420px, 100%); box-shadow: var(--shadow-1); text-align: center; }
.adm-gate .brand-mark { margin: 0 auto 16px; width: 54px; height: 54px; border-radius: 16px; }
.adm-gate h1 { font-size: 1.25rem; }
.adm-gate p { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.adm-gate input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; outline-color: var(--brass); text-align: center; letter-spacing: .3em; }
.adm-gate #adm-new1, .adm-gate #adm-new2 { letter-spacing: 0; }
.adm-gate .btn { width: 100%; }
.adm-gate .hint { font-size: .76rem; color: var(--muted); margin-top: 14px; }

.adm-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.adm-shell[hidden] { display: none; } /* سمة hidden لا يلغيها display:grid */
.adm-side { background: var(--ink); color: #b8b3aa; padding: 24px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.adm-side .brand-name { color: #fff; }
.adm-side .brand-sub { color: #a8a29a; }
.adm-nav { display: grid; gap: 4px; margin-top: 26px; }
.adm-nav button {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  border: 0; background: none; color: inherit; font-size: .93rem; font-weight: 500; text-align: start;
  transition: background .12s, color .12s;
}
.adm-nav button svg { width: 19px; height: 19px; opacity: .8; }
.adm-nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.adm-nav button.active { background: rgba(169,131,79,.18); color: #fff; }
.adm-nav button.active svg { color: var(--brass); opacity: 1; }
.adm-side .adm-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.09); }
.adm-side .adm-foot button, .adm-side .adm-foot a { display: inline-flex; gap: 8px; align-items: center; color: #9c968c; background: none; border: 0; font-size: .84rem; padding: 8px 14px; border-radius: 8px; width: 100%; }
.adm-side .adm-foot button:hover { color: #fff; background: rgba(255,255,255,.06); }
/* الجوال والتابلت: شريط علوي مضغوط وأقسام تُمرَّر أفقياً (يجب أن يأتي بعد القواعد الأساسية أعلاه) */
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-side { position: static; height: auto; padding: 12px 12px 10px; min-width: 0; }
  .adm-side > div { min-width: 0; }
  .adm-side .brand-sub { display: none; }
  .adm-nav { display: flex; overflow-x: auto; gap: 6px; margin-top: 10px; padding-bottom: 4px; scrollbar-width: none; }
  .adm-nav::-webkit-scrollbar { display: none; }
  .adm-nav button { white-space: nowrap; flex: none; padding: 9px 12px; font-size: .88rem; gap: 8px; }
  .adm-side .adm-foot { margin-top: 6px; padding-top: 6px; display: flex; gap: 4px; }
  .adm-side .adm-foot button, .adm-side .adm-foot a { width: auto; padding: 6px 10px; }
}
.adm-main { padding: 30px 34px 60px; }
@media (max-width: 640px) { .adm-main { padding: 20px 16px 50px; } }
.adm-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.adm-head h1 { font-size: 1.4rem; margin: 0; }
.adm-head .btns { margin-inline-start: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.adm-note { background: var(--brass-soft); border: 1px solid #e8d9c0; color: #6e5628; border-radius: 12px; padding: 14px 18px; font-size: .86rem; margin-bottom: 22px; display: flex; gap: 12px; align-items: start; }
.adm-note svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
@media (max-width: 1000px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card .l { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.stat-card .v { font-size: 1.65rem; font-weight: 700; color: var(--ink); }
.stat-card .s { font-size: .78rem; color: var(--brass-deep); font-weight: 600; margin-top: 4px; }
.adm-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.adm-panel + .adm-panel { margin-top: 22px; }
.adm-panel h2 { font-size: 1.05rem; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.adm-panel h2 svg { width: 20px; height: 20px; color: var(--brass-deep); }
.tbl-wrap { overflow-x: auto; margin: 0 -8px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.adm-table th { text-align: start; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.adm-table tr:hover td { background: #faf9f6; }
.adm-table img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--paper); }
.adm-table .nm { font-weight: 600; color: var(--ink); max-width: 240px; }
.adm-table .sub { font-size: .76rem; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--muted); transition: all .12s; }
.row-actions button:hover { border-color: var(--brass); color: var(--brass-deep); }
.row-actions button.del:hover { border-color: var(--danger); color: var(--danger); }
.row-actions svg { width: 16px; height: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: .74rem; font-weight: 700; padding: 3px 11px; }
.pill.in { background: #e2f3ea; color: #157347; }
.pill.low { background: #f7ecd7; color: #8e5a10; }
.pill.out { background: #f7e1e2; color: #a0333a; }
.pill.badge { background: var(--line-2); color: var(--ink-3); margin-inline-start: 4px; }
.adm-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.adm-search { flex: 1; min-width: 220px; position: relative; }
.adm-search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.adm-search input { width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 11px 42px; outline-color: var(--brass); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .field-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 7px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field label small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font-size: .92rem;
  outline-color: var(--brass); background: #fff; width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.img-rows { display: grid; gap: 10px; }
.img-row { display: flex; gap: 10px; align-items: center; }
.img-row img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--paper); flex: none; }
.img-row input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .86rem; outline-color: var(--brass); direction: ltr; }
.img-row .rm { border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 38px; height: 38px; color: var(--muted); display: grid; place-items: center; flex: none; }
.img-row .rm:hover { color: var(--danger); border-color: var(--danger); }
.spec-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 10px; align-items: center; }
.spec-row input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .88rem; outline-color: var(--brass); width: 100%; }
.spec-row .rm { border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 38px; height: 38px; color: var(--muted); display: grid; place-items: center; }
.spec-row .rm:hover { color: var(--danger); border-color: var(--danger); }
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 620px) { .spec-row { grid-template-columns: 1fr 1fr; } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal .scrim { position: absolute; inset: 0; background: rgba(23,25,29,.55); backdrop-filter: blur(3px); }
.modal .box { position: relative; background: #fff; border-radius: 18px; width: min(760px, 100%);
  max-height: min(88vh, 900px); display: flex; flex-direction: column; box-shadow: var(--shadow-2); }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal .m-head h3 { margin: 0; font-size: 1.08rem; }
.modal .m-body { padding: 22px 24px; overflow-y: auto; }
.modal .m-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: #d9d4cb; border-radius: 999px; transition: background .18s; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--wa-green); }
.switch input:checked + .track::after { transform: translateX(18px); }
html[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-18px); }

/* شبكة صور المعرض في لوحة الإدارة */
.gal-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ga-thumb {
  position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); cursor: zoom-in; background: var(--line-2);
}
.ga-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ga-thumb:hover img { transform: scale(1.06); }
.ga-thumb .x {
  position: absolute; top: 5px; inset-inline-end: 5px; width: 26px; height: 26px;
  border-radius: 999px; border: 0; background: rgba(23,25,29,.78); color: #fff;
  display: grid; place-items: center; font-size: .8rem; cursor: pointer; z-index: 2;
}
.ga-thumb .x:hover { background: var(--danger); }
.ga-thumb .cat-tag {
  position: absolute; bottom: 5px; inset-inline-start: 5px; z-index: 2;
  background: rgba(23,25,29,.72); color: #fff; font-size: .62rem; font-weight: 600;
  border-radius: 999px; padding: 2px 8px; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- لوحة الإدارة على السيرفر: بوابة، قائمة منتجات، محرر صور ---------- */
.adm-gate .card input { letter-spacing: 0; text-align: start; }
.adm-gate .code-input { text-align: center; letter-spacing: .12em; font-weight: 600; }
.adm-gate .code-input::placeholder { letter-spacing: 0; font-weight: 400; }
.adm-gate .gate-msg { color: var(--ink-2); font-size: .95rem; margin-bottom: 16px; line-height: 1.8; }
.adm-gate .gate-steps { text-align: start; margin: 0 0 18px; padding-inline-start: 20px; list-style: decimal; color: var(--muted); font-size: .86rem; line-height: 1.9; }
.adm-gate .pw-rules { font-size: .78rem; color: var(--muted); text-align: start; margin: -4px 0 14px; }
.adm-gate .pw-show { margin: -4px 0 14px; justify-content: flex-start; font-size: .84rem; }
.adm-gate .pw-show input { width: 16px; height: 16px; margin: 0; padding: 0; flex: none; }
.adm-gate .gate-help { margin-top: 16px; text-align: start; font-size: .82rem; color: var(--muted); }
.adm-gate .gate-help summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.adm-gate .gate-help p { margin: 8px 0 0; line-height: 1.8; }
.adm-gate .hint:empty { display: none; }
.adm-gate[hidden] { display: none; }

.adm-savebar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; margin: -30px -34px 22px; padding: 10px 34px;
  background: rgba(246,244,240,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); font-size: .84rem; font-weight: 600; color: #157347; }
.adm-savebar svg { width: 17px; height: 17px; flex: none; }
.adm-savebar.saving { color: var(--brass-deep); }
.adm-savebar.err { color: var(--danger); background: #fbeeee; }
@media (max-width: 640px) { .adm-savebar { margin: -20px -16px 18px; padding: 10px 16px; } }
.adm-head .adm-sub { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.adm-help { color: var(--muted); font-size: .82rem; margin: 12px 0 0; line-height: 1.8; }
.adm-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.adm-empty { padding: 26px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 12px; }
.adm-select { border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; background: #fff; outline-color: var(--brass); }
.h2-sub { color: var(--muted); font-weight: 400; font-size: .8rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #962d33; }

.pl { display: grid; gap: 10px; }
.pl-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px 150px auto; grid-template-areas: "img info price stock act";
  gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.adm-panel .pl-row { border-color: var(--line-2); }
.pl-row.is-out { background: #fdf8f8; }
.pl-img { grid-area: img; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--paper); }
.img-empty { display: grid; place-items: center; color: #b9b2a5; }
.img-empty svg { width: 24px; height: 24px; }
.pl-info { grid-area: info; min-width: 0; }
.pl-info b { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-info span { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-price { grid-area: price; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }
.pl-price:focus-within { border-color: var(--brass); }
.pl-price input { width: 100%; min-width: 0; border: 0; padding: 9px 0; font-weight: 700; direction: ltr; text-align: end; outline: none; background: transparent; color: var(--ink); }
.pl-price input.saving { opacity: .5; }
.pl-price span { font-size: .75rem; color: var(--muted); }
.pl-stock { grid-area: stock; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; min-width: 0; outline-color: var(--brass); }
.pl-actions { grid-area: act; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.pl-del { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); display: grid; place-items: center; flex: none; }
.pl-del svg { width: 17px; height: 17px; }
.pl-del:hover:not([disabled]) { color: var(--danger); border-color: var(--danger); }
.pl-del[disabled] { opacity: .35; cursor: not-allowed; }
.cat-row, .off-row { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "img info act"; }
.off-row { grid-template-columns: 64px minmax(0, 1fr) auto auto; grid-template-areas: "img info tgl act"; }
.off-row .switch { grid-area: tgl; }
.cat-ic { grid-area: img; width: 42px; height: 42px; min-width: 42px; border-radius: 10px; }
.cat-ic svg { width: 22px; height: 22px; }
.off-badge { grid-area: img; background: var(--brass-soft); color: var(--brass-deep); border-radius: 10px; padding: 8px 6px; text-align: center; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info act"; }
@media (max-width: 760px) {
  .pl-row { grid-template-columns: 56px minmax(0, 1fr) 128px; grid-template-areas: "img info act" "price price stock"; }
  .cat-row { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "img info act"; }
  .off-row { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img info tgl" "act act act"; }
  .bk-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info act"; }
  .pl-actions .btn-sm { padding: 8px 12px; }
}

.ie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ie-tile { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.ie-tile img { width: 100%; height: 100%; object-fit: cover; }
.ie-tile.loading { display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); font-size: .74rem; }
.ie-badge { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--ink); color: #fff; font-size: .66rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.ie-btns { position: absolute; inset-inline: 6px; bottom: 6px; display: flex; justify-content: space-between; }
.ie-btns button { width: 32px; height: 32px; border-radius: 999px; border: 0; background: rgba(23,25,29,.78); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.ie-btns button:hover { background: var(--ink); }
.ie-btns [data-rm]:hover { background: var(--danger); }
.ie-add { position: relative; aspect-ratio: 1 / 1; border: 2px dashed #cfc8bb; border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 6px;
  text-align: center; color: var(--ink-2); font-size: .8rem; font-weight: 600; cursor: pointer; background: #fff; padding: 8px; line-height: 1.5; }
.ie-add:hover { border-color: var(--brass); background: var(--brass-soft); }
.ie-add svg { width: 24px; height: 24px; color: var(--brass-deep); }
.ie-add small { font-weight: 400; color: var(--muted); font-size: .7rem; }
.ie-add input, .up-btn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.up-row { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.up-row .field { min-width: 220px; }
.up-btn { position: relative; overflow: hidden; }
.up-status { margin-top: 12px; font-size: .86rem; color: var(--brass-deep); display: flex; align-items: center; gap: 8px; }
.up-status:empty { display: none; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.seg button.on.in { background: #e2f3ea; border-color: #9fd5b8; color: #157347; }
.seg button.on.low { background: #f7ecd7; border-color: #e3c58f; color: #8e5a10; }
.seg button.on.out { background: #f7e1e2; border-color: #e3aeb1; color: #a0333a; }
.chk-row { display: flex; gap: 16px; flex-wrap: wrap; }
.more-opts { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf9; }
.more-opts > summary { padding: 13px 16px; cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: .9rem; }
.more-opts > .mo-body { padding: 4px 16px 18px; }
.p-editor .spec-row { grid-template-columns: 1fr 1fr 1fr auto; }
.icon-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-pick button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); }
.icon-pick button svg { width: 22px; height: 22px; }
.icon-pick button.on { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-deep); }
.confirm-box .box { width: min(460px, 100%); }
.relogin { z-index: 130; }
.adm-table tr.ev-bad td { color: var(--danger); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brass); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; vertical-align: -2px; }
.btn .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.btn-ghost .spinner { border-color: var(--line); border-top-color: var(--brass); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .modal { padding: 0; place-items: end center; }
  .modal .box { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal .m-body { padding: 18px 16px; }
  .modal .m-head, .modal .m-foot { padding: 14px 16px; }
  .modal .m-foot .btn { flex: 1; }
  .p-editor .spec-row { grid-template-columns: 1fr 1fr; }
  .adm-gate .card { padding: 28px 20px; }
}

/* Toast */
.toast-box { position: fixed; inset-block-end: 26px; inset-inline: 0; z-index: 120; display: grid; place-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 24px; font-size: .9rem;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-2);
  animation: toast-in .25s ease; pointer-events: auto; max-width: 90vw;
}
.toast.ok svg { color: #4fd08a; }
.toast.err svg { color: #ffb4b4; }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4cec2; border-radius: 999px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   Banner video announcement + Ken Burns slideshow
   ========================================================= */
.promo-video { padding: 8px 0 0; }
.pv-frame {
  position: relative; border-radius: 22px; overflow: hidden;
  aspect-ratio: 16 / 8.2; background: var(--ink); box-shadow: var(--shadow-2);
  isolation: isolate;
}
.pv-frame video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.pv-veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(18,20,24,.72) 0%, rgba(18,20,24,.12) 45%, rgba(18,20,24,0) 68%);
}
.pv-text {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
  padding: 22px 28px; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
}
.pv-text .kicker { color: var(--brass); margin-bottom: 6px; }
.pv-text h2 { color: #fff; font-size: clamp(1.25rem, 2.6vw, 1.8rem); margin: 0; }
.pv-text .pv-actions { margin-inline-start: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.pv-play {
  width: 62px; height: 62px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px); color: #fff;
  display: grid; place-items: center; transition: background .2s, transform .2s;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3;
}
.pv-play:hover { background: rgba(255,255,255,.24); transform: translate(-50%, -50%) scale(1.06); }
.pv-play svg { width: 26px; height: 26px; }

/* Ken Burns — صور مختارة تتنقل بانتقال متداخل ناعم عندما لا يوجد فيديو */
.kb { position: absolute; inset: 0; }
.kb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; animation: kbslide 18s linear infinite;
}
.kb img:nth-child(1) { animation-delay: 0s; }
.kb img:nth-child(2) { animation-delay: 3s; }
.kb img:nth-child(3) { animation-delay: 6s; }
.kb img:nth-child(4) { animation-delay: 9s; }
.kb img:nth-child(5) { animation-delay: 12s; }
.kb img:nth-child(6) { animation-delay: 15s; }
.kb-static img { animation: none; opacity: 1; } /* صورة واحدة (غلاف يوتيوب أو بديل) تبقى ظاهرة */
@keyframes kbslide {
  0%   { opacity: 0; transform: scale(1.02) translate3d(0,0,0); }
  4%   { opacity: 1; }
  21%  { opacity: 1; transform: scale(1.11) translate3d(-1.2%, -1%, 0); }
  27%  { opacity: 0; transform: scale(1.13) translate3d(-1.4%, -1.2%, 0); }
  100% { opacity: 0; transform: scale(1.13); }
}
@media (prefers-reduced-motion: reduce) {
  .kb img { animation: none; opacity: 1; position: relative; }
  .kb img:not(:first-child) { display: none; }
}

/* =========================================================
   Gallery — masonry columns + lightbox
   ========================================================= */
.gal-layout { padding: 34px 0 80px; }
.gal-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.gal-count { color: var(--muted); font-size: .9rem; }
.gal-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.gal-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 16px; font-size: .85rem; font-weight: 600; color: var(--ink-2);
  transition: all .15s;
}
.gal-chip:hover { border-color: var(--brass); color: var(--brass-deep); }
.gal-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.gal-chip .cnt { font-size: .72rem; opacity: .65; margin-inline-start: 4px; }

.masonry { column-count: 4; column-gap: 14px; }
@media (max-width: 1080px) { .masonry { column-count: 3; } }
@media (max-width: 700px)  { .masonry { column-count: 2; column-gap: 10px; } }
.m-item {
  break-inside: avoid; margin-bottom: 14px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #fff; cursor: zoom-in;
  display: block; width: 100%; padding: 0; text-align: start;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.m-item:hover { box-shadow: var(--shadow-1); border-color: #ddd5c7; }
.m-item img { width: 100%; display: block; min-height: 60px; background: var(--line-2); }
.m-cap { display: block; padding: 10px 14px 12px; font-size: .84rem; color: var(--ink-2); font-weight: 500; }
.gal-more-wrap { text-align: center; margin-top: 26px; }
.gal-empty { text-align: center; padding: 70px 20px; color: var(--muted); background: #fff; border: 1px dashed #d8d1c4; border-radius: var(--radius); }

/* عارض الصور المنبثق Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 130; display: none;
  background: rgba(15,16,19,.94); backdrop-filter: blur(6px);
}
.lightbox.open { display: grid; place-items: center; }
.lb-stage { position: relative; width: min(1100px, 94vw); height: min(84vh, 1000px); display: grid; place-items: center; }
.lb-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5); user-select: none; -webkit-user-drag: none;
}
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center;
  transition: background .15s;
}
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-prev { inset-inline-start: 14px; }
.lb-next { inset-inline-end: 14px; }
.lb-close {
  position: absolute; top: 18px; inset-inline-end: 18px; top: env(safe-area-inset-top, 18px);
  width: 46px; height: 46px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; z-index: 3;
}
.lb-close svg { width: 20px; height: 20px; }
.lb-bar {
  position: absolute; inset-inline: 0; bottom: 18px; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: #cfc9bf; font-size: .85rem; direction: ltr;
}
.lb-bar .lb-cap { color: #fff; font-weight: 500; }
.lb-hint { position: absolute; top: 22px; inset-inline-start: 22px; color: #8a8f96; font-size: .78rem; }
@media (max-width: 640px) {
  .lb-stage { height: min(78vh, 900px); }
  .lb-btn { width: 42px; height: 42px; }
  .lb-prev { inset-inline-start: 6px; }
  .lb-next { inset-inline-end: 6px; }
}

/* معرض مصغّر في الرئيسية */
.home-gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .home-gal { grid-template-columns: repeat(2, 1fr); } }
.home-gal .hg {
  position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 1/1.05;
  border: 0; padding: 0; cursor: zoom-in; background: var(--line-2); display: block;
  box-shadow: var(--shadow-1); transition: transform .45s cubic-bezier(.2,.7,.3,1), box-shadow .45s;
}
.home-gal .hg:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.home-gal .hg img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.3,1); }
.hg:hover img { transform: scale(1.08); }
/* تدرّج + اسم المنتج أسفل كل صورة */
.hg-pic::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 46%;
  background: linear-gradient(to top, rgba(18,20,24,.74), rgba(18,20,24,0));
  pointer-events: none;
}
.hg-cap {
  position: absolute; inset-inline: 0; bottom: 0; padding: 10px 12px; z-index: 2;
  color: #fff; font-size: .78rem; font-weight: 600; text-align: start; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  pointer-events: none;
}
.hg-more {
  position: relative; display: grid; place-items: center;
  background: #14161a; color: #fff; font-weight: 600; font-size: .95rem;
}
.home-gal .hg.hg-more { background: #14161a; }
.hg-more-in { display: grid; place-items: center; text-align: center; }
.hg-more .plus { font-size: 1.7rem; display: block; text-align: center; line-height: 1.1; color: #c99f61; }

/* =========================================================
   Mobile polish — تجربة اللمس والجوال
   ========================================================= */
body { -webkit-tap-highlight-color: transparent; }
section[id], [id="categories"], [id="offers"], [id="latest"], [id="best"] { scroll-margin-top: calc(var(--header-h) + 20px); }
.p-card, .cat-card, .benefit, .off-item, .hg { transition-timing-function: cubic-bezier(.2,.7,.3,1); }
@media (hover: hover) {
  .p-card:hover { transform: translateY(-4px); }
  .cat-card:hover img { transform: scale(1.05); }
  .p-card:hover .p-media img { transform: scale(1.04); }
  .hg:hover img { transform: scale(1.06); }
}
@media (hover: none) {
  .p-card:active { transform: scale(.985); }
  .btn:active { transform: scale(.97); }
}

/* شريط سفلي لاصق لصفحة المنتج على الجوال */
.pi-mobbar {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 75; display: none;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(23,25,29,.08);
}
.pi-mobbar .mobbar-in { display: flex; align-items: center; gap: 12px; max-width: 720px; margin-inline: auto; }
.pi-mobbar .mb-price { line-height: 1.25; flex: 1; min-width: 0; }
.pi-mobbar .mb-price .v { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.pi-mobbar .mb-price .s { font-size: .72rem; color: var(--muted); }
.pi-mobbar .btn { height: 46px; padding: 0 20px; font-size: .88rem; }
@media (max-width: 640px) {
  .pi-mobbar { display: block; }
  body[data-page="product"] { padding-bottom: 78px; }
  .wa-float { inset-block-end: 92px; }
  [dir="rtl"] .wa-float { inset-block-end: 92px; }
  .toast-box { inset-block-end: 96px; }
}

/* شيت تصفية الكتالوج على الجوال */
.f-sheet {
  position: fixed; inset: 0; z-index: 88; pointer-events: none; display: none;
}
@media (max-width: 960px) {
  .f-sheet { display: block; }
}
.f-sheet .scrim { position: absolute; inset: 0; background: rgba(23,25,29,.45); opacity: 0; transition: opacity .2s; }
.f-sheet .sheet {
  position: absolute; inset-inline: 0; inset-block-end: 0;
  max-height: 82vh; background: #fff; border-radius: 18px 18px 0 0;
  padding: 8px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.7,.3,1);
  overflow-y: auto; box-shadow: var(--shadow-2);
}
.f-sheet.open { pointer-events: auto; }
.f-sheet.open .scrim { opacity: 1; }
.f-sheet.open .sheet { transform: translateY(0); }
.f-sheet .grab { width: 44px; height: 5px; border-radius: 999px; background: #d9d4cb; margin: 6px auto 12px; }
.f-sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.f-sheet .sheet-head b { font-size: 1.05rem; color: var(--ink); }
.f-sheet .sheet-apply { margin-top: 16px; width: 100%; }
/* الإخفاء الافتراضي يجب أن يسبق الاستعلام؛ لو جاء بعده لأخفى الزر على الجوال أيضاً */
.m-filter-btn { display: none; }
@media (max-width: 960px) {
  .catalog-layout .filters { display: none; }
  .m-filter-btn { display: inline-flex; }
  .catalog-layout { padding: 24px 0 60px; }
}
@media (max-width: 960px) {
  .sort-box { margin-inline-start: auto; }
  .toolbar { gap: 10px; }
}

/* رأس مضغوط وخطوات أسرع على الشاشات الصغيرة */
@media (max-width: 640px) {
  :root { --header-h: 62px; }
  .announce { font-size: .74rem; padding: 7px 12px; }
  .header-in { gap: 10px; }
  .brand-sub { display: none; }
  .brand { min-width: 0; }
  .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .brand-name { font-size: .92rem; max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .header-tools { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .lang-btn { height: 38px; padding: 0 11px; font-size: .8rem; min-width: 0; }
  .main-nav { display: none; }
  .menu-btn { display: grid; }
  .wa-header { display: none; }
  .section { padding: 44px 0; }
  .hero-in { padding: 30px 0 44px; gap: 26px; }
  .hero h1 { font-size: clamp(1.6rem, 6.4vw, 2.1rem); }
  .hero-ctas .btn { flex: 1; min-width: 140px; }
  .pv-frame { aspect-ratio: 16 / 11; border-radius: 16px; }
  .pv-text { padding: 14px 16px; gap: 8px; }
  .pv-text h2 { font-size: 1.05rem; }
  .pv-text .pv-actions { margin-inline-start: 0; width: 100%; }
  .pv-play { width: 52px; height: 52px; }
  .offers-strip { padding: 24px 20px; }
  .ws-text { padding: 28px 22px; }
  .cta-band { padding: 32px 22px; }
  .gallery-main { aspect-ratio: 1/1; }
  .pi-info { position: static; }
  .pi-actions .btn { flex: 1; justify-content: center; }
  .pi-price { font-size: 1.45rem; }
  .page-head { padding: 24px 0 20px; }
  .footer-bar { justify-content: center; text-align: center; }
  .adm-table { min-width: 560px; }
}

/* شاشات صغيرة جداً (iPhone SE وأصغر) */
@media (max-width: 380px) {
  .container { width: min(1200px, 100% - 24px); }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand-name { max-width: 84px; font-size: .84rem; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .lang-btn { height: 32px; padding: 0 7px; font-size: .78rem; }
  .header-tools { gap: 3px; }
  .header-in { gap: 6px; }
  .hero-ctas .btn { min-width: 0; font-size: .9rem; padding: 14px 18px; }
  .cat-grid, .home-gal { gap: 10px; }
}

/* منع أي زر طويل من كسر العرض على الجوال */
@media (max-width: 420px) {
  .btn { white-space: normal; }
  .btn svg { flex: none; }
}

/* أزرار بطاقات المنتج تلائم عرض البطاقة على الجوال */
@media (max-width: 760px) {
  .p-actions .btn { white-space: normal; text-align: center; line-height: 1.3; font-size: .82rem; padding: 9px 10px; }
}

/* iOS: منع التكبير التلقائي عند التركيز على المدخلات (أقل من 16px يسبب التكبير)
   !important لأن قواعد أدق مثل .sort-box select و .price-inputs input كانت تتغلب عليها */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
}

/* طباعة أنيقة */
@media print {
  .site-header, .announce, .wa-float, .cart-drawer, .mobile-nav, .toast-box, .lightbox, .pi-mobbar, .f-sheet { display: none !important; }
  body { background: #fff; }
}

