/* ══════════════════════════════════════════════════════════════════════════
   Insta Story — قالب متجر «على غرار إنستجرام» (طبقة تصميم كاملة)

   الفكرة التصميمية: واجهة المتجر تتصرف كأنها تطبيق إنستجرام حقيقي —
   • هيدر علوي أيقوني رفيع (شعار دائري بتدرّج + بحث + قلب + حساب + حقيبة).
   • «بوست» ترحيبي في المنتصف برأس حساب (Avatar) وصورة 4:5 وشريط تفاعل
     وتعليق (Caption) وهاشتاجات وزر CTA بتدرّج إنستجرام.
   • شريط «Stories» حلقات متدرّجة للأقسام الحقيقية.
   • شريط «Highlights» أيقوني دائري لمزايا المتجر.
   • كتالوج شبكي 3 أعمدة بصور مربعة وحواف شبه ملتصقة (Profile Grid).
   • شريط تنقّل سفلي أيقوني للموبايل.
   • وضع ليلي أسود مطابق لإنستجرام الليلي.

   القواعد: كل ما هنا إضافي (لا يلمس قواعد الثيمات الأخرى) ومقيّد بـ
   body.ez-cat-insta أو body.theme-insta-story، ويعتمد
   الخصائص المنطقية (inline/block) ليعمل RTL/LTR بلا تعديل.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1) الهوية والتوكنز ─────────────────────────────────────────────────── */
body.theme-insta-story {
    --ig-grad: linear-gradient(45deg, #f58529 0%, #feda77 12%, #dd2a7b 42%, #8134af 70%, #515bd4 100%);
    /* تدرّج الأزرار/الشرائط: نفس روح إنستجرام بدرجات أغمق ليظل النص الأبيض مقروءاً (WCAG AA) */
    --ig-grad-cta: linear-gradient(45deg, #c13584 0%, #a62f8f 45%, #833ab4 72%, #515bd4 100%);
    --ig-bg: #fafafa;
    --ig-surface: #ffffff;
    --ig-ink: #262626;
    --ig-ink-2: #404040;
    --ig-muted: #737373;
    --ig-line: #dbdbdb;
    --ig-line-soft: #efefef;
    --ig-soft: #efefef;
    --ig-pink: #c13584;
    --ig-link: #00376b;
    --ig-blue: #0095f6;

    /* توكنز المتجر العامة: كل المكوّنات القديمة تلبس الهوية تلقائياً */
    --brand-primary: #c13584;
    --brand-hover: #a92e70;
    --brand-dark: #833ab4;
    --brand-bg: #fdf2f8;

    background-color: var(--ig-bg) !important;
    background-image: none;
    color: var(--ig-ink) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0;
}

body.theme-insta-story ::selection {
    background: var(--ig-pink);
    color: #fff;
}

/* الأسطح: بطاقات بيضاء رقيقة الحدود بلا ظلال — لغة إنستجرام البصرية */
body.theme-insta-story .card-bg {
    background-color: var(--ig-surface) !important;
    border: 1px solid var(--ig-line) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    color: var(--ig-ink) !important;
}

body.theme-insta-story .sub-text,
body.theme-insta-story .card-bg .sub-text {
    color: var(--ig-muted) !important;
}

body.theme-insta-story .glass-header {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: var(--ig-line) !important;
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

/* أزرار الإجراء الأساسية: تدرّج إنستجرام بدل اللون المسطّح */
body.theme-insta-story .btn-primary,
body.theme-insta-story button[class*="bg-[var(--brand-primary)]"],
body.theme-insta-story a[class*="bg-[var(--brand-primary)]"] {
    background-color: transparent !important;
    background-image: var(--ig-grad-cta) !important;
    background-size: 140% 140%;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 8px 20px -12px rgba(193, 53, 132, 0.75) !important;
}

body.theme-insta-story .badge-sale,
body.theme-insta-story .price-sale {
    color: var(--ig-pink) !important;
}

/* ── 2) الهيدر: شريط إنستجرام العلوي ────────────────────────────────────── */
body.ez-header-insta #sectionHeader {
    background: var(--ig-surface) !important;
    border-bottom: 1px solid var(--ig-line) !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

body.ez-header-insta #sectionHeader .max-w-7xl {
    max-width: 975px !important;
}

body.ez-header-insta #sectionHeader .max-w-7xl > div:first-child {
    height: 60px !important;
    gap: 10px !important;
}

/* الشعار: أفاتار دائري بتدرّج إنستجرام */
body.ez-cat-insta #storeLogoIcon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 999px !important;
    background: var(--ig-grad) !important;
    box-shadow: 0 0 0 2px var(--ig-surface), 0 0 0 3px var(--ig-line) !important;
}

