@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: 6px;
}
.nav-menu li a:hover { 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 {
    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; }

.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: 1279px) {
    .header-main > .container {
        gap: 24px;
    }

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

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

@media (max-width: 767px) {
    /* 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; }
}
