/* VGTech - Common Styles */

/* CSS Variables */
:root {
    /* Tech Blue Colors - Màu xanh công nghệ */
    --primary-color: #0891b2;        /* Cyan 600 - Tech Blue */
    --primary-dark: #0e7490;         /* Cyan 700 - Deep Tech Blue */
    --primary-light: #06b6d4;        /* Cyan 500 - Bright Blue */
    --secondary-color: #0ea5e9;      /* Sky Blue 500 */
    --secondary-dark: #0284c7;       /* Sky Blue 600 */
    --accent-color: #14b8a6;         /* Teal 500 - Tech Accent */
    --accent-dark: #0d9488;          /* Teal 600 */
    
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #0ea5e9;
    
    --text-primary: #0f172a;         /* Slate 900 - Dark for contrast */
    --text-secondary: #475569;       /* Slate 600 */
    --text-light: #94a3b8;           /* Slate 400 */
    --text-white: #ffffff;
    --text-muted: #64748b;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;         /* Slate 50 - Light background */
    --bg-dark: #0f172a;              /* Slate 900 */
    --bg-card: #ffffff;
    
    --border-color: #e2e8f0;         /* Slate 200 */
    --border-light: #f1f5f9;         /* Slate 100 */
    
    /* Tech Blue Gradients */
    --gradient-primary: linear-gradient(135deg, #0891b2 0%, #0ea5e9 50%, #14b8a6 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    --gradient-dark: linear-gradient(135deg, #0e7490 0%, #0f172a 100%);
    --gradient-light: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    
    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 5rem 0;
    --card-padding: 2rem;
    
    /* Transitions - Smooth animations */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.25s ease-out;
    --transition-slow: 0.4s ease-out;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Typography - prioritize fonts có hỗ trợ tiếng Việt đầy đủ */
    --font-primary: 'Inter', 'Noto Sans', 'Poppins', 'Helvetica Neue', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', 'Poppins', 'Noto Sans', 'Helvetica Neue', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    padding-top: 0;
    transition: padding-top 0.3s ease;
}

/* Body khi header scrolled */
body.header-scrolled {
    padding-top: 56px;
}

@media (max-width: 1024px) {
    body.header-scrolled {
        padding-top: 44px;
    }
}

@media (max-width: 768px) {
    body.header-scrolled {
        padding-top: 40px;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Main Content */
.main-content {
    min-height: auto;
    position: relative;
}

/* Prevent horizontal overflow */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure all sections don't overflow */
section, .section {
    width: 100%;
    overflow-x: hidden;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    font-size: 1.125rem;
    transition: transform var(--transition-normal);
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.card-body {
    padding: 2rem;
}

.card-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-white { color: white; }

.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-white { background-color: white; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ========== HEADER STYLES ========== */

/* Main Header - 3 Tier Structure */
.main-header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
    will-change: transform, background-color, box-shadow;
    overflow: visible; /* Allow dropdowns to overflow */
}

/* Header khi scroll - chỉ hiển thị menu */
.main-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    margin: 0;
    padding: 0;
    top: 0;
    left: 0;
    right: 0;
    position: fixed;
    z-index: 1000;
    height: auto !important; /* keep same as normal */
    overflow: visible; /* allow dropdowns to overflow header when scrolled */
}

.main-header.scrolled .top-bar,
.main-header.scrolled .middle-bar {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.main-header.scrolled .bottom-bar {
    padding: 1rem 0; /* keep same padding as normal */
    border-top: none;
    margin: 0;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: auto; /* same as normal bottom bar */
    display: flex;
    align-items: center;
}

.main-header.scrolled .bottom-bar .container {
    max-width: 1200px;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: flex-start; /* keep logo at left even when scrolled */
    height: 100%;
    align-items: center;
}

.main-header.scrolled .nav-list {
    justify-content: flex-start; /* same alignment as normal */
    gap: 2rem; /* same gap as normal */
    width: 100%;
    margin: 0;
    padding: 0; /* keep same padding as normal */
    display: flex;
    align-items: center;
    list-style: none;
}

/* Keep nav link size same as normal when scrolled */
.main-header.scrolled .nav-link {
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
}

.main-header.scrolled .header-social {
    display: none;
}

/* Responsive cho header scrolled */
@media (max-width: 1024px) {
    .main-header.scrolled {
        height: 44px !important;
    }
    
    .main-header.scrolled .bottom-bar {
        height: 44px;
    }
    
    .main-header.scrolled .nav-list {
        gap: 1.5rem;
        justify-content: center;
        padding: 0.15rem 0;
    }
    
    .main-header.scrolled .nav-link {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }
    
    .main-header.scrolled .bottom-bar .container {
        padding: 0;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .main-header.scrolled {
        height: 40px !important;
    }
    
    .main-header.scrolled .bottom-bar {
        padding: 0;
        height: 40px;
    }
    
    .main-header.scrolled .nav-list {
        gap: 1rem;
        justify-content: center;
        padding: 0.1rem 0;
    }
    
    .main-header.scrolled .nav-link {
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
    }
    
    .main-header.scrolled .bottom-bar .container {
        padding: 0;
        max-width: 100%;
    }
}

/* Top Bar */
.top-bar {
    background: var(--bg-secondary);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    opacity: 1;
    visibility: visible;
    position: relative;
    z-index: 999;
    transform: translateY(0);
    transition: all 0.3s ease;
    overflow: visible; /* Allow dropdowns to overflow */
}

.top-bar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.top-bar-left {
    flex: 1;
}

.company-slogan {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.top-bar-center {
    flex: 0 0 300px;
}

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

.header-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    background: white;
    transition: all var(--transition-normal);
}

.header-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1);
}

.header-search-btn {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
}

.header-search-btn svg {
    width: 16px;
    height: 16px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.cart-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cart-link svg {
    width: 18px;
    height: 18px;
}

.cart-badge {
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.4375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
    position: relative;
    display: inline-block;
    vertical-align: text-top;
}

.cart-badge:empty {
    display: none !important;
}

.cart-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.admin-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.admin-link svg {
    width: 16px;
    height: 16px;
}

/* Middle Bar - Logo & Contact Info */
.middle-bar {
    padding: 1.5rem 0;
    background: white;
    border-bottom: 1px solid var(--border-light);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.middle-bar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: auto;
    max-height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: all var(--transition-normal);
}

.header-contact-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.contact-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.contact-icon-small {
    width: 32px;
    height: 32px;
}

.contact-icon svg {
    width: 20px;
    height: 20px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-normal);
}

.contact-value:hover {
    color: var(--primary-color);
}

/* Bottom Bar - Navigation */
.bottom-bar {
    padding: 1rem 0;
    background: white;
    position: relative;
    z-index: 999;
    overflow: visible; /* Allow dropdowns to overflow */
}

/* Ensure logo at left of menu always visible */
.bottom-bar .header-logo img {
    height: 48px;
    width: auto;
    display: block;
}
.bottom-bar .header-logo { flex: 0 0 auto; display: flex; align-items: center; }
.bottom-bar .main-nav { flex: 1 1 auto; }
/* Keep logo size same when scrolled */
.main-header.scrolled .header-logo img {
    height: 48px;
}

.main-header.scrolled .bottom-bar {
    padding: 0;
}

.bottom-bar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.main-nav {
    flex: 1;
}

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

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
}

.main-header.scrolled .nav-link {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(8, 145, 178, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Ensure navigation is horizontal */
.nav-list {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.nav-item {
    display: inline-block !important;
    margin: 0 !important;
}

.nav-link {
    display: inline-flex !important;
    white-space: nowrap !important;
}

.dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.375rem;
    vertical-align: middle;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    flex-shrink: 0;
}

.has-dropdown:hover .dropdown-icon,
.has-dropdown .nav-link:focus .dropdown-icon {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-link:hover .dropdown-icon {
    opacity: 1;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 2001; /* ensure over sticky header when scrolled */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

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

.dropdown-item {
    margin: 0;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
}

.dropdown-link:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

.header-social {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.social-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-link svg {
    width: 16px;
    height: 16px;
}

/* Mobile Header */
.mobile-header-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Mobile header divider */
.mobile-nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.5rem 0;
    border: none;
    padding: 0;
    list-style: none;
}

/* Mobile header khi scroll */
.mobile-header-bar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0.875rem 1rem;
}

.mobile-header-bar.scrolled .mobile-header-search {
    display: none;
}

.mobile-header-bar.scrolled .mobile-header-wrapper {
    justify-content: center;
}

.mobile-header-bar.scrolled .mobile-header-logo-img {
    height: 35px;
}

.mobile-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.mobile-header-logo {
    flex: 0 0 auto;
}

.mobile-header-logo-img {
    height: 50px;
    width: auto;
}

.mobile-header-search {
    flex: 1;
    max-width: 200px;
}

.mobile-header-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-header-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
}

.mobile-header-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1);
}

.mobile-header-search-btn {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
}

.mobile-header-search-btn svg {
    width: 16px;
    height: 16px;
}

.mobile-header-menu-btn {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    padding: 0.625rem;
    border-radius: 8px;
    transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.2);
    /* Đảm bảo button không bị transform khi hover hoặc open */
    transform: none;
}

.mobile-header-menu-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    /* Bỏ transform scale để không di chuyển */
}

