/**
 * CSS chung cho Header/Menu
 * File này được include trong header_common.php
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #dc2626;
    color: white;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: visible;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: visible;
}

.header-container > * {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo-circle {
    width: 28px;
    height: 28px;
    background: white;
    color: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

.desktop-nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
    align-items: center;
}

.desktop-nav-links li {
    margin: 0;
    position: relative;
}

.desktop-nav-links a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    text-transform: none;
}

.desktop-nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.desktop-nav-links a.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.desktop-nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

/* Desktop Dropdown Icon */
.desktop-dropdown-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-left: 2px;
}

.desktop-has-submenu:hover .desktop-dropdown-icon {
    transform: rotate(180deg);
}

/* Desktop Submenu */
.desktop-has-submenu {
    position: relative;
}

/* Tạo khoảng trống vô hình để giữ dropdown mở khi di chuyển chuột */
.desktop-has-submenu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
    z-index: 9999;
    pointer-events: auto;
}

.desktop-submenu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
    transform-origin: top center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 400px;
    max-width: 600px;
    width: max-content;
    max-height: 500px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: none;
    list-style: none;
    margin: 0;
    padding: 12px;
    will-change: opacity, transform, visibility;
}

/* Giữ dropdown mở khi hover vào chính dropdown */
.desktop-has-submenu:hover .desktop-submenu,
.desktop-submenu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

/* Đảm bảo dropdown có pointer-events khi hover */
.desktop-submenu:hover {
    pointer-events: auto;
}

/* Desktop Brand Submenu */
.desktop-submenu-brands {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    padding: 20px !important;
    justify-items: center;
}

.desktop-submenu-brands li {
    margin: 0;
    width: 100%;
    max-width: 90px;
    display: flex;
    justify-content: center;
}

.desktop-brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px !important;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 95px;
    width: 100%;
    max-width: 90px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    text-align: center;
}

.desktop-brand-link:hover {
    background: #f9fafb;
    border-color: #dc2626;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.desktop-brand-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    object-position: center;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
    margin: 0 auto;
    display: block;
}

.desktop-brand-logo-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    color: #6b7280;
    font-size: 1.5rem;
    flex-shrink: 0;
    margin: 0 auto;
}

.desktop-brand-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    width: 100%;
}

.desktop-brand-link:hover .desktop-brand-name {
    color: #dc2626;
}

.header-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: auto;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    background: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    transition: background 0.15s ease;
}

.menu-toggle:hover {
    background: #f3f4f6;
}

.menu-toggle span {
    width: 18px;
    height: 2px;
    background: #dc2626;
    border-radius: 1px;
    transition: all 0.3s ease;
}

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

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

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

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.08);
    z-index: 2000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mobile-menu-header {
    background: #ffffff;
    color: #111827;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.mobile-menu-title {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: #111827;
    text-transform: none;
}

.menu-close {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.menu-close:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.mobile-nav {
    flex: 1;
    padding: 12px 0;
    background: transparent;
}

.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

.mobile-nav li {
    margin: 4px 0;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRight 0.4s ease forwards;
}

.mobile-nav li:nth-child(1) { animation-delay: 0.05s; }
.mobile-nav li:nth-child(2) { animation-delay: 0.1s; }
.mobile-nav li:nth-child(3) { animation-delay: 0.15s; }
.mobile-nav li:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    border-radius: 10px;
    position: relative;
}

.mobile-nav a i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    color: #6b7280;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-nav a span {
    flex: 1;
    font-weight: 500;
}

.mobile-nav a:hover {
    background: #f9fafb;
    color: #111827;
}

.mobile-nav a:hover i {
    color: #111827;
}

.mobile-nav a.active {
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
}

.mobile-nav a.active i {
    color: #111827;
}

/* Submenu styles */
.mobile-nav .has-submenu {
    position: relative;
}

.mobile-nav .submenu-header {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
}

.mobile-nav .submenu-header > a {
    flex: 1;
    border-radius: 10px 0 0 10px;
}

.mobile-nav .submenu-toggle {
    background: transparent;
    border: none;
    padding: 14px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
    border-radius: 0 10px 10px 0;
    margin: 0;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}

.mobile-nav .submenu-toggle:hover,
.mobile-nav .submenu-toggle:active {
    background: #f9fafb;
    color: #111827;
}

.mobile-nav .submenu-icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.mobile-nav .has-submenu.active .submenu-icon {
    transform: rotate(180deg);
}

