/* ===== HEADER STYLES (Desktop) ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(121, 73, 156, 0.15);
    box-shadow: 0 4px 20px rgba(121, 73, 156, 0.08);
    width: 100%;
}

.navbar {
    padding: 0.5rem 0;
    background: transparent;
    width: 100%;
}

.logo-img {
    transition: all 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Navigation Links */
.main-nav .nav-link {
    font-weight: 500;
    color: var(--dark-purple) !important;
    padding: 0.75rem 1.2rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0 2px;
    position: relative;
    font-size: 0.95rem;
}

.main-nav .nav-link.active {
    color: var(--primary) !important;
    background: rgba(121, 73, 156, 0.08);
}

.main-nav .nav-link:hover {
    color: var(--primary) !important;
    background: rgba(121, 73, 156, 0.1);
}

.main-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* Desktop Dropdown */
@media (min-width: 992px) {
    .dropdown-hover {
        position: relative;
    }

    .dropdown-hover:hover .dropdown-menu {
        display: block;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown-hover .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        pointer-events: none;
        top: 100%;
    }

    .dropdown-hover:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: all;
    }

    /* Hide mobile menu on desktop */
    .mobile-menu,
    .mobile-menu-overlay {
        display: none;
    }
}

/* Dropdown Styles */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(121, 73, 156, 0.1);
    box-shadow: 0 10px 30px rgba(121, 73, 156, 0.15);
    border-radius: 12px;
    padding: 8px;
    margin-top: 10px;
    min-width: 220px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--dark-purple);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.dropdown-item i {
    width: 20px;
    color: var(--primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(121, 73, 156, 0.1);
    color: var(--primary);
}

.dropdown-item:hover i {
    transform: scale(1.1);
    color: var(--primary-dark);
}

.dropdown-item.active {
    background: rgba(121, 73, 156, 0.08);
    color: var(--primary) !important;
    font-weight: 600;
    position: relative;
}

.dropdown-item.active i {
    color: var(--primary);
}

.dropdown-item.active::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 3px;
}

[dir="rtl"] .dropdown-item.active::before {
    right: auto;
    left: -8px;
}

/* ===== IMPROVED BUTTON STYLES ===== */

/* Base Button Styles */
.btn {
    font-family: 'Almarai', sans-serif;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

/* حاوية زر السلة والمفضلة */
.cart-button-wrapper,
.wishlist-button-wrapper {
    position: relative;
    display: inline-block;
}

/* Icon Circle Button - Improved */
.btn-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e9e2f0;
    color: #6b4e8f;
    font-size: 1.2rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(107, 78, 143, 0.05);
}

.btn-icon-circle:hover {
    background: #f8f5ff;
    border-color: #8b6faf;
    color: #4a2f6b;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(107, 78, 143, 0.15);
}

.btn-icon-circle:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(107, 78, 143, 0.1);
}

/* Cart Badge - Improved */
.cart-badge,
.wishlist-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    border-radius: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
}

.cart-badge {
    background: #d32f2f;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.4);
}

.wishlist-badge {
    background: #f44336;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.4);
}

/* Outline Button - Improved Professional */
.btn-outline-glass {
    background: transparent;
    border: 1.5px solid #6b4e8f;
    color: #6b4e8f;
    padding: 0.625rem 1.5rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(107, 78, 143, 0.05);
}

.btn-outline-glass:hover {
    background: #6b4e8f;
    color: white;
    border-color: #6b4e8f;
    box-shadow: 0 10px 20px -8px rgba(107, 78, 143, 0.4);
}

.btn-outline-glass:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(107, 78, 143, 0.2);
}

.btn-outline-glass i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

/* Primary Button - Improved Professional */
.btn-primary-glass {
    background: #6b4e8f;
    border: 1.5px solid #6b4e8f;
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(107, 78, 143, 0.25);
    position: relative;
    z-index: 1;
}

.btn-primary-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 40px;
    background: linear-gradient(135deg, #8b6faf, #4a2f6b);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: -1;
}

.btn-primary-glass:hover {
    background: transparent;
    color: #ffffff;
    box-shadow: 0 15px 25px -8px rgba(107, 78, 143, 0.4);
}

.btn-primary-glass:hover::before {
    opacity: 1;
}

.btn-primary-glass:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(107, 78, 143, 0.3);
}

.btn-primary-glass i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.btn-primary-glass:hover i {
    color: #ffffff;
}

