/* ===== هيدر الديسكتوب العصري - تصميم فاخر ===== */
/* للشاشات الكبيرة فقط (1200px وأكثر) */

@media (min-width: 1200px) {
    
    /* إخفاء الهيدر القديم */
    .header {
        display: none !important;
    }
    
    /* ===== الهيدر الجديد ===== */
    .desktop-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #ffffff;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    }
    
    body {
        padding-top: 160px !important;
    }
    
    /* ===== حماية أزرار الصفحة الرئيسية من التأثر بأنماط الهيدر ===== */
    /* هذه الأنماط تضمن أن أزرار السلة في index.php تبقى تشتغل صح */
    .product-card .add-to-cart,
    .product-card .quantity-controls,
    .product-card-v2 .add-to-cart,
    .product-card-v2 .quantity-controls {
        /* إلغاء أي تأثيرات من الهيدر */
        position: relative !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .product-card .add-to-cart.hidden,
    .product-card-v2 .add-to-cart.hidden {
        display: none !important;
    }
    
    .product-card .quantity-controls.active,
    .product-card-v2 .quantity-controls.active {
        display: flex !important;
    }
    
    /* ===== الشريط العلوي - روابط سريعة ===== */
    .desktop-top-bar {
        background: linear-gradient(135deg, #374151 0%, #1f2937 50%, #374151 100%);
        padding: 0;
        position: relative;
        overflow: hidden;
    }
    
    .desktop-top-bar::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 200%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
        animation: shimmerTopBar 8s infinite linear;
    }
    
    @keyframes shimmerTopBar {
        0% { transform: translateX(-50%); }
        100% { transform: translateX(50%); }
    }
    
    .desktop-top-content {
        max-width: 1500px;
        margin: 0 auto;
        padding: 0 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 42px;
        position: relative;
        z-index: 1;
    }
    
    /* روابط يمين - من نحن، اتصل بنا */
    .top-links-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .top-link {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px;
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        border-radius: 20px;
        transition: all 0.3s ease;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .top-link:hover {
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
        transform: translateY(-1px);
    }
    
    .top-link i {
        font-size: 12px;
        opacity: 0.85;
    }
    
    .top-divider {
        width: 1px;
        height: 20px;
        background: rgba(255, 255, 255, 0.2);
        margin: 0 4px;
    }
    
    /* المميزات في المنتصف */
    .top-features {
        display: flex;
        align-items: center;
        gap: 30px;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .top-feature {
        display: flex;
        align-items: center;
        gap: 8px;
        color: rgba(255, 255, 255, 0.95);
        font-size: 12px;
        font-weight: 600;
    }
    
    .top-feature-icon {
        width: 26px;
        height: 26px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
    }
    
    .top-feature-icon i {
        color: #a7f3d0;
    }
    
    /* روابط يسار - التواصل */
    .top-links-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .top-contact {
        display: flex;
        align-items: center;
        gap: 6px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .top-contact:hover {
        color: #a7f3d0;
    }
    
    .top-contact i {
        font-size: 14px;
    }
    
    .top-social {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-right: 10px;
        padding-right: 10px;
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .top-social-link {
        width: 28px;
        height: 28px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.85);
        font-size: 13px;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .top-social-link:hover {
        background: rgba(255, 255, 255, 0.25);
        color: #ffffff;
        transform: scale(1.1);
    }
    
    .top-social-link.whatsapp:hover {
        background: #25d366;
    }
    
    .top-social-link.instagram:hover {
        background: linear-gradient(45deg, #f09433, #e6683c, #dc2743);
    }
    
    .top-social-link.twitter:hover {
        background: #1da1f2;
    }
    
    /* ===== الشريط الرئيسي ===== */
    .desktop-main-bar {
        background: #ffffff;
        padding: 16px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .desktop-main-content {
        max-width: 1500px;
        margin: 0 auto;
        padding: 0 40px;
        display: flex;
        align-items: center;
        gap: 40px;
    }
    
    /* اللوجو */
    .desktop-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        flex-shrink: 0;
    }
    
    .desktop-logo img {
        height: 55px;
        width: auto;
        border-radius: 12px;
    }
    
    .desktop-logo-text {
        display: flex;
        flex-direction: column;
    }
    
    .desktop-logo-title {
        font-size: 20px;
        font-weight: 800;
        color: #1f2937;
        line-height: 1.2;
    }
    
    .desktop-logo-subtitle {
        font-size: 11px;
        color: #6b7280;
        font-weight: 500;
    }
    
    /* شريط البحث */
    .desktop-search {
        flex: 1;
        max-width: 600px;
        position: relative;
    }
    
    .desktop-search-input {
        width: 100%;
        padding: 14px 55px 14px 24px;
        border: 2px solid #e5e7eb;
        border-radius: 50px;
        font-size: 15px;
        font-family: 'Cairo', sans-serif;
        background: #fafafa;
        transition: all 0.3s ease;
        color: #1f2937;
    }
    
    .desktop-search-input::placeholder {
        color: #9ca3af;
    }
    
    .desktop-search-input:focus {
        outline: none;
        border-color: #1f2937;
        background: #ffffff;
        box-shadow: 0 0 0 4px rgba(44, 85, 48, 0.1);
    }
    
    .desktop-search-btn {
        position: absolute;
        left: 6px;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        border: none;
        border-radius: 50%;
        color: #ffffff;
        font-size: 16px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .desktop-search-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937);
        transform: translateY(-50%) scale(1.05);
    }
    
    /* أزرار الإجراءات */
    .desktop-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }
    
    .desktop-action-btn {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
        background: #ffffff;
        border: 2px solid #e5e7eb;
        border-radius: 50px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
    }
    
    .desktop-action-btn:hover {
        border-color: #1f2937;
        background: #f0f7f1;
    }
    
    .desktop-action-btn i {
        font-size: 20px;
        color: #1f2937;
    }
    
    .desktop-action-btn span {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
    }
    
    /* Badge عام - دائرة صغيرة */
    .desktop-action-btn .action-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        width: 20px;
        height: 20px;
        min-width: 20px;
        background: #ef4444;
        color: #ffffff;
        font-size: 10px;
        font-weight: 700;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffffff;
        padding: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        z-index: 10;
    }
    
    /* زر المفضلة */
    .desktop-action-btn.favorites-btn {
        position: relative;
        overflow: visible !important;
    }
    
    .desktop-action-btn.favorites-btn i {
        color: #ec4899;
    }
    
    .desktop-action-btn.favorites-btn:hover {
        border-color: #ec4899;
        background: #fdf2f8;
    }
    
    .desktop-action-btn.favorites-btn .action-badge {
        background: #ef4444;
    }
    
    /* زر السلة */
    .desktop-action-btn.cart-btn {
        background: linear-gradient(135deg, #1f2937, #4b5563) !important;
        border: none !important;
        padding: 12px 24px !important;
        min-width: auto;
        height: auto;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        border-radius: 50px !important;
        position: relative;
        overflow: visible !important;
    }
    
    .desktop-action-btn.cart-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937) !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(44, 85, 48, 0.3);
    }
    
    .desktop-action-btn.cart-btn i {
        color: #ffffff !important;
        font-size: 20px !important;
        display: inline-block !important;
    }
    
    .desktop-action-btn.cart-btn span,
    .desktop-action-btn.cart-btn .cart-total-price {
        color: #ffffff !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        white-space: nowrap;
        display: inline-block !important;
    }
    
    .desktop-action-btn.cart-btn .action-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        width: 20px;
        height: 20px;
        min-width: 20px;
        background: #ef4444 !important;
        color: #ffffff !important;
        font-size: 10px;
        font-weight: 700;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffffff;
        padding: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    /* زر الحساب */
    .desktop-account-wrapper {
        position: relative;
    }
    
    .desktop-account-btn {
        width: 48px;
        height: 48px;
        background: #f3f4f6;
        border: 2px solid #e5e7eb;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .desktop-account-btn:hover {
        border-color: #1f2937;
        background: #f0f7f1;
    }
    
    .desktop-account-btn i {
        font-size: 22px;
        color: #1f2937;
    }
    
    .desktop-account-btn img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* قائمة الحساب المنسدلة */
    .desktop-account-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%);
        background: #ffffff;
        border-radius: 14px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        padding: 12px;
        min-width: 220px;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(-10px);
        transition: all 0.3s ease;
        z-index: 10000;
    }
    
    .desktop-account-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    
    .desktop-account-dropdown::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 12px;
        height: 12px;
        background: #ffffff;
        border-radius: 2px;
        transform: translateX(-50%) rotate(45deg);
        box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
    }
    
    .desktop-account-dropdown .dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        color: #374151;
        text-decoration: none;
        border-radius: 10px;
        transition: all 0.2s ease;
        font-size: 14px;
        font-weight: 600;
    }
    
    .desktop-account-dropdown .dropdown-item:hover {
        background: #f0f7f1;
        color: #1f2937;
    }
    
    .desktop-account-dropdown .dropdown-item i {
        font-size: 16px;
        width: 20px;
        text-align: center;
    }
    
    .desktop-account-dropdown .dropdown-item.logout {
        color: #ef4444;
    }
    
    .desktop-account-dropdown .dropdown-item.logout:hover {
        background: #fee2e2;
    }
    
    .desktop-account-dropdown .dropdown-divider {
        height: 1px;
        background: #e5e7eb;
        margin: 8px 0;
    }
}
  
  
    /* ===== شريط الأقسام (Navbar) ===== */
    .desktop-categories-bar {
        background: #ffffff;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }
    
    .desktop-categories-content {
        max-width: 1500px;
        margin: 0 auto;
        padding: 0 40px;
        display: flex;
        align-items: center;
        gap: 15px;
        position: relative;
    }
    
    /* زر كل الأقسام */
    .all-categories-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 24px;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        border: none;
        cursor: pointer;
        font-size: 15px;
        font-weight: 700;
        font-family: 'Cairo', sans-serif;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    
    .all-categories-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937);
    }
    
    .all-categories-btn i {
        font-size: 16px;
    }
    
    /* أزرار التنقل */
    .categories-nav-btn {
        width: 40px;
        height: 40px;
        background: #ffffff;
        border: 2px solid #e5e7eb;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #1f2937;
        font-size: 14px;
        transition: all 0.3s ease;
        flex-shrink: 0;
        z-index: 10;
    }
    
    .categories-nav-btn:hover {
        background: #1f2937;
        border-color: #1f2937;
        color: #ffffff;
    }
    
    .categories-nav-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
    
    .categories-nav-btn.prev-btn {
        margin-right: 10px;
    }
    
    .categories-nav-btn.next-btn {
        margin-left: 10px;
    }
    
    /* قائمة الأقسام */
    .categories-slider-wrapper {
        flex: 1;
        overflow: hidden;
        position: relative;
        margin: 0 10px;
    }
    
    .categories-slider {
        display: flex;
        align-items: center;
        gap: 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 8px 0;
    }
    
    .category-nav-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
        color: #374151;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        transition: all 0.3s ease;
        border-radius: 8px;
        position: relative;
        flex-shrink: 0;
    }
    
    .category-nav-item::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 3px;
        background: linear-gradient(135deg, #1f2937, #6b7280);
        border-radius: 3px 3px 0 0;
        transition: width 0.3s ease;
    }
    
    .category-nav-item:hover {
        color: #1f2937;
        background: #f0f7f1;
    }
    
    .category-nav-item:hover::after {
        width: 60%;
    }
    
    .category-nav-item.active {
        color: #1f2937;
        background: #f0f7f1;
    }
    
    .category-nav-item.active::after {
        width: 60%;
    }
    
    .category-nav-icon {
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, #e8f5e9, #d4edda);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: #1f2937;
        transition: all 0.3s ease;
    }
    
    .category-nav-item:hover .category-nav-icon {
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
    }
    
    .category-nav-item.active .category-nav-icon {
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
    }
    
    /* مميزات التوصيل على اليسار */
    .delivery-features {
        display: flex;
        align-items: center;
        gap: 20px;
        padding-right: 20px;
        border-right: 1px solid #e5e7eb;
        margin-right: auto;
        flex-shrink: 0;
    }
    
    .delivery-feature {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        background: linear-gradient(135deg, #fef3c7, #fde68a);
        border-radius: 25px;
        transition: all 0.3s ease;
    }
    
    .delivery-feature:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    }
    
    .delivery-feature-icon {
        width: 28px;
        height: 28px;
        background: #f59e0b;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        font-size: 12px;
    }
    
    .delivery-feature-text {
        font-size: 12px;
        font-weight: 700;
        color: #92400e;
    }
    
    /* ===== القائمة المنسدلة للأقسام ===== */
    .categories-mega-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #ffffff;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 20px 20px;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 1000;
        max-height: 70vh;
        overflow: hidden;
    }
    
    .categories-mega-dropdown.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    /* الحاوية الرئيسية - قسمين جنب بعض */
    .mega-dropdown-container {
        display: grid;
        grid-template-columns: 350px 1fr;
        max-width: 1400px;
        margin: 0 auto;
        min-height: 500px;
        max-height: 70vh;
    }
    
    /* ===== قائمة الأقسام على اليمين ===== */
    .mega-categories-list {
        background: #f8f9fa;
        border-left: 1px solid #e5e7eb;
        overflow-y: auto;
        padding: 20px 0;
    }
    
    .mega-list-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 24px;
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 10px;
        border-bottom: 2px solid #e5e7eb;
    }
    
    .mega-list-header i {
        font-size: 18px;
    }
    
    .mega-category-item {
        margin: 0 12px 8px;
        border-radius: 12px;
        overflow: visible;
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, background 0.2s ease;
    }
    
    .mega-category-item a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        text-decoration: none;
        background: #ffffff;
        border: 2px solid transparent;
        border-radius: 12px;
        transition: all 0.3s ease;
    }
    
    .mega-category-item:hover a,
    .mega-category-item.active a {
        background: linear-gradient(135deg, #f0f7f1, #e8f5e9);
        border-color: #1f2937;
    }
    
    .mega-cat-image {
        width: 50px;
        height: 50px;
        border-radius: 10px;
        overflow: hidden;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .mega-cat-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .mega-cat-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .mega-cat-name {
        font-size: 14px;
        font-weight: 700;
        color: #1f2937;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mega-cat-count {
        font-size: 12px;
        color: #6b7280;
    }
    
    .mega-category-item a i.fa-chevron-left {
        color: #d1d5db;
        font-size: 12px;
        transition: all 0.3s ease;
    }
    
    .mega-category-item:hover a i.fa-chevron-left,
    .mega-category-item.active a i.fa-chevron-left {
        color: #1f2937;
        transform: translateX(-3px);
    }
    
    /* ===== لوحة المنتجات على اليسار ===== */
    .mega-products-panel {
        background: #ffffff;
        padding: 20px;
        overflow-y: auto;
    }
    
    .mega-products-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        background: linear-gradient(135deg, #f0f7f1, #e8f5e9);
        border-radius: 12px;
        margin-bottom: 20px;
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
    }
    
    .mega-products-header i {
        font-size: 18px;
        color: #f59e0b;
    }
    
    .mega-products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .mega-products-placeholder,
    .mega-products-loading {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px 20px;
        color: #9ca3af;
        text-align: center;
    }
    
    .mega-products-placeholder i,
    .mega-products-loading i {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: 0.5;
    }
    
    .mega-products-loading i {
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
    
    .mega-products-placeholder p,
    .mega-products-loading span {
        font-size: 14px;
        font-weight: 600;
    }
    
    /* ===== كروت المنتجات ===== */
    .mega-product-card {
        background: #ffffff;
        border: 2px solid #f0f0f0;
        border-radius: 14px;
        padding: 12px;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .mega-product-card:hover {
        border-color: #1f2937;
        box-shadow: 0 6px 20px rgba(44, 85, 48, 0.15);
        transform: translateY(-4px);
    }
    
    .mega-product-link {
        text-decoration: none;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .mega-product-img {
        width: 100%;
        aspect-ratio: 1;
        border-radius: 10px;
        overflow: hidden;
        background: #f8f9fa;
    }
    
    .mega-product-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .mega-product-card:hover .mega-product-img img {
        transform: scale(1.1);
    }
    
    .mega-product-name {
        font-size: 13px;
        font-weight: 600;
        color: #1f2937;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .mega-product-price-row {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .mega-product-price {
        font-size: 15px;
        font-weight: 700;
        color: #1f2937;
    }
    
    .mega-product-old-price {
        font-size: 12px;
        color: #9ca3af;
        text-decoration: line-through;
    }
    
    .mega-product-rating {
        font-size: 11px;
        color: #f59e0b;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .mega-product-rating span {
        color: #6b7280;
        font-weight: 600;
    }
    
    /* أزرار المنتج */
    .mega-product-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: auto;
    }
    
    .mega-qty-wrap {
        display: flex;
        align-items: center;
        gap: 4px;
        background: #f3f4f6;
        border-radius: 8px;
        padding: 4px;
        flex: 1;
    }
    
    .mega-qty-btn {
        width: 28px;
        height: 28px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        color: #1f2937;
        font-size: 12px;
    }
    
    .mega-qty-btn:hover:not(.disabled) {
        background: #1f2937;
        color: #ffffff;
        border-color: #1f2937;
    }
    
    .mega-qty-btn.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
    
    .mega-qty-num {
        flex: 1;
        text-align: center;
        font-size: 13px;
        font-weight: 700;
        color: #1f2937;
    }
    
    .mega-cart-btn,
    .mega-fav-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 14px;
    }
    
    .mega-cart-btn {
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
    }
    
    .mega-cart-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937);
        transform: scale(1.05);
    }
    
    .mega-cart-btn.mega-check-btn {
        background: #222222;
    }
    
    .mega-cart-btn.disabled {
        background: #9ca3af;
        cursor: not-allowed;
    }
    
    .mega-fav-btn {
        background: #ffffff;
        border: 2px solid #f0f0f0;
        color: #ec4899;
    }
    
    .mega-fav-btn:hover,
    .mega-fav-btn.active {
        background: #fdf2f8;
        border-color: #ec4899;
    }
    
    .mega-fav-btn.active i {
        color: #ec4899;
    }
    
    /* زر تصفح الكل */
    .mega-browse-all-btn {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 16px;
        background: linear-gradient(135deg, #f0f7f1, #e8f5e9);
        border: 2px dashed #1f2937;
        border-radius: 14px;
        text-decoration: none;
        color: #1f2937;
        font-size: 15px;
        font-weight: 700;
        transition: all 0.3s ease;
        margin-top: 10px;
    }
    
    .mega-browse-all-btn:hover {
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        border-style: solid;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(44, 85, 48, 0.25);
    }
    
    .mega-browse-all-btn i:last-child {
        transition: transform 0.3s ease;
    }
    
    .mega-browse-all-btn:hover i:last-child {
        transform: translateX(-5px);
    }
    
    /* سكرول بار مخصص */
    .mega-categories-list::-webkit-scrollbar,
    .mega-products-panel::-webkit-scrollbar {
        width: 6px;
    }
    
    .mega-categories-list::-webkit-scrollbar-track,
    .mega-products-panel::-webkit-scrollbar-track {
        background: #f0f0f0;
    }
    
    .mega-categories-list::-webkit-scrollbar-thumb,
    .mega-products-panel::-webkit-scrollbar-thumb {
        background: #1f2937;
        border-radius: 3px;
    }
    
    .mega-categories-list::-webkit-scrollbar-thumb:hover,
    .mega-products-panel::-webkit-scrollbar-thumb:hover {
        background: #1f2937;
    }
    


    /* ===== Toast للإشعارات ===== */
    .mega-toast {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background: #ffffff;
        padding: 14px 24px;
        border-radius: 50px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        font-size: 14px;
        font-weight: 600;
        z-index: 10001;
        opacity: 0;
        transition: all 0.3s ease;
        border: 2px solid #e5e7eb;
    }
    
    .mega-toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    
    .mega-toast-success {
        background: linear-gradient(135deg, #d1fae5, #a7f3d0);
        border-color: #222222;
        color: #065f46;
    }
    
    .mega-toast-info {
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        border-color: #3b82f6;
        color: #1e40af;
    }
    
    .mega-toast-error {
        background: linear-gradient(135deg, #fee2e2, #fecaca);
        border-color: #ef4444;
        color: #991b1b;
    }

/* إخفاء الهيدر الجديد في الشاشات الصغيرة */
@media (max-width: 1199px) {
    .desktop-header {
        display: none !important;
    }
}


/* ===== إصلاح أزرار السلة والمفضلة - أولوية عالية جداً ===== */
@media (min-width: 1200px) {
    
    /* ===== زر السلة ===== */
    .desktop-header .desktop-actions button.desktop-action-btn.cart-btn {
        background: linear-gradient(135deg, #1f2937, #4b5563) !important;
        border: none !important;
        padding: 14px 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        border-radius: 50px !important;
        cursor: pointer !important;
        min-height: 50px !important;
        color: #ffffff !important;
        width: auto !important;
        position: relative !important;
        overflow: visible !important;
    }
    
    .desktop-header .desktop-actions button.desktop-action-btn.cart-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937) !important;
        transform: translateY(-2px) !important;
    }
    
    .desktop-header .desktop-actions button.desktop-action-btn.cart-btn i.fas.fa-shopping-cart {
        color: #ffffff !important;
        font-size: 20px !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .desktop-header .desktop-actions button.desktop-action-btn.cart-btn span.cart-total-price,
    .desktop-header .desktop-actions button.desktop-action-btn.cart-btn #desktopCartTotal {
        color: #ffffff !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Badge السلة - دائرة صغيرة خارج الزر */
    .desktop-header .desktop-actions button.desktop-action-btn.cart-btn span.action-badge,
    .desktop-header .desktop-actions button.desktop-action-btn.cart-btn #desktopCartCount {
        position: absolute !important;
        top: -8px !important;
        right: -8px !important;
        background: #ef4444 !important;
        color: #ffffff !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        border-radius: 50% !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        border: 2px solid #ffffff !important;
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        z-index: 100 !important;
        line-height: 1 !important;
    }
    
    /* ===== زر المفضلة ===== */
    .desktop-header .desktop-actions button.desktop-action-btn.favorites-btn {
        position: relative !important;
        overflow: visible !important;
    }
    
    /* Badge المفضلة - دائرة صغيرة خارج الزر */
    .desktop-header .desktop-actions button.desktop-action-btn.favorites-btn span.action-badge,
    .desktop-header .desktop-actions button.desktop-action-btn.favorites-btn #desktopFavCount {
        position: absolute !important;
        top: -8px !important;
        right: -8px !important;
        background: #ef4444 !important;
        color: #ffffff !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        border-radius: 50% !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        border: 2px solid #ffffff !important;
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        z-index: 100 !important;
        line-height: 1 !important;
    }
}


/* ===== قائمة الحساب للهيدر الجديد ===== */
@media (min-width: 1200px) {
    
    /* الزر */
    .desktop-header .desktop-account-btn {
        position: relative;
    }
    
    /* القائمة المنسدلة */
    .desktop-header .desktop-account-btn .account-menu,
    .desktop-header .account-menu.desktop-mode {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        right: 0 !important;
        left: auto !important;
        bottom: auto !important;
        width: 220px !important;
        max-height: 400px !important;
        border-radius: 16px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
        background: #ffffff !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
        transition: all 0.3s ease !important;
        overflow: visible !important;
        z-index: 99999 !important;
    }
    
    .desktop-header .desktop-account-btn .account-menu.account-active,
    .desktop-header .account-menu.desktop-mode.account-active {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
    
    /* السهم العلوي */
    .desktop-header .account-menu.desktop-mode::before {
        content: '' !important;
        position: absolute !important;
        top: -8px !important;
        right: 18px !important;
        width: 16px !important;
        height: 16px !important;
        background: #ffffff !important;
        transform: rotate(45deg) !important;
        box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05) !important;
        border-radius: 3px !important;
    }
    
    /* إخفاء الهيدر */
    .desktop-header .account-menu.desktop-mode .account-header {
        display: none !important;
    }
    
    /* المحتوى */
    .desktop-header .account-menu.desktop-mode .account-body {
        display: flex !important;
        flex-direction: column !important;
        padding: 8px !important;
        gap: 4px !important;
    }
    
    /* العناصر */
    .desktop-header .account-menu.desktop-mode .account-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px 14px !important;
        border-radius: 10px !important;
        background: transparent !important;
        transition: all 0.2s ease !important;
        text-decoration: none !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-item:hover {
        background: #f0f7f1 !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-item i {
        width: 36px !important;
        height: 36px !important;
        background: linear-gradient(135deg, #e8f5e9, #d4edda) !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 14px !important;
        color: #1f2937 !important;
        box-shadow: none !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-item span {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #374151 !important;
    }
    
    /* الفاصل */
    .desktop-header .account-menu.desktop-mode .account-divider {
        display: block !important;
        height: 1px !important;
        background: #e5e7eb !important;
        margin: 6px 10px !important;
    }
    
    /* تسجيل الخروج */
    .desktop-header .account-menu.desktop-mode .account-logout {
        background: transparent !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-logout:hover {
        background: #fef2f2 !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-logout i {
        background: #fef2f2 !important;
        color: #ef4444 !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-logout span {
        color: #ef4444 !important;
    }
    
    /* أزرار تسجيل الدخول */
    .desktop-header .account-menu.desktop-mode .account-auth-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-login-btn {
        background: linear-gradient(135deg, #1f2937, #4b5563) !important;
        color: #ffffff !important;
        padding: 12px !important;
        border-radius: 10px !important;
        text-align: center !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-login-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937) !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-register-btn {
        background: #f0f7f1 !important;
        color: #1f2937 !important;
        padding: 12px !important;
        border-radius: 10px !important;
        text-align: center !important;
        font-weight: 700 !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
    }
    
    .desktop-header .account-menu.desktop-mode .account-register-btn:hover {
        background: #e8f5e9 !important;
    }
}


/* ===== إصلاح قائمة الحساب - أولوية قصوى ===== */
@media (min-width: 1200px) {
    /* إخفاء الـ overlay في الديسكتوب */
    .account-overlay {
        display: none !important;
    }
    
    /* التأكد من ظهور القائمة */
    .desktop-header .desktop-account-btn {
        position: relative !important;
        z-index: 9999 !important;
    }
    
    .desktop-header .desktop-account-btn > .account-menu {
        position: absolute !important;
        top: 55px !important;
        right: 0 !important;
        left: auto !important;
        bottom: auto !important;
        width: 220px !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) scale(0.95) !important;
        transition: all 0.25s ease !important;
        z-index: 99999 !important;
        overflow: hidden !important;
    }
    
    .desktop-header .desktop-account-btn > .account-menu.account-active {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) scale(1) !important;
    }
    
    /* إخفاء المقبض */
    .desktop-header .desktop-account-btn > .account-menu::before {
        display: none !important;
    }
}


/* ===== قائمة الحساب الجديدة للديسكتوب ===== */
@media (min-width: 1200px) {
    
    .desktop-account-wrapper {
        position: relative;
    }
    
    .desktop-account-dropdown {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        width: 200px;
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        padding: 8px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.25s ease;
        z-index: 99999;
    }
    
    .desktop-account-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    /* السهم العلوي */
    .desktop-account-dropdown::before {
        content: '';
        position: absolute;
        top: -6px;
        right: 16px;
        width: 12px;
        height: 12px;
        background: #ffffff;
        transform: rotate(45deg);
        box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .desktop-account-dropdown .dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        color: #374151;
        text-decoration: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.2s ease;
    }
    
    .desktop-account-dropdown .dropdown-item:hover {
        background: #f0f7f1;
        color: #1f2937;
    }
    
    .desktop-account-dropdown .dropdown-item i {
        width: 32px;
        height: 32px;
        background: #f3f4f6;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: #1f2937;
    }
    
    .desktop-account-dropdown .dropdown-item:hover i {
        background: #1f2937;
        color: #ffffff;
    }
    
    .desktop-account-dropdown .dropdown-divider {
        height: 1px;
        background: #e5e7eb;
        margin: 8px 0;
    }
    
    .desktop-account-dropdown .dropdown-item.logout {
        color: #ef4444;
    }
    
    .desktop-account-dropdown .dropdown-item.logout i {
        background: #fef2f2;
        color: #ef4444;
    }
    
    .desktop-account-dropdown .dropdown-item.logout:hover {
        background: #fef2f2;
    }
    
    .desktop-account-dropdown .dropdown-item.logout:hover i {
        background: #ef4444;
        color: #ffffff;
    }
}


/* ===== صور الفئات في القائمة المنسدلة ===== */
@media (min-width: 1200px) {
    .mega-category-image {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        overflow: hidden;
        flex-shrink: 0;
        background: #f3f4f6;
    }
    
    .mega-category-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .mega-category-card:hover .mega-category-image img {
        transform: scale(1.1);
    }
    
    /* تحسين شكل الكارت مع الصورة */
    .mega-category-card {
        display: flex;
        align-items: center;
        gap: 14px;
    }
}

/* ===== سلايدر الأقسام - سحب بالماوس ===== */
@media (min-width: 1200px) {
    .categories-slider-wrapper {
        cursor: grab;
        user-select: none;
    }
    
    .categories-slider-wrapper:active {
        cursor: grabbing;
    }
    
    .categories-slider-wrapper.dragging {
        cursor: grabbing;
    }
    
    .categories-slider-wrapper.dragging .category-nav-item {
        pointer-events: none;
    }
}


/* ===== تحسين القائمة المنسدلة للأقسام ===== */
@media (min-width: 1200px) {
    
    /* عنوان القائمة */
    .mega-dropdown-header {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 20px 25px;
        background: linear-gradient(135deg, #f0f7f1, #e8f5e9);
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 20px;
    }
    
    .mega-dropdown-header > i {
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        font-size: 22px;
    }
    
    .mega-dropdown-header h3 {
        margin: 0 0 4px 0;
        font-size: 18px;
        font-weight: 700;
        color: #1f2937;
    }
    
    .mega-dropdown-header p {
        margin: 0;
        font-size: 13px;
        color: #6b7280;
    }
    
    /* تحسين الصور - دائرية */
    .mega-category-image {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
        background: #f8f9fa;
        position: relative;
        border: 3px solid #e5e7eb;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .mega-category-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .mega-category-card:hover .mega-category-image {
        border-color: #1f2937;
    }
    
    .mega-category-card:hover .mega-category-image img {
        transform: scale(1.1);
    }
    
    /* الأيقونة البديلة */
    .mega-category-icon-fallback {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        font-size: 24px;
    }
    
    /* تحسين الكارت */
    .mega-category-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .mega-category-card:hover {
        background: #f0f7f1;
        border-color: #1f2937;
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(44, 85, 48, 0.15);
    }
    
    /* تحسين الشبكة */
    .mega-dropdown-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 0 25px 25px;
    }
    
    @media (max-width: 1400px) {
        .mega-dropdown-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
}


/* ===== تنسيق القائمة المنسدلة الجديدة للأقسام ===== */
@media (min-width: 1200px) {
    
    /* الحاوية الرئيسية */
    .mega-dropdown-container {
        display: flex;
        gap: 0;
        min-height: 400px;
    }
    
    /* قائمة الأقسام على اليمين */
    .mega-categories-list {
        width: 250px;
        background: #f8f9fa;
        border-left: 1px solid #e5e7eb;
        flex-shrink: 0;
        overflow-y: auto;
        max-height: 450px;
    }
    
    .mega-list-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 16px 20px;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        font-weight: 700;
        font-size: 15px;
    }
    
    .mega-list-header i {
        font-size: 16px;
    }
    
    /* عنصر القسم */
    .mega-category-item {
        border-bottom: 1px solid #e5e7eb;
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, background 0.2s ease;
    }
    
    .mega-category-item:hover {
        background: linear-gradient(90deg, #f0f7f1, #ffffff);
    }
    
    .mega-category-item.active {
        background: linear-gradient(90deg, #e8f5e9, #f0f7f1);
    }
    
    .mega-category-item a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        text-decoration: none;
        color: #374151;
        transition: all 0.2s ease;
    }
    
    .mega-category-item:hover a {
        color: #1f2937;
    }
    
    /* صورة القسم - صغيرة ومربعة */
    .mega-cat-image {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        overflow: hidden;
        flex-shrink: 0;
        background: #e5e7eb;
        transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .mega-cat-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .mega-category-item:hover .mega-cat-image {
        transform: none;
        box-shadow: 0 2px 10px rgba(44, 85, 48, 0.15);
    }
    
    .mega-category-item:hover .mega-cat-image img {
        transform: none;
    }
    
    /* معلومات القسم */
    .mega-cat-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .mega-cat-name {
        font-size: 14px;
        font-weight: 600;
        color: #1f2937;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mega-cat-count {
        font-size: 12px;
        color: #6b7280;
    }
    
    .mega-category-item a > i {
        color: #9ca3af;
        font-size: 12px;
        transition: all 0.2s ease;
    }
    
    .mega-category-item:hover a > i {
        color: #1f2937;
        transform: translateX(-3px);
    }
    
    /* لوحة المنتجات على اليسار */
    .mega-products-panel {
        flex: 1;
        padding: 20px 25px;
        background: #ffffff;
        overflow-y: auto;
        max-height: 450px;
    }
    
    .mega-products-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        padding-bottom: 12px;
        border-bottom: 2px solid #f0f0f0;
        font-weight: 700;
        font-size: 16px;
        color: #1f2937;
    }
    
    .mega-products-header i {
        color: #f59e0b;
    }
    
    .mega-products-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .mega-products-placeholder {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px 20px;
        color: #9ca3af;
        text-align: center;
    }
    
    .mega-products-placeholder i {
        font-size: 40px;
        margin-bottom: 15px;
        opacity: 0.5;
    }
    
    .mega-products-placeholder p {
        margin: 0;
        font-size: 14px;
    }
}


/* ===== تنسيق كروت المنتجات في القائمة المنسدلة ===== */
@media (min-width: 1200px) {
    
    .mega-products-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .mega-product-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 12px;
        background: #fafafa;
        border-radius: 12px;
        text-decoration: none;
        transition: all 0.3s ease;
        border: 1px solid #e5e7eb;
    }
    
    .mega-product-card:hover {
        background: #ffffff;
        border-color: #1f2937;
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(44, 85, 48, 0.15);
    }
    
    /* Loading */
    .mega-products-loading {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px;
        color: #6b7280;
    }
    
    .mega-products-loading i {
        font-size: 30px;
        color: #1f2937;
        margin-bottom: 10px;
    }
}


/* ===== تنسيقات المنتجات المحسنة في القائمة المنسدلة ===== */
@media (min-width: 1200px) {
    
    /* شبكة 5 منتجات في الصف مع مسافات مريحة */
    .mega-products-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 15px;
        padding: 5px;
    }
    
    /* كارت المنتج المحسن */
    .mega-product-card {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border-radius: 14px;
        border: 2px solid #e5e7eb;
        overflow: hidden;
        transition: border-color 0.2s ease;
        position: relative;
        min-width: 0;
    }
    
    .mega-product-card:hover {
        border-color: #1f2937;
    }
    
    .mega-product-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 15px 12px 10px;
        text-decoration: none;
        flex: 1;
    }
    
    .mega-product-img {
        width: 85px;
        height: 85px;
        border-radius: 12px;
        overflow: hidden;
        background: #f8f9fa;
        margin-bottom: 10px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    }
    
    .mega-product-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .mega-product-name {
        font-size: 12px;
        font-weight: 600;
        color: #1f2937;
        text-align: center;
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.5;
        min-height: 36px;
    }
    
    /* الوصف السريع */
    .mega-product-desc {
        font-size: 10px;
        color: #6b7280;
        text-align: center;
        margin-bottom: 6px;
        line-height: 1.4;
        display: none; /* إخفاء الوصف لتوفير المساحة */
    }
    
    /* صف السعر */
    .mega-product-price-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-bottom: 5px;
    }
    
    .mega-product-price {
        font-size: 13px;
        font-weight: 700;
        color: #1f2937;
    }
    
    .mega-product-old-price {
        font-size: 11px;
        color: #9ca3af;
        text-decoration: line-through;
    }
    
    .mega-product-rating {
        font-size: 11px;
        color: #f59e0b;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .mega-product-rating span {
        color: #6b7280;
        font-size: 10px;
    }
    
    /* أزرار المنتج - المفضلة يمين والسلة يسار */
    .mega-product-actions {
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        background: #f8f9fa;
        border-top: 1px solid #e5e7eb;
    }
    
    /* زر السلة - على اليمين */
    .mega-cart-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border: none;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        border-radius: 10px;
        cursor: pointer;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: background 0.2s ease;
        flex-shrink: 0;
    }
    
    .mega-cart-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937);
    }
    
    .mega-cart-btn.added {
        background: #222222 !important;
    }
    
    .mega-cart-btn.disabled {
        background: #d1d5db !important;
        cursor: not-allowed;
    }
    
    .mega-cart-btn i {
        font-size: 16px !important;
    }
    
    /* زر المفضلة - على اليسار */
    .mega-fav-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border: 1px solid #e5e7eb;
        background: #ffffff;
        border-radius: 10px;
        cursor: pointer;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease;
        color: #9ca3af;
        flex-shrink: 0;
    }
    
    .mega-fav-btn i {
        font-size: 16px !important;
    }
    
    .mega-fav-btn:hover {
        background: #fdf2f8;
        color: #ec4899;
        border-color: #ec4899;
    }
    
    .mega-fav-btn.active {
        background: #fdf2f8;
        color: #ec4899;
        border-color: #ec4899;
    }
    
    /* زر تصفح الكل */
    .mega-browse-all-btn {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 16px 24px;
        background: linear-gradient(135deg, #f0f7f1, #e8f5e9);
        border: 2px dashed #1f2937;
        border-radius: 14px;
        color: #1f2937;
        text-decoration: none;
        font-size: 15px;
        font-weight: 700;
        transition: all 0.3s ease;
        margin-top: 10px;
    }
    
    .mega-browse-all-btn:hover {
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        border-color: #1f2937;
        border-style: solid;
    }
    
    .mega-browse-all-btn i:last-child {
        transition: transform 0.3s ease;
    }
    
    .mega-browse-all-btn:hover i:last-child {
        transform: translateX(-5px);
    }
    
    /* Toast */
    .mega-toast {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background: #1f2937;
        color: #ffffff;
        padding: 14px 28px;
        border-radius: 50px;
        font-size: 14px;
        font-weight: 600;
        z-index: 999999;
        opacity: 0;
        transition: all 0.3s ease;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }
    
    .mega-toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    
    .mega-toast-success {
        background: linear-gradient(135deg, #1f2937, #4b5563);
    }
    
    .mega-toast-info {
        background: #3b82f6;
    }
    
    .mega-toast-error {
        background: #ef4444;
    }
}


/* ===== نظام الكمية الجديد في القائمة المنسدلة (موحد مع index.php) ===== */
@media (min-width: 1200px) {
    
    /* إخفاء العناصر */
    .mega-add-btn.hidden,
    .mega-qty-wrap:not(.active) {
        display: none !important;
    }
    
    /* حاوية أزرار الكمية */
    .mega-qty-wrap {
        display: none;
        align-items: center;
        gap: 4px;
        background: linear-gradient(135deg, #f0f7f1, #e8f5e9);
        border-radius: 10px;
        padding: 4px;
        height: 38px;
    }
    
    .mega-qty-wrap.active {
        display: flex !important;
    }
    
    /* أزرار + و - */
    .mega-qty-btn {
        width: 30px;
        height: 30px;
        border: none;
        background: #1f2937;
        color: #ffffff;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        font-size: 16px;
        font-weight: bold;
    }
    
    .mega-qty-btn i {
        font-size: 11px;
        color: white;
    }
    
    .mega-qty-btn:hover:not(.disabled) {
        background: #1f2937;
        transform: scale(1.05);
    }
    
    .mega-qty-btn.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
    
    /* زر الحذف (سلة المهملات) */
    .mega-qty-minus i.fa-trash {
        color: #ffffff;
    }
    
    /* عرض الكمية */
    .mega-qty-num {
        min-width: 28px;
        text-align: center;
        font-size: 14px;
        font-weight: 700;
        color: #1f2937;
    }
    
    /* زر الإضافة للسلة */
    .mega-add-btn {
        width: 38px;
        height: 38px;
        border: none;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        border-radius: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(44, 85, 48, 0.3);
    }
    
    .mega-add-btn i {
        font-size: 14px;
    }
    
    .mega-add-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937);
        transform: scale(1.05);
    }
}


