/* ==========================================================================
   HASAKI THEME - GIAO DIỆN HEADER & NAV CHUẨN THƯƠNG MẠI ĐIỆN TỬ HASAKI
   Áp dụng thực tế cho Tainguyenall.com (SHOPKEY)
   ========================================================================== */

:root {
    --hsk-primary: #326e51;
    --hsk-primary-dark: #27563f;
    --hsk-primary-light: #e5fbf1;
    --hsk-primary-subtle: #f0fdf6;
    --hsk-orange: #ff6600;
    --hsk-orange-dark: #e65c00;
    --hsk-red: #d32f2f;
    
    --hsk-bg: #f4f4f4;
    --hsk-card: #ffffff;
    --hsk-border: #e0e0e0;
    --hsk-border-light: #f0f0f0;
    
    --hsk-text: #333333;
    --hsk-text-muted: #666666;
    --hsk-text-light: #888888;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-drawer: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* 1. TOPBAR TRÊN CÙNG */
.hsk-topbar,
.header-top {
    background-color: #27563f !important;
    color: #d1fae5 !important;
    font-size: 11.5px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    height: 32px;
    display: flex;
    align-items: center;
}
.header-top-links a,
.header-top-actions button,
.header-dropdown-btn {
    color: #d1fae5 !important;
    font-size: 11.5px !important;
}
.header-top-links a:hover {
    color: #ffffff !important;
}
.hsk-topbar .container,
.header-top .container {
    padding: 0 15px;
}
.topbar-inner,
.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.topbar-left-links {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-link {
    color: #e5fbf1;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.topbar-link:hover {
    color: #ffffff;
}
.topbar-right-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d1fae5;
}
.topbar-select-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 6px;
    border-radius: 3px;
    color: #ffffff;
    font-weight: 700;
}

/* 2. MAIN HEADER XANH LÁ HASAKI (#326E51) */
.hsk-header,
.header-part {
    background-color: var(--hsk-primary) !important;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    border-bottom: none !important;
    padding: 8px 0 !important;
}
.hsk-header .container,
.header-part .container {
    padding: 0 15px;
}
.header-main,
.header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 4px 0 !important;
    gap: 20px !important;
}

/* Logo Tainguyenall.com */
.hsk-logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.hsk-logo {
    font-family: 'Montserrat', 'Inter', -apple-system, sans-serif;
    font-size: 27px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.6px;
    display: flex;
    align-items: baseline;
    text-transform: none;
    line-height: 1;
}
.hsk-logo span {
    font-family: 'Montserrat', 'Inter', -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #a7f3d0;
    margin-left: 1px;
    letter-spacing: -0.2px;
}
.hsk-logo-sub {
    font-size: 9px;
    text-transform: uppercase;
    color: #d1fae5;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-top: 3px;
}

/* Search Box con nhộng Hasaki */
.hsk-search-wrap,
.header-search-wrapper {
    flex: 1 !important;
    max-width: 580px !important;
    position: relative !important;
    margin: 0 !important;
}
.hsk-search-form,
.header-search-wrapper .header-form {
    display: flex !important;
    align-items: center !important;
    background: #ffffff !important;
    border-radius: var(--radius-pill) !important;
    height: 38px !important;
    padding: 2px 4px 2px 18px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) !important;
    border: none !important;
}
.hsk-search-input,
.header-search-wrapper input {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    font-size: 13px !important;
    color: #111827 !important;
    background: transparent !important;
    font-family: inherit !important;
    box-shadow: none !important;
}
.hsk-search-input::placeholder,
.header-search-wrapper input::placeholder {
    color: #888888 !important;
}
.hsk-search-btn,
.header-search-wrapper button {
    width: 32px !important;
    height: 32px !important;
    border-radius: var(--radius-pill) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--hsk-primary) !important;
    font-size: 15px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.2s !important;
}
.hsk-search-btn:hover,
.header-search-wrapper button:hover {
    transform: scale(1.1) !important;
}

/* Autocomplete Dropdown */
.hsk-search-wrap .search-autocomplete,
.header-search-wrapper .search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-drawer);
    margin-top: 6px;
    z-index: 105;
    overflow: hidden;
}

/* Cụm Action Header */
.hsk-header-nav,
.header-widget-group {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    list-style: none !important;
    color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
}
.header-widget.hsk-widget-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: opacity 0.2s !important;
}
.header-widget.hsk-widget-item:hover {
    opacity: 0.9 !important;
    color: #ffffff !important;
}
.header-widget.hsk-widget-item .hsk-nav-circle-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 1.5px solid rgba(255, 255, 255, 0.75) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13.5px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    color: #ffffff !important;
}
.header-widget.hsk-widget-item .hsk-nav-circle-icon sup {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: var(--hsk-orange) !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    padding: 1px 5px !important;
    border-radius: var(--radius-pill) !important;
    border: 1.5px solid var(--hsk-primary) !important;
}
.header-widget.hsk-widget-item .hsk-nav-text {
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    display: flex !important;
    flex-direction: column !important;
    color: #ffffff !important;
}
.header-widget.hsk-widget-item .hsk-nav-text strong {
    font-weight: 700 !important;
}