/* User Button - Improved */
.btn-user {
    background: white;
    border: 1px solid #e9e2f0;
    color: #1a1a1a;
    padding: 0.5rem 1.2rem 0.5rem 1.5rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-user i {
    font-size: 1.4rem;
    color: #6b4e8f;
    transition: all 0.2s ease;
}

.btn-user:hover {
    background: #faf8ff;
    border-color: #b39ddb;
    box-shadow: 0 8px 16px -6px rgba(107, 78, 143, 0.2);
    transform: translateY(-2px);
}

.btn-user:hover i {
    transform: scale(1.05);
    color: #4a2f6b;
}

.btn-user:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(107, 78, 143, 0.1);
}

/* ===== MOBILE SIDE MENU STYLES ===== */
@media (max-width: 991px) {

    /* Hide desktop navbar collapse */
    #navbarMain {
        display: none !important;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile menu */
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100%;
        background: white;
        z-index: 1002;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.3s ease;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    [dir="rtl"] .mobile-menu {
        right: -320px;
        left: auto;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
    }

    .mobile-menu.active {
        right: 0;
    }

    [dir="rtl"] .mobile-menu.active {
        right: 0;
        left: auto;
    }

    /* Mobile menu header - مع شعار أكبر */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 25px 20px;
        border-bottom: 1px solid rgba(121, 73, 156, 0.1);
    }

    .mobile-logo img {
        height: 50px;
        width: auto;
    }

    .mobile-menu-close {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(121, 73, 156, 0.05);
        border: none;
        color: var(--primary);
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-menu-close:hover {
        background: rgba(121, 73, 156, 0.1);
        transform: rotate(90deg);
    }

    /* Mobile menu content */
    .mobile-menu-content {
        flex: 1;
        padding: 20px;
        overflow-y: auto;
    }

    .mobile-nav-section {
        margin-bottom: 15px;
    }

    /* القائمة الرئيسية - بدون عنوان */
    .mobile-nav-section:first-child .mobile-nav-title {
        display: none;
    }

    .mobile-nav-links {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav-links li {
        margin-bottom: 2px;
    }

    .mobile-nav-links a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 15px;
        border-radius: 12px;
        color: var(--text-dark);
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .mobile-nav-links a i {
        width: 24px;
        color: var(--primary);
        font-size: 1.1rem;
    }

    .mobile-nav-links a:hover {
        background: rgba(121, 73, 156, 0.05);
    }

    .mobile-nav-links a.active {
        background: rgba(121, 73, 156, 0.08);
        color: var(--primary);
        font-weight: 600;
    }

    .mobile-nav-links a.active i {
        color: var(--primary);
    }

    /* Mobile dropdown - للمزيد */
    .mobile-dropdown-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 15px;
        background: rgba(121, 73, 156, 0.03);
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-bottom: 2px;
    }

    .mobile-dropdown-header:hover {
        background: rgba(121, 73, 156, 0.08);
    }

    .mobile-dropdown-header .mobile-nav-title {
        margin: 0;
        padding: 0;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-dark);
    }

    .mobile-dropdown-header .mobile-nav-title::before {
        display: none;
    }

    .mobile-dropdown-icon {
        color: var(--primary);
        font-size: 0.9rem;
        transition: transform 0.3s ease;
    }

    .mobile-dropdown-icon.rotated {
        transform: rotate(180deg);
    }

    .mobile-dropdown-menu {
        list-style: none;
        padding: 5px 0 5px 15px;
        margin: 0 0 5px 0;
        display: none;
        border-right: 2px solid rgba(121, 73, 156, 0.1);
    }

    [dir="rtl"] .mobile-dropdown-menu {
        padding: 5px 15px 5px 0;
        border-right: none;
        border-left: 2px solid rgba(121, 73, 156, 0.1);
    }

    .mobile-dropdown-menu.show {
        display: block;
    }

    .mobile-dropdown-menu li {
        margin-bottom: 2px;
    }

    .mobile-dropdown-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 15px;
        border-radius: 10px;
        color: var(--text-dark);
        text-decoration: none;
        font-size: 0.9rem;
        transition: all 0.3s ease;
    }

    .mobile-dropdown-menu a i {
        width: 24px;
        color: var(--primary);
        font-size: 1rem;
        opacity: 0.8;
    }

    .mobile-dropdown-menu a:hover {
        background: rgba(121, 73, 156, 0.05);
    }

    .mobile-dropdown-menu a.active {
        background: rgba(121, 73, 156, 0.08);
        color: var(--primary);
        font-weight: 600;
    }

    .mobile-dropdown-menu a.active i {
        opacity: 1;
    }

    .mobile-divider {
        height: 1px;
        background: rgba(121, 73, 156, 0.1);
        margin: 10px 0;
    }

    /* قسم حسابي - مع تحسينات */
    .mobile-nav-section:last-child {
        margin-top: 10px;
        border-top: 8px solid rgba(121, 73, 156, 0.05);
        padding-top: 15px;
    }

    .mobile-nav-section:last-child .mobile-nav-title {
        display: block;
        font-size: 0.85rem;
        font-weight: 700;
        color: #999;
        margin-bottom: 15px;
        padding-right: 10px;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .mobile-nav-section:last-child .mobile-nav-title::before {
        display: none;
    }

    /* Mobile action buttons */
    .mobile-action-buttons {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
    }

    /* حاوية زر السلة في الموبايل */
    .mobile-action-btn-wrapper {
        position: relative;
        flex: 1;
    }

    .mobile-action-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 0.875rem;
        background: white;
        border: 1px solid #e9e2f0;
        border-radius: 40px;
        color: #1a1a1a;
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
        transition: all 0.25s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .mobile-action-btn:hover {
        background: #faf8ff;
        border-color: #b39ddb;
        transform: translateY(-2px);
        box-shadow: 0 8px 16px -4px rgba(107, 78, 143, 0.15);
    }

    .mobile-action-btn:active {
        transform: translateY(0);
    }

    .mobile-action-btn i {
        color: #6b4e8f;
        font-size: 1.1rem;
    }

    .mobile-cart-badge,
    .mobile-wishlist-badge {
        position: absolute;
        top: -5px;
        left: 50%;
        transform: translateX(-50%);
        min-width: 18px;
        height: 18px;
        border-radius: 18px;
        padding: 0 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.65rem;
        font-weight: 600;
        color: white;
        border: 2px solid white;
        z-index: 1000;
        pointer-events: none;
    }

    .mobile-cart-badge {
        background: #d32f2f;
        box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
    }

    .mobile-wishlist-badge {
        background: #f44336;
        box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3);
    }

    /* Mobile user actions */
    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 15px;
        background: linear-gradient(135deg, #f8f5ff, #f0ebf8);
        border-radius: 16px;
        margin-bottom: 15px;
        border: 1px solid rgba(121, 73, 156, 0.1);
    }

    .mobile-user-info i {
        font-size: 2.2rem;
        color: var(--primary);
    }

    .mobile-user-info span {
        font-weight: 600;
        color: var(--dark-purple);
        font-size: 1rem;
    }

    .mobile-user-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-user-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem 1.2rem;
        border-radius: 40px;
        color: #1a1a1a;
        text-decoration: none;
        font-size: 0.95rem;
        transition: all 0.25s ease;
        background: white;
        border: 1px solid #e9e2f0;
        width: 100%;
        text-align: right;
        cursor: pointer;
        font-weight: 500;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .mobile-user-link:hover {
        background: #faf8ff;
        border-color: #b39ddb;
        transform: translateX(-4px);
        box-shadow: 0 4px 12px rgba(107, 78, 143, 0.1);
    }

    .mobile-user-link i {
        width: 24px;
        color: #6b4e8f;
        font-size: 1.2rem;
    }

    .mobile-user-link.text-danger {
        color: #d32f2f;
        border-color: rgba(211, 47, 47, 0.2);
    }

    .mobile-user-link.text-danger i {
        color: #d32f2f;
    }

    .mobile-user-link.text-danger:hover {
        background: #fff5f5;
        border-color: #d32f2f;
    }

    /* Mobile Auth Buttons */
    .mobile-auth-buttons {
        display: flex;
        gap: 10px;
        margin-top: 5px;
    }

    .mobile-auth-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.875rem;
        border-radius: 40px;
        font-weight: 600;
        font-size: 0.95rem;
        text-decoration: none;
        transition: all 0.25s ease;
        border: 1.5px solid transparent;
    }

    .mobile-auth-btn.login {
        background: white;
        border-color: #6b4e8f;
        color: #6b4e8f;
        box-shadow: 0 2px 4px rgba(107, 78, 143, 0.05);
    }

    .mobile-auth-btn.login:hover {
        background: #6b4e8f;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 10px 20px -8px rgba(107, 78, 143, 0.4);
    }

    .mobile-auth-btn.signup {
        background: #6b4e8f;
        color: white;
        box-shadow: 0 4px 12px rgba(107, 78, 143, 0.3);
    }

    .mobile-auth-btn.signup:hover {
        background: #5a3e7a;
        transform: translateY(-2px);
        box-shadow: 0 12px 24px -8px rgba(107, 78, 143, 0.5);
    }

    .mobile-auth-btn i {
        font-size: 1rem;
    }

    .mobile-auth-btn.login:hover i {
        color: white;
    }
}

