/* ============================================================== */
/* 1. تخصيص شريط التمرير وتحديد النصوص (لمسات احترافية)           */
/* ============================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f8f9fa; 
}
::-webkit-scrollbar-thumb {
    background: #1a237e; 
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #121858; 
}
::selection {
    background: #1a237e;
    color: #ffffff;
}

/* ============================================================== */
/* 2. القائمة العلوية الزجاجية (Glassmorphism Navbar)             */
/* ============================================================== */
.navbar, .header-main {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: none !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04) !important; 
    position: relative;
    z-index: 999;
}

/* ============================================================== */
/* 3. البانر الرئيسي (Hero Section) وتأثيرات الطفو والانحناء      */
/* ============================================================== */
.main-slider, 
.hero-section,
.slider-container {
    border-radius: 0 0 45px 45px !important;
    overflow: hidden !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
    margin-bottom: 40px !important;
    position: relative;
}

@media (max-width: 768px) {
    .main-slider, .hero-section, .slider-container {
        border-radius: 0 0 25px 25px !important;
        margin-bottom: 25px !important;
    }
}

@keyframes floatGentle {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.main-slider .swiper-slide img, 
.hero-section img {
    animation: floatGentle 6s ease-in-out infinite !important;
}

.main-slider::after, 
.hero-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0) 50%, rgba(0,0,0,0.15) 100%);
    pointer-events: none;
    z-index: 2;
    border-radius: 0 0 45px 45px !important;
}

/* ============================================================== */
/* 4. تنسيق البطاقات الدائرية (التصنيفات) بقالب عصري              */
/* ============================================================== */
.js-card-top {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px; 
    border-radius: 50% !important; 
    background: #fff;
    padding: 5px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.js-card-top:hover {
    border-color: #1a237e;
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.js-card-top img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 50%; 
}

@media (max-width: 768px) {
    .js-card-top {
        width: 90px;
        height: 90px;
        padding: 3px;
    }
}

/* ============================================================== */
/* 5. بطاقات المنتجات (Soft UI)                                   */
/* ============================================================== */
.card-product, 
.product-item {
    background-color: #ffffff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 16px !important;
    /* مساحة التنفس في الأسفل والجوانب فقط، الأعلى متروك للصورة */
    padding: 0 15px 15px 15px !important; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative;
}

.card-product:hover, 
.product-item:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 35px rgba(26, 35, 126, 0.08) !important;
    border-color: transparent !important;
}

.card-product .product-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    color: #333 !important;
    line-height: 1.5 !important;
}

.card-product .product-price {
    font-size: 1.2rem !important;
    color: #1a237e !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
}

.card-product .card-footer {
    display: flex !important;
    justify-content: center !important; 
    text-align: center !important;
    padding-inline: 0 !important; 
}

.card-product .card-footer a {
    display: flex !important;
    flex-direction: row-reverse !important; 
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    transition: color 0.3s ease !important;
}

.card-product .card-footer a:hover {
    color: #1a237e !important; 
}

.card-product .card-footer i, 
.card-product .card-footer svg {
    margin: 0 5px 0 0 !important; 
    transition: transform 0.3s ease !important;
}

.card-product:hover .card-footer i, 
.card-product:hover .card-footer svg {
    transform: translateX(-4px) !important;
}

/* ============================================================== */
/* 6. عرض الصور: ستايل نقي وواسع (من الحافة للحافة)               */
/* ============================================================== */
.card-product a.product-image, 
.product-item .img-wrapper,
.card-product .image-container,
.product-image-wrapper,
.card-product > a {
    background-color: transparent !important; 
    padding: 0 !important; 
    border-radius: 16px 16px 0 0 !important; /* حواف دائرية تتناسب مع البطاقة من الأعلى */
    margin-bottom: 15px !important;
    width: calc(100% + 30px) !important; /* تعويض مساحة الحشوة الجانبية للبطاقة */
    margin-left: -15px !important;
    margin-right: -15px !important;
    height: 240px !important; /* ارتفاع ممتاز يعرض تفاصيل المفارش بوضوح */
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
}

.card-product img, 
.product-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* يملأ المساحة بالكامل بدون أي فراغات بيضاء */
    mix-blend-mode: normal !important; 
    filter: none !important; /* إزالة أي ظلال أو فلاتر لتظهر الصورة بطبيعتها */
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* تقريب ناعم جداً للتركيز على خامة المنتج عند التمرير */
.card-product:hover img, 
.product-item:hover img {
    transform: scale(1.05) !important;
}

/* ============================================================== */
/* 7. إصلاح السلايدر (Swiper) وإعادة ضبط الأسهم الضائعة           */
/* ============================================================== */
.section, 
.section-products, 
.products-slider-wrapper,
.container,
.swiper-container, 
.swiper-wrapper {
    position: relative !important;
    padding-bottom: 30px !important;
}

