/**
 * Last updated: 2024-12-28 22:45:00
 * Author: GaryH
 * Related scripts: tpl_modern_header.php, modern_header.css
 * Summary: Fix for two-row desktop navigation menu formatting and alignment
 */

/* Two-Row Navigation Container */
.navigation .nav-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: linear-gradient(135deg, #006699 0%, #15a0cb 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Navigation Rows */
.nav-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    min-height: 35px; /* Further reduced height */
    height: 35px; /* Fixed height for both rows */
    padding: 0; /* Remove all padding */
    margin: 0; /* Remove all margin */
}

.nav-row-primary {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0 !important; /* Override any inline styles */
    margin: 0 !important; /* Override any inline styles */
}

.nav-row-secondary {
    /* No border for the last row */
    padding: 0 !important; /* Override any inline styles */
    margin: 0 !important; /* Override any inline styles */
}

/* Desktop Navigation Lists */
.desktop-nav,
.desktop-nav-secondary {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
    width: 100%;
    flex-wrap: wrap;
    gap: 0;
}

/* Navigation Items */
.desktop-nav > li,
.desktop-nav-secondary > li {
    position: relative;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
    text-align: center;
}

/* Navigation Links */
.desktop-nav > li > a,
.desktop-nav-secondary > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: rgba(255,255,255,0.98);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 3px solid transparent;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 35px; /* Match row height */
    height: 35px; /* Fixed height for consistency */
}

/* Hover Effects */
.desktop-nav > li > a:hover,
.desktop-nav-secondary > li > a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.15);
    border-bottom-color: #00d4ff;
    transform: translateY(-2px);
}

/* Active State */
.desktop-nav > li.active > a,
.desktop-nav-secondary > li.active > a {
    color: #ffffff;
    background: rgba(255,255,255,0.2);
    border-bottom-color: #00d4ff;
}

