:root {
    --primary: #ff4757;
    --primary-hover: #e84118;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --border-color: #e2e8f0;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 20px rgba(255, 71, 87, 0.15);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.4;
    padding-bottom: 24px;
}

/* Form Inputs - Ngăn chặn Zoom tự động trên iOS Mobile */
input[type="text"],
input[type="search"],
textarea {
    font-size: 16px; /* Ngưỡng bắt buộc của iOS Safari để không tự zoom */
}

/* Profile Header Section */
.creator-profile {
    padding: 24px 16px 16px;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}
.profile-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 10px;
}
.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}
.profile-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #0095f6;
    color: #fff;
    font-size: 0.65rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.creator-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.creator-bio {
    font-size: 0.85rem;
    color: var(--text-sub);
    max-width: 480px;
    margin: 4px auto 12px;
    line-height: 1.4;
    font-weight: 500;
}

.trust-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 10px auto 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
}
.trust-item {
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin: 12px auto 16px;
}
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}
.social-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.social-link.yt { color: #ff0000; background: #fff0f0; border: 1px solid #ffccd0; }
.social-link.tt { color: #000000; background: #f1f5f9; border: 1px solid #cbd5e1; }
.social-link.fb { color: #1877f2; background: #f0f6ff; border: 1px solid #cce3ff; }

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Header Sticky Modern */
.header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-top: 10px;
}
.header-content { max-width: 1000px; margin: 0 auto; }

/* Search Box */
.search-box { padding: 0 16px 10px; }
.search-input-wrapper { position: relative; max-width: 580px; margin: 0 auto; }
.search-input {
    width: 100%;
    padding: 10px 38px 10px 42px;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
    background: #f8fafc;
    font-weight: 500;
}
.search-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.12);
}
.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #94a3b8;
    pointer-events: none;
}
.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: #94a3b8;
    cursor: pointer;
    display: none;
}

/* Nav Scroller */
.nav-scroller {
    display: flex;
    overflow-x: auto;
    padding: 2px 16px 10px;
    gap: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) { .nav-scroller { justify-content: center; } }
.nav-scroller::-webkit-scrollbar { display: none; }
.nav-item {
    flex: 0 0 auto;
    padding: 7px 16px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.35);
}

/* Layout Grid */
.container { max-width: 1000px; margin: 0 auto; padding: 16px 12px; }
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

/* Card Sản Phẩm */
.product-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border: 1px solid var(--border-color);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    height: 100%;
}
.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(255, 71, 87, 0.25);
}

.badge-list {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 3;
}
.badge-hot {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    text-transform: uppercase;
}
.badge {
    background: linear-gradient(135deg, #ff9f43, #ffb142);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(255, 159, 67, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.video-code {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.4);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f8fafc;
    overflow: hidden;
}
.product-img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    will-change: transform;
}
.product-card:hover .product-img {
    transform: scale(1.04);
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: 8px;
}
.product-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    height: 2.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-main);
}

.meta-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-sub);
    margin-top: 2px;
    font-weight: 500;
}
.rating-stars { color: #ffab00; font-weight: 700; }

.price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.current-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
}
.old-price {
    font-size: 0.75rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.btn-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: #fff;
    text-align: center;
    padding: 9px 0;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.82rem;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    margin-top: 6px;
    letter-spacing: 0.2px;
}
.product-card:hover .btn-buy {
    background: linear-gradient(135deg, #e84118, #ff4757);
    box-shadow: 0 6px 16px rgba(255, 71, 87, 0.35);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.page-link {
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.page-link.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* FOMO Popup */
.fomo-popup {
    position: fixed; bottom: 20px; left: 20px;
    background: #fff; border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 10px;
    z-index: 1000; font-size: 0.75rem; max-width: 300px;
    border: 1px solid var(--border-color);
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
@keyframes slideUp {
    from { transform: translateY(80px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.footer {
    margin-top: 40px; background: #fff; padding: 28px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem; color: var(--text-sub); text-align: center;
}
.footer-links { margin-bottom: 12px; display: flex; justify-content: center; gap: 14px;flex-wrap:wrap}
.footer-links a { color: var(--text-main); text-decoration: none; font-weight: 600; }
.empty-state { text-align: center; grid-column: 1 / -1; padding: 60px 10px; color: var(--text-sub); }