/* =======================================================
   PRINTFY3D FINAL CONSOLIDATED HEADER STYLES (v3.0 - With Mobile Fix)
   This CSS is designed to override default styles and ensure the custom header functions.
========================================================= */

/* 1. CRITICAL OVERRIDES: Hiding Original/Duplicate Elements (Using !important) */

/* Hiding the original header bar container (including Logo, Search, Cart, Mobile Toggle) */
/* Based on the Tailwind structure of the original theme */
.lg\:h-16.h-18.flex.items-center,
.default_header_logo { 
    display: none !important;
}

/* Hiding the original search link/icon (Fallback) */
a[href="/search"] {
    display: none !important;
}

/* Hiding the original '3D Printers' / 'About' menu items (If they appear outside our new menu) */
.original-nav-list li a[href="/collections/printers"],
.original-nav-list li a[href="/pages/about"] {
    display: none !important;
}

/* 2. GLOBAL HEADER STRUCTURE AND STYLING */
.luxify_header {
    background-color: #FFFFFF !important; 
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    position: relative;
    transition: all 0.3s ease-in-out;
}

.luxify_header_container {
    max-width: 1200px !important;
    padding: 0 15px !important;
}

/* 3. TOP BAR STYLING (Trust & Contact Info) */
.luxify_top_header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 8px 0;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #eee;
}

.trust-bar-text {
    font-weight: bold;
    color: #28a745; 
}

/* 4. MAIN NAVIGATION STYLING (Desktop Menu) */
.main-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.luxify_header_logo img {
    max-height: 45px;
    width: auto;
}

.main-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

.main-menu-list > li {
    list-style-type: none;
    position: relative; 
}

.main-menu-list > li > a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 10px 0;
    display: block;
    transition: color 0.2s;
}

/* 5. MEGA MENU STYLING (The core of the multi-column layout) */
.mega-menu {
    position: absolute;
    top: 100%; 
    left: 50%; 
    transform: translateX(-50%) translateY(10px); 
    width: 800px; 
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 20px;
    
    /* CRITICAL: HIDE BY DEFAULT */
    opacity: 0;
    visibility: hidden; 
    
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Columns on Desktop */
    gap: 20px;
    z-index: 100;
}
        
/* Show the mega menu on parent hover (desktop) */
.menu-item-has-children:hover > .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu h4 {
    color: #007bff;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
}

.mega-menu ul a { 
    color: #555; 
    text-decoration: none; 
    line-height: 2; 
    font-size: 0.95rem; 
}


/* 6. MOBILE & RESPONSIVENESS FIXES */
.mobile-menu-toggle {
    display: none; 
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 992px) {
    /* CRITICAL FIX: Ensure the mobile toggle button shows */
    .mobile-menu-toggle {
        display: block !important;
    }
    
    /* HIDE desktop menu layout on mobile */
    .main-menu-list {
        display: none !important; 
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #fff;
        padding: 10px 0;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 99; 
    }
    
    /* CRITICAL FIX: Show menu when JS adds the 'active' class (Fixes collapsing issue) */
    .main-menu-list.active {
        display: flex !important;
    }

    /* Adjust Mega Menu on mobile to stack vertically */
    .mega-menu {
        position: relative;
        width: 100%;
        left: 0;
        transform: translateX(0);
        box-shadow: none;
        border: none;
        padding: 10px;
        grid-template-columns: 1fr; 
        opacity: 1; 
        visibility: visible;
    }
    
    .main-menu-list li {
        width: 100%;
        padding: 5px 20px;
        border-bottom: 1px solid #f0f0f0;
    }
}