/* =========================================================================
   RawaCOD v5 — نظام التصميم الكامل (CSS مكتوب خصيصاً — بدون أي إطار عمل)
   الهوية: بنفسجي RawaCOD + أصفر التمييز + أبيض نظيف
   ========================================================================= */

/* ---------- 1) الرموز التصميمية (Design Tokens) ---------- */
:root {
    --c-primary: #4C1D95;
    --c-primary-dark: #3B0764;
    --c-primary-deep: #290A59;
    --c-primary-soft: #F5F3FF;
    --c-primary-softer: #EDE9FE;
    --c-accent: #FACC15;
    --c-accent-dark: #EAB308;
    --c-ink: #0F172A;
    --c-body: #334155;
    --c-muted: #64748B;
    --c-faint: #94A3B8;
    --c-line: #E2E8F0;
    --c-line-soft: #EEF2F7;
    --c-surface: #F8FAFC;
    --c-white: #FFFFFF;
    --c-danger: #DC2626;
    --c-danger-soft: #FEF2F2;
    --c-success: #16A34A;
    --c-success-soft: #F0FDF4;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-card: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 28px -18px rgba(41, 10, 89, .22);
    --shadow-hover: 0 2px 6px rgba(15, 23, 42, .06), 0 18px 40px -20px rgba(41, 10, 89, .32);
    --shadow-pop: 0 24px 64px -24px rgba(15, 23, 42, .38);
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, .06);

    --font-body: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;
    --font-display: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
    --font-num: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', sans-serif;

    --header-h: 64px;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 2) الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--c-line); }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--c-body);
    background: var(--c-surface);
    /* clip بدل hidden: hidden يجعل body حاوية تمرير فيكسر position:sticky لمعرض المنتج */
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.scroll-locked { overflow: hidden; }
@supports not (overflow-x: clip) { body { overflow-x: hidden; } }

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    color: var(--c-ink);
    line-height: 1.3;
    margin: 0;
    font-weight: 800;
}

p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* سمة hidden يجب أن تنتصر على أي display صريح — إصلاح جذري لعناصر كانت تظهر رغم hidden */
[hidden] { display: none !important; }

::selection { background: var(--c-primary-softer); color: var(--c-primary-dark); }

:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

.num, .font-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------- 3) الحاويات والأقسام ---------- */
.container {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 16px;
}
@media (min-width: 768px) { .container { padding-inline: 24px; } }

.section { padding-block: 22px; }
.section-last { padding-block: 22px 28px; }
@media (min-width: 768px) { .section { padding-block: 40px; } }

.section-head { margin-bottom: 16px; }
/* رأس قسم مع زر على الصف المقابل (يُلتف أسفل العنوان على الهاتف) */
.section-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.section-head-row > div { min-width: 220px; }
.section-head-row .btn { flex-shrink: 0; margin-bottom: 2px; }
.section-head .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-primary);
    background: var(--c-primary-soft);
    border: 1px solid var(--c-primary-softer);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 10px;
}
.section-head .eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c-accent);
}
.section-head h2 {
    font-size: 22px;
    letter-spacing: -0.2px;
}
@media (min-width: 768px) {
    .section-head h2 { font-size: 28px; }
}
.section-head .section-sub {
    color: var(--c-muted);
    font-size: 13.5px;
    margin-top: 6px;
    max-width: 560px;
}

/* ---------- 4) الأزرار الموحدة ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    transition: transform .16s var(--ease-out), background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .62; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); box-shadow: 0 10px 24px -12px rgba(76, 29, 149, .55); }

.btn-accent { background: var(--c-accent); color: var(--c-ink); box-shadow: 0 10px 26px -12px rgba(234, 179, 8, .55); }
.btn-accent:hover { background: var(--c-accent-dark); }

.btn-whatsapp { background: var(--c-success); color: #fff; }
.btn-whatsapp:hover { background: #15803D; }

.btn-outline { background: transparent; color: var(--c-primary); border-color: rgba(76, 29, 149, .4); }
.btn-outline:hover { background: var(--c-primary-soft); border-color: var(--c-primary); }

.btn-ghost-light { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .2); }

.btn-soft { background: var(--c-primary-soft); color: var(--c-primary); }
.btn-soft:hover { background: var(--c-primary-softer); }

.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 28px; font-size: 15px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--c-ink);
    border: 1.5px solid transparent;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
    position: relative;
    flex-shrink: 0;
}
.icon-btn:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 21px; height: 21px; }

/* ---------- 5) الشارات والوسوم ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-display);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    line-height: 1.4;
}
.badge-discount { background: var(--c-danger); color: #fff; }
.badge-best { background: var(--c-primary); color: #fff; }
.badge-soft { background: var(--c-primary-soft); color: var(--c-primary); }

.pill-count {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

/* ---------- 6) شريط الإعلان العلوي ---------- */
.topbar {
    background: var(--c-primary-deep);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px 22px;
    flex-wrap: wrap;
    min-height: 36px;
    padding-block: 5px;
}
.topbar-item { display: inline-flex; align-items: center; gap: 6px; color: rgba(233, 213, 255, .92); }
.topbar-item svg { width: 14px; height: 14px; opacity: .85; }
.topbar-item .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--c-accent); }
a.topbar-item:hover { color: #fff; }
@media (max-width: 599px) { .topbar-item.hide-sm { display: none; } }

/* ---------- 7) الهيدر ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--c-line);
    transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -12px rgba(15, 23, 42, .14); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-h);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-mark {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text .name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    color: var(--c-primary-deep);
    letter-spacing: -0.3px;
}
.logo-text .name .cod { color: var(--c-accent-dark); }
.logo-text .tagline { font-size: 10px; font-weight: 600; color: var(--c-muted); }

.main-nav {
    display: none;
    align-items: center;
    gap: 4px;
    margin-inline-start: 14px;
}
.main-nav a {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--c-body);
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    transition: color .15s ease, background-color .15s ease;
    white-space: nowrap;
}
.main-nav a:hover { color: var(--c-primary); background: var(--c-primary-soft); }
.main-nav a[aria-current="page"] { color: var(--c-primary); background: var(--c-primary-soft); }
@media (min-width: 1024px) { .main-nav { display: flex; } }

/* إصلاح: قائمة الهاتف بلا معنى على سطح المكتب حيث القائمة الكاملة معروضة — تُخفى */
@media (min-width: 1024px) { #mobile-nav-trigger { display: none; } }

/* إبراز زر «المتجر» كوجهة رئيسية للتحويل (CRO) */
.main-nav a.nav-shop {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-deep));
    color: #fff;
    margin-inline-start: 6px;
    box-shadow: 0 6px 14px -8px rgba(41, 10, 89, .55);
}
.main-nav a.nav-shop:hover { color: #fff; background: linear-gradient(135deg, var(--c-primary-deep), var(--c-primary)); }
.main-nav a.nav-shop[aria-current="page"] {
    background: linear-gradient(135deg, var(--c-primary-deep), #3B0764);
    color: #fff;
    box-shadow: inset 0 0 0 2px rgba(250, 204, 21, .55);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
}

.cart-badge {
    position: absolute;
    top: 3px;
    inset-inline-end: 2px;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border-radius: var(--radius-pill);
    background: var(--c-danger);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    font-family: var(--font-num);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}
.cart-badge[hidden] { display: none; }

@media (max-width: 599px) {
    .logo-text .tagline { display: none; }
    .logo-text .name { font-size: 17px; }
}

/* ---------- 8) قائمة التنقل للهاتف (Drawer) ---------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
    z-index: 58;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-nav {
    position: fixed;
    top: 0; bottom: 0;
    right: 0; /* من اليمين في كل الاتجاهات — قائمة الهاتف */
    width: min(320px, 88vw);
    background: #fff;
    z-index: 60;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .3s var(--ease-out), visibility 0s linear .3s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-pop);
}
.mobile-nav.open { transform: translateX(0); visibility: visible; transition: transform .3s var(--ease-out), visibility 0s; }

.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--c-line);
}
.mobile-nav-links { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-links a, .mobile-nav-links button.linklike {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--c-ink);
    background: transparent;
    border: 0;
    width: 100%;
    text-align: start;
    transition: background-color .15s ease, color .15s ease;
}
.mobile-nav-links a:hover, .mobile-nav-links button.linklike:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.mobile-nav-links svg { width: 19px; height: 19px; color: var(--c-primary); }
.mobile-nav-foot {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--c-line);
    display: grid;
    gap: 10px;
}

/* ---------- 9) الهيرو والسلايدر ---------- */
.hero {
    position: relative;
    color: #fff;
    background: radial-gradient(circle at 22% 42%, #4C1D95 0%, #290A59 55%, #14042E 100%);
    overflow: hidden;
}

/* مؤثرات خلفية خفيفة (تحترم prefers-reduced-motion) */
.hero-fx { position: absolute; inset: 0; pointer-events: none; }
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
}
.hero-orb-a { width: 420px; height: 420px; background: rgba(124, 58, 237, .45); top: -160px; inset-inline-start: -140px; animation: orbDrift 21s ease-in-out infinite alternate; }
.hero-orb-b { width: 340px; height: 340px; background: rgba(250, 204, 21, .13); bottom: -180px; inset-inline-end: -120px; animation: orbDrift 25s ease-in-out infinite alternate-reverse; }
@keyframes orbDrift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(46px, 34px) scale(1.1); }
}
.hero-dots-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.4px);
    background-size: 26px 26px;
    opacity: .3;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, .65) 0%, transparent 72%);
    mask-image: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, .65) 0%, transparent 72%);
}