body.ez-cat-insta #storeLogoIcon svg,
body.ez-cat-insta #storeLogoIcon i {
    width: 17px !important;
    height: 17px !important;
    color: #fff !important;
}

body.ez-cat-insta #storeName {
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    color: var(--ig-ink) !important;
    line-height: 1.2 !important;
}

body.ez-cat-insta #storeSubtitleBadge {
    color: var(--ig-muted) !important;
    font-size: 10px !important;
    font-weight: 500 !important;
}

body.ez-header-insta #sectionHeader h1 + p > span:first-child {
    background: var(--ig-grad) !important;
    box-shadow: none !important;
}

/* البحث: حقل رمادي دائري بلا حدود (نفس حقل بحث إنستجرام) */
body.ez-cat-insta #searchInput,
body.ez-cat-insta #mobileSearchInput {
    background: var(--ig-soft) !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    color: var(--ig-ink) !important;
    box-shadow: none !important;
    height: 36px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 14px !important;
}

body.ez-cat-insta #searchInput::placeholder,
body.ez-cat-insta #mobileSearchInput::placeholder {
    color: var(--ig-muted) !important;
}

body.ez-cat-insta #searchInput:focus,
body.ez-cat-insta #mobileSearchInput:focus {
    background: var(--ig-surface) !important;
    border-color: #a8a8a8 !important;
    box-shadow: none !important;
}

body.ez-header-insta #sectionHeader .relative > .absolute.text-slate-400,
body.ez-header-insta #sectionHeader .absolute.inset-y-0.right-0 {
    color: var(--ig-muted) !important;
}

/* أيقونات الإجراءات: شفافة، سوداء، دائرية عند المرور */
body.ez-header-insta #sectionHeader :is(#accountOpenBtn, #wishlistOpenBtn, #compareOpenBtn, #trackOpenBtn, #darkToggleBtn, #langToggleBtn) {
    background: transparent !important;
    border-color: transparent !important;
    border-radius: 999px !important;
    color: var(--ig-ink) !important;
    padding: 8px !important;
    box-shadow: none !important;
}

body.ez-header-insta #sectionHeader :is(#accountOpenBtn, #wishlistOpenBtn, #compareOpenBtn, #trackOpenBtn, #darkToggleBtn, #langToggleBtn):hover {
    background: var(--ig-soft) !important;
}

body.ez-header-insta #sectionHeader :is(#accountOpenBtn, #wishlistOpenBtn, #compareOpenBtn, #trackOpenBtn, #darkToggleBtn, #langToggleBtn) svg {
    color: var(--ig-ink) !important;
    width: 22px !important;
    height: 22px !important;
}

/* الحقيبة: أيقونة فقط + عدّاد بتدرّج */
body.ez-cat-insta #cartOpenBtn {
    background: transparent !important;
    color: var(--ig-ink) !important;
    border-radius: 999px !important;
    padding: 8px !important;
    box-shadow: none !important;
}

body.ez-cat-insta #cartOpenBtn:hover {
    background: var(--ig-soft) !important;
}

body.ez-cat-insta #cartOpenBtn svg {
    width: 22px !important;
    height: 22px !important;
}

body.ez-cat-insta #headerCartLabel,
body.ez-cat-insta #headerTrackLabel,
body.ez-cat-insta #accountOpenLabel {
    display: none !important;
}

body.ez-cat-insta #cartCountBadge,
body.ez-cat-insta #wishlistCountBadge,
body.ez-cat-insta #compareCountBadge {
    background: var(--ig-grad-cta) !important;
    color: #fff !important;
    border: 2px solid var(--ig-surface) !important;
    box-shadow: none !important;
}

/* تنظيف الشريط على الشاشات الصغيرة: إنستجرام لا يزدحم بأدوات */
@media (max-width: 1023px) {
    body.ez-cat-insta #currencySelector,
    body.ez-cat-insta #trackOpenBtn,
    body.ez-cat-insta #compareOpenBtn,
    body.ez-cat-insta #langToggleBtn,
    body.ez-cat-insta #darkToggleBtn {
        display: none !important;
    }
}

