/* ==========================================================================
   CUSTOM HEADER STYLES (NO CSS ROOT VARIABLES)
   ========================================================================== */

/* --- Container & Basic Layout --- */
.hk-header-wrapper {
    position: relative;
    z-index: 999;
}

/* --- Top Bar --- */
.hk-top-bar {
    background-color: #F5F5F5;
    color: #333303;
    padding: 10px 0;
}

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

.hk-top-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 25px;
}

.hk-top-left .hk-icon {
    margin-right: 4px;
    transform: translateY(-1px);
}

.hk-date {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

.hk-divider {
    color: #dee2e6;
    margin: 0 4px;
}

.hk-weather-widget {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hk-weather-city {
    font-weight: 700;
    color: #007E00;
}

.hk-weather-temp em {
    font-style: normal;
    font-weight: 700;
}

.hk-weather-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.hk-hotline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hk-top-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hk-top-link {
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.hk-top-link:hover {
    color: #044973;
}

/* --- Language Dropdown --- */
.hk-lang-dropdown {
    position: relative;
}

.hk-lang-btn {
    background: none;
    border: none;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.hk-lang-btn:hover {
    background-color: #e9ecef;
}

.hk-chevron {
    transition: transform 0.2s ease;
}

.hk-lang-dropdown.active .hk-chevron {
    transform: rotate(180deg);
}

.hk-lang-list {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 4px 0;
    margin: 4px 0 0 0;
    min-width: 110px;
    z-index: 1050;
    display: none;
}

.hk-lang-dropdown.active .hk-lang-list {
    display: block;
}

.hk-lang-list li a {
    display: block;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.hk-lang-list li a:hover {
    background-color: #f1f3f5;
    color: #044973;
}

/* --- Middle Bar --- */
.hk-middle-bar {
    padding: 10px 0;
    position: relative;
}

.hk-middle-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.hk-hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.hk-hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #495057;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.hk-hamburger-btn.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hk-hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hk-hamburger-btn.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.hk-logo-area {
    flex-shrink: 0;
}

.hk-logo-img {
    height: 78px;
    display: block;
    width: auto;
}

/* --- Ticker / Stock Indices --- */
.hk-ticker-container {
    flex-grow: 1;
    overflow: hidden;
}

.hk-ticker-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.hk-ticker-track .hk-ticker-item:not(:last-child) {
    border-right: 1px solid #E5E5E5;
}

.hk-ticker-item {
    display: flex;
    align-items: center;
    padding: 6px 15px;
}

.hk-ticker-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.hk-ticker-icon.down {
    color: #de3727;
    border: 1px solid #de3727;
}

.hk-ticker-icon.up {
    color: #059669;
    border: 1px solid #059669;
}

.hk-ticker-name {
    color: #666;
    margin-bottom: 10px;
}

.hk-ticker-values {
    display: flex;
    gap: 8px;
    line-height: 1.2;
}

.hk-ticker-val {
    font-size: 13px;
    color: #666;
}

.hk-ticker-change {
    font-size: 13px;
}

.hk-ticker-change.down {
    color: #de3727;
}

.hk-ticker-change.up {
    color: #319795;
}

.hk-mobile-search-btn {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hk-mobile-search-btn:hover {
    background-color: #e9ecef;
}

/* --- Navigation Bar --- */
.hk-nav-bar {
    background-color: #044973;
    color: #ffffff;
    position: relative;
}

.hk-nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hk-menu-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.hk-menu-item {
    position: relative;
    border-right: 1px solid #003454;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.hk-menu-item>a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 15px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.hk-menu-item:hover>a,
.hk-menu-item.active>a {
    background-color: rgba(255, 255, 255, 0.1);
}

.hk-is-home>a {
    padding-left: 12px;
    padding-right: 12px;
}

/* --- Dropdown Menus (3 Levels) --- */
.hk-dropdown {
    position: absolute;
    background-color: #ffffff;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
}

/* Level 2 positioning */
.hk-dropdown-level-2 {
    top: 100%;
    left: 0;
    min-width: 230px;
}

.hk-dropdown-item {
    position: relative;
}

.hk-dropdown-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.3;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.hk-dropdown-item a:hover {
    background-color: #ddd;
}

.hk-submenu-chevron {
    color: #a0aec0;
    margin-left: 10px;
}

/* Level 3 positioning */
.hk-dropdown-level-3 {
    top: 0;
    left: 100%;
    min-width: 210px;
    transform: translateX(10px);
}

/* Hover behaviors to show dropdowns */
.hk-menu-item:hover>.hk-dropdown-level-2 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hk-dropdown-item:hover>.hk-dropdown-level-3 {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Custom class for mock indicator */
.hk-mock-dropdown {
    background-color: #fdfdfd;
}

/* --- Search Icon & Input on Desktop --- */
.hk-search-desktop {
    position: relative;
}

.hk-search-btn {
    background: none;
    border: none;
    color: #ffffff;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.hk-search-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hk-search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 4px 4px;
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 320px;
    display: none;
}

.hk-search-dropdown.active {
    display: block;
    animation: hkFadeInUp 0.2s ease;
}

.hk-search-input-wrapper {
    display: flex;
    gap: 8px;
}

.hk-search-input {
    flex-grow: 1;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    color: #495057;
}

.hk-search-input:focus {
    border-color: #044973;
    outline: none;
}

.hk-search-submit {
    background-color: #044973;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 8px 11px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hk-search-submit:hover {
    background-color: #033452;
}

@keyframes hkFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Mobile / Tablet Drawer Layout --- */
.hk-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hk-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.hk-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background-color: #ffffff;
    z-index: 2000;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.hk-mobile-drawer.open {
    transform: translateX(0);
}

.hk-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.hk-drawer-logo img {
    height: 40px;
    width: auto;
}

.hk-drawer-close {
    background: none;
    border: none;
    color: #495057;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hk-drawer-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.hk-drawer-search {
    margin-bottom: 20px;
}

.hk-drawer-search-wrapper {
    display: flex;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.hk-drawer-search-input {
    flex-grow: 1;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    color: #495057;
    width: 100%;
}

.hk-drawer-search-input:focus {
    outline: none;
}

.hk-drawer-search-btn {
    background-color: #f8f9fa;
    border: none;
    border-left: 1px solid #ced4da;
    color: #495057;
    padding: 0 12px;
    cursor: pointer;
}

/* Mobile Accordion Menu (3 Levels) */
.hk-mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.hk-mobile-item {
    border-bottom: 1px solid #f1f3f5;
}

.hk-accordion-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hk-mobile-item>.hk-accordion-title-row>a {
    display: block;
    padding: 12px 0;
    color: #212529;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    flex-grow: 1;
}

.hk-mobile-item.active>.hk-accordion-title-row>a {
    color: #044973;
}

.hk-accordion-toggle {
    background: none;
    border: none;
    color: #6c757d;
    padding: 12px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.hk-mobile-item.expanded>.hk-accordion-title-row>.hk-accordion-toggle {
    transform: rotate(180deg);
}

.hk-accordion-content {
    list-style: none;
    padding: 0 0 0 15px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.hk-level-2-accordion>li {
    border-top: 1px solid #f8f9fa;
}

.hk-mobile-sub-item>.hk-accordion-title-row>a {
    display: block;
    padding: 10px 0;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    flex-grow: 1;
}

.hk-mobile-sub-item.expanded>.hk-accordion-title-row>.hk-accordion-toggle {
    transform: rotate(180deg);
}

.hk-level-3-accordion {
    padding-left: 15px;
}

.hk-level-3-accordion a {
    display: block;
    padding: 8px 0;
    color: #6c757d;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
}

.hk-mock-accordion a {
    font-style: italic;
}

/* Drawer Footer Info */
.hk-drawer-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.hk-drawer-lang-select {
    margin-bottom: 20px;
}

.hk-drawer-lang-label {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 600;
}

.hk-drawer-lang-options {
    display: flex;
    gap: 10px;
}

.hk-drawer-lang-opt {
    flex: 1;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 700;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hk-drawer-lang-opt.active {
    background-color: #044973;
    border-color: #044973;
    color: #ffffff;
}

.hk-drawer-contact {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
}

.hk-drawer-contact p {
    margin: 4px 0;
}

/* Helper class to prevent page scrolling when menu open */
body.hk-no-scroll {
    overflow: hidden;
}


/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (NO CSS ROOT VARIABLES)
   ========================================================================== */

/* --- Tablet Viewport (max-width: 1023px) --- */
@media (max-width: 1023px) {
    .hk-top-bar {
        font-size: 12px;
    }

    .hk-top-left {
        gap: 6px;
    }

    .hk-divider {
        margin: 0 2px;
    }

    .hk-top-right {
        display: none;
        /* Hide desktop top links */
    }

    .hk-logo-img {
        height: 50px;
    }

    /* Horizontal scrolling for indices on tablet */
    .hk-ticker-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .hk-ticker-track {
        justify-content: flex-start;
        width: max-content;
        gap: 10px;
    }

    .hk-ticker-item {
        min-width: 140px;
        padding: 4px 8px;
    }

    .hk-ticker-icon {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .hk-ticker-name {
        font-size: 11px;
    }

    .hk-ticker-val {
        font-size: 12px;
    }

    .hk-ticker-change {
        font-size: 9px;
    }

    /* Hide desktop nav menu completely */
    .hk-nav-bar {
        display: none;
    }

    /* Show Hamburger on mobile/tablet */
    .hk-hamburger-btn {
        display: flex;
    }

    /* Show mobile search button in middle bar */
    .hk-mobile-search-btn {
        display: flex;
    }

    .hk-middle-bar-inner {
        gap: 10px;
    }
}

/* --- Mobile Viewport (max-width: 767px) --- */
@media (max-width: 767px) {
    .hk-top-bar {
        display: none;
        /* Hide top bar completely on small mobile */
    }

    .hk-logo-img {
        height: 40px;
    }

    .hk-middle-bar {
        padding: 10px 0;
    }

    /* Place Ticker below logo on mobile to make room */
    .hk-middle-bar-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        row-gap: 12px;
        column-gap: 10px;
    }

    .hk-logo-area {
        order: 2;
    }

    .hk-hamburger-btn {
        order: 1;
    }

    .hk-mobile-search-btn {
        order: 3;
    }

    .hk-ticker-container {
        order: 4;
        width: 100%;
        margin-top: 4px;
        border-top: 1px solid #f1f3f5;
        padding-top: 8px;
    }
}

/* --- Mega Menu Panel --- */
.hk-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fafafa;
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    z-index: 1001;
    display: none;
    padding: 20px 0;
}

.hk-mega-menu.active {
    display: block;
    animation: hkFadeInDown 0.25s ease;
}

.hk-mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.hk-mega-col {
    display: flex;
    flex-direction: column;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.hk-mega-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.hk-mega-title a {
    color: #044973;
    text-decoration: none;
}

.hk-mega-title a:hover {
    color: #000000;
}

.hk-mega-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hk-mega-list-items li a {
    font-size: 14px;
    color: #333303;
    transition: color 0.2s ease;
}

.hk-mega-list-items li a:hover {
    color: #044973;
}

@media (max-width: 1023px) {
    .hk-mega-menu {
        display: none !important;
    }
}