@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&display=swap');

/* Reset và căn bản */
header {
    background: #fff;
    padding: 15px 0;
    position: relative;
    z-index: 100;
}

header .header-container {
    max-width: 1128px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo + Tên bộ */
.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    width: 60px;
    height: auto;
}

.logo-text {
    margin: 0;
    font-size: 16px;
    color: #015B92;
    line-height: 1.4;
    font-weight: 600;
}

.logo-text > p {
    font-family: "Merriweather", serif;
    font-weight: bolder;
    font-size: 25px;
    color: #013A5D;
}

.logo-text span {
    display: block;
    font-weight: normal;
    font-size: 14px;
}

/* Nút Đăng ký / Đăng nhập */
.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-buttons a {
    padding: 8px 16px;

    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.auth-buttons .btn-register {
    background: transparent;
    color: #026DAF;
    border: 1.5px solid #026DAF;
    border-radius: 8px;
}

.auth-buttons .btn-register:hover {
    background: #f0f7ff;
}

.auth-buttons .btn-login {
    background: #026DAF;
    color: white;
    border: 1.5px solid #026DAF;
    border-radius: 8px;

}

.auth-buttons .btn-login:hover {
    background: #004494;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-trigger-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 241px;
    height: 40px;
    padding: 0 5px;

    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}



.user-avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E6F2FA;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar-img {
    width: 65%;
    height: 65%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-name {
    flex: 1;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}




/* Dropdown Menu */
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 248px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    height: 40px;
    text-decoration: none;
    color: #000000;
    transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
    background: #E6F2FA;
}

.item-avatar-container {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-avatar-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.item-text {
    flex: 1;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: #000000;
    text-align: left;
}

.item-badge {
    background: #FF424E;
    border-radius: 100px;
    padding: 0 4px;
    font-size: 12px;
    color: white;
    min-width: 15px;
    text-align: center;
    flex-shrink: 0;
}

.item-badge:empty {
    display: none;
}

/* Divider between item groups - cut from both left and right */
.user-dropdown-item.item-has-divider {
    position: relative;
}

.user-dropdown-item.item-has-divider::after {
    content: '';
    position: absolute;
    left: 40px;
    right: 15px;
    bottom: 0;
    height: 1px;
    background-color: #EBEBF0;
}

/* Mobile Drawer Styles */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: -80vw;
    width: 80vw;
    max-width: 360px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateX(0);
    transition: transform 0.3s ease;
    flex-direction: column;
    overflow: hidden;
}

.mobile-drawer.show {
    display: flex;
    transform: translateX(100%);
}


.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.drawer-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.drawer-divider {
    height: 8px;
    width: 100%;
    background-color: #f5f5fa;
    border-bottom: 1px solid #e6e9ec;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.drawer-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #e6e9ec;
    text-decoration: none;
    color: #013A5D;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
    width: 100%;
    box-sizing: border-box;

    text-align: left;
}

.drawer-menu-item:hover {
    background-color: #f5f7fa;
}

.drawer-menu-item:active,
.drawer-menu-item.active {
    background-color: #026DAF;
    color: #ffffff;
}

.drawer-menu-toggle-icon {
    width: 20px;
    height: 20px;
    margin-left: auto;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.drawer-menu-toggle-icon.rotate {
    transform: rotate(180deg);
}

.drawer-menu-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0e74a6;
}

.drawer-menu-item-icon img {
    width: 24px;
    height: 24px;
}

.drawer-menu-item-text {
    flex: 1;
    text-align: left;
    color: inherit;
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0;
    white-space: normal;
    word-wrap: break-word;
}

.drawer-menu-item-badge {
    background: #ff4d4f;
    border-radius: 12px;
    padding: 0 6px;
    font-size: 11px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 30px;
    text-align: center;
}

.drawer-submenu {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.drawer-submenu.show {
    display: block;
    max-height: 500px;
}

.drawer-submenu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
    height: 40px;
    background: #fafbfc;
    border-bottom: 1px solid #e6e9ec;
    text-decoration: none;
    color: #013A5D;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.drawer-submenu-item:hover {
    background-color: #f0f3f7;
}

.drawer-submenu-item:active,
.drawer-submenu-item.active {
    background-color: #026DAF;
    color: #ffffff;
}

.drawer-user-section {
    border-top: 1px solid #e6e9ec;
    padding: 16px;
    margin-top: auto;
    flex-shrink: 0;
    background: #ffffff;
}

.drawer-user-info {
    display: flex;
    align-items: center;
    gap: 12px;

}

.drawer-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #E6F2FA;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.drawer-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.drawer-user-name {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #000000;
}