/* Grid Icon (4 squares) */
.grid-icon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    width: 24px;
    height: 24px;
}

.grid-square {
    display: block;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: all var(--transition-normal);
    transform-origin: center;
}

/* Grid icon animation when open - chỉ thay đổi màu, giữ nguyên vị trí */
.mobile-header-menu-btn.open {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    /* Đảm bảo button không di chuyển - giữ nguyên transform translateY để căn giữa */
    /* Transform sẽ được override trong media queries với !important */
}

.mobile-header-menu-btn.open .grid-square {
    /* Chỉ thay đổi opacity và background nhẹ, không transform */
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.95);
}

/* Keep backward compatibility for hamburger lines if needed */
.hamburger-line {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    margin: 4px 0;
    transition: all var(--transition-normal);
    border-radius: 2px;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001; /* Cao hơn header (1000) */
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.mobile-nav-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    z-index: 10002; /* Cao hơn overlay */
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-nav-overlay.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: white;
}

.mobile-nav-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-nav-logo a {
    display: block;
    width: 100%;
    max-width: 200px;
}

.mobile-nav-logo-img {
    width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
    display: block;
}

.mobile-nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-close-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.mobile-close-btn:hover {
    background: var(--bg-secondary);
}

.mobile-close-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

/* Keep backward compatibility */
.mobile-nav-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-normal);
}