/* ── 3) الشريط الإعلاني: شريط تدرّج إنستجرام ─────────────────────────────── */
body.theme-insta-story #sectionAnnouncement {
    background-color: transparent !important;
    /* نسخة الأزرار من التدرّج: نص أبيض مقروء (AA) بنفس روح إنستجرام */
    background-image: var(--ig-grad-cta) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding-block: 7px !important;
    box-shadow: none !important;
}

body.theme-insta-story #sectionAnnouncement a,
body.theme-insta-story #sectionAnnouncement span,
body.theme-insta-story #sectionAnnouncement button {
    color: #fff !important;
}

/* ── 4) الهيرو = «بوست» إنستجرام ─────────────────────────────────────────── */
body.ez-hero-insta #sectionHero {
    max-width: 520px !important;
    padding-inline: 12px !important;
    margin-top: 18px !important;
}

body.ez-hero-insta #sectionHero > .relative {
    background: var(--ig-surface) !important;
    border: 1px solid var(--ig-line) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    min-height: 0 !important;
    display: block !important;
    overflow: hidden !important;
    padding: 0 !important;
}

body.ez-hero-insta #sectionHero .hero-slides-wrapper {
    min-height: 0 !important;
    /* يبقى grid: كل الشرائح متراكبة في نفس الخلية فلا تتراكم ارتفاعاتها */
    display: grid !important;
    grid-template-areas: "slide";
    overflow: hidden !important;
}

body.ez-hero-insta #sectionHero .slide-item {
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    background: transparent !important;
}

body.ez-hero-insta #sectionHero .slide-item.active {
    display: block !important;
}

body.ez-hero-insta #sectionHero #ezHeroAside {
    display: none !important;
}

/* أسهم التمرير: دوائر بيضاء صغيرة كما في كاروسيل البوستات */
body.ez-hero-insta #sectionHero > .relative > button {
    width: 26px !important;
    height: 26px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--ig-ink) !important;
    border: 0 !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18) !important;
    opacity: 0;
    transition: opacity 0.2s ease;
}

body.ez-hero-insta #sectionHero > .relative:hover > button,
body.ez-hero-insta #sectionHero > .relative > button:focus-visible {
    opacity: 1;
}

/* على الأجهزة اللمسية لا يوجد hover — الأسهم تبقى ظاهرة */
@media (hover: none) {
    body.ez-hero-insta #sectionHero > .relative > button {
        opacity: 1;
    }
}

body.ez-hero-insta #sectionHero > .relative > button svg {
    width: 14px !important;
    height: 14px !important;
}

/* نقاط الكاروسيل */
body.ez-hero-insta #sectionHero .slide-dot {
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    border-radius: 999px !important;
    background: var(--ig-line) !important;
    box-shadow: none !important;
}

body.ez-hero-insta #sectionHero .slide-dot[class*="bg-emerald"],
body.ez-hero-insta #sectionHero .slide-dot.bg-emerald-500 {
    background: var(--ig-ink) !important;
}

body.ez-hero-insta #sectionHero .absolute.bottom-3,
body.ez-hero-insta #sectionHero .absolute.bottom-5 {
    bottom: 6px !important;
    gap: 4px !important;
}

