/* ============================================================
   HAUHOUSE — header.css
   Theme: hauhouse | Platform: Zozo / OpenCart 2.3.0.2
   Colors: main #014899 | accent #F58220
   ============================================================ */

/* -----------------------------------------------
   1. TOPBAR
   ----------------------------------------------- */
.hdr__topbar {
    background-color: var(--header-bg-topbar);
    color: var(--header-color-topbar);
    font-size: 13px;
    line-height: 1;
}
.hdr__topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    gap: 16px;
}
.hdr__topbar-left,
.hdr__topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.hdr__topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--header-color-topbar);
    text-decoration: none;
    font-size: 13px;
    transition: opacity 0.2s;
}
.hdr__topbar-item:hover { opacity: 0.8; color: var(--header-color-topbar); text-decoration: none; }
.hdr__topbar-item i { font-size: 12px; }
.hdr__topbar-divider { color: rgba(255,255,255,0.4); }

/* Language dropdown trong topbar */
.hdr__topbar-lang .language { margin: 0; }
.hdr__topbar-lang .language form { display: flex; align-items: center; gap: 4px; }
.hdr__topbar-lang .language-select {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--header-color-topbar);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.2s;
}
.hdr__topbar-lang .language-select:hover { background: rgba(255,255,255,0.15); }
.hdr__topbar-lang .language-select img { width: 16px; height: 11px; border-radius: 1px; }

/* Account topbar */
.hdr__topbar-account { display: flex; align-items: center; gap: 6px; }
.hdr__topbar-account .hdr__topbar-item { font-size: 13px; }

/* -----------------------------------------------
   2. MAIN HEADER
   ----------------------------------------------- */
.hdr__main {
    background-color: var(--header-bg-main);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.hdr__main-inner {
    display: flex;
    align-items: center;
    height: 72px;
    gap: 24px;
}

/* -----------------------------------------------
   3. LOGO
   ----------------------------------------------- */
.hdr__logo { flex-shrink: 0; }
.hdr__logo-link { display: inline-block; text-decoration: none; }
.hdr__logo-img {
    max-height: 52px;
    width: auto;
    display: block;
}
.hdr__logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--shop-color-main);
    letter-spacing: -0.5px;
}

/* -----------------------------------------------
   4. DESKTOP NAVIGATION
   ----------------------------------------------- */
.hdr__nav { flex: 1; justify-content: center; }

.hdr__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    height: 72px;
}

/* Cấp 1 */
.hdr__menu-item { position: relative; height: 100%; display: flex; align-items: center; }
.hdr__menu-link {
        text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 0 16px;
    color: var(--header-color-menu);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
}
.hdr__menu-link:hover,
.hdr__menu-item.active > .hdr__menu-link {
    color: var(--shop-color-main);
    text-decoration: none;
}
/* Viền cam phía dưới khi active */
.hdr__menu-item.active > .hdr__menu-link {
    border-bottom-color: var(--shop-color-accent);
}
.hdr__menu-arrow {
    font-size: 10px;
    transition: transform 0.25s;
    margin-top: 1px;
}
.hdr__menu-item:hover > .hdr__menu-link .hdr__menu-arrow { transform: rotate(180deg); }

/* Submenu cấp 2 */
.hdr__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: #fff;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-top: 3px solid var(--shop-color-accent);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 999;
}
.hdr__menu-item:hover > .hdr__submenu--lv2 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.hdr__submenu-item { position: relative;
    text-transform: uppercase;
    
}
.hdr__submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 18px;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}
.hdr__submenu-link:hover {
    color: var(--shop-color-main);
    background: #f5f8fd;
    text-decoration: none;
}
.hdr__submenu-arrow { font-size: 10px; color: #aaa; }

/* Submenu cấp 3 */
.hdr__submenu--lv3 {
    top: -8px;
    left: 100%;
    border-top-color: var(--shop-color-main);
}
.hdr__submenu-item:hover > .hdr__submenu--lv3 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* -----------------------------------------------
   5. HEADER ACTIONS (cart, search, wishlist)
   ----------------------------------------------- */
.hdr__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.hdr__action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--header-color-menu);
    font-size: 18px;
    border-radius: 50%;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}
