/* CSS Variables from Figma Design */
:root {
    /* Brand Colors */
    --brand-blue-primary: #191E67;
    --brand-blue-extra-light: #DDE4FC;
    --brand-blue-container: #F0F3FE;

    /* Text Colors */
    --icon-text-white: #FFFFFF;
    --icon-text-primary: #3D3D3D;
    --icon-text-secondary: #888888;

    /* Spacing */
    --space-inline-8: 8px;
    --space-small: 8px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Container */
.container {
    max-width: 1920px;
    width: 1920px;
    margin: 0 auto;
    padding: 0 240px;
}

/* Mobile Location Bar - Hidden on desktop */
.mobile-location-bar {
    display: none;
}

/* Mobile Menu Toggle - Hidden on desktop */
.menu-toggle {
    display: none;
}

/* Top Bar */
.header-topbar {
    background-color: var(--brand-blue-primary);
    height: 36px;
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.header-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.topbar-left {
    display: flex;
    gap: 32px;
    align-items: center;
}

.topbar-link {
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    color: var(--brand-blue-extra-light);
    transition: color 0.3s ease;
}

.topbar-link.active {
    color: var(--icon-text-white);
    text-decoration: underline;
    text-underline-position: from-font;
    line-height: 20px;
}

.topbar-link:hover {
    color: var(--icon-text-white);
}

.topbar-right {
    display: flex;
    gap: 32px;
    align-items: center;
}

.topbar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    color: var(--brand-blue-extra-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.topbar-item:hover {
    color: var(--icon-text-white);
}

.topbar-icon {
    width: 20px;
    height: 20px;
}

/* Main Menu */
.header-menu {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 240px;
    height: 70px;
}

.menu-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 1440px;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Logo */
.logo {
    display: block;
}

.logo-img {
    width: 109px;
    height: 36px;
    display: block;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: var(--icon-text-primary);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--brand-blue-container);
    border-radius: 8px;
}

.dropdown-icon {
    width: 12px;
    height: 12px;
    transform: rotate(180deg) scaleY(-1);
    transition: transform 0.3s ease;
}

.nav-item.dropdown:hover .dropdown-icon {
    transform: rotate(0deg) scaleY(1);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(-10px);
    background: white;
    border: 1px solid #E7E7E7;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
    width: max-content;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Full width dropdown for menus without dropdown-simple-list (Sản phẩm dịch vụ, Thanh toán hỗ trợ) */
.dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
    position: fixed;
    top: 100px;
    left: 240px;
    right: 240px;
    width: auto;
}

.nav-item.dropdown-fullwidth:hover .dropdown-menu:not(.dropdown-simple-list) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Force hide dropdown when scrolling */
.nav-item.dropdown.force-hide-dropdown .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Dropdown Content Styles */
.dropdown-menu .container {
    padding: 24px;
    width: auto;
    max-width: none;
}

.dropdown-menu .row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 1fr);
    gap: 16px;
}

/* Dropdown Category (for complex dropdowns with categories) */
.dropdown-category {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.dropdown-category:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    width: 20px;
    height: 20px;
}

.category-title {
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: #3D3D3D;
}