.hero-stage { position: relative; z-index: 1; }

.hero-slide {
    display: none;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 14px;
    padding-block: 22px 16px;
    min-height: 0;
}
.hero-slide.is-active { display: grid; animation: slideIn .5s var(--ease-out); }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (min-width: 768px) {
    .hero-slide { grid-template-columns: 1.05fr .95fr; gap: 28px; min-height: 500px; padding-block: 40px 34px; }
}
@media (min-width: 1024px) {
    .hero-slide { min-height: 540px; padding-block: 46px 40px; gap: 40px; }
}

.hero-copy { text-align: center; order: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
@media (min-width: 768px) { .hero-copy { text-align: start; align-items: flex-start; } }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--c-primary-softer);
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .17);
    padding: 7px 14px;
    border-radius: var(--radius-pill);
}
.hero-eyebrow .pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--c-accent);
    animation: pulseDot 2.2s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.hero-title {
    color: #fff;
    font-size: 23px;
    line-height: 1.32;
    letter-spacing: -0.3px;
    max-width: 560px;
}
.hero-title .hl { color: var(--c-accent); }
@media (min-width: 768px) { .hero-title { font-size: 34px; } }
@media (min-width: 1024px) { .hero-title { font-size: 42px; } }

.hero-sub {
    color: rgba(233, 213, 255, .9);
    font-size: 13.5px;
    line-height: 1.7;
    max-width: 470px;
    font-weight: 500;
}
@media (min-width: 768px) { .hero-sub { font-size: 15px; } }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }
@media (min-width: 768px) { .hero-ctas { justify-content: flex-start; } }
.hero-ctas .btn { padding-block: 12px; }
@media (min-width: 768px) { .hero-ctas .btn { padding-block: 14px; } }

.hero-visual { order: 2; display: flex; align-items: center; justify-content: center; }
.hero-figure {
    position: relative;
    width: min(225px, 58vw);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 768px) { .hero-figure { width: min(360px, 38vw); } }
@media (min-width: 1024px) { .hero-figure { width: 400px; } }

.hero-glow {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(250, 204, 21, .26) 0%, transparent 64%);
    filter: blur(26px);
}
.hero-ring {
    position: absolute;
    inset: -6%;
    border: 1.5px dashed rgba(255, 255, 255, .22);
    border-radius: 50%;
    animation: ringSpin 46s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

.hero-figure img {
    position: relative;
    z-index: 1;
    width: 84%;
    height: 84%;
    object-fit: cover;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 30px 70px -28px rgba(0, 0, 0, .55);
    background: rgba(255, 255, 255, .07);
}

.hero-discount-bubble {
    position: absolute;
    z-index: 2;
    top: -6px;
    inset-inline-end: -8px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--c-danger);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    transform: rotate(-10deg);
    border: 2px solid rgba(255, 255, 255, .3);
    box-shadow: 0 12px 28px -10px rgba(220, 38, 38, .6);
    font-family: var(--font-display);
}
.hero-discount-bubble .lbl { font-size: 10.5px; font-weight: 700; opacity: .92; }
.hero-discount-bubble .val { font-size: 21px; font-weight: 800; font-family: var(--font-num); line-height: 1; }

/* شريحة السعر الحقيقي لمنتج الشريحة (تُبنى من البيانات — لا سعر وهمي) */
.hero-price-chip {
    position: absolute;
    z-index: 2;
    bottom: 4px;
    inset-inline-start: -6px;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 14px 30px -14px rgba(2, 6, 23, .45);
    border: 1px solid rgba(255, 255, 255, .6);
}
.hero-price-chip .lbl { font-size: 10px; font-weight: 700; color: var(--c-muted); }
.hero-price-chip .val { font-size: 15.5px; font-weight: 800; color: var(--c-primary-deep); font-family: var(--font-num); line-height: 1; }
.hero-price-chip .old { font-size: 11px; font-weight: 600; color: var(--c-faint); text-decoration: line-through; font-family: var(--font-num); line-height: 1; }

/* أدوات التحكم في السلايدر */
.hero-controls {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding-block: 0 12px;
}
@media (min-width: 768px) { .hero-controls { justify-content: space-between; padding-block: 0 20px; } }

.hero-arrows { display: flex; gap: 8px; order: 2; }
.hero-arrow {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .09);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .18s ease, transform .18s ease, border-color .18s ease;
}
.hero-arrow:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .5); }
.hero-arrow:active { transform: scale(.92); }
.hero-arrow svg { width: 19px; height: 19px; }

.hero-dots { display: flex; align-items: center; gap: 7px; order: 1; }
.hero-dot {
    width: 9px; height: 9px;
    padding: 0;
    border-radius: var(--radius-pill);
    border: 0;
    background: rgba(255, 255, 255, .34);
    transition: width .3s var(--ease-out), background-color .2s ease;
    position: relative;
    overflow: hidden;
}
.hero-dot:hover { background: rgba(255, 255, 255, .6); }
.hero-dot.is-active { width: 34px; background: rgba(255, 255, 255, .28); }
.hero-dot .dot-fill {
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: right;
}
.hero-dot.is-active .dot-fill.is-running { animation: dotFill var(--hero-interval, 6000ms) linear forwards; }
.hero.is-paused .dot-fill.is-running { animation-play-state: paused; }
@keyframes dotFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero-counter {
    display: none;
    align-items: baseline;
    gap: 2px;
    font-family: var(--font-num);
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, .78);
    order: 3;
}
@media (min-width: 768px) { .hero-counter { display: flex; } }
.hero-counter .cur { color: #fff; font-size: 16px; }

/* شريط الثقة المتحرك أسفل الهيرو */
.hero-marquee {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, .1);
    overflow: hidden;
    padding-block: 9px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee-track {
    display: flex;
    gap: 38px;
    width: max-content;
    animation: marquee 30s linear infinite;
}
.hero-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }
[dir="rtl"] .marquee-track { animation-name: marqueeRtl; }
@keyframes marqueeRtl { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(233, 213, 255, .88);
    white-space: nowrap;
}
.marquee-item svg { width: 15px; height: 15px; color: var(--c-accent); opacity: .9; }

/* ---------- 10) شريط المميزات ---------- */
.trust-strip { margin-top: -1px; }
.trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 768px) { .trust-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
}
.trust-item .ico {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.trust-item .ico svg { width: 21px; height: 21px; }
.trust-item .ico.purple { background: var(--c-primary-soft); color: var(--c-primary); }
.trust-item .ico.green { background: var(--c-success-soft); color: var(--c-success); }
.trust-item .ico.amber { background: #FFFBEB; color: #B45309; }
.trust-item .ico.sky { background: #F0F9FF; color: #0284C7; }
.trust-item h3 { font-size: 13.5px; margin-bottom: 1px; }
.trust-item p { font-size: 11.5px; color: var(--c-muted); }

/* ---------- 11) التصنيفات (بطاقات بصور حقيقية تفتح صفحات مستقلة) ---------- */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 480px) { .cats-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 768px) { .cats-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .cats-grid { grid-template-columns: repeat(7, 1fr); } }

.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 0;
    text-align: start;
    font-family: var(--font-display);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s var(--ease-out);
}
@media (hover: hover) {
    .cat-card:hover { border-color: rgba(76, 29, 149, .45); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
    .cat-card:hover .cat-thumb img { transform: scale(1.06); }
    .cat-card:hover .cat-go { opacity: 1; transform: none; }
}
.cat-card:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.cat-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--c-surface);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s var(--ease-out);
}
.cat-fallback { color: var(--c-primary); opacity: .8; }
.cat-fallback svg { width: 34px; height: 34px; }

.cat-card .cat-go {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s var(--ease-out);
    z-index: 2;
}
.cat-go svg { width: 13px; height: 13px; }

.cat-card .cat-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 12px;
    min-width: 0;
}
.cat-card .cat-label {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-ink);
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}
.cat-card .cat-count {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--font-num);
    color: var(--c-muted);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 1px 9px;
    line-height: 1.5;
}

