/* ==========================================================================
   TRUNG TÂM THỜI TRANG AN NHƠN (Since 1980) - Mobile Optimized Stylesheet
   Website: thoitrang-annhon.com
   Màu chủ đạo: Xanh Đậm (#004b93) + Trắng + Đỏ Nổi Bật (#d90429) + Zalo Blue (#0068ff)
   ========================================================================== */

:root {
    --primary-color: #004b93;
    --primary-dark: #003366;
    --primary-light: #eef5fc;
    --secondary-color: #d90429;
    --zalo-color: #0068ff;
    --zalo-hover: #0052cc;
    --text-color: #2b2b2b;
    --text-muted: #6c757d;
    --bg-light: #f4f6f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

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

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

/* ==========================================================================
   1. TOP BAR
   ========================================================================== */
.top-bar {
    background-color: var(--primary-dark);
    color: #ffffff;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.top-bar-item i {
    color: #ffd166;
}

.hotline-link {
    font-weight: 700;
    color: #ffd166;
}

/* ==========================================================================
   2. MAIN HEADER (Flexbox Mobile Optimized)
   ========================================================================== */
.main-header {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 15px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-logo img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.brand-text-box {
    display: flex;
    flex-direction: column;
}

.brand-text-box h1 {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.1;
}

.brand-text-box .sub-title {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

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

.search-input-group {
    display: flex;
    align-items: center;
    background: #f0f4f9;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 3px 6px 3px 14px;
}

.search-input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    outline: none;
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-zalo-header {
    background: var(--zalo-color);
    color: white;
    padding: 7px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 104, 255, 0.25);
}

.cart-icon-btn {
    position: relative;
    background: var(--primary-light);
    color: var(--primary-color);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--secondary-color);
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Nav Menu Bar */
.nav-menu-bar {
    background: var(--primary-color);
}

.nav-list {
    display: flex;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-item a {
    display: block;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
}

.nav-item.active a {
    background: rgba(255, 255, 255, 0.15);
    border-bottom-color: #ffd166;
}

.nav-item.sale-item a {
    color: #ffea00;
}

/* ==========================================================================
   3. HERO BANNER
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, #003666 0%, #004b93 100%);
    color: white;
    padding: 30px 0;
    position: relative;
}

.hero-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 30px;
}

.hero-text-box h2 {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.hero-text-box h2 span {
    color: #ffd166;
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
}

.hero-text-box p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-hero-zalo {
    background: var(--zalo-color);
    color: white;
    padding: 12px 22px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 104, 255, 0.4);
}

.btn-hero-outline {
    border: 2px solid white;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-image-box {
    position: relative;
    text-align: center;
}

.hero-image-box img {
    max-height: 320px;
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.hero-badge-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--secondary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 11px;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   4. FEATURES BAR
   ========================================================================== */
.features-section {
    background: #ffffff;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.feature-info h4 {
    font-size: 13px;
    font-weight: 700;
}

.feature-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   5. PRODUCTS GRID
   ========================================================================== */
.products-section {
    padding: 30px 0 50px;
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
}

.category-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    margin-bottom: 25px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

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

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.product-thumb {
    position: relative;
    padding-top: 130%;
    overflow: hidden;
    background: #f8f9fa;
}

.product-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--secondary-color);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.cat-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 51, 102, 0.85);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.product-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 34px;
}

.product-price-box {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.current-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--secondary-color);
}

.old-price {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card-actions {
    margin-top: auto;
    display: flex;
    gap: 6px;
}

.btn-zalo-buy {
    flex: 1;
    background: var(--zalo-color);
    color: white;
    border: none;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-quick-view {
    background: var(--primary-light);
    color: var(--primary-color);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==========================================================================
   6. SHOWROOM & FOOTER
   ========================================================================== */
.showroom-section {
    background: #ffffff;
    padding: 35px 0;
    border-top: 1px solid var(--border-color);
}

.showroom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.showroom-image-box img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.showroom-info-box h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.since-tag {
    display: inline-block;
    background: #ffd166;
    color: #222;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 11px;
    margin-bottom: 12px;
}

.info-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.footer {
    background: var(--primary-dark);
    color: #e2e8f0;
    padding-top: 40px;
    font-size: 13px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1fr;
    gap: 25px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
}

.copyright-bar {
    padding: 15px 0;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

/* Floating Widgets */
.floating-widgets {
    position: fixed;
    bottom: 20px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.float-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.float-zalo { background: var(--zalo-color); }
.float-phone { background: var(--secondary-color); }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    padding: 15px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f1f5f9;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

.modal-product-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 15px;
}

.size-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.size-btn {
    border: 1px solid var(--border-color);
    background: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

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

/* ==========================================================================
   📱 RESPONSIVE BREAKPOINTS (SPECIFIC MOBILE FIXES)
   ========================================================================== */
@media (max-width: 992px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .top-bar { display: none; } /* Hide topbar on mobile to save vertical space */
    
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 8px 0;
    }

    .brand-logo img { height: 38px; }

    .brand-text-box h1 {
        font-size: 14px;
        white-space: nowrap;
    }

    .brand-text-box .sub-title {
        font-size: 9px;
        white-space: nowrap;
    }

    /* Move search bar to full width below header on mobile */
    .header-search {
        order: 3;
        flex: 100%;
        max-width: 100%;
        margin-top: 2px;
    }

    .search-input-group {
        padding: 2px 4px 2px 12px;
    }

    .btn-zalo-header span {
        display: none; /* Hide text, keep Zalo icon on mobile */
    }

    .btn-zalo-header {
        padding: 8px;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .hero-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .hero-text-box h2 {
        font-size: 22px;
    }

    .hero-text-box h2 span {
        font-size: 16px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .btn-hero-zalo, .btn-hero-outline {
        width: 100%;
        justify-content: center;
    }

    .showroom-grid {
        grid-template-columns: 1fr;
    }

    .modal-product-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container { padding: 0 10px; }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-details {
        padding: 8px;
    }

    .product-title {
        font-size: 12px;
        height: 32px;
    }

    .current-price {
        font-size: 13px;
    }

    .old-price {
        font-size: 10px;
    }

    .btn-zalo-buy {
        font-size: 10px;
        padding: 6px 4px;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