.hsk-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.hsk-nav-item:hover {
    opacity: 0.9;
}
.hsk-nav-link-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
}
.hsk-nav-link-flex:hover {
    color: #ffffff;
}
.hsk-nav-circle-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    flex-shrink: 0;
    position: relative;
}
.hsk-badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--hsk-orange);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--hsk-primary);
}
.hsk-nav-text {
    font-size: 11.5px;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
}
.hsk-nav-text strong {
    font-weight: 700;
}
.user-balance-badge {
    color: #4ade80;
    font-weight: 800;
}

/* 3. SUB-NAVBAR XANH NHẠT (#E5FBF1) - CHÍNH XÁC 7 LINK */
.hsk-subnav,
.navbar-part {
    background-color: var(--hsk-primary-light) !important;
    border-bottom: 1px solid #cceee0 !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    padding: 0 !important;
}
.hsk-subnav .container,
.navbar-part .container {
    padding: 0 15px !important;
}
.hsk-subnav-inner,
.sknav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 40px !important;
}
.sknav-main {
    display: flex !important;
    align-items: center !important;
}
.hsk-subnav-links,
.sknav-menu {
    display: flex !important;
    align-items: center !important;
    gap: 22px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.sknav-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.hsk-subnav-link,
.sknav-link {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--hsk-primary) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 10px 0 !important;
    transition: color 0.2s !important;
}
.hsk-subnav-link:hover,
.sknav-link:hover {
    color: var(--hsk-primary-dark) !important;
    text-decoration: underline !important;
}

/* 4. SIDEBAR DRAWER (OFF-CANVAS TÀI KHOẢN) */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
}
.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}
.hsk-sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: #ffffff;
    z-index: 999;
    box-shadow: var(--shadow-drawer);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.hsk-sidebar-drawer.active {
    transform: translateX(0);
}
.drawer-head {
    background: var(--hsk-primary);
    color: #ffffff;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-head-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
}
.drawer-user-info strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
}
.drawer-user-info span {
    font-size: 12px;
    color: #d1fae5;
}
.drawer-close-btn {
    color: #ffffff;
    font-size: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 0;
}
.drawer-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--hsk-text-light);
    padding: 10px 18px 4px 18px;
    letter-spacing: 0.5px;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: var(--hsk-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.drawer-link:hover {
    background: var(--hsk-primary-light);
    color: var(--hsk-primary);
    padding-left: 22px;
}
.drawer-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: var(--hsk-primary);
}
.drawer-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    border-radius: var(--radius-pill);
    background: #fee2e2;
    color: #dc2626;
    font-weight: 700;
    font-size: 12.5px;
    text-decoration: none;
    transition: background 0.2s;
}
.drawer-logout-btn:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* 5. BOTTOM NAVIGATION BAR CHUẨN APP MOBILE */
.hsk-bottom-bar {
    display: none;
}

/* 6. STYLE CHO SIDEBAR TRANG TÀI KHOẢN (views/client/sidebar.php) */
.client-sidebar {
    background: #ffffff;
    border: 1px solid var(--hsk-border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.sidebar-user-card {
    background: linear-gradient(135deg, #27563f, #326e51);
    color: #ffffff;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.sidebar-user-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
}
.user-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #ffffff;
}
.sidebar-user-info {
    overflow: hidden;
}
.sidebar-user-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-balance {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #a7f3d0;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.sidebar-menu {
    padding: 10px 0;
}
.sidebar-menu-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--hsk-text-light);
    padding: 10px 16px 4px 16px;
    letter-spacing: 0.5px;
}
.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--hsk-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}
.sidebar-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 14.5px;
    color: var(--hsk-primary);
}
.sidebar-menu-item:hover,
.sidebar-menu-item.active {
    background: var(--hsk-primary-light);
    color: var(--hsk-primary);
    padding-left: 20px;
}
.sidebar-menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--hsk-primary);
}
.menu-badge {
    margin-left: auto;
    background: var(--hsk-orange);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
}
.sidebar-footer {
    padding: 12px 16px 16px 16px;
    border-top: 1px solid var(--hsk-border-light);
}
.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 0;
    border-radius: var(--radius-pill);
    background: #fee2e2;
    color: #dc2626;
    font-weight: 700;
    font-size: 12.5px;
    text-decoration: none;
    transition: background 0.2s;
}
.sidebar-logout-btn:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* ================= 7. MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {
    .hsk-topbar { display: none; }
    
    .hsk-header {
        padding-bottom: 8px;
    }
    .header-main {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0 4px 0;
        gap: 8px 10px;
    }
    .hsk-logo-wrap {
        order: 1;
    }
    .hsk-logo {
        font-size: 21px;
        letter-spacing: -0.4px;
    }
    .hsk-logo span {
        font-size: 15px;
    }
    .hsk-logo-sub {
        display: none;
    }
    .hsk-header-nav {
        order: 2;
        gap: 8px;
        margin-left: auto;
    }
    .hsk-nav-item {
        gap: 0;
    }
    .hsk-nav-circle-icon {
        width: 33px;
        height: 33px;
        font-size: 13px;
    }
    .hsk-nav-text {
        display: none;
    }
    .hsk-search-wrap {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 2px 0 0 0;
    }
    .hsk-search-form {
        height: 36px;
        padding: 2px 4px 2px 14px;
    }
    .hsk-search-input {
        font-size: 12px;
    }
    .hsk-search-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    /* Subnav cuộn ngang mượt mà */
    .hsk-subnav {
        display: block;
        height: 38px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .hsk-subnav::-webkit-scrollbar {
        display: none;
    }
    .hsk-subnav-inner {
        width: max-content;
        min-width: 100%;
        padding: 0 4px;
    }
    .hsk-subnav-links {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 0 6px;
    }
    .hsk-subnav-link {
        font-size: 11.5px;
        white-space: nowrap;
        padding: 4px 2px;
    }

    /* Bottom App Bar */
    .hsk-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 54px;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
        z-index: 105;
        justify-content: space-around;
        align-items: center;
        padding: 4px 6px;
    }
    .bottom-bar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: #6b7280;
        font-size: 10px;
        font-weight: 600;
        flex: 1;
        text-align: center;
        transition: color 0.15s;
        text-decoration: none;
    }
    .bottom-bar-item i {
        font-size: 16px;
    }
    .bottom-bar-item.active,
    .bottom-bar-item:hover {
        color: var(--hsk-primary);
    }
}