/* بطاقة «جميع المنتجات»: وجهة صفحة المتجر بهوية متجر مميزة */
.cat-card.cat-card-all { background: linear-gradient(145deg, #4C1D95, #290A59); border-color: transparent; }
.cat-card.cat-card-all .cat-thumb { background: transparent; }
.cat-card.cat-card-all .cat-fallback { color: rgba(255, 255, 255, .95); opacity: 1; }
.cat-card.cat-card-all .cat-fallback svg { width: 44px; height: 44px; }
.cat-card.cat-card-all .cat-label { color: #fff; }
.cat-card.cat-card-all .cat-count { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; }
@media (hover: hover) {
    .cat-card.cat-card-all:hover { box-shadow: 0 18px 40px -18px rgba(41, 10, 89, .55); }
}

/* ---------- 12) أدوات التحكم بالمنتجات (Toolbar) ---------- */
.catalog-toolbar {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 12px;
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}
@media (min-width: 768px) {
    .catalog-toolbar { grid-template-columns: 1fr auto auto; align-items: center; padding: 14px 16px; }
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
}
.search-field > svg {
    position: absolute;
    inset-inline-start: 14px;
    width: 18px; height: 18px;
    color: var(--c-faint);
    pointer-events: none;
}
.search-field input {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--c-line);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    padding-inline: 42px 40px;
    font-size: 13.5px;
    color: var(--c-ink);
    outline: none;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.search-field input::placeholder { color: var(--c-faint); }
.search-field input:focus { border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 3px rgba(76, 29, 149, .12); }
.search-clear {
    position: absolute;
    inset-inline-end: 8px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--c-line-soft);
    color: var(--c-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    transition: background-color .15s ease, color .15s ease;
}
.search-clear:hover { background: var(--c-line); color: var(--c-ink); }
.search-clear svg { width: 13px; height: 13px; }
.search-clear[hidden] { display: none; }

.select-wrap { position: relative; }
.select-wrap select {
    height: 46px;
    min-width: 190px;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid var(--c-line);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    color: var(--c-ink);
    font-size: 13px;
    font-weight: 700;
    padding-inline: 14px 36px;
    cursor: pointer;
    outline: none;
    transition: border-color .16s ease;
    width: 100%;
}
.select-wrap select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(76, 29, 149, .12); }
.select-wrap > svg {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px; height: 15px;
    color: var(--c-muted);
    pointer-events: none;
}
@media (max-width: 767px) { .select-wrap select { min-width: 0; } }

.toolbar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.toolbar-meta .results-count { font-size: 12.5px; color: var(--c-muted); font-weight: 600; }
.toolbar-meta .results-count strong { color: var(--c-ink); font-family: var(--font-num); }
.active-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 13) شبكة وبطاقات المنتجات ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 480px) { .products-grid { gap: 14px; } }
@media (min-width: 768px) { .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

.product-card {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s var(--ease-out);
}
@media (hover: hover) {
    .product-card:hover { border-color: rgba(76, 29, 149, .45); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
}

.pc-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #F8F9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    cursor: pointer;
    overflow: hidden;
}
.pc-media img {
    max-width: 100%;
    max-height: 100%;
    width: auto; height: auto;
    object-fit: contain;
    transition: transform .3s var(--ease-out);
}
@media (hover: hover) {
    .product-card:hover .pc-media img { transform: scale(1.05); }
}
.pc-badges {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
    z-index: 2;
}
.pc-quick {
    position: absolute;
    bottom: 10px;
    inset-inline-start: 10px;
    inset-inline-end: 10px;
    z-index: 2;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s var(--ease-out);
}
@media (hover: hover) {
    .product-card:hover .pc-quick { opacity: 1; transform: none; }
}
@media (hover: none) { .pc-quick { display: none; } }

.pc-body {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.pc-cat { font-size: 10.5px; font-weight: 700; color: var(--c-faint); letter-spacing: .2px; }
.pc-title {
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.45;
    color: var(--c-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
    cursor: pointer;
    transition: color .15s ease;
}
.pc-title:hover { color: var(--c-primary); }
.pc-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-muted);
}
.pc-rating svg { width: 13px; height: 13px; color: var(--c-accent-dark); fill: var(--c-accent); }
.pc-pricing { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.pc-price {
    font-family: var(--font-num);
    font-size: 16.5px;
    font-weight: 800;
    color: var(--c-danger);
    letter-spacing: -0.2px;
}
.pc-price .unit { font-size: 11px; font-weight: 700; color: inherit; opacity: .85; }
.pc-old {
    font-family: var(--font-num);
    font-size: 12px;
    color: var(--c-faint);
    text-decoration: line-through;
}
.pc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.pc-actions .btn { padding: 13px 8px; font-size: 12.5px; border-radius: var(--radius-sm); }
/* شارة طريقة الدفع الحقيقية للمتجر (COD) — من هوية المتجر نفسه لا من ادعاء */
.pc-cod {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--c-success);
    margin-top: -1px;
}
.pc-cod svg { width: 12px; height: 12px; flex-shrink: 0; }

/* حالة عدم وجود نتائج */
.empty-state {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px dashed var(--c-line);
    border-radius: var(--radius-xl);
    padding: 44px 24px;
    text-align: center;
}
.empty-state .ico {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--c-surface);
    color: var(--c-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.empty-state .ico svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--c-muted); margin-bottom: 16px; }

.load-more-wrap { display: flex; justify-content: center; margin-top: 22px; }

/* ---------- 14) البانرات الترويجية ---------- */
.promo-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .promo-grid { grid-template-columns: 1fr 1fr; } }
.promo-card {
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.promo-card.red { background: linear-gradient(120deg, #DC2626, #B91C1C); }
.promo-card.dark { background: linear-gradient(120deg, #3B0764, #6D28D9); }
.promo-card h3 { color: #fff; font-size: 17px; margin-bottom: 4px; }
@media (min-width: 768px) { .promo-card h3 { font-size: 19px; } }
.promo-card p { font-size: 12px; opacity: .88; margin-bottom: 12px; }
.promo-card .promo-visual {
    width: 84px; height: 84px;
    border-radius: 20px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .14);
    padding: 6px;
}
.promo-card .promo-stat {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: #fff;
    color: var(--c-danger);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-display);
    border: 4px solid rgba(255, 255, 255, .35);
}
.promo-card .promo-stat .lbl { font-size: 10.5px; font-weight: 700; }
.promo-card .promo-stat .val { font-size: 24px; font-weight: 800; font-family: var(--font-num); line-height: 1.1; }

/* ---------- 15) CTA السفلي ---------- */
.cta-band {
    background: linear-gradient(120deg, var(--c-primary-dark) 0%, #6D28D9 100%);
    border-radius: var(--radius-xl);
    color: #fff;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
@media (min-width: 768px) {
    .cta-band { flex-direction: row; justify-content: space-between; text-align: start; padding: 30px 36px; }
}
.cta-band h3 { color: #fff; font-size: 21px; }
@media (min-width: 768px) { .cta-band h3 { font-size: 25px; } }
.cta-band p { font-size: 13px; color: rgba(233, 213, 255, .9); margin-top: 4px; }

/* ---------- 16) صفحة تفاصيل المنتج ---------- */
.pdp-view { padding-block: 20px 40px; }
@media (min-width: 768px) { .pdp-view { padding-block: 28px 56px; } }

/* خلفية مسرحية تُبرز المنتج كنقطة التركيز في أعلى الصفحة (طبقة خلف المحتوى — لا تؤثر على sticky) */
#pdp-view { position: relative; z-index: 0; }
#pdp-view::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 420px;
    background:
        radial-gradient(640px 320px at 88% -90px, rgba(124, 58, 237, .09), transparent 68%),
        radial-gradient(520px 280px at 8% -70px, rgba(234, 179, 8, .07), transparent 68%);
    pointer-events: none;
    z-index: -1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--c-muted);
    margin-bottom: 16px;
    font-weight: 600;
}
.breadcrumb button, .breadcrumb a {
    background: none;
    border: 0;
    padding: 2px 4px;
    color: var(--c-muted);
    font: inherit;
    border-radius: 6px;
    transition: color .15s ease;
}
.breadcrumb button:hover { color: var(--c-primary); }
.breadcrumb .sep { color: var(--c-faint); }
.breadcrumb .current { color: var(--c-ink); font-weight: 700; }

.pdp-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
}
@media (min-width: 1024px) {
    /* عمودان متوازنان: الصور 45% (يمين في RTL) والتفاصيل 55% (تحمل الخيارات والنموذج والوصف) */
    .pdp-layout { grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); gap: 32px; }
    /* المعرض اللاصق: صور المنتج تبقى ثابتة أعلى الصفحة أثناء تمرير التفاصيل والوصف */
    .pdp-gallery-col {
        position: sticky;
        top: calc(var(--header-h) + 14px);
        align-self: start;
        /* سقف الارتفاع: يضمن بقاء المصغرات ضمن الشاشة وإيقاف الالتصاق عند حدود الحاوية الأصلية */
        max-height: calc(100vh - var(--header-h) - 28px);
    }
    .gallery-main {
        /* منع تجاوز ارتفاع الشاشة: الصورة الرئيسية تتقلص مع الحفاظ على تناسبها (لا تشويه) */
        max-height: max(340px, calc(100vh - var(--header-h) - 128px));
    }
}

/* المعرض — الحاسوب */
.gallery-main {
    position: relative;
    background: radial-gradient(circle at 50% 45%, #FFFFFF 0%, #F4F5F7 78%, #ECEEF2 100%);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-xl);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    overflow: hidden;
}
@media (min-width: 768px) { .gallery-main { cursor: zoom-in; } }
.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    width: auto; height: auto;
    object-fit: contain;
    transition: transform .25s var(--ease-out), opacity .26s var(--ease-out);
    transform-origin: center;
}
/* انتقال سلس عند تبديل الصور (تعتمد مدتها على REDUCED_MOTION في JS) */
.gallery-main img.is-swapping { opacity: 0; transform: scale(.975); }
/* شارة الخصم الحقيقية على الصورة الرئيسية — تُملأ من بيانات المنتج فقط */
.gallery-flag {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 3;
    background: linear-gradient(135deg, #EF4444, var(--c-danger));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 18px -8px rgba(220, 38, 38, .6);
    font-family: var(--font-display);
}
.gallery-flag[hidden] { display: none; }
@media (min-width: 768px) { .gallery-main img { will-change: transform; } }
.gallery-hint {
    position: absolute;
    bottom: 12px;
    inset-inline-start: 12px;
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-muted);
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    box-shadow: var(--shadow-soft);
    pointer-events: none;
}
@media (min-width: 768px) { .gallery-hint { display: inline-flex; } }
.gallery-hint svg { width: 14px; height: 14px; }
.gallery-counter {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    font-family: var(--font-num);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--c-body);
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 5px 11px;
    box-shadow: var(--shadow-soft);
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--c-line);
    color: var(--c-ink);
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    transition: background-color .15s ease, transform .15s ease;
    z-index: 2;
}
@media (min-width: 768px) { .gallery-nav { display: flex; } }
.gallery-nav:hover { background: #fff; }
.gallery-nav:active { transform: translateY(-50%) scale(.93); }
.gallery-nav.prev { inset-inline-start: 12px; }
.gallery-nav.next { inset-inline-end: 12px; }
.gallery-nav svg { width: 17px; height: 17px; }

.gallery-thumbs {
    display: none;
    margin-top: 12px;
}
/* صف مصغرات ثابت المقاس وسط الصفحة: ارتفاع متوقع يحمي حساب الالتصاق مع أي عدد صور */
@media (min-width: 768px) {
    .gallery-thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
    .gallery-thumbs .gallery-thumb { width: 86px; flex-shrink: 0; }
}
.gallery-thumb {
    aspect-ratio: 1 / 1;
    border: 2px solid var(--c-line);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.gallery-thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.gallery-thumb:hover { border-color: #A78BFA; }
.gallery-thumbs .gallery-thumb:hover { transform: translateY(-2px); }
.gallery-thumb.is-active {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(76, 29, 149, .14);
}

/* المعرض — الهاتف (Scroll Snap) */
.snap-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: var(--radius-xl);
    border: 1px solid var(--c-line);
    background: radial-gradient(circle at 50% 45%, #FFFFFF 0%, #F4F5F7 78%, #ECEEF2 100%);
}
.snap-carousel::-webkit-scrollbar { display: none; }
.snap-slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.snap-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.mobile-thumbs { display: flex; gap: 9px; margin-top: 11px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mobile-thumbs::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .mobile-thumbs { display: none; } }
.mobile-thumbs .gallery-thumb { width: 62px; flex-shrink: 0; aspect-ratio: 1/1; padding: 6px; }

/* لوحة معلومات المنتج */
.pdp-info { display: flex; flex-direction: column; gap: 16px; }
.pdp-cat-pill {
    display: inline-flex;
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--c-primary);
    background: var(--c-primary-soft);
    border: 1px solid var(--c-primary-softer);
    padding: 5px 13px;
    border-radius: var(--radius-pill);
}
.pdp-title { font-size: 21px; line-height: 1.4; letter-spacing: -0.2px; }
@media (min-width: 768px) { .pdp-title { font-size: 26px; } }

.pdp-rating-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdp-rating-row .rating-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-num);
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-ink);
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
}
.pdp-rating-row .rating-chip svg { width: 14px; height: 14px; fill: var(--c-accent); color: var(--c-accent-dark); }
.pdp-rating-row .rating-note { font-size: 11.5px; color: var(--c-faint); }

