/**
 * Desktop Navigation Menu Styles
 * Hyvä Theme - Custom Mega Menu
 */

/* ========================================
   MAIN CONTAINER
   ======================================== */
.menu-desktop-container {
    background-color: #e1e8f0;
}

/* ========================================
   MEGA MENU DROPDOWN
   ======================================== */
.mega-menu {
    min-width: 300px;
    max-width: 900px;
}

.mega-menu-grid {
    display: grid;
    gap: 1rem 2rem; /* gap-y-4 gap-x-8 */
}

/* ========================================
   BRANDS DROPDOWN
   ======================================== */
.brands-dropdown {
    width: 680px;
}

/* ========================================
   BRAND CARDS
   ======================================== */
.brand-card {
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 110px;
    text-decoration: none;
}

.brand-card-image {
    background-color: #484848;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease;
}

.brand-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-card-footer {
    background-color: #676767;
    padding: 0.5rem;
    text-align: center;
    transition: background-color 0.25s ease;
}

.brand-card-footer span {
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Brand Card Hover Effects */
.brand-card:hover .brand-card-image {
    background-color: #676767;
}

.brand-card:hover .brand-card-footer {
    background-color: #484848;
}

/* ========================================
   LEVEL 2 LINKS (Bold Headers)
   ======================================== */
.menu-level-2-link {
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    color: #111827; /* text-gray-900 */
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.menu-level-2-link:hover {
    background-color: #1da3dd !important;
    color: #ffffff !important;
}

/* ========================================
   LEVEL 3 LINKS (Sub-items)
   ======================================== */
.menu-level-3-link {
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* text-gray-600 */
    transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.menu-level-3-link:hover {
    background-color: #1da3dd !important;
    color: #ffffff !important;
}

/* ========================================
   DEALS LINK (Special Styling)
   ======================================== */
.menu-deals-link {
    font-weight: 700;
    color: #b91c1c !important; /* text-red-700 */
    text-transform: uppercase;
}

.menu-deals-link:hover {
    color: #991b1b !important; /* darker red */
}

/* ========================================
   ACTIVE MENU STYLING
   ======================================== */
li.level-0[data-active] {
    border-color: var(--color-primary, #1da3dd);
}

li.level-0[data-active] > span > a {
    font-weight: 500;
}

/* Active submenu items */
.menu-level-2-link[aria-current="page"],
.menu-level-3-link[aria-current="page"] {
    text-decoration: underline;
    font-weight: 600;
}

/* ========================================
   DROPDOWN ANIMATIONS
   ======================================== */
.mega-menu,
.brands-dropdown {
    transform-origin: top;
}

/* Alpine.js transitions handled via x-transition */

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Large screens (1280px and below) */
@media (max-width: 1280px) {
    .mega-menu {
        max-width: 700px;
    }
    
    .brands-dropdown {
        width: 580px;
    }
}

/* Medium screens (1024px and below) */
@media (max-width: 1024px) {
    .mega-menu {
        max-width: 500px;
    }
    
    .brands-dropdown {
        width: 480px;
    }
    
    .brands-dropdown .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   ACCESSIBILITY FOCUS STATES
   ======================================== */
.menu-level-2-link:focus,
.menu-level-3-link:focus {
    outline: 2px solid #1da3dd;
    outline-offset: 2px;
}

.brand-card:focus {
    outline: 2px solid #1da3dd;
    outline-offset: 2px;
}

/* Level 0 focus */
li.level-0 > span > a:focus {
    outline: 2px solid #1da3dd;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

li.level-0 > span > button:focus {
    outline: 2px solid #1da3dd;
    outline-offset: 2px;
}

/* ========================================
   CHEVRON ICON STYLING
   ======================================== */
li.level-0 svg {
    transition: transform 0.2s ease-out;
}

/* ========================================
   SCROLLBAR STYLING (for long menus)
   ======================================== */
.mega-menu::-webkit-scrollbar {
    width: 6px;
}

.mega-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.mega-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.mega-menu::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ========================================
   UTILITY CLASSES (if needed)
   ======================================== */
.menu-hidden {
    display: none !important;
}

.menu-visible {
    display: block !important;
}