/* ========================================
   Mega Dropdown Styles
   Consolidated from inline styles
   ======================================== */

.mega-dropdown {
    position: relative;
}

.mega-dropdown .dropdown-menu {
    display: none;
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    margin-top: 0.5rem;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
}

.mega-dropdown .dropdown-menu .container-fluid {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.mega-dropdown .dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    animation: smoothFadeIn 0.3s ease-out;
}

@keyframes smoothFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mega-dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.subcategory-link {
    transition: all 0.2s ease;
    position: relative;
    padding: 0.5rem 0.75rem !important;
    border-radius: 6px;
    display: block;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.subcategory-link:hover {
    background-color: rgba(37, 99, 235, 0.1) !important;
    color: var(--cliko-primary, #2563eb) !important;
    transform: translateX(5px);
    padding-left: 1rem !important;
}

.subcategory-link:active {
    transform: translateX(3px) scale(0.98);
}

.category-title {
    transition: all 0.2s ease;
}

.category-group:hover .category-title {
    color: var(--cliko-primary, #2563eb) !important;
    transform: translateX(3px);
}

.category-group:hover .category-title i {
    transform: translateX(3px);
}

.mega-menu {
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* Responsive dropdown positioning */
@media (max-width: 1200px) {
    .mega-dropdown .dropdown-menu {
        min-width: 800px;
        max-width: 1000px;
    }
}

        @media (max-width: 992px) {
            .mega-dropdown .dropdown-menu {
                left: 0;
                transform: translateX(0) translateY(-10px);
                min-width: 100%;
                max-width: 100vw;
                position: static !important;
                width: 100%;
                max-height: 60vh;
                overflow-y: auto;
                overflow-x: hidden;
                border: 1px solid var(--cliko-border, #e2e8f0);
                border-radius: 12px;
                margin-top: 0.5rem;
                padding: 1rem;
                -webkit-overflow-scrolling: touch;
                scroll-behavior: smooth;
            }
    
    .mega-dropdown .dropdown-menu.show {
        transform: translateX(0) translateY(0);
        animation: smoothFadeInMobile 0.3s ease-out;
    }
    
    @keyframes smoothFadeInMobile {
        from {
            opacity: 0;
            transform: translateX(0) translateY(-10px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateX(0) translateY(0) scale(1);
        }
    }
    
    .mega-dropdown:hover .dropdown-menu {
        transform: translateX(0) translateY(0);
    }
    
    .category-group {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #e5e7eb;
        transition: all 0.2s ease;
    }
    
    .category-group:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .category-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
            .subcategory-link {
                font-size: 0.85rem;
                padding: 0.5rem 0.75rem !important;
                margin: 0.25rem 0;
                border-radius: 6px;
            }
            
            /* Mobile dropdown scrollbar */
            .mega-dropdown .dropdown-menu::-webkit-scrollbar {
                width: 4px;
            }
            
            .mega-dropdown .dropdown-menu::-webkit-scrollbar-track {
                background: #f1f1f1;
                border-radius: 2px;
            }
            
            .mega-dropdown .dropdown-menu::-webkit-scrollbar-thumb {
                background: var(--cliko-primary, #2563eb);
                border-radius: 2px;
            }
}

/* Navbar link responsive improvements */
.navbar-nav .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        white-space: normal;
        max-width: none;
        text-align: center;
        padding: 0.75rem 1rem !important;
        line-height: 1.4;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navbar-nav .btn {
        white-space: normal;
        min-width: 120px;
        text-align: center;
        min-height: 44px;
    }
}

@media (max-width: 767.98px) {
    .navbar-nav .nav-link {
        font-size: 0.95rem;
        padding: 0.75rem 1rem !important;
        min-height: 44px;
    }
    
    .navbar-nav .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        min-width: 100px;
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.75rem 1rem !important;
        min-height: 44px;
    }
    
    .navbar-nav .btn {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
        min-width: 90px;
        min-height: 44px;
    }
}

/* Language switcher responsive */
.language-switcher {
    position: relative;
}

@media (max-width: 991.98px) {
    .language-switcher {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .language-switcher .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
}