/* بطاقة السعر: العنصر التجاري الأساسي — لوحة مميزة بلون الهوية مع سطر الدفع عند الاستلام */
.pdp-price-card {
    background: linear-gradient(135deg, #fff 0%, var(--c-primary-soft) 140%);
    border: 1px solid var(--c-primary-softer);
    border-radius: var(--radius-lg);
    padding: 14px 16px 12px;
    box-shadow: var(--shadow-soft);
}
.pdp-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.pdp-price-now {
    font-family: var(--font-num);
    font-size: 31px;
    font-weight: 800;
    color: var(--c-danger);
    line-height: 1.1;
}
.pdp-price-now .unit { font-size: 14px; font-weight: 700; }
.pdp-price-old-block { display: flex; align-items: center; gap: 9px; }
.pdp-price-old { font-family: var(--font-num); font-size: 15px; color: var(--c-faint); text-decoration: line-through; }
.pdp-save-tag {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--c-success);
    background: var(--c-success-soft);
    border: 1px solid #BBF7D0;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}
/* شارة نسبة الخصم الحقيقية (تظهر فقط مع خصم فعلي من البيانات) */
.pdp-discount-badge {
    font-family: var(--font-num);
    font-size: 12.5px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #EF4444, var(--c-danger));
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    box-shadow: 0 6px 14px -8px rgba(220, 38, 38, .55);
}
.pdp-discount-badge[hidden] { display: none; }
.pdp-cod-line {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px dashed var(--c-primary-softer);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--c-primary-dark);
}
.pdp-cod-line svg { width: 15px; height: 15px; flex-shrink: 0; }
.pdp-shortdesc { font-size: 14px; color: var(--c-body); line-height: 1.75; }

.pdp-highlights {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
@media (min-width: 480px) { .pdp-highlights { grid-template-columns: 1fr 1fr; } }
.pdp-highlights li {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #fff;
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-ink);
    line-height: 1.5;
}
.pdp-highlights svg { width: 16px; height: 16px; color: var(--c-success); flex-shrink: 0; }

/* خيارات المنتج */
.option-block { display: flex; flex-direction: column; gap: 9px; }
.option-label { font-size: 12.5px; font-weight: 800; color: var(--c-ink); font-family: var(--font-display); }
.option-label .sel-val { color: var(--c-primary); }
.swatch-row { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--c-line);
    background: #fff;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-body);
    transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.swatch .swatch-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(15, 23, 42, .18); }
.swatch:hover { border-color: #A78BFA; }
.swatch.is-active {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    box-shadow: 0 0 0 1px var(--c-primary);
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--c-line);
    border-radius: var(--radius-pill);
    background: #fff;
    overflow: hidden;
    height: 48px;
}
.qty-stepper button {
    width: 44px; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--c-primary);
    transition: background-color .15s ease;
}
.qty-stepper button:hover { background: var(--c-primary-soft); }
.qty-stepper button:disabled { color: var(--c-faint); cursor: not-allowed; background: transparent; }
.qty-stepper button svg { width: 16px; height: 16px; }
.qty-val {
    min-width: 44px;
    text-align: center;
    font-family: var(--font-num);
    font-size: 16px;
    font-weight: 800;
    color: var(--c-ink);
    border-inline: 1.5px solid var(--c-line);
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-save-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-success);
    background: var(--c-success-soft);
    border: 1px solid #BBF7D0;
    padding: 8px 13px;
    border-radius: var(--radius-pill);
}
.qty-save-note svg { width: 14px; height: 14px; }
.qty-save-note[hidden] { display: none; }

/* شرائح خصم الكميات — مبنية آلياً من STORE_CONFIG.volumeDiscounts (لا أرقام يدوية) */
.tier-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tier-chips[hidden] { display: none; }
.tier-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--c-muted);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    padding: 6px 11px;
    border-radius: var(--radius-pill);
    transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.tier-chip svg { width: 12px; height: 12px; opacity: .45; }
.tier-chip.is-active {
    color: var(--c-success);
    background: var(--c-success-soft);
    border-color: #BBF7D0;
}
.tier-chip.is-active svg { opacity: 1; }

/* نبضة العداد عند تغيير الكمية أو إضافة للسلة */
@keyframes qtyBump { 0% { transform: scale(1); } 45% { transform: scale(1.24); } 100% { transform: scale(1); } }
.qty-val.bump { animation: qtyBump .26s var(--ease-out); }
.cart-badge.bump { animation: qtyBump .42s var(--ease-out); }

.pdp-actions { display: grid; gap: 10px; grid-template-columns: 1fr; }
.pdp-actions .btn { padding-block: 15px; transition: transform .18s var(--ease-out), box-shadow .18s ease; }
.pdp-actions .btn:hover { transform: translateY(-1.5px); }
.pdp-actions .btn:active { transform: translateY(0) scale(.99); }
.pdp-actions .btn-accent { font-size: 15px; padding-block: 16px; }

/* شبكة الثقة: خدمات حقيقية فقط من إعدادات المتجر (COD/توصيل/إرجاع/تأكيد هاتفي) */
.pdp-trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
@media (max-width: 359px) { .pdp-trust-grid { grid-template-columns: 1fr; } }
.pdp-trust-grid .tg-item {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--c-ink);
    line-height: 1.45;
}
.pdp-trust-grid .tg-item svg { width: 17px; height: 17px; color: var(--c-primary); flex-shrink: 0; }