.mobile-nav-close:hover {
    background: var(--bg-secondary);
}

.mobile-nav-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.mobile-nav-item {
    margin: 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--border-light);
    line-height: 1.5;
    min-height: 48px; /* Ensure touch target size */
}

.mobile-nav-link:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.mobile-nav-link.active {
    background: var(--primary-color);
    color: white;
}

.mobile-dropdown {
    position: relative;
}

.mobile-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 1.5;
    min-height: 48px; /* Ensure touch target size */
}

.mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    background: var(--bg-secondary);
}

.mobile-dropdown.active .mobile-dropdown-menu {
    max-height: 500px;
}

/* Support for .mobile-dropdown-list class used in markup */
.mobile-dropdown-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    background: var(--bg-secondary);
}
.mobile-dropdown.active .mobile-dropdown-list { max-height: 500px; }

/* Rotate arrow when open */
.mobile-dropdown.active .dropdown-arrow { transform: rotate(180deg); }

/* Prevent background scroll when menu open */
body.nav-open { overflow: hidden; }

/* Cart & Login rows consistency */
.mobile-cart,
.mobile-login {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mobile-cart svg,
.mobile-login svg { flex-shrink: 0; }

/* Tweak layout for cart/login rows */
.mobile-cart { justify-content: flex-start !important; }
.mobile-cart .mobile-cart-badge {
    margin-left: auto;
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    padding: 0 10px;
    font-weight: 700;
    line-height: 20px;
}
.mobile-login { justify-content: flex-start !important; }

.mobile-dropdown-item {
    margin: 0;
}

.mobile-dropdown-link {
    display: block;
    padding: 0.75rem 1.25rem 0.75rem 2.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--border-light);
    line-height: 1.5;
    min-height: 44px; /* Ensure touch target size */
}