.mobile-nav .submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 4px;
    margin-bottom: 0;
    opacity: 0;
    visibility: hidden;
}

.mobile-nav .has-submenu.active .submenu {
    max-height: 1000px;
    padding: 8px 0 4px 0;
    margin-bottom: 0;
    opacity: 1;
    visibility: visible;
}

/* Fix z-index for brand links to be clickable */
.mobile-nav .submenu-brands {
    position: relative;
    z-index: 10;
    padding-bottom: 4px !important;
}

.mobile-nav .submenu-brands .brand-link {
    position: relative;
    z-index: 11;
}

.mobile-nav .submenu li {
    margin: 0;
    opacity: 1;
    transform: none;
    animation: none;
}

.mobile-nav .submenu a {
    padding: 10px 16px 10px 48px;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
}

.mobile-nav .submenu a:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Brand logos in submenu - Horizontal scroll */
.mobile-nav .submenu-brands {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 8px 10px 4px 10px !important;
    margin-bottom: 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #dc2626 #f3f4f6;
}

.mobile-nav .submenu-brands::-webkit-scrollbar {
    height: 4px;
}

.mobile-nav .submenu-brands::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 2px;
}

.mobile-nav .submenu-brands::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 2px;
}

.mobile-nav .submenu-brands li {
    margin: 0;
    animation: none;
    flex-shrink: 0;
}

.mobile-nav .submenu-brands .brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 10px !important;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 60px;
    min-height: 60px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    cursor: pointer;
}

.mobile-nav .submenu-brands .brand-link:active {
    background: #f9fafb;
    border-color: #dc2626;
    transform: scale(0.95);
}

.mobile-nav .submenu-brands .brand-link:hover {
    background: #f9fafb;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.mobile-nav .submenu-brands .brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    object-position: center;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
}

.mobile-nav .submenu-brands .brand-logo-placeholder {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 5px;
    color: #6b7280;
    font-size: 1rem;
    flex-shrink: 0;
}

