/* تصميم القائمة المنسدلة للهواتف */
@media screen and (max-width: 768px) {
    .header-icons {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .header-icons .icon-link {
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.2);
        margin-right: 0;
    }

    .header-icons .icon-link:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }

    .cart-icon .cart-count {
        top: -5px;
        left: -5px;
        width: 18px;
        height: 18px;
        font-size: 11px;
    }

    .user-dropdown {
        position: static;
    }

    .user-dropdown .icon-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.2);
        margin-right: 10px;
    }

    /* إضافة قاعدة dropdown-content الناقصة */
    .user-dropdown .dropdown-content {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100%;
        background: white;
        z-index: 10000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        padding: 60px 20px 20px;
        overflow-y: auto;
        display: none;
        /* إضافة هذه الخاصية */
        opacity: 1;
        transform: none;
    }

    .user-dropdown .dropdown-content.show {
        right: 0;
        display: block;
    }

    .user-dropdown .dropdown-content a {
        display: flex;
        align-items: center;
        padding: 15px;
        text-decoration: none;
        color: #495057;
        border-bottom: 1px solid #f1f3f5;
        font-size: 16px;
        transition: all 0.3s ease;
    }

    .user-dropdown .dropdown-content a i {
        margin-left: 12px;
        width: 20px;
        text-align: center;
        font-size: 18px;
        color: #ff6b8b;
    }

    .user-dropdown .dropdown-content a:hover {
        background-color: #f8f9fa;
        color: #ff6b8b;
        padding-right: 20px;
    }

    .user-dropdown .dropdown-content a:hover i {
        color: #ff6b8b;
    }

    .close-menu {
        position: absolute;
        top: 15px;
        left: 15px;
        background: none;
        border: none;
        font-size: 24px;
        color: #6c757d;
        cursor: pointer;
        z-index: 10001;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        display: none;
        transition: background 0.3s ease;
    }

    .menu-overlay.show {
        display: block;
    }

    /* تخصيص ألوان الروابط المختلفة */
    .user-dropdown .dropdown-content a[href*="logout"] {
        color: #dc3545;
    }

    .user-dropdown .dropdown-content a[href*="logout"] i {
        color: #dc3545;
    }

    .user-dropdown .dropdown-content a[href*="login"] {
        color: #28a745;
    }

    .user-dropdown .dropdown-content a[href*="login"] i {
        color: #28a745;
    }

    .user-dropdown .dropdown-content a[href*="register"] {
        color: #17a2b8;
    }

    .user-dropdown .dropdown-content a[href*="register"] i {
        color: #17a2b8;
    }
}

/* تحسينات إضافية للهواتف صغيرة الحجم */
@media screen and (max-width: 480px) {
    .user-dropdown .dropdown-content {
        width: 85%;
    }

    .user-dropdown .dropdown-content a {
        padding: 18px 15px;
        font-size: 17px;
    }

    .user-dropdown .dropdown-content a i {
        font-size: 20px;
    }
}

/* تحسينات للشاشات الكبيرة (لضمان عدم تأثير التغييرات على النسخة المكتبية) */
@media screen and (min-width: 769px) {

    .close-menu,
    .menu-overlay {
        display: none !important;
    }

    .user-dropdown .dropdown-content {
        display: none !important;
        /* استخدام !important للتأكد من التطبيق */
        position: absolute;
        top: 100%;
        right: 0;
        width: auto;
        height: auto;
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-radius: 5px;
        padding: 10px 0;
        transition: opacity 0.3s ease, transform 0.3s ease;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
    }

    .user-dropdown:hover .dropdown-content {
        display: block !important;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* حل مشكلة المنطقة بين 769px و 791px */
@media screen and (min-width: 769px) and (max-width: 791px) {
    .user-dropdown .dropdown-content {
        display: none !important;
    }

    .user-dropdown:hover .dropdown-content {
        display: block !important;
    }
}