/* رابط الدعم الحقيقي عبر واتساب (نفس الرقم المركزي للمتجر) */
.pdp-support-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-primary-dark);
    background: var(--c-primary-soft);
    border: 1px dashed var(--c-primary-softer);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    transition: background-color .16s ease;
}
.pdp-support-link svg { width: 16px; height: 16px; color: #16A34A; flex-shrink: 0; }
.pdp-support-link:hover { background: #EDE9FE; }

/* التبويبات (الوصف / المواصفات) */
.pdp-tabs { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg); overflow: hidden; }
.tab-buttons { display: flex; border-bottom: 1px solid var(--c-line); overflow-x: auto; scrollbar-width: none; }
.tab-buttons::-webkit-scrollbar { display: none; }
.tab-btn {
    flex: 1;
    padding: 13px 16px;
    background: transparent;
    border: 0;
    border-bottom: 2.5px solid transparent;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    color: var(--c-muted);
    transition: color .16s ease, border-color .16s ease, background-color .16s ease;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--c-primary); background: var(--c-primary-soft); }
.tab-btn.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); background: var(--c-primary-soft); }
.tab-panel { padding: 16px; font-size: 13.5px; line-height: 1.8; color: var(--c-body); }
.tab-panel[hidden] { display: none; }

/* عرض الوصف باحترافية: فقرة افتتاحية مميزة + قائمة مميزات منسقة (نفس البيانات دون تغيير) */
.pdp-desc-lead {
    font-size: 14px;
    line-height: 2.05;
    color: var(--c-body);
    padding-inline-start: 14px;
    border-inline-start: 3px solid var(--c-primary-softer);
    margin-bottom: 16px;
    max-width: 68ch;
}
.pdp-desc-sub {
    font-size: 13px;
    font-weight: 800;
    color: var(--c-ink);
    font-family: var(--font-display);
    margin-bottom: 10px;
}
.pdp-desc-list { display: grid; grid-template-columns: 1fr; gap: 7px; }
@media (min-width: 480px) { .pdp-desc-list { grid-template-columns: 1fr 1fr; } }
.pdp-desc-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-ink);
    line-height: 1.6;
}
.pdp-desc-list svg { width: 14px; height: 14px; color: var(--c-success); flex-shrink: 0; }

.specs-list { display: grid; gap: 0; }
.specs-list .spec-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-block: 11px;
    border-bottom: 1px dashed var(--c-line);
    font-size: 13.5px;
}
.specs-list .spec-row:last-child { border-bottom: 0; }
.specs-list .spec-k { color: var(--c-muted); }
.specs-list .spec-v { font-weight: 700; color: var(--c-ink); font-family: var(--font-num); text-align: start; }

/* منتجات مرتبطة */
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 768px) { .related-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .related-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

/* ---------- 17) نموذج الطلب COD ---------- */
.cod-form {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
/* وميض توجيه الانتباه عند الضغط على «اطلب الآن» (بدون إزعاج) */
@keyframes codFlash { 0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .4); } 100% { box-shadow: 0 0 0 16px rgba(124, 58, 237, 0); } }
.cod-form.flash { animation: codFlash .8s var(--ease-out) 1; }
/* شريط تقدم حقيقي لإكمال بيانات الطلب (0-4 حقول مطلوبة) */
.cod-progress { height: 5px; background: rgba(255, 255, 255, .28); }
.cod-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--c-accent);
    transition: width .4s var(--ease-out), background-color .3s ease;
}
.cod-progress-fill.complete { background: #4ADE80; }
.cod-form-head {
    background: linear-gradient(120deg, var(--c-primary-dark), #6D28D9);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cod-form-head .fh-ico {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cod-form-head .fh-ico svg { width: 21px; height: 21px; }
.cod-form-head h3 { color: #fff; font-size: 15.5px; }
.cod-form-head p { font-size: 11.5px; color: rgba(233, 213, 255, .85); margin-top: 2px; }
.cod-cod-tag {
    margin-inline-start: auto;
    background: var(--c-accent);
    color: var(--c-ink);
    font-size: 10.5px;
    font-weight: 800;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    font-family: var(--font-display);
}

.cod-form-body { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 768px) { .cod-form-body { padding: 20px; } }

.cod-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.cod-section-title .step-num {
    /* إلغاء قاعدة .step-num العامة (أرقام بطاقات خطوات الرئيسية) التي تُخرج الرقم من موضعه داخل النموذج */
    position: static;
    top: auto;
    inset-inline-end: auto;
    width: 26px; height: 22px;
    border-radius: 7px;
    background: var(--c-primary-softer);
    color: var(--c-primary);
    font-family: var(--font-num);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cod-section-title .t { font-size: 13px; font-weight: 800; color: var(--c-ink); white-space: nowrap; font-family: var(--font-display); }
.cod-section-title .line { height: 1px; background: var(--c-line); flex: 1; }
.cod-section-title .step-num { transition: background-color .25s ease, color .25s ease; }
.cod-section-title.done .step-num { background: var(--c-success-soft); color: var(--c-success); }
.cod-section-title.done .t { color: var(--c-success); }

.form-grid { display: grid; gap: 11px; }
@media (min-width: 560px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-ink);
    display: flex;
    align-items: center;
    gap: 4px;
}
.form-field label .req { color: var(--c-danger); }
.form-field .input, .form-field select.input {
    height: 48px;
    border: 1.5px solid var(--c-line);
    border-radius: var(--radius-md);
    background: #fff;
    padding-inline: 14px;
    font-size: 13.5px;
    color: var(--c-ink);
    outline: none;
    width: 100%;
    transition: border-color .16s ease, box-shadow .16s ease;
    appearance: none;
    -webkit-appearance: none;
}
.form-field textarea.input { height: auto; min-height: 74px; resize: vertical; padding-block: 12px; }
.form-field .input::placeholder { color: var(--c-faint); }
.form-field .input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(76, 29, 149, .12); }
.form-field .input.input-error { border-color: var(--c-danger); background: var(--c-danger-soft); }
.form-field .input.input-error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.field-error {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-danger);
    padding-inline: 4px;
}
.field-error svg { width: 12px; height: 12px; flex-shrink: 0; }
.field-error.show { display: flex; }

.phone-wrap {
    display: flex;
    align-items: stretch;
    height: 48px;
    border: 1.5px solid var(--c-line);
    border-radius: var(--radius-md);
    overflow: hidden;
    direction: ltr;
    transition: border-color .16s ease, box-shadow .16s ease;
    background: #fff;
}
.phone-wrap:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(76, 29, 149, .12); }
.phone-wrap.input-error { border-color: var(--c-danger); }
.phone-wrap .prefix {
    display: flex;
    align-items: center;
    background: var(--c-surface);
    color: var(--c-muted);
    font-family: var(--font-num);
    font-size: 13px;
    font-weight: 700;
    padding-inline: 13px;
    border-inline-end: 1.5px solid var(--c-line);
    user-select: none;
}
.phone-wrap input {
    flex: 1;
    border: 0;
    outline: none;
    padding-inline: 12px;
    font-size: 13.5px;
    font-family: var(--font-num);
    color: var(--c-ink);
    background: transparent;
    min-width: 0;
}

.select-wrap.cod-select select { height: 48px; border: 1.5px solid var(--c-line); border-radius: var(--radius-md); background: #fff; width: 100%; font-size: 13.5px; font-weight: 600; }
.select-wrap.cod-select select.input-error { border-color: var(--c-danger); background: var(--c-danger-soft); }

/* ملخص الطلب داخل النموذج */
.order-summary {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.summary-items { display: flex; flex-direction: column; gap: 9px; }
.summary-item {
    display: flex;
    align-items: center;
    gap: 11px;
}
.summary-item img {
    width: 52px; height: 52px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    padding: 5px;
    flex-shrink: 0;
}
.summary-item .si-info { flex: 1; min-width: 0; }
.summary-item .si-name {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.summary-item .si-meta { font-size: 11px; color: var(--c-muted); margin-top: 2px; }
.summary-item .si-price { font-family: var(--font-num); font-size: 12.5px; font-weight: 800; color: var(--c-ink); white-space: nowrap; }

.summary-rows { display: flex; flex-direction: column; gap: 7px; border-top: 1px dashed var(--c-line); padding-top: 10px; }
.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
    color: var(--c-muted);
    font-weight: 600;
}
.summary-row .v { font-family: var(--font-num); font-weight: 700; color: var(--c-ink); }
.summary-row.total {
    border-top: 1px solid var(--c-line);
    padding-top: 10px;
    font-size: 14px;
    font-weight: 800;
    color: var(--c-ink);
    font-family: var(--font-display);
}
.summary-row.total .v { font-size: 19px; color: var(--c-danger); font-weight: 800; }
.summary-row .free { color: var(--c-success); font-weight: 800; }

/* شريط تقدم التوصيل المجاني */
.ship-progress { display: flex; flex-direction: column; gap: 7px; }
.ship-progress .sp-label { font-size: 11.5px; font-weight: 700; color: var(--c-primary); }
.ship-progress .sp-label.free { color: var(--c-success); }
.ship-progress .sp-track {
    height: 8px;
    background: var(--c-primary-softer);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.ship-progress .sp-fill {
    height: 100%;
    background: var(--c-primary);
    border-radius: inherit;
    transition: width .4s var(--ease-out), background-color .3s ease;
}
.ship-progress .sp-fill.free { background: var(--c-success); }

.cod-submit-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11.5px;
    color: var(--c-muted);
    background: var(--c-surface);
    border: 1px dashed var(--c-line);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    line-height: 1.7;
}
.cod-submit-note svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--c-primary); margin-top: 2px; }

/* ---------- 18) السلة (Drawer) ---------- */
.cart-drawer {
    position: fixed;
    top: 0; bottom: 0;
    left: 0; /* من اليسار في كل الاتجاهات — درج السلة */
    width: min(410px, 94vw);
    background: #fff;
    z-index: 60;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .3s var(--ease-out), visibility 0s linear .3s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-pop);
}
.cart-drawer.open { transform: translateX(0); visibility: visible; transition: transform .3s var(--ease-out), visibility 0s; }