.mobile-dropdown-link:hover {
    background: white;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .top-bar-center {
        flex: 0 0 250px;
    }
    
    .header-contact-info {
        gap: 1.5rem;
    }
    
    .contact-group {
        gap: 0.5rem;
    }
    
    .contact-icon {
        width: 36px;
        height: 36px;
    }
    
    .contact-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 768px) {
    .top-bar,
    .middle-bar,
    .bottom-bar {
        display: none;
    }
    
    .mobile-header-bar {
        display: flex;
    }
    
    /* Hide search entirely on mobile */
    .mobile-header-search { display: none !important; }
    
    /* Mobile header bar padding */
    .mobile-header-bar {
        padding: 1rem 1rem 1rem 1rem;
    }
    
    /* Center logo, keep hamburger at right */
    .mobile-header-wrapper { 
        justify-content: center; 
        position: relative;
        min-height: 56px;
    }
    .mobile-header-menu-btn { 
        position: absolute !important; 
        right: 1rem !important; 
        top: 50% !important; 
        transform: translateY(-50%) !important;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.625rem;
    }
    
    .mobile-header-menu-btn.open {
        /* Giữ nguyên vị trí khi mở menu */
        transform: translateY(-50%) !important;
        right: 1rem !important;
        top: 50% !important;
    }
    
    .grid-icon {
        width: 24px;
        height: 24px;
        gap: 4px;
    }
    
    /* Keep backward compatibility */
    .hamburger-line {
        width: 24px;
        height: 3px;
        margin: 4px 0;
    }
    .mobile-header-logo { 
        margin: 0 auto; 
        flex: 1 1 100%; 
        display: flex; 
        justify-content: center;
        align-items: center;
    }
    .mobile-header-logo a { 
        display: block; 
        width: 100%;
        max-width: 240px;
    }
    .mobile-header-logo-img { 
        width: 100%; 
        height: auto; 
        max-height: 56px; 
        object-fit: contain;
        display: block;
    }
    
    /* Keep header look stable on scroll */
    .mobile-header-bar.scrolled { 
        background: white; 
        backdrop-filter: none; 
        box-shadow: var(--shadow-sm);
        padding: 0.875rem 1rem 0.875rem 1rem;
    }
    .mobile-header-bar.scrolled .mobile-header-wrapper { 
        justify-content: center;
        min-height: 48px;
    }
    .mobile-header-bar.scrolled .mobile-header-logo-img {
        max-height: 48px;
    }
    
    /* Drawer chỉ chiếm nửa màn hình trên mobile */
    .mobile-nav-content { 
        width: 50vw; 
        max-width: none; 
        height: 100%; 
    }
    
    /* Mobile nav header */
    .mobile-nav-header {
        padding: 1rem 3rem 1rem 1rem;
    }
    
    .mobile-nav-logo-img {
        max-height: 44px;
    }
    
    .mobile-close-btn {
        right: 0.75rem;
        width: 36px;
        height: 36px;
    }
    
    /* Menu items spacing */
    .mobile-nav-link,
    .mobile-dropdown-toggle {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
    
    .mobile-dropdown-link {
        padding: 0.75rem 1rem 0.75rem 2rem;
        font-size: 0.875rem;
    }
    
    .mobile-nav-list {
        padding: 0.25rem 0;
    }
}

@media (max-width: 480px) {
    .mobile-header-wrapper {
        gap: 0.5rem;
    }
    
    .mobile-header-logo-img { 
        width: 100%; 
        height: auto; 
        max-height: 48px; 
        object-fit: contain; 
    }
    
    .mobile-header-menu-btn {
        right: 1rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 44px;
        height: 44px;
        padding: 0.625rem;
    }
    
    .mobile-header-menu-btn.open {
        /* Giữ nguyên vị trí khi mở menu */
        transform: translateY(-50%) !important;
        right: 1rem !important;
        top: 50% !important;
    }
    
    .mobile-header-search {
        max-width: 120px;
    }
    
    .mobile-header-search-input {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem 0.375rem 2rem;
    }
    
    .mobile-header-search-btn {
        left: 0.5rem;
    }
    
    .mobile-header-search-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .grid-icon {
        width: 22px;
        height: 22px;
        gap: 3px;
    }
    
    .grid-square {
        border-radius: 2px;
    }
    
    /* Keep backward compatibility */
    .hamburger-line {
        width: 22px;
        height: 3px;
        margin: 3.5px 0;
    }
    
    /* Mobile nav adjustments for very small screens */
    .mobile-nav-header {
        padding: 0.875rem 2.75rem 0.875rem 0.875rem;
    }
    
    .mobile-nav-logo-img {
        max-height: 40px;
    }
    
    .mobile-close-btn {
        right: 0.625rem;
        width: 32px;
        height: 32px;
        padding: 0.375rem;
    }
    
    .mobile-nav-link,
    .mobile-dropdown-toggle {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
    }
    
    .mobile-dropdown-link {
        padding: 0.625rem 0.875rem 0.625rem 1.75rem;
        font-size: 0.8125rem;
    }
}

/* ========== WELCOME MODAL ========== */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

.welcome-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.welcome-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(0, 0, 0, 0.05),
                0 20px 40px rgba(8, 145, 178, 0.15);
    max-width: 480px;
    width: 100%;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.welcome-modal-overlay.active .welcome-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.welcome-modal-content {
    padding: 3rem 2.5rem;
    text-align: center;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: welcomeIconBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3),
                0 0 0 4px rgba(16, 185, 129, 0.1);
    position: relative;
}