.drawer-user-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-user-option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: transparent;
    border: none;
    text-decoration: none;
    color: #0e74a6;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.drawer-user-option-item:hover {
    background-color: #f5f7fa;
    border-radius: 4px;
}

.drawer-user-option-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drawer-user-option-icon img {
    width: 24px;
    height: 24px;
}

.drawer-user-option-badge {
    background: #FF424E;
    border-radius: 100px;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    min-width: 25px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
}

.drawer-user-option-badge:empty,
.drawer-user-option-badge[data-count="0"] {
    display: none;
}

/* Drawer Auth Buttons Section */
.drawer-auth-section {
    display: none;
    padding: 12px 16px;
    border-bottom: 1px solid #e6e9ec;
    flex-direction: column;
    gap: 8px;
}

.drawer-auth-section a {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1.5px solid;
}

.drawer-auth-section .btn-register {
    background: transparent;
    color: #026DAF;
    border-color: #026DAF;
}

.drawer-auth-section .btn-register:hover {
    background: #f0f7ff;
}

.drawer-auth-section .btn-login {
    background: #026DAF;
    color: white;
    border-color: #026DAF;
}

.drawer-auth-section .btn-login:hover {
    background: #004494;
}

/* Responsive */
/* Tablet and up (iPad, large tablets) - show dropdown */
@media (min-width: 421px) and (max-width: 768px) {
    .logo-section img {
        width: 50px;
    }
    .logo-text {
        font-size: 14px;
    }
    .logo-text span {
        font-size: 12px;
    }
    .auth-buttons a {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }

    .user-trigger-btn {
        width: auto;
        padding: 0 8px;
        gap: 8px;
    }

    .user-name {
        display: none;
    }

    .user-avatar-container {
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .user-caret {
        width: 24px;
        height: 24px;
    }

    .icon-dropdown-caret-img {
        width: 24px;
        height: 24px;
    }
}

/* Mobile Large: 420px and below - show drawer, hide dropdown, hide avatar */
@media (max-width: 420px) {

    .user-name {
        display: none;
    }
    .logo-section {
        gap: 10px;
    }
    .logo-text {
        font-size: 13px;
    }
    .logo-text span {
        font-size: 11px;
    }

    /* Hide auth link buttons on mobile, but keep container visible */
    .auth-buttons .btn-register,
    .auth-buttons .btn-login {
        display: none !important;
    }

    /* Show menu button for non-logged-in users on mobile */
    #mobileMenuBtn {
        display: flex !important;
    }

    .drawer-menu-item {
        height: auto;
        min-height: 40px;
        gap: 12px;
    }
    .drawer-menu-item-text {
        font-size: 15px;
    }
    .user-trigger-btn {
        width: auto;
        padding: 0 6px;
        height: 36px;
        gap: 6px;
    }

    .user-avatar-container {
        display: none;
    }

    .user-avatar-img {
        width: 20px;
        height: 20px;
    }

    /* Show drawer auth buttons when mobile */
    .drawer-auth-section {
        display: flex;
    }

    /* Hide dropdown menu on mobile L */
    .user-dropdown-menu {
        display: none !important;
    }
}

/* Desktop and tablet - hide mobile menu button */
@media (min-width: 421px) {
    #mobileMenuBtn {
        display: none !important;
    }
}