.mobile-nav .submenu-brands .brand-name {
    font-size: 0.6rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mobile-nav .submenu-brands .brand-link:hover .brand-name,
.mobile-nav .submenu-brands .brand-link:active .brand-name {
    color: #dc2626;
}

/* Responsive brand horizontal scroll */
@media (max-width: 480px) {
    .mobile-nav .submenu-brands {
        gap: 5px;
        padding: 6px 8px 4px 8px !important;
        margin-bottom: 0 !important;
    }
    
    .mobile-nav .submenu-brands .brand-link {
        padding: 6px 8px !important;
        min-width: 55px;
        min-height: 55px;
        gap: 4px;
    }
    
    .mobile-nav .submenu-brands .brand-logo {
        width: 28px;
        height: 28px;
    }
    
    .mobile-nav .submenu-brands .brand-logo-placeholder {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .mobile-nav .submenu-brands .brand-name {
        font-size: 0.55rem;
    }
}

.mobile-menu-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: #111827;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.mobile-login-btn:hover {
    background: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
}

.mobile-login-btn:active {
    transform: translateY(0);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    margin: 0 15px;
    z-index: 1001;
}

.search-box form {
    position: relative;
    width: 100%;
}

.search-box input {
    background: #f9fafb;
    border: 2px solid transparent;
    padding: 8px 38px 8px 38px;
    border-radius: 24px;
    font-size: 0.8125rem;
    width: 100%;
    outline: none;
    color: #1f2937;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Search icon on the left */
.search-box::before {
    content: '\ea8d';
    font-family: 'boxicons';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

.search-box:focus-within::before {
    color: #dc2626;
}

.search-box input:focus {
    background: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-box input::placeholder {
    color: #9ca3af;
    font-size: 0.75rem;
    opacity: 0.8;
}

.search-box button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc2626;
    border: none;
    color: white;
    padding: 0;
    cursor: pointer;
    font-size: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    z-index: 10;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.search-box button i {
    font-size: 0.85rem;
    line-height: 1;
}

.search-box button:hover {
    background: #b91c1c;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.search-box button:active {
    transform: translateY(-50%) scale(0.95);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10000;
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.search-results.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-results-loading {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.search-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-results-content {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.search-result-item:hover {
    background-color: #f9fafb;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-item-info {
    flex: 1;
    min-width: 0;
}

.search-result-item-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.search-result-item-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.search-result-item-price {
    font-weight: 700;
    font-size: 0.875rem;
    color: #dc2626;
}

.search-result-item-price-old {
    font-size: 0.75rem;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 8px;
}

.search-results-empty {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.search-results-empty i {
    font-size: 2rem;
    color: #d1d5db;
    margin-bottom: 12px;
    display: block;
}

.search-results-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: #f9fafb;
}

.view-all-results {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.view-all-results:hover {
    color: #b91c1c;
}

/* Custom Scrollbar for Search Results */
.search-results-content::-webkit-scrollbar {
    width: 6px;
}

.search-results-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.search-results-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.cart-btn {
    background: white;
    color: #dc2626;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    position: relative;
    height: 32px;
}

.cart-btn:hover {
    background: #f3f4f6;
}

.cart-btn i {
    font-size: 0.85rem;
}

.cart-count {
    background: #dc2626;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    position: absolute;
    top: -4px;
    right: -4px;
    border: 2px solid white;
}

.login-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    height: 32px;
    white-space: nowrap;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* User Menu Styles */
.user-menu-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    /* Không set z-index ở đây để tránh conflict */
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 32px;
    white-space: nowrap;
    /* Reset button styles */
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    margin: 0;
    outline: none;
    box-shadow: none;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.user-menu-trigger:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.user-menu-wrapper.active .user-menu-trigger {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-menu-trigger:active {
    transform: scale(0.98);
}

.user-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-initials {
    font-size: 0.7rem;
    font-weight: 700;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name-short {
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-icon {
    color: white;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.user-menu-wrapper.active .user-menu-icon {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 280px;
    max-width: 320px;
    width: max-content;
    max-height: calc(100vh - 120px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transform-origin: top right;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: none;
    display: none;
    will-change: opacity, transform, visibility;
    margin: 0;
    padding: 0;
    /* Đảm bảo không bị clip */
    contain: layout style paint;
}

.user-menu-wrapper.active .user-dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

.user-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.user-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.user-dropdown-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.user-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Hover effect cho trigger */
.user-menu-trigger {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.user-menu-trigger:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.user-dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-initials-large {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name-full {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-dropdown-item i {
    font-size: 1.2rem;
    color: #6b7280;
    width: 20px;
    text-align: center;
}

.user-dropdown-item:hover {
    background: #f3f4f6;
    color: #dc2626;
}

.user-dropdown-item:hover i {
    color: #dc2626;
}

.user-dropdown-logout {
    color: #dc2626;
}

.user-dropdown-logout:hover {
    background: #fee2e2;
    color: #991b1b;
}

.user-dropdown-logout i {
    color: #dc2626;
}

/* Mobile User Info */
.mobile-user-info {
    padding: 20px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-radius: 12px;
}

.mobile-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mobile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-user-initials {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-user-details {
    flex: 1;
    min-width: 0;
}

.mobile-user-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-email {
    font-size: 0.85rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px 20px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-menu-link i {
    font-size: 1.2rem;
    color: #dc2626;
    width: 20px;
    text-align: center;
}

.mobile-menu-link:hover {
    background: #e5e7eb;
    color: #dc2626;
}

.mobile-logout-btn {
    margin-top: 8px;
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5;
}


/* Footer */
.footer {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #ffd700, transparent);
    border-radius: 2px;
}

.footer-section p, .footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    line-height: 1.8;
    transition: transform 0.3s ease, padding 0.3s ease;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: rgba(255,255,255,0.8) !important;
    transform: translateX(4px);
    padding-left: 4px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.contact-info p:hover {
    color: rgba(255,255,255,0.8) !important;
}

.contact-info i {
    font-size: 1.1rem;
    color: #ffd700;
    width: 20px;
    text-align: center;
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.social-links a:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(220,38,38,0.4);
    border-color: rgba(255,255,255,0.2);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    margin-top: 40px;
    position: relative;
}

.footer-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    color: #999;
}

.payment-methods {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #999;
}

.payment-icons {
    display: flex;
    gap: 8px;
}

.payment-icons i {
    font-size: 28px;
    color: rgba(255,255,255,0.6);
    transition: all 0.3s ease;
    filter: grayscale(0.5);
}

.payment-icons i:hover {
    color: rgba(255,255,255,0.9);
    filter: grayscale(0);
    transform: scale(1.1);
}

/* Responsive Design */
@media (min-width: 1025px) {
    .desktop-nav {
        display: block;
        flex: 0 0 auto;
    }
    
    .desktop-nav-links {
        gap: 4px;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .login-btn {
        display: inline-flex;
    }
    
    .header-container {
        gap: 16px;
    }
    
    .search-box {
        flex: 1;
        max-width: 400px;
        margin: 0 16px;
    }
    
    .logo {
        flex: 0 0 auto;
    }
    
    .header-actions {
        flex: 0 0 auto;
        gap: 8px;
    }
}

@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .login-btn {
        display: none;
    }
    
    .user-menu-wrapper {
        display: none !important;
    }
    
    .user-dropdown-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .search-box {
        max-width: 250px;
        margin: 0 8px;
        flex: 0 1 auto;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.4rem 0;
    }

    .header-container {
        padding: 0 15px;
        gap: 8px;
    }

    .logo {
        font-size: 0.95rem;
    }

    .logo-circle {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .search-box {
        flex: 1;
        max-width: none;
        margin: 0 8px;
        min-width: 0;
        position: relative;
    }

    .search-box input {
        font-size: 0.75rem;
        padding: 8px 36px 8px 36px;
        height: 36px;
        width: 100%;
    }
    
    .search-box::before {
        left: 10px;
        font-size: 0.9rem;
    }
    
    .search-box input::placeholder {
        font-size: 0.7rem;
        opacity: 0.8;
    }

    .search-box button {
        width: 26px;
        height: 26px;
        min-width: 26px;
        right: 3px;
    }

    .search-box button i {
        font-size: 0.75rem;
    }
    
    /* Search box focus state - expand on mobile */
    .search-box:focus-within {
        z-index: 1002;
    }
    
    .search-box:focus-within::before {
        color: #dc2626;
    }
    
    .search-box:focus-within input {
        box-shadow: 0 0 0 3px rgba(220,38,38,0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Search results responsive */
    .search-results {
        max-height: 400px;
        border-radius: 8px;
    }
    
    .search-result-item {
        padding: 10px 12px;
    }
    
    .search-result-item img {
        width: 45px;
        height: 45px;
        object-fit: contain;
        padding: 3px;
    }
    
    .search-result-item-name {
        font-size: 0.8125rem;
    }
    
    .search-result-item-meta {
        font-size: 0.7rem;
    }
    
    .search-result-item-price {
        font-size: 0.8125rem;
    }

    .cart-btn {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .menu-toggle {
        width: 32px;
        height: 32px;
    }

    .menu-toggle span {
        width: 16px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.35rem 0;
    }

    .header-container {
        padding: 0 10px;
        gap: 6px;
    }

    .logo {
        font-size: 0.85rem;
    }

    .logo-circle {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }

    .search-box {
        max-width: 120px;
        margin: 0 4px;
        flex: 0 1 auto;
        min-width: 0;
    }

    .search-box input {
        font-size: 0.65rem;
        padding: 3px 26px 3px 7px;
        height: 26px;
    }

    .search-box input::placeholder {
        font-size: 0.6rem;
        opacity: 0.6;
    }

    .search-box button {
        width: 18px;
        height: 18px;
        min-width: 18px;
        right: 2px;
    }

    .search-box button i {
        font-size: 0.65rem;
    }

    .cart-btn {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    .menu-toggle {
        width: 30px;
        height: 30px;
    }

    .menu-toggle span {
        width: 14px;
    }
}

@media (max-width: 360px) {
    .header-container {
        padding: 0 8px;
        gap: 4px;
    }
    
    .logo {
        font-size: 0.8rem;
    }
    
    .logo-circle {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    .search-box {
        flex: 1;
        max-width: none;
        margin: 0 4px;
        min-width: 0;
    }
    
    .search-box input {
        font-size: 0.65rem;
        padding: 6px 32px 6px 32px;
        height: 32px;
    }
    
    .search-box::before {
        left: 8px;
        font-size: 0.8rem;
    }
    
    .search-box input::placeholder {
        font-size: 0.6rem;
        opacity: 0.8;
    }
    
    .search-box button {
        width: 22px;
        height: 22px;
        min-width: 22px;
        right: 3px;
    }
    
    .search-box button i {
        font-size: 0.65rem;
    }
    
    .cart-btn {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
    
    .menu-toggle {
        width: 28px;
        height: 28px;
    }
}