.welcome-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.3));
    animation: welcomeIconPulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes welcomeIconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) rotate(5deg);
    }
    75% {
        transform: scale(0.95) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes welcomeIconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.welcome-icon svg {
    width: 50px;
    height: 50px;
}

.welcome-title {
    font-size: 1.875rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.welcome-message {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-weight: 500;
}

.welcome-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.3),
                0 2px 8px rgba(8, 145, 178, 0.2);
    position: relative;
    overflow: hidden;
}

.welcome-close-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.welcome-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(8, 145, 178, 0.4),
                0 4px 12px rgba(8, 145, 178, 0.3);
}

.welcome-close-btn:hover::before {
    width: 300px;
    height: 300px;
}

.welcome-close-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

.welcome-close-btn span {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .welcome-modal {
        max-width: 90%;
        border-radius: 20px;
    }
    
    .welcome-modal-content {
        padding: 2.5rem 2rem;
    }
    
    .welcome-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 1.25rem;
    }
    
    .welcome-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .welcome-message {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .welcome-close-btn {
        padding: 0.75rem 1.75rem;
        font-size: 0.9375rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .welcome-modal-content {
        padding: 2rem 1.5rem;
    }
    
    .welcome-icon {
        width: 70px;
        height: 70px;
    }
    
    .welcome-icon svg {
        width: 35px;
        height: 35px;
    }
    
    .welcome-title {
        font-size: 1.375rem;
    }
    
    .welcome-message {
        font-size: 0.9375rem;
    }
}

/* ========== FOOTER STYLES ========== */

.main-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: var(--text-white);
    padding: 3rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}

.footer-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.footer-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.footer-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(8, 145, 178, 0.08);
    animation: footerFloat 12s ease-in-out infinite;
}

.footer-shape-1 {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 8%;
    animation-delay: 0s;
}

.footer-shape-2 {
    width: 180px;
    height: 180px;
    top: 55%;
    right: 10%;
    animation-delay: 4s;
}

.footer-shape-3 {
    width: 90px;
    height: 90px;
    bottom: 25%;
    left: 25%;
    animation-delay: 8s;
}

@keyframes footerFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.08;
    }
    33% {
        transform: translateY(-15px) rotate(120deg) scale(1.1);
        opacity: 0.15;
    }
    66% {
        transform: translateY(10px) rotate(240deg) scale(0.9);
        opacity: 0.12;
    }
}

.footer-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
    align-items: start;
    width: 100%;
}

.footer-main {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
}

.footer-brand {
    margin-bottom: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0891b2 0%, #0ea5e9 50%, #14b8a6 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.25);
    position: relative;
}

.footer-logo-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.3), rgba(20, 184, 166, 0.3));
    border-radius: 20px;
    z-index: -1;
    filter: blur(8px);
}