/* ── مكوّن البوست ─────────────────────────────────────────────────────────── */
.ez-ig-post {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--ig-surface, #fff);
    color: var(--ig-ink, #262626);
    font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.ez-ig-post-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.ez-ig-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    padding: 2px;
    background: var(--ig-grad, linear-gradient(45deg, #f58529, #dd2a7b, #515bd4));
}

.ez-ig-avatar > span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--ig-surface, #fff);
    color: var(--ig-ink, #262626);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.ez-ig-user {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.ez-ig-user b {
    font-size: 13px;
    font-weight: 700;
    color: var(--ig-ink, #262626);
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ez-ig-verified {
    display: inline-grid;
    place-items: center;
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: var(--ig-blue, #0095f6);
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
}

.ez-ig-user small {
    font-size: 11px;
    color: var(--ig-muted, #737373);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ez-ig-more {
    margin-inline-start: auto;
    color: var(--ig-ink, #262626);
    font-size: 15px;
    letter-spacing: 1px;
    line-height: 1;
}

.ez-ig-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--ig-soft, #efefef);
    overflow: hidden;
}

.ez-ig-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ez-ig-media--empty {
    display: grid;
    place-items: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22)), var(--ig-grad);
    color: #fff;
}

.ez-ig-media--empty span {
    font-size: clamp(22px, 6vw, 40px);
    font-weight: 900;
    letter-spacing: -0.02em;
    opacity: 0.95;
    text-align: center;
    padding-inline: 18px;
}

@media (min-width: 640px) {
    .ez-ig-media {
        aspect-ratio: 4 / 5;
    }
}

.ez-ig-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 12px 5px;
    color: var(--ig-ink, #262626);
}

.ez-ig-actions svg {
    width: 23px;
    height: 23px;
    stroke-width: 1.7;
}

.ez-ig-actions .ez-ig-like,
.ez-ig-actions .ez-ig-like svg {
    color: #ed4956;
    fill: #ed4956;
}

.ez-ig-actions .ez-ig-save {
    margin-inline-start: auto;
}

.ez-ig-likes {
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ig-ink, #262626);
}

.ez-ig-caption {
    padding: 3px 12px 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ig-ink, #262626);
}

.ez-ig-caption b {
    font-weight: 700;
}

.ez-ig-caption p {
    display: inline;
    margin: 0;
    color: var(--ig-ink, #262626);
}

.ez-ig-tags {
    padding: 4px 12px 0;
    font-size: 13px;
    color: var(--ig-link, #00376b);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ez-ig-time {
    padding: 6px 12px 14px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ig-muted, #737373);
}

.ez-ig-cta {
    padding: 12px;
}

.ez-ig-cta a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 38px;
    border-radius: 8px;
    background-image: var(--ig-grad-cta);
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px -12px rgba(193, 53, 132, 0.8);
    transition: transform 0.15s ease, filter 0.2s ease;
}

.ez-ig-cta a:hover {
    filter: brightness(1.06);
}

.ez-ig-cta a:active {
    transform: scale(0.985);
}

.ez-ig-cta a svg {
    width: 15px;
    height: 15px;
}

/* ── 5) Stories: حلقات الأقسام ───────────────────────────────────────────── */
body.ez-cat-insta #sectionCircularCategories {
    max-width: 520px !important;
    margin-top: 6px !important;
    padding-inline: 12px !important;
}

body.ez-cat-insta #sectionCircularCategories > .card-bg {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

body.ez-cat-insta #sectionCircularCategories .text-center.max-w-xl {
    display: none !important;
}

body.ez-cat-insta #sectionCircularCategories > .card-bg > .relative > button {
    display: none !important;
}

body.ez-cat-insta #circularCategoriesRow {
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 8px 2px 6px !important;
    scroll-snap-type: x proximity;
}

body.ez-cat-insta #circularCategoriesRow > div {
    scroll-snap-align: start;
    width: 72px;
}

body.ez-cat-insta #circularCategoriesRow > div > div:first-child {
    width: 66px !important;
    height: 66px !important;
    padding: 3px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--ig-grad) !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

body.ez-cat-insta #circularCategoriesRow > div > div:first-child:hover {
    transform: scale(1.04);
    border: 0 !important;
    box-shadow: 0 0 0 2px var(--ig-surface), 0 0 0 4px rgba(193, 53, 132, 0.25) !important;
}

body.ez-cat-insta #circularCategoriesRow img,
body.ez-cat-insta #circularCategoriesRow > div > div:first-child > div {
    width: 100% !important;
    height: 100% !important;
    border: 3px solid var(--ig-surface) !important;
    border-radius: 999px !important;
    object-fit: cover;
    overflow: hidden;
}

body.ez-cat-insta #circularCategoriesRow img {
    transform: none !important;
}

body.ez-cat-insta #circularCategoriesRow > div:hover img {
    transform: scale(1.06) !important;
}

body.ez-cat-insta #circularCategoriesRow > div > span {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: var(--ig-ink) !important;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 6) Highlights: مزايا المتجر كحلقات مضيئة ────────────────────────────── */
body.ez-cat-insta #sectionFeatures {
    max-width: 520px !important;
    margin-top: 2px !important;
    padding-inline: 12px !important;
}

body.ez-cat-insta #sectionFeatures > .text-center {
    display: none !important;
}

body.ez-cat-insta #featuresGridContainer {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 18px !important;
    overflow-x: auto;
    padding: 6px 2px 10px !important;
    scrollbar-width: none;
}

body.ez-cat-insta #featuresGridContainer::-webkit-scrollbar {
    display: none;
}