.swiper-slide {
    z-index: 1 !important; 
    overflow: hidden !important; 
    border-radius: 16px !important;
}

.js-product .swiper-slide-image,
img.swiper-slide-image,
div.swiper-slide-image {
    width: 100% !important;      
    max-width: 100% !important;
    height: 100% !important;
    inset: 0 !important; 
    transform: none !important;
}

/* تنسيق الأسهم بشكل فاخر لتناسب الهوية */
.swiper-button-next, 
.swiper-button-prev {
    position: absolute !important;
    top: 45% !important; 
    transform: translateY(-50%) !important;
    background-color: #ffffff !important;
    color: #1a237e !important; 
    border: 1px solid #f0f0f0 !important;
    border-radius: 50% !important;
    width: 45px !important;
    height: 45px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999 !important; 
    transition: all 0.3s ease !important;
}

.swiper-button-next:hover, 
.swiper-button-prev:hover {
    background-color: #1a237e !important;
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.1) !important;
}

html[dir="rtl"] .swiper-button-next,
body[dir="rtl"] .swiper-button-next,
.swiper-button-next {
    left: -10px !important; 
    right: auto !important;
}

html[dir="rtl"] .swiper-button-prev,
body[dir="rtl"] .swiper-button-prev,
.swiper-button-prev {
    right: -10px !important; 
    left: auto !important;
}

/* ============================================================== */
/* 8. الأزرار الفاخرة (الشراء، السلة، أزرار الهيدر، وزر المزيد)    */
/* ============================================================== */
.btn-primary, 
.btn-add-to-cart, 
.custom-header-button,
.card-product .btn, 
.product-item button,
.section-header .btn, 
a.btn-outline-primary,
.banner-action-btn {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%) !important; 
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    position: relative;
    overflow: hidden;
}

/* ضبط مقاسات زر المنتج ليكون بعرض البطاقة */
.card-product .btn, 
.btn-add-to-cart,
.product-item button {
    width: 100% !important;
    margin-top: 15px !important;
    padding: 12px 28px !important;
}

/* استثناء زر الهيدر وزر "المزيد" من عرض 100% */
.navbar .nav-item .custom-header-button {
    width: auto !important;
    margin-top: 0 !important;
    padding: 8px 20px !important; 
}

.section-header .btn, 
a.btn-outline-primary,
.banner-action-btn {
    width: auto !important;
    padding: 10px 35px !important;
}

.btn-primary:hover, 
.btn-add-to-cart:hover, 
.custom-header-button:hover,
.card-product .btn:hover, 
.product-item button:hover,
.section-header .btn:hover, 
a.btn-outline-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(26, 35, 126, 0.35) !important;
    background: linear-gradient(135deg, #121858 0%, #1a237e 100%) !important;
}

/* ============================================================== */
/* 9. تحسين شارات الخصم (Tags / Badges)                           */
/* ============================================================== */
.discount-badge, 
.product-label {
    border-radius: 8px !important;
    font-weight: bold !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
    background-color: #d32f2f !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 5px rgba(211, 47, 47, 0.3) !important;
    z-index: 10 !important;
}
/* ============================================================== */
/* 10. الإصلاح الجذري لقسم التصنيفات (فصلها عن المنتجات)          */
/* ============================================================== */

/* 1. إلغاء التنسيق المستطيل المزعج حول التصنيفات فقط */
.card-category, 
.category-item, 
.category-card,
div[class*="category"] .card-product,
.categories-slider .card-product {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* 2. إجبار الدائرة على أن تكون دائرة مثالية تماماً (غير ممطوطة) */
.js-card-top {
    width: 140px !important; 
    height: 140px !important; 
    min-width: 140px !important; /* أوامر إجبارية لمنع انضغاط الدائرة */
    min-height: 140px !important;
    border-radius: 50% !important; 
    margin: 0 auto 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border: 2px solid #f0f0f0 !important; /* إطار دائري خفيف ونظيف */
    background-color: #ffffff !important;
    transition: all 0.3s ease !important;
}

/* 3. منع تشوه وتمطط الصور داخل الدوائر (السر في object-fit: cover) */
.js-card-top img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; 
    border-radius: 50% !important;
    transition: transform 0.4s ease !important;
}

/* 4. تأثير فخم عند تمرير الماوس على التصنيف */
.js-card-top:hover {
    border-color: #1a237e !important; /* ظهور لون الهوية */
    box-shadow: 0 10px 25px rgba(26, 35, 126, 0.15) !important;
}

.js-card-top:hover img {
    transform: scale(1.08) !important; /* تقريب ناعم للصورة */
}

/* 5. تنظيف وتوسيط نصوص التصنيفات أسفل الدائرة */
.card-category .card-footer, 
.category-item .card-footer,
div[class*="category"] .card-footer {
    border: none !important;
    background: transparent !important;
    padding-top: 5px !important;
}