.logo-symbol {
    color: white;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.footer-logo-text {
    flex: 1;
}

.footer-logo-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.footer-logo-subtitle {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.footer-description {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    max-width: 90%;
}

.footer-social {
    display: flex;
    gap: 0.625rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.social-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.3);
}

.social-link:hover::before {
    opacity: 1;
}

.social-icon {
    font-size: 1.125rem;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
}

.social-link:hover .social-icon {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.footer-links {
    display: contents;
}

.footer-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
}

.footer-col-title {
    color: white;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    padding-bottom: 0.625rem;
}

.footer-col-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

.col-icon {
    font-size: 1rem;
    opacity: 0.9;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-list li {
    margin: 0;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 400;
    position: relative;
    padding-left: 0.875rem;
}

.footer-link::before {
    content: '→';
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition-normal);
    color: var(--primary-light);
    font-weight: 600;
    position: absolute;
    left: 0;
}

.footer-link:hover {
    color: var(--primary-light);
    background: rgba(8, 145, 178, 0.08);
    transform: translateX(8px);
    padding-left: 1.5rem;
}

.footer-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Footer Contact */
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(8, 145, 178, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.contact-item:hover::before {
    transform: scaleY(1);
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.25);
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.125rem;
}

.contact-value {
    font-size: 0.875rem;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-normal);
    line-height: 1.4;
}

.contact-value:hover {
    color: var(--primary-light);
}

/* Newsletter Section */
.footer-newsletter {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.footer-newsletter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.newsletter-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsletter-title {
    color: white;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.newsletter-icon {
    font-size: 1.125rem;
    color: var(--primary-light);
}

.newsletter-description {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all var(--transition-normal);
}

.form-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
    background: rgba(255, 255, 255, 0.1);
}

.newsletter-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: 8px;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.25);
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.35);
}

.btn-icon {
    font-size: 1rem;
    transition: transform var(--transition-normal);
}

.newsletter-btn:hover .btn-icon {
    transform: translateX(3px);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.footer-bottom-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    text-align: center;
}

/* Desktop: center the footer bottom content as a group */
@media (min-width: 1024px) {
    .footer-bottom-content {
        justify-content: center;
        text-align: center;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    .footer-bottom-links {
        justify-content: center;
    }
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bottom-link {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-normal);
    font-weight: 400;
}

.bottom-link:hover {
    color: var(--primary-light);
}

.separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.875rem;
}

.copyright {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9375rem;
    font-weight: 400;
}

.copyright p {
    margin: 0;
    line-height: 1.6;
}

.copyright strong {
    color: white;
    font-weight: 600;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 1000;
    box-shadow: 0 6px 25px rgba(8, 145, 178, 0.3);
}

/* Floating Action Buttons */
.floating-actions {
    position: fixed;
    right: 1rem;
    bottom: 6.25rem; /* nằm trên nút back-to-top */
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 1101; /* cao hơn back-to-top (1000) */
    pointer-events: none; /* container không bắt sự kiện để dễ click từng nút */
}

.fab-btn {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    position: relative;
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
    border: 1px solid rgba(255,255,255,0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    --ring: rgba(14,165,233,0.55);
    animation: fabWobble 2.8s ease-in-out infinite;
}

.fab-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 28px rgba(0,0,0,0.22); }

/* Modern premium gradients */
.fab-phone { background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 50%, #14b8a6 100%); --ring: rgba(45,212,191,0.55); }
.fab-zalo { background: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%); --ring: rgba(99,102,241,0.5); }
.fab-location { background: linear-gradient(135deg, #f43f5e 0%, #f97316 50%, #f59e0b 100%); --ring: rgba(244,63,94,0.5); }

/* Ring blink glow */
.fab-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    box-shadow: 0 0 0 0 var(--ring);
    animation: fabRing 2.2s ease-out infinite;
}

/* Glowing pulse effect */
.floating-actions .fab-glow {
    position: absolute;
    right: 0.35rem;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.55;
    pointer-events: none;
    animation: fabPulse 2.4s ease-in-out infinite;
}
.floating-actions .fab-glow:nth-of-type(1) { bottom: calc(6.25rem + 0px); background: radial-gradient(circle, rgba(34,197,94,0.6), transparent 60%); animation-delay: 0s; }
.floating-actions .fab-glow:nth-of-type(2) { bottom: calc(6.25rem + 52px + 0.6rem); background: radial-gradient(circle, rgba(59,130,246,0.6), transparent 60%); animation-delay: .2s; }
.floating-actions .fab-glow:nth-of-type(3) { bottom: calc(6.25rem + (52px + 0.6rem)*2); background: radial-gradient(circle, rgba(249,115,22,0.6), transparent 60%); animation-delay: .4s; }

@keyframes fabPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.45; }
    50% { transform: scale(1.08); opacity: 0.75; }
}