.hdr__action-btn:hover {
    color: var(--shop-color-main);
    background: #f0f5ff;
    text-decoration: none;
}
.hdr__action-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--shop-color-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* Cart dropdown */
.hdr__cart { position: relative; }
.top-cart-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    border-top: 3px solid var(--shop-color-accent);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 1001;
}
.hdr__cart:hover .top-cart-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Search toggle button trạng thái active */
.hdr__search-toggle.is-active { color: var(--shop-color-main); background: #f0f5ff; }

/* Search bar dropdown */
.hdr__search-bar {
    background: #f0f5ff;
    border-top: 1px solid #e0eaf8;
    padding: 12px 0;
    display: none;
}
.hdr__search-bar.is-open { display: block; }
.hdr__search-bar .container { display: flex; align-items: center; gap: 12px; }
.hdr__search-bar #search { flex: 1; }
.hdr__search-bar #search input[name="search"] {
    width: 100%;
    height: 44px;
    border: 1.5px solid #c5d8f5;
    border-radius: 6px;
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.hdr__search-bar #search input[name="search"]:focus { border-color: var(--shop-color-main); }
.hdr__search-close {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.hdr__search-close:hover { color: var(--shop-color-main); }

/* -----------------------------------------------
   6. HAMBURGER (mobile)
   ----------------------------------------------- */
.hdr__hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.hdr__hamburger:hover { background: #f0f5ff; }
.hdr__hamburger-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--header-color-menu);
    border-radius: 2px;
    transition: all 0.3s;
}

/* -----------------------------------------------
   7. MOBILE OVERLAY
   ----------------------------------------------- */
.hdr__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.hdr__overlay.is-open { opacity: 1; visibility: visible; }

/* -----------------------------------------------
   8. MOBILE SIDEBAR DRAWER
   ----------------------------------------------- */
.hdr__drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    z-index: 1100;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
}
.hdr__drawer.is-open { transform: translateX(0); }

/* Drawer header */
.hdr__drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--shop-color-main);
    flex-shrink: 0;
}
.hdr__drawer-logo { display: block; }
.hdr__drawer-logo img { max-height: 40px; width: auto;  }
.hdr__drawer-logo span { color: #fff; font-size: 18px; font-weight: 700; }
.hdr__drawer-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}
.hdr__drawer-close:hover { color: #fff; }

/* Drawer search */
.hdr__drawer-search {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.hdr__drawer-search #search input[name="search"] {
    width: 100%;
    height: 40px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
}
.hdr__drawer-search #search input[name="search"]:focus { border-color: var(--shop-color-main); }

/* Drawer nav */
.hdr__drawer-nav { flex: 1; overflow-y: auto; }
.hdr__mobile-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.hdr__mobile-item { border-bottom: 1px solid #f2f2f2; }
.hdr__mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hdr__mobile-link {
    text-transform: uppercase;
    flex: 1;
    display: block;
    padding: 13px 18px;
    color: #222;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.hdr__mobile-link:hover { color: var(--shop-color-main); text-decoration: none; }
.hdr__mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    padding: 13px 16px;
    transition: color 0.2s, transform 0.3s;
    flex-shrink: 0;
}
.hdr__mobile-toggle svg{
    width:15px;
}
.hdr__mobile-toggle:hover { color: var(--shop-color-main); }
.hdr__mobile-item.is-open > .hdr__mobile-row .hdr__mobile-toggle {
    transform: rotate(90deg);
    color: var(--shop-color-main);
}
.hdr__mobile-item.is-open > .hdr__mobile-row .hdr__mobile-link { color: var(--shop-color-main); }

/* Submenu mobile */
.hdr__mobile-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fafafa;
    display: none;
}
.hdr__mobile-item.is-open > .hdr__mobile-sub { display: block; }

/* Cấp 2 indent */
.hdr__mobile-sub--lv2 .hdr__mobile-link { padding-left: 30px; font-size: 14px; font-weight: 400; }
.hdr__mobile-sub--lv2 .hdr__mobile-toggle { padding-right: 16px; }

/* Cấp 3 indent thêm */
.hdr__mobile-sub--lv3 { background: #f2f4f8; }
.hdr__mobile-sub--lv3 .hdr__mobile-link { padding-left: 44px; font-size: 13px; color: #555; }
.hdr__mobile-sub--lv3 .hdr__mobile-item { border-bottom-color: #ebebeb; }

/* Drawer footer */
.hdr__drawer-footer {
    padding: 16px 18px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hdr__drawer-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #444;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}
.hdr__drawer-contact i { color: var(--shop-color-main); font-size: 14px; width: 16px; }
.hdr__drawer-contact:hover { color: var(--shop-color-main); text-decoration: none; }
.hdr__drawer-lang { margin-top: 4px; }
.hdr__drawer-lang .language form { display: flex; gap: 8px; flex-wrap: wrap; }
.hdr__drawer-lang .language-select {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.hdr__drawer-lang .language-select:hover { border-color: var(--shop-color-main); }
.hdr__drawer-lang .language-select img { width: 18px; height: 13px; border-radius: 1px; }
.hdr__drawer-account { display: flex; gap: 10px; flex-wrap: wrap; }
.hdr__drawer-account-link {
    display: inline-block;
    padding: 7px 16px;
    border: 1.5px solid var(--shop-color-main);
    border-radius: 4px;
    color: var(--shop-color-main);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.hdr__drawer-account-link:hover { background: var(--shop-color-main); color: #fff; text-decoration: none; }
.hdr__drawer-account-text { font-size: 13px; color: #666; }

/* -----------------------------------------------
   9. STICKY HEADER — trạng thái scrolled
   ----------------------------------------------- */
.hdr.is-scrolled .hdr__main {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* -----------------------------------------------
   10. RESPONSIVE — Mobile header height
   ----------------------------------------------- */
@media (max-width: 991.98px) {
    .hdr__main-inner { height: 60px; }
    .hdr__logo-img { max-height: 44px; }
}
