/**
 * Brands Megamenu Styles
 * Modern megamenu voor merken
 */

/* Megamenu container */
.brands-megamenu {
    position: static;
}

/* Verberg het oude dropdown menu voor Merken */
.brands-megamenu .dropdown-menu:not(.megamenu) {
    display: none !important;
}

/* Zorg dat dropdown styling niet wordt toegepast op megamenu */
.brands-megamenu.dropdown .dropdown-menu {
    display: none !important;
}

.brands-megamenu.dropdown:hover .dropdown-menu:not(.megamenu) {
    display: none !important;
}

.brands-megamenu .megamenu {
    position: fixed;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none !important;
    width: 90%;
    max-width: 1320px;
    max-height: 80vh;
    padding: 0;
    margin: 0 auto;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: megamenuFadeIn 0.2s ease-out;
    overflow: hidden;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.brands-megamenu .megamenu.show {
    display: flex !important;
    visibility: visible;
    opacity: 1;
}

@keyframes megamenuFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.brands-megamenu .megamenu.show {
    display: block;
}

/* Megamenu content */
.megamenu-container {
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* Custom scrollbar styling */
.megamenu-container::-webkit-scrollbar {
    width: 8px;
}

.megamenu-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.megamenu-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.megamenu-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox scrollbar */
.megamenu-container {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.megamenu-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.megamenu-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.megamenu-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* Grid layout - 5 kolommen met doorlopende items (van boven naar beneden) */
.megamenu-grid {
    column-count: 5;
    column-gap: 2rem;
    max-width: 100%;
}

/* Niet meer nodig - CSS columns gebruikt nu geen .megamenu-column meer */

/* Brand links */
.megamenu-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    font-weight: 400;
    border-radius: 6px;
    transition: all 0.2s ease;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.megamenu-item-link:hover {
    background-color: #f8f9fa;
    color: #850000;
    transform: translateX(5px);
}

.megamenu-item-name {
    flex: 1;
}

.megamenu-item-count {
    font-size: 0.85rem;
    color: #999;
    margin-left: 0.5rem;
}

.megamenu-item-link:hover .megamenu-item-count {
    color: #850000;
}

/* Loading state */
.megamenu-loading {
    padding: 3rem 2rem;
    text-align: center;
    color: #666;
    font-size: 1rem;
}

.megamenu-loading i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Error state */
.megamenu-error {
    padding: 2rem;
    text-align: center;
    color: #dc3545;
    font-size: 1rem;
}

.megamenu-error i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Dropdown toggle styling voor merken */
.brands-megamenu > a.nav-link {
    position: relative;
}

.brands-megamenu > a.nav-link::after {
    content: "\f107";
    font-family: "Font Awesome 6 Pro";
    font-weight: 900;
    margin-left: 0.5rem;
    font-size: 0.85em;
    transition: transform 0.2s ease;
}

.brands-megamenu:hover > a.nav-link::after {
    transform: rotate(180deg);
}

/* Responsive aanpassingen */
@media (max-width: 1400px) {
    .brands-megamenu .megamenu {
        width: 95%;
    }
    
    .megamenu-grid {
        column-count: 4;
        column-gap: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .brands-megamenu .megamenu {
        width: 95%;
    }
    
    .megamenu-grid {
        column-count: 4;
        column-gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .brands-megamenu .megamenu {
        width: 95%;
    }
    
    .megamenu-grid {
        column-count: 3;
        column-gap: 1rem;
    }
    
    .megamenu-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .brands-megamenu .megamenu {
        position: fixed;
        top: 60px !important;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        border-radius: 0;
        max-height: calc(100vh - 60px);
    }
    
    .megamenu-grid {
        column-count: 2;
        column-gap: 1rem;
    }
    
    .megamenu-container {
        padding: 1rem;
    }
    
    .megamenu-header h3 {
        font-size: 1.25rem;
    }
    
    .megamenu-header p {
        font-size: 0.85rem;
    }
    
    .megamenu-item-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.5rem;
    }
}

/* Zorg dat megamenu boven andere content komt */
.brands-megamenu {
    z-index: 1001;
}

/* Hover effect voor het menu item zelf */
.brands-megamenu:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Smooth transitions */
.megamenu-item-link,
.brands-megamenu > a.nav-link::after {
    transition: all 0.2s ease;
}