body.ez-cat-insta #featuresGridContainer > * {
    flex: 0 0 76px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px !important;
    min-width: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.ez-cat-insta #featuresGridContainer > * > div:first-child {
    width: 64px !important;
    height: 64px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background: var(--ig-surface) !important;
    border: 1px solid var(--ig-line) !important;
    color: var(--ig-ink) !important;
    box-shadow: inset 0 0 0 4px var(--ig-surface), 0 0 0 1px var(--ig-line) !important;
    display: grid !important;
    place-items: center !important;
}

body.ez-cat-insta #featuresGridContainer > * > div:first-child svg {
    width: 24px !important;
    height: 24px !important;
    color: var(--ig-ink) !important;
}

body.ez-cat-insta #featuresGridContainer > * > div:last-child {
    width: 100%;
}

body.ez-cat-insta #featuresGridContainer h4 {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: var(--ig-ink) !important;
    line-height: 1.4 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.ez-cat-insta #featuresGridContainer p {
    display: none !important;
}

/* ── 7) الكتالوج: تبويبات ثم شبكة البروفايل ─────────────────────────────── */
body.ez-cat-insta #catalogSection {
    max-width: 975px !important;
    padding-inline: 0 !important;
    padding-top: 4px !important;
}

body.ez-cat-insta #catalogCategoriesBarWrapper {
    border-top: 1px solid var(--ig-line);
    margin-bottom: 10px !important;
}

body.ez-cat-insta #catalogCategoriesBarWrapper > div:first-child {
    margin-bottom: 0 !important;
    padding: 8px 12px 0;
    gap: 8px;
    flex-wrap: wrap;
    row-gap: 6px;
}

body.ez-cat-insta #catalogCategoriesBarWrapper h3 {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ig-muted) !important;
    gap: 6px !important;
}

body.ez-cat-insta #catalogCategoriesBarWrapper h3 > span:first-child {
    width: 6px !important;
    height: 6px !important;
    background: var(--ig-grad) !important;
    animation: none !important;
}

body.ez-cat-insta #activeFilterLabel {
    font-size: 11px !important;
    font-weight: 400 !important;
    color: var(--ig-muted) !important;
    max-width: 26ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    body.ez-cat-insta #activeFilterLabel {
        display: none !important;
    }
}

body.ez-cat-insta #catalogSortSelect,
body.ez-cat-insta #toggleAdvancedFiltersBtn,
body.ez-cat-insta #clearFilterBtn {
    background: var(--ig-soft) !important;
    border: 0 !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--ig-ink) !important;
    box-shadow: none !important;
    padding: 7px 10px !important;
}

body.ez-cat-insta #catalogSection .ez-view-toggle {
    background: var(--ig-soft) !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 3px !important;
}

body.ez-cat-insta #catalogSection .ez-view-toggle button {
    color: var(--ig-muted) !important;
    border-radius: 6px !important;
}

body.ez-cat-insta #catalogSection .ez-view-toggle button.ez-view-btn-active {
    background: var(--ig-surface) !important;
    color: var(--ig-ink) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

body.ez-cat-insta #categoriesBar {
    gap: 4px !important;
    padding: 6px 10px 0 !important;
    border-bottom: 1px solid var(--ig-line);
}

body.ez-cat-insta .category-btn {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    padding: 10px 10px 9px !important;
    color: var(--ig-muted) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    box-shadow: none !important;
}

body.ez-cat-insta .category-btn.active {
    color: var(--ig-ink) !important;
    border-bottom-color: var(--ig-ink) !important;
}

body.ez-cat-insta #advancedFiltersPanel,
body.ez-cat-insta #searchNotice {
    margin: 8px 12px 0 !important;
    border-radius: 10px !important;
    border: 1px solid var(--ig-line) !important;
    background: var(--ig-surface) !important;
}

@media (max-width: 639px) {
    body.ez-cat-insta #catalogSection .ez-view-toggle,
    body.ez-cat-insta #toggleAdvancedFiltersBtn {
        display: none !important;
    }

    body.ez-cat-insta #catalogSortSelect {
        max-width: 11rem;
        text-overflow: ellipsis;
    }
}

/* الشبكة: 3 أعمدة دائمة وحواف شبه ملتصقة — توقيع إنستجرام البصري */
body.ez-cat-insta #productsGrid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
}

@media (min-width: 640px) {
    body.ez-cat-insta #productsGrid {
        gap: 4px !important;
    }
}

body.ez-cat-insta #productsGrid.ez-view-list {
    grid-template-columns: 1fr !important;
}

/* البطاقة: صورة مربعة بلا إطار + تسمية صغيرة تحتها */
body.ez-cat-insta #productsGrid > .card-bg {
    position: relative;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 0 !important;
    transition: none !important;
}

