/* assets/css/header.css */

.site-header {
    /* height: var(--header-height); */
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo img {
    height: 50px;
    /* Adjust based on actual logo aspect ratio */
    width: auto;
}
.main-nav{
    height: 100%;
}
.main-nav ul {
    display: flex;
    gap: 40px;
    height: 100%;
}
.main-nav ul>li{
    display: flex;
    height: 100%;
    align-items: center;
}
.main-nav a {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-black);
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-red);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-trigger {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-black);
    transition: color 0.3s ease;
}

.search-trigger:hover {
    color: var(--primary-red);
}

.header-cta {
    font-size: 0.9rem;
    padding: 8px 20px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Topbar */
.top-bar {
    width: 100%;
    background-color: var(--primary-black);
    color: #ccc;
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    gap: 20px;
}

.top-bar a:hover {
    color: var(--white);
}

.top-bar i {
    margin-right: 6px;
    color: var(--primary-red);
}

/* Megamenu */
.main-nav .has-megamenu {
    position: static;
    /* Allows megamenu to be full width relative to header or container */
}

/* To make megamenu relative to container or header?
   Let's make it relative to the LI but styled to be wider.
   Actually, `position: static` on LI and `position: absolute; left: 0; width: 100%` on menu works for full screen width.
   But we want it contained probably. Let's try full width of site-header.
*/

.mega-menu {
    position: absolute;
    top: 90%;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    border-top: 1px solid var(--border-color);
    z-index: 900;
    pointer-events: none;
}

.main-nav li:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    /* 40% Left, 60% Right */
    gap: 50px;
}

.mega-intro h3 {
    font-size: 1.5rem;
    color: var(--primary-black);
    margin-bottom: 15px;
}

.mega-intro p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.mega-advantages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mega-adv-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    box-shadow: 0 0px 5px rgba(0, 0, 0, 0.1);;
    transition: all 0.3s ease;
}

.mega-adv-card.featured{
    background: var(--primary-red);
}
.mega-adv-card.featured a{
    color: white;
}
.mega-adv-card.featured:hover a{
    color: var(--primary-red);
}

.mega-adv-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-red);
    background: var(--white);
}

.mega-adv-card a {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-black);
}

.mega-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mega-prod-card {
    text-align: left;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    padding: 10px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.mega-prod-card:hover {
    border-color: #eee;
    transform: translateY(-3px);
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
}
.mega-prod-card .mega-prod-link{
    font-size: 0.9rem;
}
.mega-prod-img {
    height: 140px;
    background: #eee;
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.mega-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary-red);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.mega-tag.new {
    background: var(--primary-green);
}

.mega-prod-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mega-prod-card:hover .mega-prod-img img {
    transform: scale(1.1);
}

.mega-prod-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    padding: 0 5px;
}

.mega-prod-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-black);
    margin-bottom: 5px;
}

.mega-prod-desc {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mega-prod-link {
    font-size: 0.85rem;
    width: fit-content;
    color: var(--primary-red);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.mega-prod-card:hover .mega-prod-link {
    gap: 8px;
}

/* Search Bar Overlay */
.search-overlay {
    position: fixed;
    top: -140px;
    /* Hidden initially */
    left: 0;
    width: 100%;
    height: 120px;
    background-color: var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    /* Just below header */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.search-overlay.active {
    top: 0;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
}

.search-form input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-bottom: 2px solid var(--border-color);
    outline: none;
}

.search-form button {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--primary-red);
    cursor: pointer;
}

.search-close {
    position: absolute;
    right: 30px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

/* Responsive Specifics for Header */
@media (max-width: 992px) {
    .main-nav {
        display: none;
        /* Can implement mobile drawer later */
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
    }

    .mobile-menu-toggle {
        display: block;
    }
}