.cart-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--c-line);
    background: #fff;
}
.cart-head h3 { font-size: 15.5px; }
.cart-head .pill-count { margin-inline-start: 2px; }
.cart-head .close-btn { margin-inline-start: auto; }

.cart-items { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 11px; }
.cart-item {
    display: flex;
    gap: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-lg);
    padding: 11px;
}
.cart-item img {
    width: 62px; height: 62px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    padding: 6px;
    flex-shrink: 0;
}
.cart-item .ci-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cart-item .ci-name {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item .ci-color { font-size: 10.5px; color: var(--c-muted); font-weight: 600; }
.cart-item .ci-price { font-family: var(--font-num); font-size: 13px; font-weight: 800; color: var(--c-primary); }
.cart-item .ci-controls { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cart-item .ci-controls .qty-stepper { height: 36px; }
.cart-item .ci-controls .qty-stepper button { width: 34px; }
.cart-item .ci-controls .qty-stepper .qty-val { min-width: 34px; font-size: 13.5px; }
.cart-item .ci-remove {
    width: 34px; height: 36px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--c-line);
    color: var(--c-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
    margin-inline-start: auto;
}
.cart-item .ci-remove:hover { color: var(--c-danger); border-color: #FCA5A5; background: var(--c-danger-soft); }
.cart-item .ci-remove svg { width: 15px; height: 15px; }

.cart-empty { text-align: center; padding: 48px 20px; }
.cart-empty .ico {
    width: 66px; height: 66px;
    border-radius: 50%;
    background: var(--c-surface);
    color: var(--c-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.cart-empty .ico svg { width: 30px; height: 30px; }
.cart-empty h4 { font-size: 15px; margin-bottom: 5px; }
.cart-empty p { font-size: 12.5px; color: var(--c-muted); margin-bottom: 16px; }

.cart-foot {
    border-top: 1px solid var(--c-line);
    padding: 14px 16px 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cart-foot .cf-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--c-muted);
    font-weight: 600;
}
.cart-foot .cf-row .v { font-family: var(--font-num); font-weight: 700; color: var(--c-ink); }
.cart-foot .cf-row.grand { font-size: 14.5px; font-weight: 800; color: var(--c-ink); font-family: var(--font-display); }
.cart-foot .cf-row.grand .v { font-size: 19px; color: var(--c-danger); }
.cart-foot .ship-progress { margin-block: 2px; }

/* ---------- 19) النوافذ المنبثقة (Modals) ---------- */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 6, 23, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-root.open { display: flex; }
.modal-card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-pop);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn .3s var(--ease-out);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 0;
}
.modal-head .m-ico {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-head .m-ico svg { width: 22px; height: 22px; }
.modal-head h3 { font-size: 16.5px; line-height: 1.4; }
.modal-head .close-btn { margin-inline-start: auto; }
.modal-body { padding: 14px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-note {
    font-size: 12px;
    line-height: 1.8;
    padding: 11px 13px;
    border-radius: var(--radius-md);
}
.modal-note.info { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.modal-note.success { background: var(--c-success-soft); border: 1px solid #BBF7D0; color: #166534; }
.receipt {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
}
.receipt .r-row { display: flex; justify-content: space-between; gap: 14px; }
.receipt .r-row .k { color: var(--c-muted); flex-shrink: 0; }
.receipt .r-row .v { font-weight: 700; color: var(--c-ink); text-align: start; overflow-wrap: anywhere; }
.receipt .r-row.grand {
    border-top: 1px solid var(--c-line);
    padding-top: 9px;
    font-weight: 800;
    color: var(--c-ink);
}
.receipt .r-row.grand .v { font-family: var(--font-num); color: var(--c-danger); font-size: 15px; }

/* Lightbox المعرض */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(2, 6, 23, .93);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: min(92vw, 860px);
    max-height: 76vh;
    width: auto; height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .04);
}
.lightbox .lb-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease;
}
.lightbox .lb-close:hover { background: rgba(255, 255, 255, .25); }
.lightbox .lb-close svg { width: 20px; height: 20px; }
.lightbox .lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease;
}
.lightbox .lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox .lb-nav svg { width: 20px; height: 20px; }
.lightbox .lb-nav.prev { inset-inline-start: 14px; }
.lightbox .lb-nav.next { inset-inline-end: 14px; }
.lightbox .lb-counter {
    position: absolute;
    bottom: 18px;
    font-family: var(--font-num);
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    padding: 6px 15px;
    border-radius: var(--radius-pill);
}

/* ---------- 20) الفوتر ---------- */
.site-footer {
    background: #110B29;
    color: #fff;
    margin-top: 26px;
    padding-top: 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    padding-bottom: 24px;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1.3fr; gap: 22px; } }
.footer-brand .logo-text .name { color: #fff; }
.footer-brand p { font-size: 12.5px; color: rgba(226, 232, 240, .72); line-height: 1.8; margin-top: 12px; max-width: 300px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col ul a, .footer-col ul button.linklike {
    font-size: 12.5px;
    color: rgba(226, 232, 240, .72);
    background: none;
    border: 0;
    padding: 0;
    font-weight: 600;
    text-align: start;
    transition: color .15s ease;
    cursor: pointer;
}
.footer-col ul a:hover, .footer-col ul button.linklike:hover { color: var(--c-accent); }
.footer-contact-list { display: flex; flex-direction: column; gap: 10px; }
.footer-contact-list .fc-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(226, 232, 240, .78); font-weight: 600; }
.footer-contact-list .fc-item svg { width: 16px; height: 16px; color: var(--c-accent); flex-shrink: 0; }
.footer-contact-list a.fc-item:hover { color: #fff; }

.newsletter-box { display: flex; flex-direction: column; gap: 10px; }
.newsletter-box p { font-size: 12px; color: rgba(226, 232, 240, .72); line-height: 1.7; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    color: #fff;
    padding-inline: 14px;
    font-size: 13px;
    outline: none;
    transition: border-color .16s ease, background-color .16s ease;
}
.newsletter-form input::placeholder { color: rgba(226, 232, 240, .5); }
.newsletter-form input:focus { border-color: var(--c-accent); background: rgba(255, 255, 255, .12); }
.newsletter-form .btn { padding-inline: 18px; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-block: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; text-align: start; } }
.footer-bottom p { font-size: 11.5px; color: rgba(226, 232, 240, .55); }
.footer-bottom .payments-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    color: rgba(226, 232, 240, .72);
}
.footer-bottom .payments-note svg { width: 15px; height: 15px; color: var(--c-accent); }

/* ---------- 21) التوست (التنبيهات) ---------- */
.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 90;
    background: #1E293B;
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-pop);
    font-size: 13px;
    font-weight: 600;
    max-width: min(92vw, 480px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s var(--ease-out);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast svg { width: 19px; height: 19px; flex-shrink: 0; }
.toast.success svg { color: #4ADE80; }
.toast.error svg { color: #FB7185; }
.toast.info svg { color: #FBBF24; }

/* ---------- 22) شريط الطلب اللاصق (هاتف) ---------- */
.sticky-order-bar {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 45;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--c-line);
    box-shadow: 0 -8px 30px -12px rgba(15, 23, 42, .18);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(110%);
    transition: transform .3s var(--ease-out);
}
.sticky-order-bar.show { transform: translateY(0); }
.sticky-order-bar .sob-info { flex: 1; min-width: 0; }
.sticky-order-bar .sob-name { font-size: 12px; font-weight: 800; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-order-bar .sob-price { font-family: var(--font-num); font-size: 15px; font-weight: 800; color: var(--c-danger); }
.sticky-order-bar .btn { flex-shrink: 0; }
@media (min-width: 1024px) { .sticky-order-bar { display: none; } }

/* زر العودة للأعلى */
.back-top {
    position: fixed;
    bottom: 18px;
    inset-inline-start: 18px;
    z-index: 44;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s var(--ease-out), background-color .15s ease;
}
.back-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-top:hover { background: var(--c-primary-dark); }
.back-top svg { width: 19px; height: 19px; }

/* ---------- 23) رابط تخطي المحتوى ---------- */
.skip-link {
    position: fixed;
    top: -60px;
    inset-inline-start: 16px;
    z-index: 95;
    background: var(--c-primary);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- 24) حركات الظهور عند التمرير ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s var(--ease-out); transition-delay: var(--rd, 0ms); }
.reveal.revealed { opacity: 1; transform: none; }

/* ---------- 25) تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .hero-orb, .hero-ring, .marquee-track, .hero-eyebrow .pulse { animation: none !important; }
    .reveal { opacity: 1; transform: none; }
    .hero-dot .dot-fill { animation: none !important; }
}

/* ---------- 26) طباعة آمنة ---------- */
@media print {
    .site-header, .topbar, .hero, .site-footer, .toast, .back-top, .sticky-order-bar, .cart-drawer, .mobile-nav, .drawer-backdrop, .modal-root, .lightbox { display: none !important; }
}

/* ---------- 27) إضافات دقيقة ---------- */
section[id], div[id="pdp-view"] { scroll-margin-top: calc(var(--header-h) + 52px); }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.spin { animation: spin360 1s linear infinite; }
@keyframes spin360 { to { transform: rotate(360deg); } }
.field-error svg { width: 13px; height: 13px; flex-shrink: 0; }
.modal-note.info, .modal-note.success { line-height: 1.85; }
.summary-row .v, .summary-row.total .v { direction: ltr; unicode-bidi: embed; }
.toast #toast-msg { overflow-wrap: anywhere; }

/* ---------- 28) حماية شبكات RTL من انفجار min-content ---------- */
.footer-grid > *, .trust-grid > *, .cats-grid > *, .form-grid > *, .promo-grid > *,
.products-grid > *, .related-grid > *, .cta-band > *, .hero-slide > *, .order-summary,
.summary-item, .cart-item, .newsletter-form > *, .footer-bottom > *, .cod-form-head > * { min-width: 0; }

/* ---------- 29) شاشات صغيرة جداً (≤360px): أزرار مرنة بلا تمرير ---------- */
@media (max-width: 480px) {
    .cod-form-head { flex-wrap: wrap; row-gap: 4px; }
    .cod-form-head > div { flex: 1; min-width: 0; }
    .cod-cod-tag { order: 3; margin-inline-start: 0; width: 100%; text-align: center; }
}
@media (max-width: 360px) {
    .btn { padding-inline: 14px; font-size: 13px; }
    .btn-lg { padding-block: 14px; }
    .btn-block { white-space: normal; line-height: 1.45; text-align: center; }
    .cod-form-head { flex-wrap: wrap; }
    .cod-cod-tag { order: 3; margin-inline-start: 0; width: 100%; text-align: center; }
    .hero-ctas .btn { padding-inline: 16px; }
}
.summary-item .si-info, .cart-item .ci-info { min-width: 0; }
/* حماية نهائية: منع أي تمرير أفقي فعلي على مستوى المستند (clip أفضل من hidden: لا يكسر sticky) */
html { overflow-x: clip; }
@supports not (overflow-x: clip) { html { overflow-x: hidden; } }

/* ================== 29) مكونات الصفحة الرئيسية المطوّرة ================== */

/* بطاقات التصنيفات: تحسينات الشاشات الصغيرة */
@media (max-width: 479px) {
    .cat-card .cat-body { padding: 8px 10px 10px; }
    .cat-card .cat-label { font-size: 11.5px; }
    .cat-card .cat-count { padding: 1px 7px; font-size: 10px; }
}

/* سلايدر المنتجات المميزة: رف أفقي بانجاب + لمحة من البطاقة التالية (لمس/سحب/أسهم/لوحة مفاتيح — متوافق RTL) */
.feat-carousel { position: relative; }
.feat-track {
    --feat-w: 72%;                                  /* هاتف: بطاقة + لمحة من التالية لتوضيح إمكانية التمرير */
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;                 /* لا ينتقل التمرير الأفقي إلى الصفحة نفسها */
    padding: 6px 4px 10px;
    margin: -6px -4px -4px;                         /* مساحة لظل البطاقة فوق الحافة (overflow يقتص الظلال) */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.feat-track:active { cursor: grabbing; }
.feat-track::-webkit-scrollbar { display: none; }
.feat-track:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 8px; border-radius: var(--radius-md); }
.feat-track > .product-card {
    flex: 0 0 var(--feat-w);
    min-width: 0;
    scroll-snap-align: start;
}
@media (min-width: 480px) { .feat-track { --feat-w: 46%; gap: 14px; } }
@media (min-width: 768px) { .feat-track { --feat-w: 31.5%; gap: 16px; } }
/* سطح المكتب: 3 بطاقات كاملة + لمحة واضحة من الرابعة — توضح إمكانية التمرير وتحرك الأسهم بشكل مفهوم */
@media (min-width: 1024px) { .feat-track { --feat-w: 26.5%; } }

.feat-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-bottom: 2px; }
.feat-nav { display: none; gap: 8px; }              /* الهاتف: تمرير لمسي بدل الأسهم */
.feat-arrow {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--c-line);
    color: var(--c-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, opacity .15s ease, transform .15s ease;
}
.feat-arrow svg { width: 19px; height: 19px; }
.feat-arrow:hover { border-color: rgba(76, 29, 149, .45); background: var(--c-primary-soft); color: var(--c-primary); }
.feat-arrow:active { transform: scale(.94); }
.feat-arrow:disabled { opacity: .32; pointer-events: none; }
@media (min-width: 768px) { .feat-nav { display: flex; } }

/* صف السعر قبل/بعد في بانر العروض (أسعار حقيقية من البيانات فقط) */
.promo-price-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.promo-price-old {
    text-decoration: line-through;
    opacity: .78;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-num);
}
.promo-arrow { width: 14px; height: 14px; opacity: .85; flex-shrink: 0; }
.promo-price-new {
    font-size: 19px;
    font-weight: 800;
    font-family: var(--font-num);
    color: var(--c-accent);
    line-height: 1;
}

/* قسم «لماذا تطلب من متجرنا»: خطوات الطلب الثلاث */
.why-steps { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
@media (min-width: 768px) { .why-steps { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.step-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: 16px 16px 14px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.step-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
    opacity: .85;
}
.step-num {
    position: absolute;
    top: 10px;
    inset-inline-end: 12px;
    font-size: 26px;
    font-weight: 800;
    font-family: var(--font-num);
    color: var(--c-primary-soft);
    -webkit-text-stroke: 1px var(--c-primary-softer);
    line-height: 1;
    user-select: none;
}
.step-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    margin-bottom: 10px;
}
.step-ico svg { width: 20px; height: 20px; }
.step-card h3 { font-size: 14px; margin-bottom: 4px; }
.step-card p { font-size: 12px; color: var(--c-muted); line-height: 1.65; }

/* بطاقات المزايا الحقيقية (من STORE_CONFIG) */
.why-points { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 480px) { .why-points { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .why-points { grid-template-columns: repeat(4, 1fr); } }
.why-points > * { min-width: 0; }
.why-point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
}
.why-point .ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--c-primary);
    border: 1px solid var(--c-primary-softer);
    flex-shrink: 0;
}
.why-point .ico svg { width: 18px; height: 18px; }
.why-point h3 { font-size: 12.5px; margin-bottom: 3px; }
.why-point p { font-size: 11px; color: var(--c-muted); line-height: 1.55; }

