/* Basic Resets & Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-color: #333;
    --light-text-color: #f8f9fa;
    --border-color: #dee2e6;
    --font-family-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-family-serif: 'Georgia', serif;
    --container-width: 1200px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: var(--light-text-color);
    text-decoration: none;
}

.btn-secondary {
    color: #fff;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #fff;
    text-decoration: none;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus, textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Header Styles */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-bar {
    background-color: var(--dark-bg);
    color: var(--light-text-color);
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.welcome-message {
    margin: 0;
    padding: 5px 0;
}

.top-nav ul {
    display: flex;
    gap: 15px;
}

.top-nav a {
    color: var(--light-text-color);
    padding: 5px 0;
    display: block;
}

.top-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.language-selector {
    position: relative;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--dark-bg);
    min-width: 120px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: none;
    z-index: 10;
}

.language-selector:hover .language-dropdown {
    display: block;
}

.language-dropdown li a {
    padding: 8px 15px;
    white-space: nowrap;
}

.flag-icon {
    width: 20px;
    height: 15px;
    background-size: cover;
    background-position: center;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid rgba(255,255,255,0.2);
}
.flag-icon-vn { background-image: url('https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/vn.svg'); }
.flag-icon-us { background-image: url('https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/us.svg'); }
.flag-icon-cn { background-image: url('https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/cn.svg'); }
.flag-icon-th { background-image: url('https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/flags/4x3/th.svg'); }


.header-main-nav {
    padding: 15px 0;
}

.main-nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-link:hover {
    text-decoration: none;
}

.site-logo {
    height: 40px;
    width: auto;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.primary-navigation ul {
    display: flex;
    gap: 25px;
}

.primary-navigation a {
    display: block;
    padding: 10px 0;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.primary-navigation a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.primary-navigation .menu-item-has-children {
    position: relative;
}

.primary-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 10;
    border-top: 3px solid var(--primary-color);
    padding: 10px 0;
}

.primary-navigation .sub-menu li a {
    padding: 8px 20px;
    white-space: nowrap;
}

.primary-navigation .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.primary-navigation .sub-menu .menu-item-has-children > a i {
    float: right;
    margin-top: 5px;
}

.primary-navigation .sub-menu .sub-menu {
    left: 100%;
    top: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.search-form input {
    border: none;
    padding: 8px 15px;
    min-width: 150px;
    background-color: transparent;
}

.search-form input:focus {
    box-shadow: none;
}

.search-form button {
    background-color: var(--primary-color);
    border: none;
    color: #fff;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #0056b3;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon {
    font-size: 1.3rem;
    position: relative;
    color: var(--text-color);
}

.cart-count {
    background-color: var(--accent-color);
    color: #fff;
    font-size: 0.75rem;
    border-radius: 50%;
    padding: 2px 6px;
    position: absolute;
    top: -8px;
    right: -8px;
    line-height: 1;
}

.login-button, .register-button {
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 500;
}

.login-button {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.login-button:hover {
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

.register-button {
    background-color: var(--primary-color);
    color: #fff;
}

.register-button:hover {
    background-color: #0056b3;
    color: #fff;
    text-decoration: none;
}

.header-banner-area {
    background-color: var(--accent-color);
    color: #fff;
    padding: 10px 0;
    text-align: center;
}

.promo-banner a {
    color: #fff;
    font-weight: 500;
    display: block;
}

.promo-banner a:hover {
    text-decoration: underline;
}

.cta-text {
    font-weight: 700;
    margin-left: 10px;
}

/* Footer Styles */
.site-footer {
    background-color: var(--dark-bg);
    color: var(--light-text-color);
    padding: 50px 0 20px;
    font-size: 0.9rem;
}

.footer-widgets {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-widget {
    flex: 1;
    min-width: 220px;
}

.footer-widget .widget-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget .widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer-widget p {
    margin-bottom: 15px;
}

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

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget ul li a {
    color: var(--light-text-color);
    display: block;
}

.footer-widget ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-widget .social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.footer-widget .social-links a {
    color: var(--light-text-color);
    font-size: 1.3rem;
    width: 35px;
    height: 35px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-widget .social-links a:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.footer-widget .newsletter-form {
    display: flex;
    margin-top: 15px;
}

.footer-widget .newsletter-form input {
    flex-grow: 1;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    background-color: #fff;
    color: var(--text-color);
}

.footer-widget .newsletter-form button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.footer-widget .newsletter-form button:hover {
    background-color: #0056b3;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.copyright {
    margin: 0;
}

.payment-methods {
    display: flex;
    gap: 10px;
}

.payment-methods img {
    height: 25px;
    width: auto;
    filter: grayscale(100%) brightness(180%); /* Make them visible on dark background */
}


/* Responsive Design */
@media (max-width: 992px) {
    .primary-navigation {
        order: 3;
        flex-basis: 100%;
        margin-top: 15px;
    }
    .primary-navigation ul {
        flex-direction: column;
        display: none; /* Hidden by default for mobile */
        width: 100%;
        background-color: #fff;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border-color);
        padding: 10px 0;
    }
    .primary-navigation ul.active {
        display: flex;
    }
    .primary-navigation li {
        border-bottom: 1px solid #eee;
    }
    .primary-navigation li:last-child {
        border-bottom: none;
    }
    .primary-navigation a {
        padding: 12px 20px;
    }
    .menu-toggle {
        display: block;
        order: 2;
        margin-left: auto;
    }
    .site-branding {
        order: 1;
    }
    .header-actions {
        order: 2;
        margin-left: auto; /* Push to right */
        gap: 10px;
    }
    .search-box {
        display: none; /* Hide search box on smaller screens, can be a toggle */
    }
    .user-area {
        gap: 10px;
    }
    .login-button, .register-button {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .footer-widgets {
        flex-direction: column;
        align-items: center;
    }
    .footer-widget {
        width: 100%;
        max-width: 400px;
        text-align: center;
    }
    .footer-widget .widget-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .footer-widget .social-links {
        justify-content: center;
    }
    .footer-widget .newsletter-form {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    .top-nav ul {
        margin-top: 10px;
        justify-content: center;
    }
    .main-nav-wrapper {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    .site-branding, .header-actions, .primary-navigation {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .site-branding {
        margin-bottom: 15px;
    }
    .header-actions {
        margin-left: 0;
        justify-content: center;
    }
    .search-box {
        display: flex; /* Show it back but centered */
        width: 100%;
        max-width: 300px;
    }
    .search-form {
        width: 100%;
    }
    .menu-toggle {
        order: initial;
        margin-left: initial;
        width: 100%;
        text-align: center;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        padding: 10px 0;
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .promo-banner p {
        font-size: 0.9rem;
    }
    .promo-banner .cta-text {
        display: block;
        margin-top: 5px;
    }
    .footer-widget .newsletter-form {
        flex-direction: column;
    }
    .footer-widget .newsletter-form input,
    .footer-widget .newsletter-form button {
        border-radius: 4px;
        width: 100%;
        margin-bottom: 10px;
    }
    .footer-widget .newsletter-form button {
        margin-bottom: 0;
    }
}

/* FontAwesome Icons */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