.category-links {
    list-style: none;
    padding: 0 0 0 52px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-links li a {
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #606060;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-links li a:hover {
    color: #FF730A;
    font-weight: 600;
}

.badge-new {
    background: #FF2156;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 0px 6px;
    border-radius: 32px;
}

/* Dropdown Simple List (for simple dropdowns without categories) */
.dropdown-simple-list {
    display: flex;
    flex-direction: column;
    /* gap: 8px; */
    /* padding: 24px; */
}

.dropdown-simple-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-simple-item:hover {
    background-color: #F7F7F8;
}

.dropdown-simple-item .item-icon {
    width: 24px;
    height: 24px;
}

.dropdown-simple-item span {
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #3D3D3D;
}

/* Search Box */
.menu-right {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    width: 337px;
    height: 40px;
    border: 1px solid #E7E7E7;
    background: #F0F3FE;
    border-radius: 999px;
}

.search-input {
    width: 100%;
    height: 100%;
    background: transparent; /* Transparent vì background đã có ở .search-box */
    border: none; /* Border đã có ở .search-box */
    border-radius: 999px;
    padding: 0 48px 0 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    color: #3D3D3D;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #888888; /* Hint màu 888888 */
    font-weight: 400;
}

.search-input:focus {
    border-color: var(--brand-blue-primary);
    background-color: white;
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 40px;
    width: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.search-btn:hover {
    opacity: 0.7;
}

.search-icon {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 1680px) {
    .container {
        width: 100%;
        padding: 0 120px;
    }

    .header-menu {
        padding: 0px 120px;
    }

    .menu-wrapper {
        width: 100%;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 120px;
        right: 120px;
    }
}

@media (max-width: 1440px) {
    .container {
        width: 100%;
        padding: 0 80px;
    }

    .header-menu {
        padding: 8px 80px;
    }

    .menu-wrapper {
        width: 100%;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 80px;
        right: 80px;
    }
}

@media (max-width: 1200px) {
    .container {
        width: 100%;
        padding: 0 40px;
    }

    .header-menu {
        padding: 8px 40px;
    }

    .menu-wrapper {
        width: 100%;
    }

    .nav-link {
        padding: 16px 20px;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 40px;
        right: 40px;
    }
}

@media (max-width: 991px) {
    .container {
        width: 100%;
        padding: 0 20px;
    }

    .header-menu {
        padding: 8px 20px;
    }

    .menu-wrapper {
        width: 100%;
    }

    .menu-left {
        gap: 16px;
    }

    .main-nav {
        gap: 8px;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 14px;
    }

    .search-box {
        width: 250px;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 16px;
    }

    .header-menu {
        padding: 8px;
    }

    .menu-wrapper {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
    }

    .topbar-left,
    .topbar-right {
        gap: 16px;
    }

    .topbar-link,
    .topbar-item {
        font-size: 12px;
    }

    .menu-left {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .menu-right {
        width: 180px;
    }

    .search-box {
        width: 100%;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 16px;
        right: 16px;
    }
}

/* Mobile Header Responsive (Bootstrap breakpoint) */
@media (max-width: 991px) {
    /* Hide desktop topbar on mobile */
    .header-topbar {
        display: none;
    }

    /* Mobile Header Menu */
    .header-menu {
        padding: 8px;
        background: #FFFFFF;
        position: relative;
        z-index: 100;
        height: 56px;
        box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.08), 0px 4px 16px 10px rgba(16, 24, 40, 0.02), 0px 2px 32px -4px rgba(16, 24, 40, 0.03);
    }

    .menu-wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    /* Mobile Menu Left Side */
    .menu-left {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Hamburger Menu Button */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        background: none;
        border: none;
        cursor: pointer;
    }

    .menu-toggle-icon {
        width: 24px;
        height: 24px;
    }

    /* Hide desktop navigation on mobile */
    .main-nav {
        display: none;
    }

    /* Logo on mobile */
    .logo {
        display: block;
    }

    .logo-img {
        width: 108px;
        height: 36px;
    }

    /* Mobile Search Box - Menu Right */
    .menu-right {
        display: flex;
        align-items: center;
        width: 180px;
    }

    .search-box {
        width: 100%;
        background: var(--brand-blue-container);
        border: 1px solid #E7E7E7;
        border-radius: 999px;
        padding-left: 12px;
        padding-right: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 32px;
    }

    .search-input {
        flex: 1;
        border: none;
        background: transparent;
        font-size: 12px;
        line-height: 16px;
        color: var(--icon-text-secondary);
        padding: 0;
        outline: none;
    }

    .search-input::placeholder {
        color: #888888;
        content: "Tìm kiếm";
    }

    /* Override placeholder text on mobile using attribute selector trick */
    .search-input {
        font-size: 12px !important;
    }

    .search-btn {
        position: static;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        background: none;
        border: none;
        cursor: pointer;
        height: 100%;
        width: auto;
    }

    .search-icon {
        width: 16px;
        height: 16px;
        display: block;
    }

    /* Mobile Location Bar */
    .mobile-location-bar {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 4px 16px;
        background: #FFFFFF;
        border-top: 1px solid #E7E7E7;
        gap: 4px;
    }

    .location-item {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .location-icon {
        width: 16px;
        height: 16px;
    }

    .location-text {
        font-family: 'SF Pro', sans-serif;
        font-size: 14px;
        font-weight: 510;
        line-height: 24px;
        color: var(--icon-text-primary);
    }

    /* Hide desktop-only elements */
    .topbar-item {
        display: none;
    }
}

/* iPad Pro 12.9" and Large Tablets */
@media (min-width: 1024px) and (max-width: 1366px) {
    .container {
        padding: 0 60px;
    }

    .header-menu {
        padding: 8px 60px;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 60px;
        right: 60px;
    }

    .nav-link {
        padding: 14px 24px;
        font-size: 15px;
    }

    .search-box {
        width: 280px;
    }
}

/* iPad Landscape (11" and 10.9") */
@media (min-width: 835px) and (max-width: 1194px) {
    .container {
        padding: 0 50px;
    }

    .header-menu {
        padding: 8px 50px;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 50px;
        right: 50px;
    }

    .menu-left {
        gap: 20px;
    }

    .main-nav {
        gap: 8px;
    }

    .nav-link {
        padding: 12px 20px;
        font-size: 14px;
    }

    .search-box {
        width: 260px;
    }

    .dropdown-menu .row {
        gap: 24px;
    }
}

/* iPad Portrait (all sizes) */
@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
    .container {
        padding: 0 40px;
    }

    .header-menu {
        padding: 8px 40px;
    }

    .menu-wrapper {
        width: 100%;
    }

    .menu-left {
        gap: 16px;
    }

    .main-nav {
        gap: 6px;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 14px;
    }

    .search-box {
        width: 240px;
    }

    .dropdown-fullwidth .dropdown-menu:not(.dropdown-simple-list) {
        left: 40px;
        right: 40px;
    }

    .dropdown-menu .row {
        grid-auto-columns: minmax(180px, 1fr);
        gap: 20px;
    }
}

/* Tablet adjustments - Keep for other tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .menu-right {
        width: 250px;
    }

    .search-input {
        font-size: 14px;
    }

    .search-icon {
        width: 18px;
        height: 18px;
    }
}

/* Small mobile phones - iPhone SE, etc */
@media (max-width: 375px) {
    .header-menu {
        padding: 8px 4px;
    }

    .menu-right {
        width: 150px;
    }

    .search-input {
        font-size: 11px;
    }

    .logo-img {
        width: 90px;
    }
}