body.ez-cat-insta #productsGrid > .card-bg:hover {
    transform: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

body.ez-cat-insta #productsGrid > .card-bg > div:first-child > div:first-child {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    border-radius: 0 !important;
    background: var(--ig-soft) !important;
    box-shadow: none !important;
}

body.ez-cat-insta #productsGrid > .card-bg > div:first-child > div:first-child img {
    object-fit: cover !important;
}

body.ez-cat-insta #productsGrid > .card-bg img {
    border-radius: 0 !important;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.ez-cat-insta #productsGrid > .card-bg:hover img {
    transform: scale(1.035);
}

/* شارات الصورة: خصم وحالة مخزون صغيرة وهادئة */
body.ez-cat-insta #productsGrid > .card-bg > div:first-child > span {
    top: 6px !important;
    bottom: auto !important;
    inset-inline-end: 6px !important;
    inset-inline-start: auto !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    background: rgba(0, 0, 0, 0.66) !important;
    color: #fff !important;
    border: 0 !important;
    backdrop-filter: blur(4px);
    /* نسبة الخصم «-19%» تُعرض LTR كي لا ينقلب موضع الإشارة في RTL */
    direction: ltr;
    unicode-bidi: isolate;
}

body.ez-cat-insta #productsGrid > .card-bg > div:first-child > span[class*="bottom-"] {
    display: none !important; /* شارة المخزون تختفي في شبكة البروفايل */
}

body.ez-cat-insta #productsGrid > .card-bg > div:first-child > span[class*="bg-red"],
body.ez-cat-insta #productsGrid > .card-bg > div:first-child > span[class*="bg-rose"] {
    background: var(--ig-grad-cta) !important;
}

body.ez-cat-insta #productsGrid .wishlist-btn {
    top: 6px !important;
    inset-inline-start: 6px !important;
    inset-inline-end: auto !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--ig-ink) !important;
    border: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

body.ez-cat-insta #productsGrid > .card-bg:hover .wishlist-btn,
body.ez-cat-insta #productsGrid .wishlist-btn.active,
body.ez-cat-insta #productsGrid .wishlist-btn:focus-visible {
    opacity: 1;
}

/* على اللمس لا يوجد hover: قلب المفضلة ظاهر دائماً */
@media (hover: none) {
    body.ez-cat-insta #productsGrid .wishlist-btn {
        opacity: 1;
    }
}

body.ez-cat-insta #productsGrid .wishlist-btn.active {
    background: var(--ig-surface) !important;
    color: #ed4956 !important;
}

body.ez-cat-insta #productsGrid .ez-quick-view-btn,
body.ez-cat-insta #productsGrid .compare-btn {
    display: none !important;
}

/* جسم البطاقة: اسم ثم سعر ثم زر مصغّر */
body.ez-cat-insta #productsGrid .ez-row-body {
    padding: 6px 6px 9px !important;
    background: var(--ig-surface) !important;
    gap: 0 !important;
    text-align: start !important;
    align-items: stretch !important;
}

body.ez-cat-insta #productsGrid .ez-row-body > div:first-child {
    margin-top: 0 !important;
    gap: 0 !important;
    align-items: stretch !important;
    text-align: start !important;
}

body.ez-cat-insta #productsGrid .ez-row-body p {
    display: none !important;
}

/* تقييم النجوم والشرائح الوصفية تختفي في الشبكة الصغيرة */
body.ez-cat-insta #productsGrid .ez-row-body [class*="text-amber-"] {
    display: none !important;
}

body.ez-cat-insta #productsGrid .card-bg h4 {
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    color: var(--ig-ink) !important;
    -webkit-line-clamp: 1;
    margin-bottom: 2px;
}

body.ez-cat-insta #productsGrid > .card-bg:hover h4 {
    color: var(--ig-ink) !important;
}

body.ez-cat-insta #productsGrid .ez-row-body > div:first-child > div:last-child {
    padding-top: 0 !important;
}

body.ez-cat-insta #productsGrid .offer-price-now {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: var(--ig-ink) !important;
    letter-spacing: -0.01em;
}

body.ez-cat-insta #productsGrid .offer-price-old,
body.ez-cat-insta #productsGrid .ez-row-body span[class*="line-through"] {
    font-size: 10px !important;
    color: var(--ig-muted) !important;
}

body.ez-cat-insta #productsGrid .ez-row-body span[class*="bg-emerald"] {
    display: none !important;
}