/* Hide dropdowns ONLY in desktop view - keep mobile dropdowns functional */
@media (min-width: 768px) {
    /* Target specific dropdown elements only */
    .desktop-nav .dropdown,
    .desktop-nav-secondary .dropdown,
    .desktop-nav .dropdown-menu,
    .desktop-nav-secondary .dropdown-menu,
    .desktop-nav li .dropdown,
    .desktop-nav-secondary li .dropdown,
    .desktop-nav li .dropdown-menu,
    .desktop-nav-secondary li .dropdown-menu,
    .desktop-nav li .dropdown-content,
    .desktop-nav-secondary li .dropdown-content,
    .desktop-nav li .dropdown-grid,
    .desktop-nav-secondary li .dropdown-grid,
    .desktop-nav li .brands-grid,
    .desktop-nav-secondary li .brands-grid,
    .desktop-nav li:hover .dropdown,
    .desktop-nav-secondary li:hover .dropdown,
    .desktop-nav li:hover .dropdown-menu,
    .desktop-nav-secondary li:hover .dropdown-menu,
    .desktop-nav li:hover .dropdown-content,
    .desktop-nav-secondary li:hover .dropdown-content,
    .desktop-nav li:hover .dropdown-grid,
    .desktop-nav-secondary li:hover .dropdown-grid,
    .desktop-nav li:hover .brands-grid,
    .desktop-nav-secondary li:hover .brands-grid,
    .desktop-nav > li:hover .dropdown,
    .desktop-nav-secondary > li:hover .dropdown,
    .desktop-nav > li:hover .dropdown-menu,
    .desktop-nav-secondary > li:hover .dropdown-menu,
    .desktop-nav > li:hover .dropdown-content,
    .desktop-nav-secondary > li:hover .dropdown-content,
    .desktop-nav > li:hover .dropdown-grid,
    .desktop-nav-secondary > li:hover .dropdown-grid,
    .desktop-nav > li:hover .brands-grid,
    .desktop-nav-secondary > li:hover .brands-grid {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* Hide any ul elements that might be dropdowns */
    .desktop-nav li ul,
    .desktop-nav-secondary li ul,
    .desktop-nav li > ul,
    .desktop-nav-secondary li > ul,
    .desktop-nav li:hover ul,
    .desktop-nav-secondary li:hover ul,
    .desktop-nav li:hover > ul,
    .desktop-nav-secondary li:hover > ul,
    .desktop-nav > li ul,
    .desktop-nav-secondary > li ul,
    .desktop-nav > li > ul,
    .desktop-nav-secondary > li > ul,
    .desktop-nav > li:hover ul,
    .desktop-nav-secondary > li:hover ul,
    .desktop-nav > li:hover > ul,
    .desktop-nav-secondary > li:hover > ul {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* Root categories are now directly clickable - no dropdowns needed */

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-row {
        min-height: 32px;
        height: 32px;
    }
    
    .desktop-nav > li > a,
    .desktop-nav-secondary > li > a {
        padding: 6px 8px;
        font-size: 13px;
        min-height: 32px;
        height: 32px;
    }
}

@media (max-width: 992px) {
    .nav-row {
        min-height: 30px;
        height: 30px;
    }
    
    .desktop-nav > li > a,
    .desktop-nav-secondary > li > a {
        padding: 5px 6px;
        font-size: 12px;
        min-height: 30px;
        height: 30px;
    }
}

@media (max-width: 768px) {
    .navigation {
        display: none;
    }
}

/* Ensure proper alignment between rows */
.nav-row-primary .desktop-nav,
.nav-row-secondary .desktop-nav-secondary {
    justify-content: space-evenly;
}

/* Fix for misaligned rows */
.nav-row-secondary {
    padding-left: 0;
    margin-left: 0;
}

/* Equal spacing for all items */
.desktop-nav > li,
.desktop-nav-secondary > li {
    flex: 1 1 auto;
    max-width: none;
}

/* Better text alignment - already handled above */

/* Remove any existing grid or column styles that might interfere */
.desktop-nav[style*="--asrm-cols"],
.desktop-nav-secondary[style*="--asrm-cols"] {
    display: flex !important;
    grid-template-columns: none !important;
}

/* Ensure consistent styling between both rows */
.nav-row-primary .desktop-nav > li > a,
.nav-row-secondary .desktop-nav-secondary > li > a {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    color: rgba(255,255,255,0.98);
    min-height: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override conflicting styles from header file */
.nav-row-primary {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.nav-row-secondary {
    padding-top: 0 !important;
}

/* Ensure both rows have identical background and styling */
.nav-row-primary,
.nav-row-secondary {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Special styling for the separator line */
.nav-row-primary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

/* All dropdown functionality removed - root categories are directly clickable */

/* Animation for smooth transitions */
.desktop-nav > li,
.desktop-nav-secondary > li {
    animation: slideInUp 0.3s ease forwards;
}

.desktop-nav > li:nth-child(1) { animation-delay: 0.1s; }
.desktop-nav > li:nth-child(2) { animation-delay: 0.2s; }
.desktop-nav > li:nth-child(3) { animation-delay: 0.3s; }
.desktop-nav > li:nth-child(4) { animation-delay: 0.4s; }
.desktop-nav > li:nth-child(5) { animation-delay: 0.5s; }
.desktop-nav > li:nth-child(6) { animation-delay: 0.6s; }
.desktop-nav > li:nth-child(7) { animation-delay: 0.7s; }

.desktop-nav-secondary > li:nth-child(1) { animation-delay: 0.1s; }
.desktop-nav-secondary > li:nth-child(2) { animation-delay: 0.2s; }
.desktop-nav-secondary > li:nth-child(3) { animation-delay: 0.3s; }
.desktop-nav-secondary > li:nth-child(4) { animation-delay: 0.4s; }
.desktop-nav-secondary > li:nth-child(5) { animation-delay: 0.5s; }
.desktop-nav-secondary > li:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print styles */
@media print {
    .navigation {
        display: none;
    }
}
