:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --accent: #f43f5e;
    --accent-light: #fff1f2;
    --text-main: #0c0a09;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --radius-md: 14px;
    --radius-sm: 8px;
    --shadow-subtle: 0 4px 12px rgba(15, 23, 42, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==================== E-COMMERCE HEADER ĐA TẦNG ==================== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* Tầng 1: Main Header */
.header-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.brand-name span { color: var(--primary); }

/* Thanh tìm kiếm trung tâm */
.header-search-wrap {
    flex: 1;
    max-width: 580px;
    position: relative;
}

.header-search-form {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 9999px;
    padding: 0.2rem 0.35rem 0.2rem 1rem;
    transition: all 0.2s ease;
}

.header-search-form:focus-within {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.header-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-main);
}

.header-search-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s ease;
}

.header-search-btn:hover { background: var(--primary-dark); }

/* Cụm Action Bên Phải (Hotline, Đăng nhập, Giỏ hàng) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    flex-shrink: 0;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.action-item:hover { color: var(--primary); }

.action-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #475569;
}

.action-item:hover .action-icon-box {
    background: #e0f2fe;
    color: var(--primary);
}

.action-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
}

.action-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.action-text small { font-size: 0.725rem; color: #64748b; }
.action-text strong { font-size: 0.85rem; font-weight: 600; color: #0f172a; }

/* Tầng 2: Menu điều hướng danh mục */
.header-nav {
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.75rem;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.nav-link {
    padding: 0.65rem 0;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

/* Banner Hero */
.hero {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 60%, #38bdf8 100%);
    color: #ffffff;
    padding: 2.75rem 1.25rem;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 1.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.hero p {
    font-size: 0.95rem;
    opacity: 0.92;
    max-width: 620px;
    margin: 0 auto;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.badge-pill {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Container */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.cat-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 0.55rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cat-btn:active { transform: scale(0.96); }

.cat-btn.active, .cat-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Lưới sản phẩm Responsive */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

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

.card-cover {
    height: 180px;
    background: linear-gradient(135deg, #e0f2fe 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.cover-tag {
    background: #ffffff;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-dark);
    border: 1px solid #bae6fd;
    max-width: 85%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.badge-new { background: var(--accent); color: #ffffff; }
.badge-out { background: #64748b; color: #ffffff; }

.card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.975rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #0f172a;
    line-height: 1.4;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.card-desc {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.75rem;
    margin-top: auto;
}

.price {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
}

.btn-order {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-order:hover { background: var(--primary-dark); }
.btn-order:active { transform: scale(0.96); }

.btn-order:disabled {
    background: #cbd5e1 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Tra cứu đơn */
.track-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 2.5rem;
}

.track-grid {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-md);
    max-width: 440px;
    width: 100%;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.35rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.form-group { margin-bottom: 0.85rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 16px;
    outline: none;
    background: #fff;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }

/* Cụm Widget Nút Nổi Hỗ Trợ Nhanh */
.floating-contact-widget {
    position: fixed;
    bottom: 24px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.contact-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.contact-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.zalo-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.phone-btn {
    background: #10b981;
    animation: pulsePhone 2s infinite;
}

@keyframes pulsePhone {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

footer {
    text-align: center;
    padding: 2.5rem 1rem;
    background: #0f172a;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 3.5rem;
}

/* iPad & Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container { padding: 1.5rem; }
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.15rem;
    }
    .card-cover { height: 160px; }
    .hero { padding: 2.5rem 1.5rem; }
    .hero h1 { font-size: 1.75rem; }
}

/* Smartphone & Tablet nhỏ (< 900px) */
@media (max-width: 900px) {
    .header-main {
        flex-wrap: wrap;
        padding: 0.65rem 1rem;
        gap: 0.75rem;
    }
    .header-search-wrap {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .action-text { display: none; }
    .header-actions { gap: 0.75rem; }
    .nav-container { gap: 1.25rem; }
}

/* Smartphone (< 768px) */
@media (max-width: 767px) {
    .hero { padding: 2rem 1rem 1.75rem 1rem; }
    .hero h1 { font-size: 1.4rem; line-height: 1.35; }
    .hero p { font-size: 0.875rem; }
    .container { padding: 1.25rem 0.85rem; }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .card-cover { height: 135px; }
    .card-body { padding: 0.75rem; }
    .card-title {
        font-size: 0.875rem;
        min-height: 2.6em;
        margin-bottom: 0.25rem;
    }
    .card-desc { display: none; }
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding-top: 0.6rem;
    }
    .price { font-size: 0.95rem; }
    .btn-order {
        width: 100%;
        text-align: center;
        padding: 0.55rem;
        font-size: 0.8rem;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-box {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 1.5rem 1.25rem 2rem 1.25rem;
        max-height: 85vh;
    }
    .track-section { padding: 1.15rem; }
    .floating-contact-widget { bottom: 18px; right: 14px; gap: 10px; }
    .contact-btn { width: 46px; height: 46px; }
}