/* ==========================================================================
   OneClickMalls Custom Header & Mobile Profile Dropdown Styles
   ========================================================================== */

/* User Profile Dropdown Container */
.user-profile-dropdown {
    position: relative;
}

/* Caret rotation on expansion */
.user-profile-dropdown .dropdown-toggle::after {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-left: 0.5rem !important;
}

.user-profile-dropdown .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg) !important;
}

/* --- MOBILE SPECIFIC (< 992px) --- */
@media (max-width: 991.98px) {
    .header-right-actions {
        border-top: 1px solid #e2e8f0 !important;
        margin-top: 0.75rem !important;
        padding-top: 0.75rem !important;
        width: 100% !important;
    }

    .user-profile-dropdown {
        width: 100% !important;
    }

    .user-profile-dropdown .dropdown-toggle {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        background-color: #ffffff !important;
        border: 1.5px solid #1e3a8a !important;
        color: #1e3a8a !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
    }

    .user-profile-dropdown .dropdown-toggle:hover,
    .user-profile-dropdown .dropdown-toggle:focus,
    .user-profile-dropdown .dropdown-toggle[aria-expanded="true"] {
        background-color: #f8fafc !important;
        border-color: #ff9900 !important;
        color: #0f172a !important;
    }

    /* Static positioning on mobile keeps the dropdown in normal flow so drawer expands naturally */
    .user-profile-dropdown .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
        border: 1px solid #e2e8f0 !important;
        background-color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        padding: 0.25rem 0 !important;
    }

    .user-profile-dropdown .dropdown-menu.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .user-profile-dropdown .dropdown-item {
        color: #1e293b !important;
        padding: 0.7rem 1.1rem !important;
        font-size: 0.92rem !important;
        transition: background-color 0.15s ease, color 0.15s ease !important;
    }

    .user-profile-dropdown .dropdown-item:hover,
    .user-profile-dropdown .dropdown-item:active {
        background-color: #f1f5f9 !important;
        color: #1e3a8a !important;
    }

    .user-profile-dropdown .dropdown-item.text-danger:hover,
    .user-profile-dropdown .dropdown-item.text-danger:active {
        background-color: #fef2f2 !important;
        color: #dc2626 !important;
    }
}

/* --- DESKTOP SPECIFIC (>= 992px) --- */
@media (min-width: 992px) {
    .header-right-actions {
        border-top: none !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        width: auto !important;
    }

    .user-profile-dropdown {
        position: relative !important;
        width: auto !important;
    }

    .user-profile-dropdown .dropdown-toggle {
        display: inline-flex !important;
        align-items: center !important;
        width: auto !important;
    }

    .user-profile-dropdown .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        min-width: 220px !important;
        margin-top: 0.35rem !important;
        border: 1px solid #e2e8f0 !important;
        background-color: #ffffff !important;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
        transform: none !important;
        z-index: 1050 !important;
    }

    .user-profile-dropdown .dropdown-menu.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        animation: oMallsDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes oMallsDropdownFade {
        from {
            opacity: 0;
            transform: translateY(-6px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==========================================================================
   PROPER SIZING FOR "EXPLORE CATEGORIES" CARDS
   ========================================================================== */

.category-icon-link {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
}

.category-icon-link:active {
    transform: scale(0.94) !important;
}

/* Base Card Wrapper (Mobile First: ~90px) */
.category-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.category-icon-link:hover .category-icon-wrapper {
    border-color: #ff9900;
    background-color: #fffaf0;
    box-shadow: 0 8px 18px rgba(255, 153, 0, 0.25);
    transform: translateY(-4px);
}

/* Category Image Sizing */
.category-icon-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.25s ease;
}

.category-icon-link:hover .category-icon-img {
    transform: scale(1.08);
}

/* Category Title Typography */
.category-icon-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    text-transform: capitalize;
    transition: color 0.2s ease;
    word-break: break-word;
    max-width: 96px;
    margin-top: 8px;
}

.category-icon-link:hover .category-icon-title {
    color: #ff9900;
}

/* Small Device Responsive Enhancements (min-width: 576px) */
@media (min-width: 576px) {
    .category-icon-wrapper {
        width: 105px;
        height: 105px;
        border-radius: 22px;
        padding: 12px;
    }
    .category-icon-title {
        font-size: 0.90rem;
        max-width: 110px;
    }
}

/* Tablet Responsive Enhancements (min-width: 768px) */
@media (min-width: 768px) {
    .category-icon-wrapper {
        width: 110px;
        height: 110px;
        border-radius: 24px;
        padding: 12px;
    }
    .category-icon-title {
        font-size: 0.90rem;
        max-width: 115px;
    }
}

/* Desktop Responsive Enhancements (min-width: 992px) */
@media (min-width: 992px) {
    .category-icon-wrapper {
        width: 125px;
        height: 125px;
        border-radius: 26px;
        padding: 14px;
    }
    .category-icon-title {
        font-size: 0.95rem;
        max-width: 125px;
        margin-top: 10px;
    }
}

@media (max-width: 767.98px) {
    .featured-product-card .prod-img-container {
        height: 140px !important;
    }
    .featured-product-card .card-body {
        padding: 0.65rem !important;
    }
    .featured-product-card .prod-name {
        font-size: 0.82rem !important;
    }
    .featured-product-card .prod-price {
        font-size: 0.95rem !important;
    }
    .featured-product-card .btn-add-cart {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
}