body.ez-cat-insta #productsGrid .ez-quick-add {
    display: none !important;
}

body.ez-cat-insta #productsGrid .ez-row-body > div:last-child {
    margin-top: 6px !important;
    padding-top: 0 !important;
    border-top: 0 !important;
    gap: 4px !important;
}

body.ez-cat-insta #productsGrid .ez-row-body button {
    flex: 1;
    min-height: 27px;
    padding: 4px 6px !important;
    border-radius: 8px !important;
    border: 0 !important;
    background: var(--ig-soft) !important;
    color: var(--ig-ink) !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

body.ez-cat-insta #productsGrid .ez-row-body button:hover {
    background: var(--ig-ink) !important;
    border-color: var(--ig-ink) !important;
    color: #fff !important;
}

body.ez-cat-insta #productsGrid .ez-row-body button svg,
body.ez-cat-insta #productsGrid .ez-row-body button span {
    color: inherit !important;
}

body.ez-cat-insta #productsGrid .ez-row-body button[class*="bg-indigo"] {
    display: none !important;
}

/* أزرار الشبكة/القائمة تبقى مفيدة لكن بهدوء */
body.ez-cat-insta #productsGrid .ezd-card {
    border-radius: 0 !important;
}

/* ── 8) أشرطة العروض (فلاش/الأكثر مبيعاً/المدعومة) ───────────────────────── */
body.ez-cat-insta :is(#flashSalesSection, #bestSellersSection, #sponsoredProductsSection) {
    margin-inline: 12px !important;
    border: 1px solid var(--ig-line) !important;
    border-radius: 12px !important;
    background: var(--ig-surface) !important;
    background-image: none !important;
    box-shadow: none !important;
    padding: 12px !important;
}

body.ez-cat-insta :is(#flashSalesSection, #bestSellersSection, #sponsoredProductsSection) h4 {
    color: var(--ig-ink) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

body.ez-cat-insta :is(#flashSalesSection, #bestSellersSection, #sponsoredProductsSection) button {
    background: var(--ig-soft) !important;
    color: var(--ig-ink) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
}

body.ez-cat-insta :is(#flashSalesSection, #bestSellersSection) [class*="bg-white"] {
    background: var(--ig-soft) !important;
    color: var(--ig-ink) !important;
}

body.ez-cat-insta #flashSalesTimerBadge,
body.ez-cat-insta #flashSalesTimerBadge * {
    color: var(--ig-ink) !important;
}

body.ez-cat-insta #flashSalesTimerBadge svg {
    color: var(--ig-pink) !important;
}

/* ── 9) الأقسام العامة: تقييمات، أسئلة، مدونة ────────────────────────────── */
body.theme-insta-story :is(#sectionReviews, #sectionFaq, #sectionBlog) {
    border-color: var(--ig-line) !important;
}

body.theme-insta-story :is(#reviewsGrid, #faqAccordion, #blogPostsContainer) > * {
    background-color: var(--ig-surface) !important;
    border-color: var(--ig-line) !important;
    box-shadow: none !important;
}

body.theme-insta-story #reviewsGrid [class*="rounded-3xl"],
body.theme-insta-story #reviewsGrid [class*="rounded-2xl"] {
    border-radius: 12px !important;
}

body.theme-insta-story #sectionReviews h3,
body.theme-insta-story #sectionFaq h3,
body.theme-insta-story #sectionBlog h3 {
    color: var(--ig-ink) !important;
}

/* ── 10) الفوتر: شريط أبيض هادئ بخط فاصل رقيق ───────────────────────────── */
body.ez-cat-insta #sectionFooter {
    background: var(--ig-surface) !important;
    background-image: none !important;
    color: var(--ig-muted) !important;
    border-top: 1px solid var(--ig-line) !important;
    padding-block: 26px !important;
    font-size: 11.5px !important;
}

body.ez-cat-insta #sectionFooter * {
    color: var(--ig-muted) !important;
    border-color: var(--ig-line) !important;
}

body.ez-cat-insta #sectionFooter #footerStoreName {
    color: var(--ig-ink) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

body.ez-cat-insta #sectionFooter a:hover,
body.ez-cat-insta #sectionFooter a:hover * {
    color: var(--ig-ink) !important;
}

body.ez-cat-insta #sectionFooter .max-w-7xl {
    gap: 14px !important;
    max-width: 935px !important;
}