/* ================== 30) صفحة المتجر وصفحات التصنيفات (v6) ================== */

/* مسار التنقل أعلى الصفحات المستقلة */
.page-crumb { padding-top: 14px; margin-bottom: 14px; }

/* ترويسة صفحة المتجر */
.shop-hero { padding-top: 8px; margin-bottom: 6px; }
.shop-hero h1 { font-size: 25px; letter-spacing: -0.2px; }
@media (min-width: 768px) { .shop-hero h1 { font-size: 30px; } }
.shop-sub { font-size: 13.5px; color: var(--c-muted); margin-top: 7px; max-width: 640px; line-height: 1.75; }
.shop-meta, .ch-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-body);
    box-shadow: var(--shadow-soft);
    max-width: 100%;
}
.meta-chip svg { width: 15px; height: 15px; color: var(--c-primary); flex-shrink: 0; }
.meta-chip strong { color: var(--c-ink); font-size: 13px; }

/* شرائح التصفية السريعة: شريط أفقي محتوًى لا يمرّر الصفحة */
.chips-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px 12px;
    margin-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-body);
    white-space: nowrap;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.chip:hover { border-color: #A78BFA; color: var(--c-primary-dark); }
.chip.is-active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(76, 29, 149, .55);
}
.chip .chip-count {
    font-size: 10.5px;
    font-weight: 800;
    font-family: var(--font-num);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 0 7px;
    line-height: 1.7;
    color: var(--c-muted);
}
.chip.is-active .chip-count { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .32); color: #fff; }

/* شريط أدوات المتجر: زر مسح الفلاتر بجانب الأدوات */
.shop-toolbar { margin-bottom: 14px; }
@media (min-width: 768px) {
    .shop-toolbar { grid-template-columns: 1fr auto auto; align-items: center; }
}
.shop-clear-btn {
    height: 46px;
    white-space: nowrap;
    color: var(--c-danger);
    border-color: rgba(220, 38, 38, .35);
}
.shop-clear-btn:hover { background: #FEF2F2; }

/* ترويسة صفحة التصنيف: شريط متدرج بهوية المتجر */
.catpage-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, #F3EEFB 0%, #FBF9FF 55%, #FDFCF8 100%);
    border: 1px solid var(--c-primary-softer);
    border-radius: var(--radius-xl);
    padding: 18px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}
