/* Top bar */
.top-bar {
    background-color: var(--color-bg-topbar);
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.top-bar .container {
    max-width: 1270px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: end;
    align-items: center;
}

.phone-numbers {
    color: var(--color-primary);
    font-size: 14px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.phone-numbers svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 5px;
    fill: var(--color-primary);
}

.social-search {
    display: flex;
    align-items: center;
    gap: 14px;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
}

.search-box input {
    padding: 8px 35px 8px 12px;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    width: 298px;
    font-size: 14px;
}

.search-box button {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.search-box svg {
    width: 18px;
    height: 18px;
    fill: var(--color-text-light);
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icons a {
    width: 32px;
    height: 32px;
    align-items: center;
}

.social-icons a:hover {
    transform: scale(1.1);
}

.social-icons svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Hide mobile-only elements on desktop */
.mobile-sidebar-header,
.mobile-sidebar-footer,
.mobile-dropdown-toggle {
    display: none;
}

/* Dropdown arrow (hidden on desktop) */
.dropdown-arrow {
    display: none;
}

/* Navigation */
.navbar {
    background-color: var(--color-primary);
    padding: 0;
    position: relative;
}

.navbar .container {
    max-width: 1145px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 11px 0;
}

.logo-shield {
    width: 50px;
    height: 55px;
    background-color: white;
    border-radius: 5px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
}

.logo-content {
    text-align: center;
    color: var(--color-primary);
}

.logo-content .logo-hbr {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.logo-text strong {
    font-size: 16px;
}

.logo-text small {
    font-size: 12px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
    margin: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu > li > .nav-item-link {
    color: var(--color-nav-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    padding: 20px 0px;
    display: block;
    transition: background-color 0.3s;
    line-height: 100%;
    cursor: pointer;
}

.nav-menu > li > .nav-item-link.active {
    color: #e30613;
}

.nav-menu > li.has-dropdown:hover > .nav-item-link::after,
.nav-menu > li.has-dropdown.active > .nav-item-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid var(--color-bg-dropdown);
}

/* Dropdown content */
.dropdown-mega {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-bg-dropdown);
    box-shadow: var(--shadow-dropdown);
    z-index: 1000;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0;
}

.nav-menu > li:hover > .dropdown-mega,
.nav-menu > li.active > .dropdown-mega {
    display: block;
}

/* .nav-menu > li.last-dropdown > .dropdown-mega {
    left: auto;
} */

.dropdown-content {
    width: 850px;
    padding: 27px 28px;
    display: flex;
}

.dropdown-left {
    width: 280px;
    flex-shrink: 0;
}

/* Khi không có bài viết nổi bật */
.dropdown-content--no-posts {
    width: auto;
    min-width: 300px;
}

.dropdown-left--full {
    width: auto;
}

.dropdown-mega .dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: auto;
}

.dropdown-mega .dropdown-menu li {
    padding: 0;
    margin-bottom: 0;
}

.dropdown-mega .dropdown-menu a,
.dropdown-mega .dropdown-menu .dropdown-item {
    color: var(--color-text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.3s;
    font-size: 16px;
    font-weight: 400;
    line-height: 33px;
    padding: 0;
    background: transparent;
}

.dropdown-mega .dropdown-menu a:hover,
.dropdown-mega .dropdown-menu .dropdown-item:hover {
    color: var(--color-primary);
    background: transparent;
}

.dropdown-menu svg {
    width: 22px;
    height: 22px;
    fill: var(--color-text-base);
    flex-shrink: 0;
}

.dropdown-mega .dropdown-menu .cate-child-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.dropdown-right {
    flex: 1;
    border-left: 1px solid var(--color-border-gray);
    padding-left: 35px;
    margin-left: 49px;
}

.recent-posts h3 {
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--color-text-dark);
    font-weight: bold;
}

.post-item {
    display: flex;
    gap: 17px;
    margin-bottom: 14px;
}

.post-item img {
    width: 130px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.post-content {
    flex: 1;
}

.post-content h4 {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 21px;
    color: var(--color-text-dark);
    font-weight: 600;
}

.post-content p {
    font-size: 14px;
    line-height: 21px;
    font-weight: 400;
    color: var(--color-text-dark);
}

.view-more {
    color: var(--color-accent);
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

.view-more:hover {
    text-decoration: underline;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-bg-white);
    margin: 3px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========== HEADER RESPONSIVE ========== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    .top-bar .container {
        padding: 0 15px;
    }

    .search-box input {
        width: 200px;
    }

    /* .navbar .container {
        padding: 0 15px;
    } */

    .nav-menu {
        gap: 40px;
    }

    .nav-menu > li > .nav-item-link {
        font-size: 14px;
        padding: 18px 0;
    }

    .dropdown-content {
        width: 700px;
        padding: 20px;
    }

    .dropdown-right {
        padding-left: 20px;
        margin-left: 20px;
    }

    .post-item img {
        width: 100px;
        height: 70px;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Top Bar */
    .top-bar {
        padding: 8px 0;
    }

    .top-bar .container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .phone-numbers {
        margin-right: 0;
        font-size: 13px;
    }

    .search-box {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }

    .search-box input {
        width: 100%;
    }
    .social-icons a {
        width: 28px;
        height: 28px;
    }

    /* Navbar */
    .navbar .container {
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile Sidebar Menu */
    .nav-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -328px;
        width: 328px;
        height: 100vh;
        background-color: #00285A;
        z-index: 1001;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 0;
        margin: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .nav-menu.active {
        left: 0;
        gap: 0;
    }

    .nav-menu > li {
        border-bottom: none;
    }

    /* Border between menu items */
    .nav-menu > li:not(.mobile-sidebar-header):not(.mobile-sidebar-footer) {
        border-top: 2px solid #1F64BC40;
    }

    /* Mobile Sidebar Header */
    .nav-menu > li.mobile-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        background-color: #00285A;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-logo img {
        display: block;
        height: 50px;
        width: auto;
        filter: brightness(0) invert(1);
    }

    .mobile-menu-close {
        background-color: #D9D9D9;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 33px;
        height: 33px;
        transition: all 0.3s ease;
    }

    .mobile-menu-close svg {
        width: 14px;
        height: 14px;
    }

    .mobile-menu-close svg path {
        stroke: #00285A;
    }

    .mobile-menu-close:hover {
        background-color: #c0c0c0;
    }

    /* Menu item with dropdown - use flexbox layout */
    .nav-menu > li.has-dropdown {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
        margin: 0;
        background-color: transparent;
        border-radius: 0;
        overflow: visible;
    }

    .nav-menu > li.has-dropdown > .nav-item-link {
        flex: 1;
        margin: 5px 0 5px 15px;
        border-radius: 8px 0 0 8px;
        background-color: #00285A;
        padding-right: 10px;
    }

    .nav-menu > li.has-dropdown > .nav-item-link:hover {
        background-color: #243f6b;
    }

    .nav-menu > li.has-dropdown > .mobile-dropdown-toggle {
        margin: 5px 15px 5px 0;
        border-radius: 0 8px 8px 0;
        background-color: #00285A;
    }
    .nav-menu > li > .nav-item-link {
        padding: 18px 20px;
        font-size: 15px;
        font-weight: 700;
        color: #fff;
        text-transform: uppercase;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: #00285A;
        margin: 5px 15px;
        border-radius: 8px;
        text-decoration: none;
    }

    .nav-menu > li > .nav-item-link:hover {
        background-color: #243f6b;
    }

    /* Mobile menu arrow icon - hide default dropdown arrow */
    .nav-menu > li > .nav-item-link .dropdown-arrow {
        display: none;
    }

    /* Remove ::after for all items */
    .nav-menu > li > .nav-item-link::after {
        display: none;
    }

    /* Mobile dropdown toggle button */
    .mobile-dropdown-toggle {
        display: none;
        width: 56px;
        background-color: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    .nav-menu > li.has-dropdown .mobile-dropdown-toggle {
        display: flex;
    }

    .mobile-dropdown-toggle span {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 33px;
        height: 33px;
        background-color: #D9D9D9;
        border-radius: 50%;
    }

    .mobile-dropdown-toggle svg {
        width: 20px;
        height: 20px;
        color: #00285A;
        transition: transform 0.3s ease;
    }

    .nav-menu > li.has-dropdown.active .mobile-dropdown-toggle svg {
        transform: rotate(90deg);
    }

    /* Dropdown takes full width */
    .nav-menu > li.has-dropdown > .dropdown-mega {
        flex-basis: 100%;
    }

    .mobile-dropdown-toggle svg {
        width: 20px;
        height: 20px;
        color: #1B365D;
        transition: transform 0.3s ease;
    }

    .nav-menu > li.has-dropdown.active .mobile-dropdown-toggle svg {
        transform: rotate(90deg);
    }

    /* Mobile Sidebar Footer */
    .nav-menu > li.mobile-sidebar-footer {
        padding: 20px;
        border-bottom: none;
        margin-top: auto;
        background-color: #0D1B2A;
    }

    .sidebar-phone {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #fff;
        font-size: 13px;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }

    .sidebar-phone img {
        filter: brightness(0) invert(1);
    }

    .sidebar-social {
        display: flex;
        gap: 12px;
    }

    .sidebar-social a {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-social img {
        width: 33px;
        height: 33px;
    }

    /* Dropdown on mobile sidebar */
    .dropdown-mega {
        display: none !important;
        position: static;
        transform: none;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        background-color: #00285A;
    }

    .nav-menu > li.has-dropdown.active > .dropdown-mega {
        display: block !important;
    }

    .dropdown-content {
        width: 100%;
        flex-direction: column;
        padding: 0 20px 15px 35px;
    }

    .dropdown-right {
        display: none;
    }

    .dropdown-mega .dropdown-menu a,
    .dropdown-mega .dropdown-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.8);
        font-size: 14px;
        line-height: 32px;
        padding: 5px 0;
        font-weight: 400;
    }

    .dropdown-mega .dropdown-menu a:hover,
    .dropdown-mega .dropdown-menu .dropdown-item:hover {
        color: #fff;
    }

    /* Hide recent posts section */
    .recent-posts {
        display: none;
    }

    /* Logo */
    .logo {
        padding: 8px 0;
    }

    .logo-shield {
        width: 40px;
        height: 45px;
    }

    .logo-content .logo-hbr {
        font-size: 14px;
    }

    .logo-text strong {
        font-size: 14px;
    }

    .logo-text small {
        font-size: 10px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .top-bar {
        padding: 6px 0;
    }

    .top-bar .container {
        padding: 0 10px;
    }

    .phone-numbers {
        font-size: 12px;
    }

    .phone-numbers svg {
        width: 12px;
        height: 12px;
    }

    .social-icons a {
        width: 24px;
        height: 24px;
    }

    .search-box input {
        padding: 6px 30px 6px 10px;
        font-size: 13px;
    }

    /* Navbar */
    .navbar .container {
        padding: 0 10px;
    }

    .logo-shield {
        width: 35px;
        height: 40px;
        margin-right: 8px;
    }

    .logo-content .logo-hbr {
        font-size: 12px;
    }

    .logo-text strong {
        font-size: 12px;
    }

    .logo-text small {
        font-size: 9px;
    }

    /* Mobile sidebar adjustments */
    .nav-menu {
        width: 328px;
        left: -328px;
    }

    .nav-menu > li > .nav-item-link {
        padding: 15px 15px;
        font-size: 16px;
        margin: 4px 10px;
    }

    .nav-menu > li.has-dropdown > .nav-item-link {
        margin: 4px 0 4px 10px;
    }

    .nav-menu > li.has-dropdown > .mobile-dropdown-toggle {
        margin: 4px 10px 4px 0;
    }

    .mobile-dropdown-toggle {
        width: 48px;
    }

    .mobile-dropdown-toggle span {
        width: 33px;
        height: 33px;
    }

    .mobile-dropdown-toggle svg {
        width: 23px;
        height: 23px;
    }

    .dropdown-content {
        padding: 10px 15px 10px 25px;
    }

    .dropdown-mega .dropdown-menu a,
    .dropdown-mega .dropdown-menu .dropdown-item {
        font-size: 13px;
        line-height: 26px;
    }

    .post-item {
        gap: 10px;
    }

    .post-item img {
        width: 60px;
        height: 45px;
    }

    .post-content h4,
    .post-content p {
        font-size: 12px;
        line-height: 18px;
    }
}