/* ── 11) شريط التنقّل السفلي: أيقونات إنستجرام ───────────────────────────── */
body.ez-cat-insta #mobileBottomNav {
    background: rgba(255, 255, 255, 0.97) !important;
    border-top: 1px solid var(--ig-line) !important;
    padding-block: 7px !important;
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

body.ez-cat-insta #mobileBottomNav button,
body.ez-cat-insta #mobileBottomNav a {
    color: var(--ig-ink) !important;
    gap: 3px !important;
}

body.ez-cat-insta #mobileBottomNav svg {
    width: 22px !important;
    height: 22px !important;
    stroke-width: 1.8;
}

body.ez-cat-insta #mobileBottomNav span {
    font-size: 9px !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em;
}

body.ez-cat-insta #mobileBottomNav [style*="--brand-primary"] {
    color: var(--ig-ink) !important;
}

body.ez-cat-insta #mobileCartBadge {
    background: var(--ig-grad-cta) !important;
}

/* ── 12) السلة، المودالات، صفحة المنتج: نفس اللغة ────────────────────────── */
body.theme-insta-story #cartDrawer > div > div,
body.theme-insta-story #cartDrawer .bg-white {
    background: var(--ig-surface) !important;
}

body.theme-insta-story #cartDrawer {
    --brand-primary: var(--ig-pink);
}

body.theme-insta-story #cartDrawer h3,
body.theme-insta-story #cartDrawer h5,
body.theme-insta-story #productModalTitle,
body.theme-insta-story #productPageView h1,
body.theme-insta-story #productPageView h2 {
    color: var(--ig-ink) !important;
}

body.theme-insta-story :is(#productModal, #cartDrawer, #wishlistModal, #compareModal) [class*="rounded-3xl"] {
    border-radius: 14px !important;
}

body.theme-insta-story :is(#productModal, #cartDrawer, #wishlistModal, #compareModal) [class*="shadow-2xl"] {
    box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.5) !important;
}

body.theme-insta-story #checkoutBtn,
body.theme-insta-story #instantCheckoutBtn,
body.theme-insta-story #cartCheckoutBtn {
    background-image: var(--ig-grad-cta) !important;
    background-color: transparent !important;
    color: #fff !important;
    border: 0 !important;
}

/* صفحة المنتج: معرض بحواف نظيفة وأزرار تدرّج */
body.theme-insta-story #productPageView .ezpp-media [class*="rounded"] {
    border-radius: 10px !important;
}

body.theme-insta-story #productPageView [class*="bg-[var(--brand-primary)]"] {
    background-image: var(--ig-grad-cta) !important;
}

/* حقول الإدخال: رمادية ناعمة مثل إنستجرام */
body.theme-insta-story :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    border-radius: 9px !important;
}

body.theme-insta-story :is(input:not([type="checkbox"]):not([type="radio"]), textarea):focus {
    border-color: #a8a8a8 !important;
    box-shadow: none !important;
}

/* ── 13) الوضع الليلي: إنستجرام الأسود ──────────────────────────────────── */
html.dark body.theme-insta-story {
    --ig-bg: #000000;
    --ig-surface: #121212;
    --ig-ink: #f5f5f5;
    --ig-ink-2: #e0e0e0;
    --ig-muted: #a8a8a8;
    --ig-line: #262626;
    --ig-line-soft: #1f1f1f;
    --ig-soft: #1f1f1f;
    --ig-link: #e0f1ff;
    --brand-primary: #d4539a;
    --brand-hover: #e06cae;
    --brand-dark: #a06ad4;
    --brand-bg: #2a1220;
    background-color: #000 !important;
    color: #f5f5f5 !important;
}

html.dark body.theme-insta-story .glass-header,
html.dark body.ez-header-insta #sectionHeader {
    background: rgba(0, 0, 0, 0.92) !important;
    border-color: #262626 !important;
}

html.dark body.theme-insta-story #mobileBottomNav {
    background: rgba(0, 0, 0, 0.94) !important;
}

html.dark body.theme-insta-story .ez-ig-media {
    background: #1f1f1f;
}

html.dark body.theme-insta-story .ez-ig-avatar > span {
    background: #000;
}

html.dark body.theme-insta-story #sectionFooter {
    background: #000 !important;
}

/* ── 14) حركة أقل عند طلب المستخدم ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    body.ez-cat-insta #productsGrid img,
    body.ez-cat-insta #circularCategoriesRow img,
    .ez-ig-cta a {
        transition: none !important;
        transform: none !important;
    }
}