/* ================= DROPDOWN SUBNAV HASAKI ================= */
.hsk-subnav-item.has-dropdown {
    position: relative !important;
}
.hsk-subnav-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: #ffffff !important;
    border: 1px solid #cceee0 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    padding: 8px !important;
    min-width: 220px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-6px) !important;
    transition: opacity 0.15s, transform 0.15s !important;
    z-index: 300 !important;
    list-style: none !important;
}
.hsk-subnav-item:hover > .hsk-subnav-dropdown {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
    display: block !important;
}
.hsk-subnav-dropdown li a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: #333333 !important;
    text-decoration: none !important;
    transition: background 0.1s !important;
    white-space: nowrap !important;
}
.hsk-subnav-dropdown li a:hover {
    background: #e5fbf1 !important;
    color: #326e51 !important;
}

/* ================= NÚT HAMBURGER MOBILE (3 GẠCH) ================= */
.hsk-hamburger-btn {
    display: none !important;
}

/* ================= RESPONSIVE MOBILE CHUẨN MẪU HASAKI ================= */
@media (max-width: 768px) {
    .hsk-topbar {
        display: none !important;
    }
    .hsk-header {
        padding-bottom: 8px !important;
    }
    .header-main {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 0 4px 0 !important;
        gap: 8px 6px !important;
    }
    .hsk-hamburger-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        border: none !important;
        color: #ffffff !important;
        font-size: 20px !important;
        width: 36px !important;
        height: 36px !important;
        cursor: pointer !important;
        padding: 0 !important;
        margin-right: 4px !important;
        flex-shrink: 0 !important;
        order: 1 !important;
    }
    .hsk-hamburger-btn i {
        color: #ffffff !important;
        font-size: 20px !important;
    }
    .hsk-logo-wrap {
        order: 2 !important;
        display: flex !important;
        align-items: center !important;
        margin-right: auto !important;
    }
    .hsk-logo {
        font-size: 20px !important;
        letter-spacing: -0.4px !important;
        white-space: nowrap !important;
    }
    .hsk-logo span {
        font-size: 14.5px !important;
    }
    .hsk-logo-sub {
        display: none !important;
    }
    .hsk-header-nav {
        order: 3 !important;
        gap: 8px !important;
        margin-left: 0 !important;
    }
    .hsk-nav-item {
        gap: 0 !important;
    }
    .hsk-nav-circle-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
    }
    .hsk-nav-text {
        display: none !important;
    }
    .hsk-search-wrap {
        order: 4 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 4px 0 0 0 !important;
    }
    .hsk-search-form {
        height: 36px !important;
        padding: 2px 4px 2px 14px !important;
    }
    .hsk-search-input {
        font-size: 12px !important;
    }
    .hsk-search-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 13px !important;
    }
    .hsk-subnav {
        display: none !important;
    }
}
@media (max-width: 380px) {
    .hsk-logo { font-size: 18px !important; }
    .hsk-logo span { font-size: 13.5px !important; }
    .hsk-header-nav { gap: 6px !important; }
    .hsk-nav-circle-icon { width: 30px !important; height: 30px !important; font-size: 12px !important; }
}
