/* --- 1. RESET & NỀN TẢNG --- */
:root {
    --primary: #e91e63; /* Hồng chuyên nghiệp */
    --primary-bg: #fce4ec;
    --text-main: #2d3436;
    --text-sub: #636e72;
    --white: #ffffff;
    --shadow: 0 4px 10px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: #fffcfd;
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* --- 2. HEADER & SEARCH (FIX CỨNG MOBILE) --- */
.main-header {
    background: var(--white);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 15px;
}



/* 1. Xử lý Logo bám sát nhưng vẫn linh hoạt */
.logo {
    display: flex;
    flex-wrap: wrap; /* Cho phép xuống dòng khi hết chỗ */
    gap: 5px;       /* Khoảng cách giữa "MUA SẮM" và "THÔNG MINH" cực nhỏ cho tự nhiên */
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    text-decoration: none;
}

/* 2. Đẩy Search sang phải tuyệt đối */
.header-top {
    display: flex;
    justify-content: flex-start; /* Để các phần tử bám lề trái trước */
    align-items: center;
    width: 100%;
}

/* --- TỐI ƯU Ô SEARCH CO GIÃN THEO MÀN HÌNH --- */
#search {
    margin-left: auto; /* Đẩy hẳn sang phải */
    width: 100%;       /* Cho phép chiếm hết không gian khả dụng */
    max-width: 300px;  /* Mặc định trên mobile chỉ rộng tối đa 300px để không đè logo */
    min-width: 180px;
}

/* Khi màn hình lớn hơn (Desktop/Tablet ngang) */
@media (min-width: 1024px) {
    #search {
        max-width: 800px; /* Trên máy tính sẽ bung rộng ra gấp đôi cho dễ nhìn */
    }
}


/* --- FOOTER TỐI ƯU MOBILE --- */
.main-footer {
    text-align: center;
    padding: 20px 10px;
    border-top: 1px solid #eee;
    margin-top: 40px;
    color: #666;
    font-weight: bold;
    font-size: 0.9rem; /* Kích thước chuẩn Desktop */
    width: 100%;
}

@media (max-width: 480px) {
    .main-footer {
        font-size: 0.7rem; /* Thu nhỏ chữ trên điện thoại */
        padding: 15px 5px;
        letter-spacing: 0.3px;
    }
}


/* Menu danh mục cuộn ngang mượt mà */
.nav-menu {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0 5px;
    -webkit-overflow-scrolling: touch;
}
.nav-menu::-webkit-scrollbar { display: none; }
.nav-menu a {
    text-decoration: none;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* --- 3. TRANG CHỦ (DẠNG 1 CỘT - ẢNH TRÊN TIÊU ĐỀ DƯỚI) --- */
.container {
    max-width: 600px; /* Bóp gọn để ảnh hiển thị đẹp nhất trên mobile */
    margin: 0 auto;
    padding: 15px;
}

.cat-section {
    margin-bottom: 30px;
}

.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-bg);
    margin-bottom: 12px;
}

.cat-title {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    font-size: 0.85rem;
    border-radius: 4px 4px 0 0;
    text-transform: uppercase;
}

.view-all {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

/* Cấu trúc bài viết: Ảnh to đùng ở trên, Tiêu đề ở dưới */
.post-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.post-card {
    display: block;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9; /* Tỷ lệ ảnh chuẩn Shopee/Lazada */
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
}

.post-card h3 {
    padding: 12px 15px;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
    font-weight: 700;
}

/* --- 4. TRANG BÀI VIẾT CHI TIẾT (SINGLE PAGE) --- */
.article-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 15px;
}

.article-title {
    font-size: 1.5rem;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 10px;
}

.article-meta {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Box Quà tặng/Celeb */
.voucher-box, .celeb-items-box {
    background: var(--primary-bg);
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
}

.voucher-code {
    background: white;
    border: 2px dashed var(--primary);
    padding: 8px 15px;
    font-weight: 800;
    color: var(--primary);
    display: inline-block;
    margin: 10px 0;
    font-size: 1.2rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
}
/* Logo xuống dòng trên mobile */
.mobile-br { display: none; }
@media (max-width: 480px) {
    .mobile-br { display: block; }
    .logo { font-size: 1rem; line-height: 1.1; }
}

/* Đẩy search sang phải */
.search-wrapper {
    margin-left: auto; 
    width: 60%;
}

/* CSS cho Hero Slider 5 bài */
.hero-slider {
    margin-bottom: 30px;
    overflow: hidden;
}
.slider-container {
    display: flex;
    overflow-x: auto;
    snap-type: x mandatory;
    scrollbar-width: none;
}
.slider-container::-webkit-scrollbar { display: none; }
.slider-item {
    flex: 0 0 100%;
    snap-align: start;
    position: relative;
    text-decoration: none;
    color: white;
}
.slider-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
    /* Khoảng cách này giúp dừng lại đúng trên tên Category */
}
/* Chỉ đổi màu riêng cho chữ MỚI NHẤT ở Hero */
.badge-hero {
    background-color: var(--primary) !important;
    /* Màu hồng Rose Gold #e91e63 */
    color: #ffffff !important;
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 3px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 5px;
}

/* Các badge khác (nếu có) sẽ không bị ảnh hưởng */
.badge {
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 3px;
}

/* CSS cho lớp phủ mờ Affiliate Wall */
.article-body.blur-active {
    mask-image: linear-gradient(to bottom, black 15%, transparent 95%);
    -webkit-mask-image: linear-gradient(to bottom, black 15%, transparent 95%);
    pointer-events: none; /* Khóa chết toàn bộ sự kiện click/bôi đen văn bản trong vùng mờ */
    user-select: none;
}

.aff-wall-overlay {
    width: 100%;
    margin-top: -150px;
    padding-bottom: 50px;
    position: relative;
    z-index: 99;
    text-align: center;
}

.aff-wall-card {
    background: #fff;
    border: 2px solid #222;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    max-width: 600px;
    margin: 0 auto;
}

.aff-wall-text {
    font-size: 15px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 500;
}

.aff-wall-btn {
    background: #e60000;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(230,0,0,0.3);
    transition: all 0.2s ease;
}

.aff-wall-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
}