@import "variables.css";


/* HEADER */
.header-main {
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky; top: 0; z-index: 50;
}
.header-main > .container {
    display: flex;
    align-items: center;
    height: 70px;
    gap: 40px;
}

/* Mobile left group (hidden on desktop) */
.header-left-mobile { display: none; }

/* Mobile hamburger button */
.h-icon-menu {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: none; border-radius: 4px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s;
    background: none;
    color: #fff;
}
.h-icon-menu:hover { background: rgba(255,255,255,0.15); }

/* Mobile search in left group (hidden on desktop) */
.h-icon-search-mobile { display: none; }

/* Logo */
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 48px; width: auto; display: block; }

/* Nav */
nav { flex: 1; }
.nav-menu { display: flex; gap: 0; list-style: none; }
.nav-menu > li { position: relative; }
.nav-menu li a {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    padding: 24px 14px; /* Increased vertical padding to match header height and provide hover area */
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0;
}
.nav-menu li a:hover,
.nav-menu li.active > a { color: var(--green); }
.nav-menu li a i { font-size: 10px; transition: transform 0.2s; }

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    list-style: none;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
}
.dropdown-menu li a {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 400;
    display: block;
}
.dropdown-menu li a:hover,
.dropdown-menu li.active a {
    background: #f8f8f8;
    color: var(--green);
}
.nav-menu li.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-menu li.has-dropdown:hover > a i {
    transform: rotate(180deg);
}

/* Right icons */
.header-right { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.h-icon {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: none; border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    background: none;
    color: #222;
}
.h-icon:hover { background: #f0f0f0; }
.h-icon-cart { position: relative; }
.h-icon-badge {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 18px; height: 18px;
    line-height: 18px;
    font-size: 11px; font-weight: 700;
    text-align: center;
    color: #fff;
    background: #e53935;
    border-radius: 9px;
    padding: 0 4px;
    pointer-events: none;
}

.btn-login {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    background: #1a1a1a;
    color: #fff;
}
.btn-login:hover { background: #333; }

/* RESPONSIVE HEADER */

/* Tablet: 768px – 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .header-main > .container {
        height: 60px;
        gap: 16px;
    }

    .nav-menu li a {
        font-size: 13px;
        padding: 21px 8px;
    }

    .header-right {
        gap: 2px;
    }

    /* Hide phone icon on tablet to save space */
    .h-icon-phone { display: none; }
}

/* Laptop: 1024px – 1279px */
@media (min-width: 1024px) and (max-width: 1480px) {
    .header-main > .container {
        gap: 24px;
    }

    .nav-menu li a {
        font-size: 13px;
        padding: 15px 10px;
    }

    .header-right {
        gap: 2px;
    }
}

@media (max-width: 1200px) {
    /* Top bar: hide promo text, keep lang on right */
    .top-bar { background: var(--yellow); }
    .top-bar-promo {text-align: left;}
    .top-bar-promo span { display: none; }
    .top-bar-promo a { color: var(--black-100); }
    .top-bar-bd {
        justify-content: flex-end;
        padding-top: 6px;
        padding-bottom: 6px;
    }
    .top-bar-lang { color: var(--black-100); }

    /* Header becomes green on mobile */
    .header-main {
        background: var(--green);
        border-bottom: none;
    }
    .header-main > .container {
        height: 56px;
        gap: 0;
        justify-content: space-between;
    }

    /* Show left mobile group */
    .header-left-mobile { display: flex; align-items: center; }
    .h-icon-search-mobile { display: flex; color: #fff; }

    /* Logo centered */
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    .logo-img { height: 36px; }

    /* Hide desktop nav */
    nav { display: none; }

    /* Right icons: heart + phone only, white color */
    .header-right { gap: 0; margin-left: 0; }
    .h-icon {
        color: var(--yellow);
        width: 40px; height: 40px;
    }
    .h-icon:hover { background: rgba(255,255,255,0.15); }

    /* Hide search, cart & login from right side on mobile */
    .h-icon-search-right { display: none; }
    .h-icon-cart { display: none; }
    .btn-login { display: none; }
}

/* Offcanvas Mobile Menu Drawer */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
.mobile-menu-drawer.active {
    left: 0;
}

.mobile-menu-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.mobile-menu-logo img {
    height: 32px;
}
.mobile-menu-close {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile-nav-item {
    border-bottom: 1px solid #f5f5f5;
}
.mobile-nav-link-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.mobile-nav-link {
    display: block;
    padding: 12px 20px;
    color: #333;
    font-weight: 500;
    flex: 1;
}
.mobile-nav-item.active > .mobile-nav-link-wrapper .mobile-nav-link {
    color: var(--green);
}
.mobile-nav-toggle {
    background: none;
    border: none;
    padding: 12px 20px;
    color: #999;
    cursor: pointer;
    pointer-events: none;
}
.mobile-nav-toggle i {
    transition: transform 0.2s;
}
.mobile-nav-item.open > .mobile-nav-link-wrapper .mobile-nav-toggle i {
    transform: rotate(180deg);
}

.mobile-sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fcfcfc;
    display: none;
}
.mobile-nav-item.open .mobile-sub-menu {
    display: block;
}
.mobile-sub-menu li a {
    display: block;
    padding: 10px 40px;
    color: #666;
    font-size: 14px;
}
.mobile-sub-menu li.active a {
    color: var(--green);
    font-weight: 600;
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: #f9f9f9;
}
.mobile-menu-auth {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.btn-mobile-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #333;
    font-weight: 500;
}
.mobile-menu-contact {
    display: flex;
    flex-direction: column;
}
.mobile-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--green);
    font-weight: 600;
}
