/* --- /css/components/header.css --- */

/* --- Variables --- */
:root {
    --cta-color: #f7a840; 
    --cta-hover-color: #f19c2d;
    --text-color: #212529;
    --border-color: #dee2e6;
}

/* --- Base Header Styles --- */
.main-header {
    background-color: #ffffff;
    padding: 8px 0; 
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.main-header .logo img { height: 110px; display: block; }
.desktop-nav { display: none; }
.mobile-actions { display: flex; align-items: center; }
.hamburger-menu { display: flex; flex-direction: column; justify-content: space-around; width: 28px; height: 22px; background: transparent; border: none; cursor: pointer; padding: 0; }
.hamburger-menu .bar { display: block; width: 100%; height: 3px; background-color: var(--text-color); border-radius: 3px; }

/* --- Button Styles --- */
.btn { display: inline-block; padding: 12px 28px; border-radius: 5px; text-decoration: none; font-weight: 600; font-size: 1rem; text-align: center; }
.btn-cta { color: #000000; background-color: var(--cta-color); border: 2px solid var(--cta-color); }
.btn-cta:hover { background-color: var(--cta-hover-color); border-color: var(--cta-hover-color); }


/* --- DESKTOP NAVIGATION & MEGA MENU (992px and up) --- */
@media (min-width: 992px) {
    .main-header .logo img { height: 110px; }
    .mobile-actions { display: none; }
    .desktop-nav { display: flex; align-items: center; }
    .main-nav { margin-left: auto; }
    .main-nav > ul { display: flex; gap: 40px; list-style: none; margin: 0; padding: 0; }
    .main-nav > ul > li { position: relative; } /* This is the anchor for the absolute positioned menu */
    .main-nav > ul > li > a { text-decoration: none; color: var(--text-color); font-weight: 700; font-size: 1rem; position: relative; padding: 20px 0; }
    .main-nav > ul > li > a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 15px; left: 0; background-color: var(--cta-color); transition: width 0.3s ease; }
    .main-nav > ul > li > a:hover::after { width: 100%; }
    .header-right { margin-left: 80px; }

    /* Mega Menu Styles - FINAL VERSION TO MATCH REFERENCE */
    .mega-menu {
        position: absolute;
        top: 100%;
        left: 40%; /* Position the start of the menu at the center of the 'Products' li */
        width: 1200px; /* A fixed, wide width for the menu */
        padding-top: 20px; /* Space between nav and menu */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        /* Combine transforms to handle both centering and the slide-up animation */
        transform: translate(-50%, 10px); 
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .has-dropdown:hover > .mega-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0); /* Final centered position */
    }

    .mega-menu-content {
        display: flex;
        background-color: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        overflow: hidden;
        border-radius: 6px;
    }

    .mega-menu-links-container {
        flex-basis: 55%; /* Links section takes 55% of the width */
        padding: 40px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px 40px; /* Vertical and horizontal spacing between links */
        align-content: start;
    }

    .mega-menu-links-container a {
        padding: 0;
        text-decoration: none;
        color: var(--text-color);
        font-weight: 500;
        font-size: 1rem;
        transition: color 0.2s ease;
    }

    .mega-menu-links-container a:hover {
        color: var(--cta-color);
    }

    .mega-menu-image {
        flex-basis: 50%; /* Image takes the remaining 45% */
    }

    .mega-menu-image img {
        width: 110%;
        height: 110%;
        object-fit: cover; /* Ensures image covers the space without distortion */
        display: block;
    }
    .mobile-nav { display: none; }
}


/* --- MOBILE NAVIGATION (up to 991px) --- */
@media (max-width: 991px) {
    .mobile-nav { position: fixed; top: 0; right: 0; width: 100%; height: 100vh; background-color: #111; z-index: 1005; transform: translateX(100%); transition: transform 0.35s ease-in-out; display: flex; flex-direction: column; padding: 20px 0; }
    .mobile-nav.is-open { transform: translateX(0); }
    .mobile-nav-header { padding: 15px 25px; display: flex; justify-content: flex-end; }
    .close-menu { background: transparent; border: none; color: #fff; font-size: 2.5rem; cursor: pointer; }
    
    /* MODIFIED: Adjusted padding to remove extra space at the bottom */
    .mobile-nav-links { flex-grow: 1; overflow-y: auto; padding: 10px 30px 0; } 
    
    .mobile-nav-links ul { list-style: none; padding: 0; margin: 0; }
    .mobile-nav-links > ul > li > a { 
        display: flex; 
        justify-content: space-between;
        align-items: center;
        color: #fff; 
        text-decoration: none; 
        font-size: 1.5rem; 
        font-weight: 500; 
        padding: 20px 0; 
        border-bottom: 1px solid #444; 
    }
    .mobile-nav-links li:last-child > a { border-bottom: none; }
    
    /* MODIFIED: Adjusted top padding to match link spacing */
    .mobile-nav-footer { 
        padding: 20px 30px 30px; 
        text-align: left;
    }

    /* UPDATED: Mobile Dropdown Styles for 2-column layout */
    .mobile-nav .dropdown-menu {
        list-style: none;
        padding-left: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 20px; /* 0px vertical gap, 20px horizontal gap */
    }
    .mobile-nav .has-dropdown.open > .dropdown-menu {
        max-height: 500px; /* Adjust if more space is needed */
    }

    .mobile-nav .dropdown-menu a {
        display: block; /* Ensures the hover area covers the full item height */
        font-size: 1.2rem;
        color: #ccc;
        padding: 18px 0;
        font-weight: 400;
        text-decoration: none;
        transition: color 0.2s ease-in-out; /* Smooth color transition */
    }

    .mobile-nav .dropdown-menu a:hover {
        color: var(--cta-color);
    }

    /* UPDATED: CSS Chevron Icon */
.mobile-dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: all 0.3s ease-out; /* Changed to 'all' for smoother transition */
}

/* UPDATED: Rotated State for Open Dropdown */
.has-dropdown.open > .mobile-dropdown-toggle::after {
    transform: rotate(0); /* Reset rotation */
    height: 2px; /* Set height to the thickness of the line */
    width: 10px; /* Set the width of the minus sign */
    border-right: none; /* Remove the right border */
    border-bottom: 2px solid #fff; /* This now acts as the minus line */
    margin-bottom: 4px; /* Optional: Adjust vertical alignment */
}
}