.catpage-hero::after {
    content: "";
    position: absolute;
    inset-inline-end: -60px;
    top: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76, 29, 149, .10), transparent 70%);
    pointer-events: none;
}
.ch-copy { flex: 1; min-width: 0; position: relative; z-index: 1; }
.ch-ico {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(145deg, #4C1D95, #290A59);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 10px 20px -8px rgba(76, 29, 149, .55);
}
.ch-ico svg { width: 21px; height: 21px; }
.catpage-hero h1 { font-size: 24px; margin-bottom: 5px; }
@media (min-width: 768px) { .catpage-hero h1 { font-size: 28px; } }
.ch-sub { font-size: 13px; color: var(--c-muted); max-width: 560px; line-height: 1.7; }
.ch-visual {
    flex-shrink: 0;
    width: 112px;
    height: 112px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--c-primary-softer);
    box-shadow: var(--shadow-card);
    display: none;
    position: relative;
    z-index: 1;
}
.ch-visual img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 480px) { .ch-visual { display: block; } }
@media (max-width: 479px) { .catpage-hero { padding: 16px; gap: 14px; } }

/* تخطيط صفحة التصنيف: قائمة جانبية على الحاسوب، شريط أفقي على الهاتف */
.catpage-layout { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.catpage-main { min-width: 0; }
/* على الهاتف: كل الشرائح + رابط المتجر عناصر مباشرة في شريط واحد أفقي قابل للتمرير */
#catpage-cats { display: contents; }
.catpage-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.catpage-side::-webkit-scrollbar { display: none; }
.side-title { display: none; }
.side-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-body);
    white-space: nowrap;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.side-link .sl-ico { display: inline-flex; color: var(--c-primary); flex-shrink: 0; }
.side-link .sl-ico svg { width: 15px; height: 15px; }
.side-link .sl-name { min-width: 0; }
.side-link .sl-count {
    font-size: 10.5px;
    font-weight: 800;
    font-family: var(--font-num);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-pill);
    padding: 0 7px;
    line-height: 1.7;
    color: var(--c-muted);
    flex-shrink: 0;
}
.side-link:hover { border-color: #A78BFA; color: var(--c-primary-dark); }
.side-link.is-active {
    background: var(--c-primary-soft);
    border-color: var(--c-primary);
    color: var(--c-primary-dark);
}
.side-link.is-active .sl-count { background: #fff; border-color: var(--c-primary-softer); color: var(--c-primary-dark); }
.side-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    align-self: center;
    border: 1.5px dashed var(--c-primary-softer);
    border-radius: var(--radius-pill);
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-primary);
    background: var(--c-primary-soft);
    white-space: nowrap;
    transition: border-color .15s ease, background-color .15s ease;
}
.side-all svg { width: 15px; height: 15px; }
.side-all:hover { border-color: var(--c-primary); background: #EDE9FE; }
@media (min-width: 1024px) {
    .catpage-layout { grid-template-columns: 252px minmax(0, 1fr); gap: 22px; }
    #catpage-cats { display: block; }
    .catpage-side {
        flex-direction: column;
        align-items: stretch;
        overflow: visible;
        background: #fff;
        border: 1px solid var(--c-line);
        border-radius: var(--radius-lg);
        padding: 12px;
        position: sticky;
        top: calc(var(--header-h) + 14px);
        box-shadow: var(--shadow-soft);
        gap: 4px;
    }
    .side-title {
        display: block;
        font-size: 11.5px;
        font-weight: 800;
        color: var(--c-faint);
        padding: 2px 8px 8px;
        letter-spacing: .3px;
    }
    .side-link {
        width: 100%;
        border-color: transparent;
        background: transparent;
        border-radius: var(--radius-md);
        padding: 9px 10px;
    }
    .side-link .sl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
    .side-link:hover { background: var(--c-surface); border-color: var(--c-line); }
    .side-link.is-active { background: var(--c-primary-soft); border-color: var(--c-primary-softer); }
    .side-all {
        width: 100%;
        margin-top: 6px;
        border-top: 1px dashed var(--c-line);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        border-width: 1.5px 0 0 0;
        padding: 10px 8px 2px;
        background: none;
    }
}

/* حماية شبكات الصفحات الجديدة من انفجار min-content في RTL */
.cats-grid > *, .chips-row > *, .shop-meta > *, .ch-meta > *, .catpage-layout > *,
.catpage-side > *, .shop-hero .section-head-row > div, .catpage-hero > * { min-width: 0; }

/* ضبط الشاشات الصغيرة جداً (320-360px) */
@media (max-width: 360px) {
    .shop-hero h1 { font-size: 21px; }
    .catpage-hero h1 { font-size: 20px; }
    .meta-chip { padding: 6px 10px; font-size: 11px; }
    .chip { padding: 7px 11px; font-size: 11.5px; }
    .side-link { padding: 7px 11px; font-size: 11.5px; }
    .catpage-hero { padding: 14px; }
    .page-crumb { padding-top: 10px; }
}


/* =========================================================================
   RawaCOD Theme — إضافات بيئة WordPress (تُحمَّل بعد نظام تصميم v7 كما هو)
   1) زر واتساب العائم (اختياري — يُدار من «إعدادات WhatsApp» في لوحة القالب)
   2) إزالة روابط واتساب عند عدم ضبط رقم (صدق بدل رابط مكسور)
   3) توافق شريط إدارة WordPress مع الترويسة اللاصقة
   ========================================================================= */

/* 1) زر واتساب العائم — متناسق مع لغة التصميم (دائرة، ظل pop، أيقونة مسار WhatsApp الأصلية) */
.rc-wa-float {
    position: fixed;
    bottom: 18px;
    inset-inline-end: 18px;          /* الافتراضي: الجهة المقابلة لزر العودة للأعلى */
    z-index: 45;                     /* فوق المحتوى وتحت السلة/النوافذ (z-index 60+) */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 18px;
    border-radius: 999px;
    background: #16A34A;             /* نفس أخضر النجاح في الهوية */
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    box-shadow: 0 12px 32px -10px rgba(22, 163, 74, .55);
    transition: transform .2s var(--ease-out), box-shadow .2s ease, background-color .15s ease;
}
.rc-wa-float:hover,
.rc-wa-float:focus-visible {
    background: #15803D;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -12px rgba(22, 163, 74, .6);
}
.rc-wa-float svg { width: 22px; height: 22px; flex: 0 0 auto; }
.rc-wa-float .rc-wa-label { white-space: nowrap; }
.rc-wa-float.pos-left { inset-inline-end: auto; inset-inline-start: 18px; }
.rc-wa-float.pos-right { inset-inline-start: auto; inset-inline-end: 18px; }

/* على الهاتف: الزر أيقونة دائرية مضغوطة فوق شريط الطلب اللاصق */
@media (max-width: 767px) {
    .rc-wa-float { width: 48px; height: 48px; padding: 0; justify-content: center; bottom: 84px; }
    .rc-wa-float .rc-wa-label { display: none; }
}

/* 2) لا رقم واتساب مضبوط: إخفاء روابط واتساب بدل رابط مكسور (يضبطه PHP على body) */
.rc-no-wa [data-wa-link] { display: none !important; }

/* 3) شريط إدارة WordPress: إنزال الترويسة اللاصقة بمقداره دون كسر الالتصاق */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

/* 4) صفحات WordPress العامة (page/404/single): حاوية محتوى متناسقة مع إيقاع v7 */
.rc-generic-main { padding-block: 34px 56px; }
.rc-generic-main .rc-page-card {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 26px;
}
.rc-generic-main .rc-page-card > :first-child { margin-top: 0; }
.rc-generic-main .rc-page-card h1,
.rc-generic-main .rc-page-card h2 { font-family: var(--font-display); color: var(--c-ink); }
.rc-generic-main .rc-page-card h1 { font-size: 24px; margin-bottom: 14px; }
.rc-generic-main .rc-page-card h2 { font-size: 19px; margin: 22px 0 10px; }
.rc-generic-main .rc-page-card p { margin-bottom: 12px; }
.rc-generic-main .rc-page-card a { color: var(--c-primary); }
.rc-generic-main .rc-page-card img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.rc-generic-title { font-family: var(--font-display); font-size: 24px; color: var(--c-ink); margin-bottom: 6px; }
.rc-generic-sub { color: var(--c-body); margin-bottom: 22px; }

/* 5) تنبيهات WooCommerce داخل قوالب القالب: تختفي تلقائياً بلا تدخل بصري */
.woocommerce-notices-wrapper { container-type: inline-size; }
.rc-generic-main .woocommerce-message,
.rc-generic-main .woocommerce-info,
.rc-generic-main .woocommerce-error {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    font-size: 14px;
}
.rc-generic-main .woocommerce-message { background: var(--c-success-soft); color: #14532D; }
.rc-generic-main .woocommerce-info { background: var(--c-primary-soft); color: var(--primary-deep, #290A59); }
.rc-generic-main .woocommerce-error { background: #FEE2E2; color: #991B1B; }

/* مؤشر المخزون في بطاقة السعر (بيانات حقيقية من WooCommerce) */
.pdp-stock-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.pdp-stock-chip.in   { background: var(--c-success-soft); color: #14532D; }
.pdp-stock-chip.out  { background: #FEE2E2; color: #991B1B; }
.pdp-stock-chip.back { background: var(--c-primary-soft); color: var(--c-primary-deep); }