/* Wobble animation for buttons */
@keyframes fabWobble {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(6deg); }
    30% { transform: rotate(-6deg); }
    45% { transform: rotate(4deg); }
    60% { transform: rotate(-4deg); }
    75% { transform: rotate(2deg); }
    100% { transform: rotate(0deg); }
}

/* Expanding ring blink */
@keyframes fabRing {
    0% { box-shadow: 0 0 0 0 var(--ring); opacity: 1; }
    70% { box-shadow: 0 0 0 14px rgba(0,0,0,0); opacity: .35; }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fab-btn, .floating-actions .fab-glow { animation: none !important; }
}

@media (max-width: 768px) {
    .floating-actions { right: 0.75rem; bottom: 5.75rem; gap: 0.5rem; }
    .fab-btn { width: 48px; height: 48px; }
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 35px rgba(8, 145, 178, 0.4);
}

.back-to-top-icon {
    font-size: 1.375rem;
    font-weight: 700;
}

/* Footer Responsive - UPDATED FOR MOBILE */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    
    .footer-main {
        grid-column: 1 / -1;
        margin-bottom: 1.5rem;
    }
    
    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
        align-items: stretch;
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .main-footer {
        padding: 3rem 0 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr; /* 2 cột đều trên mobile */
        gap: 1.5rem;
        align-items: start;
    }
    
    .footer-main {
        text-align: center;
        margin-bottom: 1.5rem;
        grid-column: 1 / -1; /* logo chiếm full hàng */
    }

    /* Cho phép các cột co giãn đều nhau, không bị tràn nội dung */
    .footer-main,
    .footer-col { min-width: 0; }
    .footer-col .visit-stats { width: 100%; }
    
    .footer-logo {
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .footer-description {
        max-width: 100%;
        margin-bottom: 1.5rem;
        font-size: 0.9375rem;
    }
    
    .footer-social {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .footer-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
        align-items: start;
    }
    
    /* Lĩnh vực: 2 cột gọn gàng trên mobile */
    .footer-col .footer-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem 1rem;
    }
    .footer-col .footer-list li a.footer-link {
        display: block;
        padding: 0.25rem 0;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .footer-col-title {
        font-size: 1.0625rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-newsletter {
        padding: 2rem;
        margin-top: 2rem;
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .newsletter-title {
        font-size: 1.25rem;
    }
    
    .form-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .newsletter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-bottom-links {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .main-footer {
        padding: 2.5rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr; /* 1 cột ở màn nhỏ */
        gap: 1.25rem;
    }
    
    .footer-main {
        margin-bottom: 1.5rem;
    }
    
    .footer-logo-icon {
        width: 55px;
        height: 55px;
        font-size: 1.75rem;
    }
    
    .footer-logo-title {
        font-size: 1.5rem;
    }
    
    .footer-logo-subtitle {
        font-size: 0.875rem;
    }
    
    .footer-description {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .footer-social {
        gap: 0.5rem;
    }
    
    .social-link {
        width: 42px;
        height: 42px;
    }
    
    .social-icon {
        font-size: 1.125rem;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    /* Lĩnh vực: vẫn 2 cột nếu đủ chỗ trên màn rất nhỏ */
    .footer-col .footer-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem 0.75rem;
    }
    .footer-col .footer-list li a.footer-link {
        font-size: 0.875rem;
    }
    
    .footer-col-title {
        font-size: 1rem;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }
    
    .footer-list {
        gap: 0.5rem;
    }
    
    .footer-link {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }
    
    .contact-item {
        padding: 0.875rem;
        gap: 0.75rem;
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .contact-label {
        font-size: 0.75rem;
    }
    
    .contact-value {
        font-size: 0.8125rem;
    }
    
    .footer-newsletter {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .newsletter-title {
        font-size: 1.125rem;
        gap: 0.5rem;
    }
    
    .newsletter-description {
        font-size: 0.875rem;
    }
    
    .newsletter-input {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }
    
    .newsletter-btn {
        font-size: 0.875rem;
        padding: 0.75rem 1.25rem;
    }
    
    .footer-bottom-links {
        flex-direction: row;
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: nowrap;
    }
    
    .separator {
        display: none;
    }
    
    .bottom-link {
        font-size: 0.8125rem;
    }
    
    .copyright {
        font-size: 0.8125rem;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .back-to-top-icon {
        font-size: 1.125rem;
    }
}

/* ========== LOADING SCREEN ========== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 50%, #155e75 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    overflow: hidden;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.loading-logo {
    margin-bottom: 2rem;
    animation: fadeInDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loading-logo .gradient-text {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.95) 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 2s ease infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    position: relative;
}

.loading-logo .gradient-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
    position: relative;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid white;
    border-right: 4px solid rgba(255, 255, 255, 0.7);
    border-bottom: 4px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: spin 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4),
                0 0 50px rgba(255, 255, 255, 0.2),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.5);
    animation: spin 1s linear infinite reverse;
    opacity: 0.6;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes spin {
    0% { 
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.05);
    }
    100% { 
        transform: rotate(360deg) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading Progress Bar (Optional enhancement) */
.loading-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
    overflow: hidden;
}

.loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: progressMove 1.5s ease-in-out infinite;
}

@keyframes progressMove {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Visit Statistics Styles */
.visit-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0.5rem 0;
    flex-wrap: nowrap; /* desktop: giữ 1 hàng ngang */
}

/* Ensure stats in footer column render in a single row on desktop */
.footer-content .visit-stats {
    flex-direction: column; /* Desktop: 1 cột dọc */
    align-items: flex-start;
    gap: 0.75rem;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap; /* tránh rớt chữ xuống dòng trong mỗi item */
}

.stats-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.stats-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

.stats-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.stats-value {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Visit Stats */
@media (max-width: 768px) {
    .visit-stats,
    .footer-content .visit-stats {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
        flex-wrap: wrap; /* cho phép chia 2 hàng */
    }
    
    .stats-item {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
        flex: 1 1 calc(50% - 0.5rem); /* 2 item mỗi hàng */
        justify-content: space-between;
    }
    
    .stats-label {
        font-size: 0.7rem;
    }
    
    .stats-value {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .visit-stats,
    .footer-content .visit-stats {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
        flex-wrap: wrap; /* 2 hàng trên màn rất nhỏ */
    }
    
    .stats-item {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: space-between;
    }
}

/* ========== PROGRESS BAR ========== */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-color);
    z-index: 10001;
    transition: width 0.3s ease;
}

/* ========== USER MENU ========== */
.user-menu-wrapper {
    position: relative;
    z-index: 10003;
    isolation: isolate;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.user-menu-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-menu-toggle svg {
    width: 16px;
    height: 16px;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    min-width: 320px;
    background: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
    z-index: 99999 !important;
    overflow: hidden;
    isolation: isolate;
    will-change: opacity, transform, visibility;
    pointer-events: none;
    transform-style: preserve-3d;
}

/* Khi dropdown được append vào body (position: fixed) */
body > .user-menu-dropdown,
.user-menu-dropdown[style*="position: fixed"] {
    position: fixed !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
}

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

.user-menu-header {
    padding: 1.25rem;
    background: var(--gradient-primary);
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.user-menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

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

.user-menu-name {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
    white-space: nowrap;
    min-width: 0;
}

.user-menu-item span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.user-menu-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.user-menu-item:hover svg {
    color: var(--primary-color);
}

.user-menu-logout {
    color: var(--error-color);
}

.user-menu-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.user-menu-logout svg {
    color: var(--error-color);
}

@media (max-width: 768px) {
    .user-menu-dropdown {
        width: 280px;
        min-width: 280px;
        right: -8px;
    }
    
    .user-name {
        display: none;
    }
}