/* ===== Overlay التعتيم ===== */
@media (min-width: 1200px) {
    .mega-dropdown-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9990;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
    }
    
    .mega-dropdown-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* تعتيم عند hover على روابط الشريط العلوي */
    .top-link {
        position: relative;
        z-index: 9999;
    }
    
    /* ===== أزرار السلة الموحدة (نفس تصميم index.php) ===== */
    
    /* زر الإضافة للسلة */
    .mega-add-btn {
        flex: 1;
        height: 36px;
        background: linear-gradient(135deg, #1f2937, #4b5563);
        color: #ffffff;
        border: none;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 16px;
    }
    
    .mega-add-btn:hover {
        background: linear-gradient(135deg, #1f2937, #1f2937);
        transform: scale(1.02);
    }
    
    .mega-add-btn.hidden {
        display: none !important;
    }
    
    /* أزرار الكمية */
    .mega-qty-wrap {
        display: none;
        align-items: center;
        gap: 4px;
        background: #f3f4f6;
        border-radius: 8px;
        padding: 4px;
        flex: 1;
    }
    
    .mega-qty-wrap.active {
        display: flex !important;
    }
    
    .mega-qty-btn {
        width: 28px;
        height: 28px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        color: #1f2937;
        font-size: 14px;
        font-weight: 700;
    }
    
    .mega-qty-btn:hover:not(.disabled) {
        background: #1f2937;
        color: #ffffff;
        border-color: #1f2937;
    }
    
    .mega-qty-btn.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
    
    .mega-qty-btn.mega-qty-minus i {
        font-size: 12px;
    }
    
    .mega-qty-num {
        flex: 1;
        text-align: center;
        font-size: 14px;
        font-weight: 700;
        color: #1f2937;
        min-width: 30px;
    }
    
    /* Toast للإشعارات */
    .mega-toast {
        position: fixed;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: #1f2937;
        color: #ffffff;
        padding: 14px 28px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        z-index: 99999;
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .mega-toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    
    .mega-toast-success {
        background: linear-gradient(135deg, #222222, #111111);
    }
    
    .mega-toast-info {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
    }
    
    .mega-toast-error {
        background: linear-gradient(135deg, #ef4444, #dc2626);
    }
    
    /* ===== طبقة التعتيم للروابط العلوية ===== */
    .top-link-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.75);
        z-index: 999999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .top-link-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* الرابط النشط يظهر فوق التعتيم */
    .top-link.above-overlay {
        position: relative;
        z-index: 9999999 !important;
        background: #ffffff !important;
        color: #374151 !important;
        border-color: #ffffff !important;
        box-shadow: 0 0 50px rgba(255, 255, 255, 0.8);
    }
    
    .top-link.above-overlay i,
    .top-link.above-overlay span {
        color: #374151 !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   إصلاح z-index للهيدر - لا يغطي على الـ modals
   ═══════════════════════════════════════════════════════════════════════════════ */

/* جعل الهيدر بـ z-index منخفض عند فتح أي modal */
body.modal-open .desktop-header,
body.modal-open .desktop-header *,
html:has(.rn-modal.active) .desktop-header,
html:has(.rn-modal.active) .desktop-header * {
    z-index: 1 !important;
}

/* التأكد من أن الـ modal فوق كل شي */
.rn-modal.active {
    z-index: 9999999 !important;
}
