/* ===== CSS Variables - Makro Style Theme ===== */
:root {
    --red: #fd1803;
    --red-dark: #e01502;
    --red-darker: #c81201;
    --red-light: #FCE8EB;
    --red-50: #F9D0D6;
    --yellow: #FFCD00;
    --yellow-dark: #E6B800;
    --orange: #FF6B00;
    --green: #00A651;
    --green-light: #E5F5EC;
    --blue: #0066B3;
    --blue-light: #E5F0F8;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #888888;
    --gray-500: #757575;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    --shadow-red: 0 4px 16px rgba(253,24,3,0.25);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
    height: 100%; 
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden; /* ป้องกัน horizontal scroll บนมือถือ */
}
body { 
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: linear-gradient(135deg, #ED1C24 0%, #ED1C24 15%, #F8B4B4 25%, #FFFFFF 40%, #FFFFFF 60%, #7BA3CC 75%, #002D72 85%, #001A45 100%);
    background-attachment: fixed;
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    line-height: 1.5; 
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* ป้องกัน horizontal scroll — S24 Ultra fix */
    max-width: 100vw; /* ไม่ให้ body กว้างเกิน viewport */
}
main { flex: 1; padding-bottom: 70px; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; border: none; background: none; -webkit-appearance: none; }
ul, ol { list-style: none; }

/* ===== Container ===== */
.container { 
    width: 100%; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 12px; 
}

/* ===== Topbar - Style 3: Minimal + Animated Border ===== */
.topbar { 
    background: var(--red); 
    color: #fff; 
    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    display: block;
    position: relative;
}
.topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #FFD700, #fff, #002D72, #fff, #FFD700);
    background-size: 200% 100%;
    animation: topbar-shimmer 3s linear infinite;
}
@keyframes topbar-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.topbar-inner { 
    display: flex; 
    align-items: center; 
    justify-content: flex-end; 
    height: 36px;
    padding: 0 8px;
}
.topbar-left { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}
.topbar-left span { 
    display: flex; 
    align-items: center; 
    gap: 8px;
    font-size: 14px;
}
.topbar-left svg { width: 18px; height: 18px; }
.topbar-right { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.topbar-right a { 
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s;
    padding: 4px 14px;
    border-radius: 50px;
}
.topbar-right a:hover { background: rgba(255,255,255,0.15); }
.topbar-right .divider { color: rgba(255,255,255,0.3); font-size: 12px; }
.topbar-right .btn-login {
    background: #fff;
    color: var(--red);
    font-weight: 600;
    padding: 4px 20px;
}
.topbar-right .btn-login:hover { background: #fff5f5; }

/* ===== Header ===== */
.header { 
    background: #fff; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky; 
    top: 0; 
    z-index: 100; 
}
.header-main { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 10px 0;
    min-height: 60px;
}
.logo { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-shrink: 0; 
}
.logo img { 
    height: 44px; 
    width: auto;
    max-width: 160px;
    object-fit: contain;
}
.logo-icon { 
    width: 36px; 
    height: 36px; 
    background: var(--red); 
    border-radius: var(--radius); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #fff; 
    font-weight: 700; 
    font-size: 18px;
    flex-shrink: 0;
}
.logo-text { display: none; }
.logo-text .name { 
    color: var(--red); 
    font-weight: 700; 
    font-size: 16px; 
    line-height: 1.2; 
}
.logo-text .tagline { 
    color: var(--gray-500); 
    font-size: 10px; 
}

/* ===== Search Box ===== */
.search-box { 
    flex: 1; 
    min-width: 0;
    max-width: 100%;
}
.search-form { 
    display: flex; 
    background: var(--gray-50); 
    border-radius: 50px; 
    overflow: hidden; 
    border: 2px solid var(--gray-200); 
    transition: all 0.25s ease; 
}
.search-form:focus-within { 
    border-color: var(--red); 
    background: #fff;
    box-shadow: 0 0 0 4px rgba(253,24,3,0.08);
}
.search-input { 
    flex: 1; 
    min-width: 0;
    padding: 10px 16px; 
    font-family: 'Kanit', sans-serif;
    font-size: 15px; 
    font-weight: 400;
    color: #000;
    line-height: 22px;
    outline: none; 
    background: transparent;
}
.search-input::placeholder { color: var(--gray-400); font-size: 14px; }
.search-btn { 
    padding: 0 16px; 
    background: linear-gradient(135deg, var(--red), #ff3d2e); 
    color: #fff; 
    cursor: pointer; 
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 50px 50px 0;
}
.search-btn:hover, .search-btn:active { background: linear-gradient(135deg, var(--red-dark), var(--red)); }
.search-btn svg { width: 18px; height: 18px; }

/* ===== Nav Icons ===== */
.nav-icons { 
    display: flex; 
    align-items: center; 
    gap: 2px;
    flex-shrink: 0;
}
.nav-icon { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 6px 8px; 
    color: var(--gray-600); 
    transition: all 0.2s; 
    border-radius: 12px; 
    position: relative;
}
.nav-icon:hover, .nav-icon:active { 
    color: var(--red); 
    background: var(--red-light);
}
.nav-icon .icon-wrap { 
    width: 34px; 
    height: 34px; 
    border-radius: 50%; 
    background: var(--gray-100); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative;
    transition: all 0.2s;
}
.nav-icon svg { width: 18px; height: 18px; }
/* Point icon — ย่อให้เท่า icon อื่น */
.icon-wrap-point { background: transparent !important; padding: 0; }
.icon-wrap-point img { width: 28px; height: 28px; object-fit: contain; }
/* Login icon highlight */
.nav-icon-login .icon-wrap { background: var(--red-light); color: var(--red); }
.nav-icon-login:hover .icon-wrap { background: var(--red); color: #fff; }
.nav-icon .label { 
    font-size: 10px; 
    font-weight: 500; 
    margin-top: 2px; 
    display: none; 
}
.cart-badge { 
    position: absolute; 
    top: -4px; 
    right: -4px; 
    min-width: 16px; 
    height: 16px; 
    background: var(--red); 
    color: #fff; 
    font-size: 10px; 
    font-weight: 700; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    padding: 0 4px;
}

/* ===== Auth Buttons ===== */
.auth-btns { 
    display: flex; 
    gap: 4px; 
}
.auth-btns-mobile {
    display: flex;
    gap: 4px;
}
.btn-register { 
    background: linear-gradient(135deg, var(--red), var(--orange)); 
    color: #fff; 
    padding: 6px 10px; 
    border-radius: var(--radius); 
    font-weight: 600; 
    font-size: 11px; 
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(253,24,3,0.2);
}
.btn-register:hover { 
    background: linear-gradient(135deg, var(--red-dark), var(--red)); 
    box-shadow: 0 4px 14px rgba(253,24,3,0.3);
    transform: translateY(-1px);
}
.btn-login { 
    background: var(--red-light); 
    color: var(--red); 
    padding: 6px 10px; 
    border-radius: var(--radius); 
    font-weight: 500; 
    font-size: 11px;
    white-space: nowrap;
}
/* Mobile: ซ่อนข้อความ แสดงเฉพาะไอคอน */
.btn-register .btn-text,
.btn-login .btn-text {
    display: none;
}
.btn-register .btn-icon,
.btn-login .btn-icon {
    display: flex;
}
.btn-register .btn-icon svg,
.btn-login .btn-icon svg {
    width: 16px;
    height: 16px;
}

/* ===== Profile Dropdown ===== */
.profile-dd { position: relative; display: none; }
.profile-btn { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 6px 10px; 
    background: var(--gray-100); 
    border-radius: var(--radius); 
    cursor: pointer; 
    font-size: 13px; 
    font-weight: 500;
}
.profile-btn svg { width: 16px; height: 16px; }
.profile-menu { 
    position: absolute; 
    top: calc(100% + 8px); 
    right: 0; 
    background: #fff; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-lg); 
    min-width: 180px; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-8px); 
    transition: all 0.2s; 
    z-index: 200; 
    overflow: hidden; 
}
.profile-dd.open .profile-menu { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}
.profile-menu a { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 12px 16px; 
    font-size: 14px; 
    border-bottom: 1px solid var(--gray-100); 
    transition: background 0.2s; 
}
.profile-menu a:last-child { border-bottom: none; }
.profile-menu a:hover { background: var(--gray-50); }
.profile-menu a.logout { color: #EF4444; }

/* ===== Category Nav ===== */
.cat-nav { 
    background: #fff; 
    border-top: 1px solid var(--gray-100);
    border-bottom: 2px solid var(--gray-100);
    overflow: hidden;
}
.cat-nav-inner { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    padding: 6px 0; 
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-btn { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 7px 14px; 
    background: var(--red); 
    color: #fff; 
    border-radius: 50px; 
    font-weight: 600; 
    font-size: 12px; 
    white-space: nowrap; 
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.cat-btn:hover { background: var(--red-dark); }
.cat-btn svg { width: 16px; height: 16px; }
.cat-link { 
    padding: 7px 14px; 
    color: var(--gray-600); 
    font-size: 12px; 
    font-weight: 500; 
    white-space: nowrap; 
    border-radius: 50px; 
    transition: all 0.2s;
    flex-shrink: 0;
}
.cat-link:hover, .cat-link:active { 
    color: var(--red); 
    background: rgba(253,24,3,0.06); 
}
.cat-link.active { 
    color: var(--red); 
    background: rgba(253,24,3,0.08); 
    font-weight: 600; 
}

/* ===== Hero Banner Slider ===== */
/* สีพื้นหลังจะถูกกำหนดโดย inline style จาก slider_settings */
.hero-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
}
.hero-slider-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.hero-slide {
    min-width: 100%;
    position: relative;
}
.hero-slide a {
    display: block;
    width: 100%;
}
.hero-slide img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
    object-position: center;
}
.hero-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none; /* ซ่อนบน mobile */
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    z-index: 10;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.hero-slider-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}
/* แสดงลูกศรเฉพาะ Desktop (1024px ขึ้นไป) */
@media (min-width: 1024px) {
    .hero-slider-nav { display: flex; }
    .hero-slider-nav.prev { left: calc(50% - 600px); } /* ติดขอบรูป */
    .hero-slider-nav.next { right: calc(50% - 600px); }
}
/* จอใหญ่มาก */
@media (min-width: 1400px) {
    .hero-slider-nav.prev { left: calc(50% - 700px); }
    .hero-slider-nav.next { right: calc(50% - 700px); }
}
.hero-slider-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}
.hero-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 2px solid rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.hero-slider-dot.active {
    background: #fff;
    transform: scale(1.2);
}
/* Fallback Hero Content */
.hero-content { 
    background: linear-gradient(135deg, var(--red) 0%, #D4213D 50%, #E03A52 100%); 
    padding: 30px 16px; 
    min-height: 180px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    position: relative; 
    overflow: hidden; 
}
.hero-badge { 
    display: inline-block; 
    background: var(--yellow); 
    color: var(--gray-900); 
    font-weight: 700; 
    font-size: 11px; 
    padding: 4px 10px; 
    border-radius: 4px; 
    margin-bottom: 8px; 
    width: fit-content;
}
.hero-title { 
    color: #fff; 
    font-size: clamp(20px, 5vw, 32px); 
    font-weight: 800; 
    margin-bottom: 4px;
    line-height: 1.2;
}
.hero-subtitle { 
    color: rgba(255,255,255,0.95); 
    font-size: clamp(12px, 3vw, 16px); 
    font-weight: 600; 
    margin-bottom: 8px; 
}
.hero-desc { 
    color: rgba(255,255,255,0.85); 
    font-size: 12px; 
    margin-bottom: 12px;
    max-width: 280px;
    line-height: 1.4;
}
.hero-btn { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    background: #fff; 
    color: var(--red); 
    padding: 12px 24px; 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 14px;
    width: fit-content;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.hero-btn:hover { 
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    background: var(--red);
    color: #fff;
}
.hero-emoji { 
    position: absolute; 
    right: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    font-size: clamp(40px, 12vw, 80px); 
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Flash Sale — v3 Blue Theme (Reference Match) ===== */
.flash-section { padding: 12px; }
.fs-container {
    background: #eef4fb;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
}
/* — Header — */
.fs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    gap: 10px;
}
.fs-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.fs-bolt {
    font-size: 22px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
    animation: fs-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes fs-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
.fs-title {
    font-size: 18px;
    font-weight: 900;
    color: #1565c0;
    letter-spacing: 1px;
    line-height: 1;
    white-space: nowrap;
}
/* — Countdown (border style) — */
.fs-countdown { display: flex; align-items: center; gap: 3px; }
.fs-time-box {
    background: #fff;
    color: #1565c0;
    border: 2px solid #1565c0;
    font-size: 14px;
    font-weight: 800;
    min-width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.fs-time-sep {
    color: #1565c0;
    font-weight: 800;
    font-size: 14px;
    margin: 0 1px;
}
/* — View All — */
.fs-viewall {
    font-size: 12px;
    color: #e53935;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding: 5px 14px;
    background: rgba(229,57,53,0.08);
    border-radius: 20px;
    transition: all 0.2s;
}
.fs-viewall:hover { background: #e53935; color: #fff; text-decoration: none; }
.fs-viewall svg { width: 14px; height: 14px; }
/* — Horizontal Scroll — */
.fs-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 16px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.fs-scroll::-webkit-scrollbar { display: none; }
/* — Product Card — */
.fs-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}
.fs-card:hover { transform: translateY(-4px); }
.fs-card-img {
    position: relative;
    aspect-ratio: 3 / 2;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}
.fs-card:hover .fs-card-img {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.fs-card-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: transform 0.3s;
}
.fs-card:hover .fs-card-img img { transform: scale(1.05); }
/* — Discount Badge (ขวาบน) — */
.fs-badge {
    position: absolute;
    top: 0; right: 0;
    background: linear-gradient(135deg, #e53935, #FF6B00);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 0 12px 0 10px;
    z-index: 2;
}
/* — Price — */
.fs-price {
    font-size: 18px;
    font-weight: 800;
    color: #212121;
    line-height: 1.3;
    padding: 0 2px;
}
.fs-orig-price {
    display: block;
    font-size: 12px;
    color: #767676;
    text-decoration: line-through;
    font-weight: 400;
    padding: 0 2px;
    margin-bottom: 5px;
}
/* — Progress Bar (ใต้ราคา, สีตั้งค่าได้) — */
.fs-progress {
    height: 22px;
    border-radius: 11px;
    background: #d4e4f7;
    position: relative;
    overflow: hidden;
}
.fs-progress-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    border-radius: 11px;
    background: var(--prog-color, #1565c0);
    animation: fs-grow 1.2s ease-out;
}
@keyframes fs-grow { from { width: 0; } }
.fs-progress-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
/* — Banner (optional) — */
.fs-banner-wrap {
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 0 auto -8px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.fs-banner {
    width: 100%;
    height: auto;
    display: block;
}
@media (min-width: 641px) {
    .fs-banner-wrap { max-width: 820px; }
}
.fs-banner + .fs-container,
.fs-banner-wrap + .fs-container { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.fs-banner-wrap + .fs-container { margin-top: 0; }

/* ===== Promo Section ===== */
.promo-section { padding: 12px; }
.promo-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 10px; 
}
.promo-card { 
    background: linear-gradient(135deg, #1976D2, #2196F3); 
    border-radius: var(--radius-lg); 
    padding: 16px; 
    color: #fff; 
    position: relative; 
    overflow: hidden; 
}
.promo-card.green { background: linear-gradient(135deg, #388E3C, #4CAF50); }
.promo-label { 
    font-size: 10px; 
    opacity: 0.9; 
    margin-bottom: 4px; 
}
.promo-title { 
    font-size: 16px; 
    font-weight: 700; 
    margin-bottom: 4px; 
}
.promo-desc { 
    font-size: 11px; 
    opacity: 0.8; 
    margin-bottom: 12px; 
}
.promo-btn { 
    display: inline-block; 
    background: #fff; 
    color: #1976D2; 
    font-size: 11px; 
    font-weight: 700; 
    padding: 6px 12px; 
    border-radius: var(--radius-sm); 
}
.promo-card.green .promo-btn { color: #388E3C; }

/* ===== Featured Section (Horizontal Scroll) ===== */
.featured-section { 
    padding: 12px; 
}

/* Wrapper สำหรับ Fade Effect ขอบซ้าย-ขวา */
.scroll-fade-wrapper {
    position: relative;
    overflow: hidden;
}
.scroll-fade-wrapper::before,
.scroll-fade-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 6px; /* ไม่บังแถบ scroll */
    width: 40px;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.scroll-fade-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 30%, transparent 100%);
}
.scroll-fade-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 30%, transparent 100%);
}
/* แสดง fade ตามตำแหน่ง scroll */
.scroll-fade-wrapper.can-scroll-left::before {
    opacity: 1;
}
.scroll-fade-wrapper.can-scroll-right::after {
    opacity: 1;
}
/* ปุ่มลูกศรซ้าย-ขวา */
.scroll-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
}
.scroll-nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.scroll-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}
.scroll-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--gray-700);
    stroke-width: 2.5;
    fill: none;
}
.scroll-nav-btn.prev { left: 8px; }
.scroll-nav-btn.next { right: 8px; }
.scroll-fade-wrapper.can-scroll-left .scroll-nav-btn.prev {
    opacity: 1;
}
.scroll-fade-wrapper.can-scroll-right .scroll-nav-btn.next {
    opacity: 1;
}
/* ซ่อนปุ่มบนมือถือ แสดง fade อย่างเดียว */
@media (max-width: 767px) {
    .scroll-nav-btn { display: none; }
    .scroll-fade-wrapper::before,
    .scroll-fade-wrapper::after {
        width: 30px;
    }
}

.featured-products-scroll {
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
}

/* ── Desktop: scroll เหมือนเดิม + กึ่งกลางเมื่อสินค้าน้อย ── */
@media (min-width: 900px) {
    .featured-products-scroll {
        justify-content: safe center;
        padding: 16px 20px;
        gap: 16px;
    }
    .featured-product-card {
        flex: 0 0 190px;
    }
}
.featured-products-scroll::-webkit-scrollbar { height: 6px; }
.featured-products-scroll::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 3px; }
.featured-products-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
.featured-products-scroll::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* Card Style Variations */
.featured-section.card-minimal .featured-product-card {
    box-shadow: none;
    border: 1px solid #f0f0f0;
}
.featured-section.card-minimal .featured-product-card:hover {
    box-shadow: none;
    border-color: var(--red);
}
.featured-section.card-shadow .featured-product-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: none;
}
.featured-section.card-shadow .featured-product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.featured-product-card {
    flex: 0 0 170px;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    isolation: isolate;
}
.featured-product-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}
/* Glow cards - ไม่เปลี่ยน shadow ตอน hover */
.featured-product-card.thai-glow:hover,
.featured-product-card.thai-static-glow:hover,
.featured-product-card.rainbow-glow:hover {
    transform: translateY(-2px);
}
.featured-product-card .product-img {
    aspect-ratio: 1;
    background: var(--gray-50);
    position: relative;
    overflow: visible;
}
.featured-product-card .product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.35s ease;
    clip-path: inset(0);
}
.featured-product-card:hover .product-img img {
    transform: scale(1.06);
}
.featured-product-card .product-info {
    padding: 10px;
    cursor: pointer;
}
.featured-product-card .product-info:hover .product-name {
    color: var(--red);
}
.featured-product-card .product-name {
    font-size: 12px;
    line-height: 1.4;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
    color: var(--gray-800);
    transition: color 0.2s;
}
.featured-product-card .product-price {
    margin-bottom: 6px;
}
/* Price Card V1 - สำหรับสินค้าที่มีส่วนลด */
.featured-product-card .product-price.has-discount {
    background: #df1803;
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    min-height: 40px;
    gap: 4px;
    flex-wrap: wrap;
}
.featured-product-card .product-price.has-discount .price-left {
    flex: 1;
    min-width: 0;
}
.featured-product-card .product-price.has-discount .price-current {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    display: block;
    line-height: 1.3;
}
.featured-product-card .product-price.has-discount .price-original {
    color: rgba(255,255,255,0.7);
    font-size: 9px;
    text-decoration: line-through;
    margin-left: 0;
    display: block;
    white-space: nowrap;
    line-height: 1.2;
}
.featured-product-card .product-price.has-discount .points-badge {
    background: linear-gradient(180deg, #FFE55C 0%, #FFD700 30%, #F4A700 70%, #E09200 100%);
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 8px;
    font-weight: 700;
    color: #5D3A00;
    box-shadow: 
        0 1px 2px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.5);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    border: 1px solid #C68B00;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    line-height: 1.3;
}
/* ราคาปกติ - ไม่มีส่วนลด */
.featured-product-card .price-current {
    font-size: 16px;
    font-weight: 700;
    color: var(--red);
}

/* Responsive - หน้าจอใหญ่ขึ้น */
@media (min-width: 400px) {
    .featured-product-card .product-price.has-discount .price-current {
        font-size: 14px;
    }
    .featured-product-card .product-price.has-discount .price-original {
        font-size: 10px;
    }
    .featured-product-card .product-price.has-discount .points-badge {
        font-size: 9px;
        padding: 2px 5px;
    }
}
@media (min-width: 480px) {
    .featured-product-card .product-price.has-discount .price-current {
        font-size: 15px;
    }
    .featured-product-card .product-price.has-discount .points-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}
.featured-product-card .price-original {
    font-size: 11px;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: 4px;
}
.featured-product-card .seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
}
.featured-product-card .seller-badge svg {
    width: 10px;
    height: 10px;
}
.featured-product-card .product-points {
    font-size: 10px;
    color: #F59E0B;
    margin-bottom: 8px;
}
.featured-product-card .btn-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px;
    background: var(--gray-50);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.featured-product-card .btn-add-cart:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    box-shadow: 0 4px 12px rgba(253,24,3,0.2);
}
.featured-product-card .btn-add-cart svg {
    width: 14px;
    height: 14px;
}
.featured-product-card .like-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    min-height: 28px;
    max-height: 28px;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 0;
    margin: 0;
}
.featured-product-card .like-btn:hover {
    background: #fff !important;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.featured-product-card .like-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--gray-400);
    stroke-width: 2;
}
.featured-product-card .like-btn.liked svg {
    fill: var(--red);
    stroke: var(--red);
}
.featured-product-card .product-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 2;
}
.featured-product-card .product-discount {
    position: absolute !important;
    bottom: -8px !important;
    right: 6px !important;
    top: auto !important;
    left: auto !important;
    background: var(--red) !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    width: auto !important;
    max-width: fit-content !important;
    display: inline-block !important;
    z-index: 10 !important;
    line-height: 1.4 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
/* Discount badge inline override removed — now uses .product-discount class */

/* Card Header Badge - Badge เล็กๆ มุมซ้ายบน */
.card-header-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 3px 6px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--red), #FF6B6B) !important;
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: fit-content !important;
    height: auto !important;
    z-index: 5 !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}
.featured-product-card .card-header-badge,
.product-card .card-header-badge {
    display: inline-flex !important;
    width: auto !important;
    max-width: fit-content !important;
    right: auto !important;
}
.card-header-badge .badge-emoji {
    font-size: 10px;
    line-height: 1;
}
.card-header-badge .badge-text {
    white-space: nowrap;
}
/* like-btn อยู่มุมขวาบนเสมอ - ไม่เปลี่ยนตำแหน่ง */
.featured-product-card.has-badge .like-btn {
    top: 8px;
    right: 8px;
}

/* ==========================================
   Thai Flag Glow - แสงเรืองด้านนอกกรอบ (แสงวิ่ง)
   ========================================== */
/* DISABLED - Thai Glow Effect
.featured-product-card.thai-glow {
    animation: thai-glow-rotate 3s linear infinite;
    margin: 8px 4px;
}
*/
.featured-product-card.thai-glow {
    animation: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}
@keyframes thai-glow-rotate {
    0% { 
        box-shadow: 
            0 0 15px rgba(237, 28, 36, 0.8),
            0 0 30px rgba(237, 28, 36, 0.4),
            0 0 45px rgba(237, 28, 36, 0.2);
    }
    33% { 
        box-shadow: 
            0 0 15px rgba(255, 255, 255, 0.8),
            0 0 30px rgba(255, 255, 255, 0.4),
            0 0 45px rgba(255, 255, 255, 0.2);
    }
    66% { 
        box-shadow: 
            0 0 15px rgba(36, 29, 79, 0.8),
            0 0 30px rgba(36, 29, 79, 0.4),
            0 0 45px rgba(36, 29, 79, 0.2);
    }
    100% { 
        box-shadow: 
            0 0 15px rgba(237, 28, 36, 0.8),
            0 0 30px rgba(237, 28, 36, 0.4),
            0 0 45px rgba(237, 28, 36, 0.2);
    }
}

/* ==========================================
   Thai Flag Static Glow - แสงเรืองด้านนอกกรอบ (นิ่ง)
   ========================================== */
.featured-product-card.thai-static-glow {
    box-shadow: 
        0 0 10px rgba(237, 28, 36, 0.6),
        0 0 20px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(36, 29, 79, 0.5),
        0 0 40px rgba(237, 28, 36, 0.3);
    animation: thai-static-pulse 2s ease-in-out infinite;
}
@keyframes thai-static-pulse {
    0%, 100% { 
        box-shadow: 
            0 0 10px rgba(237, 28, 36, 0.6),
            0 0 20px rgba(255, 255, 255, 0.3),
            0 0 30px rgba(36, 29, 79, 0.5),
            0 0 40px rgba(237, 28, 36, 0.3);
    }
    50% { 
        box-shadow: 
            0 0 15px rgba(237, 28, 36, 0.8),
            0 0 30px rgba(255, 255, 255, 0.5),
            0 0 45px rgba(36, 29, 79, 0.7),
            0 0 60px rgba(237, 28, 36, 0.4);
    }
}

/* ==========================================
   Rainbow Glow - แสงเรืองด้านนอกกรอบ สีรุ้ง
   ========================================== */
.featured-product-card.rainbow-glow {
    animation: rainbow-glow-rotate 4s linear infinite;
}
@keyframes rainbow-glow-rotate {
    0% { box-shadow: 0 0 15px #ff0000, 0 0 30px #ff0000, 0 0 45px #ff000050; }
    14% { box-shadow: 0 0 15px #ff7f00, 0 0 30px #ff7f00, 0 0 45px #ff7f0050; }
    28% { box-shadow: 0 0 15px #ffff00, 0 0 30px #ffff00, 0 0 45px #ffff0050; }
    42% { box-shadow: 0 0 15px #00ff00, 0 0 30px #00ff00, 0 0 45px #00ff0050; }
    57% { box-shadow: 0 0 15px #0000ff, 0 0 30px #0000ff, 0 0 45px #0000ff50; }
    71% { box-shadow: 0 0 15px #4b0082, 0 0 30px #4b0082, 0 0 45px #4b008250; }
    85% { box-shadow: 0 0 15px #9400d3, 0 0 30px #9400d3, 0 0 45px #9400d350; }
    100% { box-shadow: 0 0 15px #ff0000, 0 0 30px #ff0000, 0 0 45px #ff000050; }
}

/* Responsive: Tablet & Desktop */
@media (min-width: 640px) {
    .featured-product-card {
        flex: 0 0 190px;
    }
    .featured-product-card .product-name {
        font-size: 13px;
        height: 36px;
    }
}
@media (min-width: 1024px) {
    .featured-product-card {
        flex: 0 0 210px;
    }
    .featured-products-scroll {
        gap: 16px;
        padding: 16px;
    }
    .featured-product-card .product-name {
        font-size: 14px;
        height: 38px;
    }
    .featured-product-card .product-price.has-discount .price-current {
        font-size: 16px;
    }
}

/* ===== Products Section ===== */
.products-section { padding: 12px; }
.section-card { 
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border-radius: var(--radius-xl); 
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 4px 32px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.8); 
    transition: box-shadow 0.3s, background 0.3s;
}
.section-card:hover {
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 40px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* Section Header Bar - หัว Section ปรับสีและรูปได้ */
.section-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--red-light), #fff);
    border-bottom: 3px solid var(--red);
    position: relative;
    overflow: hidden;
}
.section-header-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--orange), var(--red));
}
.section-header-bar .header-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.section-header-bar .header-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.section-header-bar .header-content {
    flex: 0 0 auto;
    min-width: 0;
}
.section-header-bar .header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-header-bar .header-title small {
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 400;
}
.section-header-bar .header-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Header Banner - รูปตรงกลาง */
.section-header-bar .header-banner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.section-header-bar .header-banner img {
    max-height: 45px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}
@media (max-width: 640px) {
    .section-header-bar .header-banner {
        display: none;
    }
}

.section-header-bar .header-action {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: var(--red);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--red-light);
    border-radius: 20px;
    transition: all 0.2s;
}
.section-header-bar .header-action:hover {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(253,24,3,0.2);
    transform: translateY(-1px);
}
.section-header-bar .header-action svg { width: 14px; height: 14px; }

/* เดิม - section-header ปกติ */
.section-header { 
    display: flex; 
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px 8px; 
    border-bottom: 1px solid var(--gray-100); 
}
.section-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.section-title { 
    font-size: 16px; 
    font-weight: 700; 
    color: var(--gray-900);
    line-height: 1.3;
}
.section-title small {
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 400;
}
.section-subtitle { 
    font-size: 12px; 
    color: var(--gray-500);
    margin-top: 2px;
}
.section-link { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    color: var(--red); 
    font-size: 12px; 
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.section-link svg { width: 14px; height: 14px; }
.section-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sort-select { 
    padding: 6px 10px; 
    border: 1px solid var(--gray-200); 
    border-radius: var(--radius); 
    font-size: 12px; 
    color: var(--gray-700); 
    cursor: pointer;
    background: #fff;
}
.products-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
    padding: 12px; 
}

/* ===== Product Card ===== */
.product-card { 
    background: #fff; 
    border-radius: var(--radius-lg); 
    overflow: hidden; 
    box-shadow: var(--shadow-sm); 
    transition: all 0.3s; 
    position: relative; 
}
.product-card:active { 
    transform: scale(0.98); 
}
.product-img { 
    aspect-ratio: 1; 
    background: var(--gray-50); 
    position: relative; 
    overflow: hidden; 
}
.product-img img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    padding: 10px; 
    transition: transform 0.3s; 
}
.product-badges { 
    position: absolute; 
    top: 8px; 
    left: 8px; 
    display: flex; 
    flex-direction: column; 
    gap: 4px;
    z-index: 2;
}
.badge-hot { 
    background: linear-gradient(135deg, #FF5722, #FF9800); 
    color: #fff; 
    font-size: 9px; 
    font-weight: 700; 
    padding: 3px 6px; 
    border-radius: 4px; 
}
.badge-new { 
    background: var(--blue); 
    color: #fff; 
    font-size: 9px; 
    font-weight: 700; 
    padding: 3px 6px; 
    border-radius: 4px; 
}
.product-discount { 
    position: absolute; 
    top: 8px; 
    right: 8px; 
    background: var(--red); 
    color: #fff; 
    font-size: 10px; 
    font-weight: 700; 
    padding: 3px 6px; 
    border-radius: 4px;
    z-index: 2;
}
.fs-badge b, .product-discount b { font-size: 1.2em; }
.like-btn { 
    position: absolute; 
    top: 8px; 
    right: 8px; 
    width: 30px; 
    height: 30px; 
    background: rgba(255,255,255,0.95); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    transition: all 0.2s; 
    z-index: 5; 
    box-shadow: var(--shadow-sm);
}
.like-btn:active { transform: scale(0.9); }
.like-btn svg { 
    width: 16px; 
    height: 16px; 
    fill: none; 
    stroke: var(--gray-400); 
    stroke-width: 2; 
    transition: all 0.2s; 
}
.like-btn.liked svg { fill: #EF4444; stroke: #EF4444; }
/* Product Card with Header Badge */
.product-card.has-badge .like-btn { top: 40px; }
.like-count { 
    position: absolute; 
    bottom: -3px; 
    right: -3px; 
    background: var(--red); 
    color: #fff; 
    font-size: 8px; 
    font-weight: 700; 
    min-width: 14px; 
    height: 14px; 
    border-radius: 7px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0 3px; 
}
.product-info { padding: 10px; }
.seller-badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 3px; 
    background: var(--red); 
    color: #fff; 
    font-size: 9px; 
    font-weight: 600; 
    padding: 2px 6px; 
    border-radius: 4px; 
    margin-bottom: 6px; 
}
.seller-badge svg { width: 10px; height: 10px; }
.product-name { 
    font-size: 13px; 
    font-weight: 500; 
    color: var(--gray-800); 
    line-height: 1.3; 
    height: 2.6em; 
    overflow: hidden; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    margin-bottom: 6px; 
}
.product-name a { color: inherit; }
.product-price { 
    display: flex; 
    align-items: baseline; 
    gap: 6px; 
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.price-current { 
    color: var(--red); 
    font-size: 18px; 
    font-weight: 700; 
}
.price-original { 
    color: var(--gray-400); 
    font-size: 12px; 
    text-decoration: line-through; 
}
.product-points { 
    color: var(--orange); 
    font-size: 10px; 
    font-weight: 600; 
}
.product-meta { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-top: 8px; 
    padding-top: 8px; 
    border-top: 1px solid var(--gray-100); 
}
.product-rating { 
    display: flex; 
    align-items: center; 
    gap: 3px; 
    font-size: 10px; 
    color: var(--gray-500); 
}
.product-rating svg { width: 12px; height: 12px; fill: var(--yellow); }
.product-sold { font-size: 10px; color: var(--gray-500); }
.add-cart-btn { 
    width: 100%; 
    margin-top: 10px; 
    padding: 10px; 
    background: linear-gradient(135deg, var(--red), #ff3d2e); 
    color: #fff; 
    border-radius: var(--radius); 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px;
    box-shadow: 0 2px 8px rgba(253,24,3,0.2);
}
.add-cart-btn:hover, .add-cart-btn:active { 
    background: linear-gradient(135deg, var(--red-dark), var(--red)); 
    box-shadow: 0 4px 14px rgba(253,24,3,0.3);
    transform: translateY(-1px);
}
.add-cart-btn svg { width: 14px; height: 14px; }

/* ===== Footer ===== */
.footer { 
    background: var(--footer-bg); 
    color: var(--footer-text); 
    padding: 32px 12px calc(80px + var(--safe-bottom)); 
}
.footer-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 24px; 
}
.footer-logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 14px; 
}
.footer-logo img { height: 44px; width: auto; max-width: 120px; object-fit: contain; display: block; }
.footer-logo .logo-icon { background: var(--red); }
.footer-logo-text .name { 
    color: var(--footer-text); 
    font-size: 17px; 
    font-weight: 700; 
}
.footer-logo-text .tagline { 
    color: var(--footer-text-99); 
    font-size: 11px; 
}
.footer-desc { 
    color: var(--footer-text-99); 
    font-size: 13px; 
    line-height: 1.7; 
    margin-bottom: 16px; 
}
.footer-contact { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}
.footer-contact-item { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    color: var(--footer-text-99); 
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}
a.footer-contact-item:hover {
    color: var(--footer-text);
}
.footer-contact-item svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Footer Social */
.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}
.social-link {
    width: 44px;
    height: 44px;
    background: var(--footer-text-20);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    overflow: hidden;
}
.social-link:hover {
    background: var(--footer-text-40);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.social-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}
.social-link .social-emoji {
    font-size: 24px;
    line-height: 1;
}

.footer-col { display: none; }
.footer-col h4 { 
    font-size: 14px; 
    font-weight: 600; 
    margin-bottom: 12px;
    color: var(--footer-text);
}
.footer-col ul { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}
.footer-col a { 
    color: var(--footer-text-99); 
    font-size: 13px; 
    transition: color 0.2s; 
}
.footer-col a:hover { color: var(--footer-text); }

/* Footer Certifications */
.footer-certs {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--footer-text-20);
    text-align: center;
}
.footer-certs h4, .footer-channels h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--footer-text-80);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.cert-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--footer-text-20), var(--footer-text-30));
    border: 1px solid var(--footer-text-30);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--footer-text);
    transition: all 0.25s;
}
.cert-badge:hover {
    background: linear-gradient(135deg, var(--footer-text-30), var(--footer-text-40));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.cert-icon {
    font-size: 14px;
}

/* Footer Distribution Channels */
.footer-channels {
    margin-top: 16px;
    text-align: center;
}
.channel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.channel-badge {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--footer-text-30);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--footer-text-99);
    transition: all 0.25s;
}
.channel-badge:hover {
    border-color: var(--footer-text-80);
    color: var(--footer-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Footer Bottom */
.footer-bottom { 
    margin-top: 20px; 
    padding-top: 20px; 
    border-top: 1px solid var(--footer-text-20); 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    align-items: center; 
}
.footer-payments, .footer-shipping { 
    display: flex; 
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 8px;
}
.footer-payments span, .footer-shipping span { 
    background: var(--footer-text-20); 
    color: var(--footer-text); 
    font-size: 11px; 
    font-weight: 600; 
    padding: 5px 10px; 
    border-radius: 8px;
    border: 1px solid var(--footer-text-30);
    transition: all 0.2s;
}
.footer-payments span:hover, .footer-shipping span:hover {
    background: var(--footer-text-30);
    transform: translateY(-1px);
}
.footer-copyright { 
    color: var(--footer-text-80); 
    font-size: 11px; 
    text-align: center; 
}

/* ===== Mobile Navigation ===== */
/* ===== Product Rating Stars ===== */
.product-rating-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 3px 0 1px;
    flex-wrap: nowrap;
    overflow: hidden;
}
.rating-stars-mini {
    display: flex;
    gap: 0.5px;
    flex-shrink: 0;
}
.rating-stars-mini svg {
    width: 11px;
    height: 11px;
}
.rating-text {
    font-size: 11px;
    font-weight: 600;
    color: #F59E0B;
    line-height: 1;
}
.rating-count {
    font-size: 10px;
    color: #999;
    line-height: 1;
}
.sales-count {
    font-size: 10px;
    color: #999;
    margin-left: auto;
    white-space: nowrap;
    line-height: 1;
}

/* ===== Bottom Navigation — App-like ===== */
.mobile-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.06);
    z-index: 100; 
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -1px 20px rgba(0,0,0,0.06);
}
.mobile-nav ul { 
    display: flex; 
    justify-content: space-around; 
    padding: 6px 0 8px;
    max-width: 500px;
    margin: 0 auto;
}
.mobile-nav li { flex: 1; }
.mobile-nav a { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 2px; 
    color: #8B8B8B;
    font-size: 10px; 
    padding: 4px 8px; 
    position: relative;
    transition: all 0.2s;
    font-weight: 500;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav a.active { 
    color: var(--red); 
}
.mobile-nav a.active::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--red);
    border-radius: 0 0 3px 3px;
}
.mobile-nav a:active {
    background: rgba(253,24,3,0.06);
}
.mobile-nav svg { width: 22px; height: 22px; transition: transform 0.15s; }
.mobile-nav a:active svg { transform: scale(0.9); }
.mobile-nav .custom-nav-icon { width: 22px; height: 22px; object-fit: contain; }
.mobile-nav .nav-avatar {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--red), #ff4444);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(253,24,3,0.3);
}
.mobile-nav a.has-user {
    color: var(--red);
}
.mobile-nav .cart-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(14px);
    min-width: 16px;
    height: 16px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 4px rgba(253,24,3,0.3);
}

/* ===== PWA Install Banner ===== */
.pwa-install-banner {
    position: fixed;
    bottom: calc(68px + var(--safe-bottom));
    left: 12px;
    right: 12px;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 150;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.05) inset;
}
.pwa-slide-up {
    animation: pwaSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.pwa-slide-down {
    animation: pwaSlideDown 0.3s ease-in forwards;
}
@keyframes pwaSlideUp {
    from { transform: translateY(120%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes pwaSlideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(120%); opacity: 0; }
}
.pwa-close {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #444;
    border: 2px solid #1a1a2e;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.pwa-icon-box {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #FD1803, #ff4444);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(253,24,3,0.35);
    overflow: hidden;
}
.pwa-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pwa-icon-box span {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}
.pwa-info { flex: 1; min-width: 0; }
.pwa-title { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; }
.pwa-desc { color: rgba(255,255,255,0.55); font-size: 11px; }
.pwa-install-btn {
    background: #FD1803;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(253,24,3,0.3);
    transition: transform 0.15s;
}
.pwa-install-btn:active { transform: scale(0.95); }

/* ===== Toast ===== */
.toast { 
    position: fixed; 
    bottom: calc(70px + var(--safe-bottom)); 
    left: 12px; 
    right: 12px; 
    background: linear-gradient(135deg, #22C55E, #16A34A); 
    color: #fff; 
    padding: 14px 18px; 
    border-radius: var(--radius-lg); 
    transform: translateY(100%); 
    opacity: 0; 
    transition: all 0.3s; 
    z-index: 200;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: linear-gradient(135deg, #EF4444, #DC2626); }

/* ===== Mobile Menu Overlay ===== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background: #fff;
    z-index: 301;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.mobile-menu.show {
    transform: translateX(0);
}
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--red);
    color: #fff;
}
.mobile-menu-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.mobile-menu-header .close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
}
.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.mobile-user-info .user-avatar {
    width: 48px;
    height: 48px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.mobile-user-info .user-name {
    font-weight: 600;
    color: var(--gray-900);
}
.mobile-user-info .user-link {
    font-size: 12px;
    color: var(--red);
}
.mobile-auth-box {
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--red) 0%, #ff4444 100%);
    text-align: center;
}
.mobile-auth-box p {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    margin-bottom: 12px;
}
.mobile-auth-btns {
    display: flex;
    gap: 8px;
}
.btn-login-mobile, .btn-register-mobile {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.btn-login-mobile {
    background: #fff;
    color: var(--red);
}
.btn-register-mobile {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.mobile-menu-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}
.mobile-menu-section h4 {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mobile-menu-link {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--gray-700);
    transition: all 0.2s;
}
.mobile-menu-link:active {
    background: var(--gray-100);
}
.mobile-menu-link.logout {
    color: #EF4444;
}

@media (min-width: 768px) {
    .mobile-menu-overlay, .mobile-menu { display: none !important; }
}

/* ===== Empty State ===== */
.empty-state { 
    text-align: center; 
    padding: 48px 16px; 
}
.empty-state p { 
    color: var(--gray-500); 
    font-size: 14px; 
    margin-bottom: 16px; 
}
.empty-state a { 
    display: inline-block; 
    background: var(--red); 
    color: #fff; 
    padding: 12px 24px; 
    border-radius: var(--radius); 
    font-weight: 600;
    transition: all 0.2s;
}
.empty-state a:hover {
    background: var(--red-dark);
}

/* ===== TABLET (640px+) ===== */
@media (min-width: 640px) {
    .container { padding: 0 20px; }
    main { padding-bottom: 0; }
    
    .header-main { 
        gap: 16px; 
        padding: 12px 0;
        min-height: 64px;
    }
    .logo img { height: 48px; max-width: 180px; }
    .logo-icon { width: 42px; height: 42px; font-size: 20px; }
    .logo-text { display: block; }
    .logo-text .name { font-size: 18px; }
    .logo-text .tagline { font-size: 11px; }
    
    .search-input { padding: 12px 16px; font-size: 15px; }
    .search-btn { padding: 0 16px; }
    
    .nav-icon { padding: 8px 12px; }
    .nav-icon .icon-wrap { width: 36px; height: 36px; }
    .icon-wrap-point img { width: 34px; height: 34px; }
    .nav-icon .label { display: block; }
    .auth-btns { display: flex; gap: 6px; }
    .profile-dd { display: block; }
    
    .hero-slider-dots { bottom: 12px; gap: 8px; }
    .hero-slider-dot { width: 10px; height: 10px; }
    .hero-content { padding: 40px 28px; min-height: 280px; }
    .hero-desc { max-width: 350px; }
    .hero-emoji { font-size: 100px; right: 24px; }
    
    .flash-section { padding: 16px 20px; }
    .fs-card { flex: 0 0 220px; }
    .fs-header { padding: 16px 20px 12px; }
    .fs-price { font-size: 20px; }
    .fs-orig-price { font-size: 13px; }
    .fs-progress { height: 22px; }
    
    .promo-section { padding: 16px 20px; }
    .promo-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .promo-card { padding: 20px; }
    .promo-title { font-size: 18px; }
    
    .products-section { padding: 16px 20px; }
    .section-header { 
        flex-direction: row; 
        align-items: center;
        justify-content: space-between;
        padding: 16px; 
    }
    .section-header-top { flex: 1; }
    .products-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 16px; 
        padding: 16px; 
    }
    .product-info { padding: 12px; }
    .product-name { font-size: 14px; }
    .price-current { font-size: 20px; }
    
    .footer { padding: 32px 20px; }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
    .footer-col { display: block; }
    
    .mobile-nav { display: none; }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
    .container { padding: 0 32px; }
    
    .header-main { 
        gap: 24px;
        min-height: 72px;
    }
    .logo img { height: 52px; max-width: 200px; }
    .logo-icon { width: 48px; height: 48px; font-size: 22px; }
    .logo-text .name { font-size: 20px; }
    .logo-text .tagline { font-size: 12px; }
    
    .search-box { max-width: 560px; }
    .icon-wrap-point img { width: 34px; height: 34px; }
    .nav-icons { gap: 4px; }
    
    .cat-nav-inner { gap: 6px; }
    .cat-btn { padding: 8px 18px; font-size: 13px; }
    .cat-link { padding: 8px 16px; font-size: 13px; }
    
    .hero-slider-dots { bottom: 16px; gap: 10px; }
    .hero-slider-dot { width: 10px; height: 10px; }
    .hero-content { padding: 48px 40px; min-height: 350px; }
    .hero-emoji { font-size: 120px; right: 40px; }
    
    .flash-section { padding: 20px 32px; }
    .fs-card { flex: 0 0 220px; }
    .fs-scroll { gap: 12px; padding: 0 20px 20px; }
    .fs-header { padding: 18px 20px 14px; }
    .fs-title { font-size: 22px; }
    .fs-time-box { min-width: 34px; height: 32px; font-size: 16px; }
    .fs-bolt { font-size: 24px; }
    .fs-badge { font-size: 12px; padding: 4px 12px; }
    .fs-price { font-size: 22px; }
    .fs-orig-price { font-size: 14px; }
    .fs-progress { height: 24px; border-radius: 12px; }
    .fs-progress-fill { border-radius: 12px; }
    .fs-progress-text { font-size: 11px; }
    
    .promo-section { padding: 20px 32px; }
    .promo-card { padding: 24px; }
    .promo-title { font-size: 20px; }
    
    .products-section { padding: 20px 32px; }
    .section-header { padding: 20px; }
    .section-title { font-size: 18px; }
    .products-grid { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 20px;
        padding: 20px;
    }
    .product-card:hover { 
        box-shadow: var(--shadow-lg); 
        transform: translateY(-4px); 
    }
    .product-card:hover .product-img img { transform: scale(1.05); }
    .product-info { padding: 14px; }
    .product-name { font-size: 14px; }
    .price-current { font-size: 22px; }
    .add-cart-btn { padding: 12px; font-size: 14px; }
    
    .footer { padding: 40px 32px; }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
    .footer-logo img { height: 44px; width: auto; max-width: 160px; }
    .footer-logo-text .name { font-size: 18px; }
    .footer-desc { font-size: 14px; }
}

/* ===== LARGE DESKTOP (1280px+) ===== */
@media (min-width: 1280px) {
    .container { padding: 0 48px; }
    .search-box { max-width: 700px; }
    .products-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .header-login-btn { display: none; }
    .auth-btns { display: none; }
    .topbar { display: none; }
    
    /* Header compact */
    .header-main { 
        gap: 8px; 
        padding: 8px 0;
        min-height: 52px;
    }
    .logo img { height: 34px; max-width: 110px; }
    .logo-icon { width: 30px; height: 30px; font-size: 14px; }
    .search-form { border-width: 1.5px; }
    .search-input { padding: 7px 10px; font-size: 13px; }
    .search-input::placeholder { font-size: 12px; }
    .search-btn { padding: 0 10px; }
    .search-btn svg { width: 15px; height: 15px; }
    .nav-icons { gap: 0; }
    .nav-icon { padding: 4px 5px; }
    .nav-icon .icon-wrap { width: 30px; height: 30px; }
    .nav-icon svg { width: 16px; height: 16px; }
    .icon-wrap-point img { width: 24px; height: 24px; }
    .cart-badge { min-width: 14px; height: 14px; font-size: 9px; top: -3px; right: -3px; }
    
    /* Auth buttons mobile */
    .btn-register, .btn-login { padding: 5px 8px; font-size: 10px; }
    
    /* Category nav */
    .cat-nav-inner { gap: 2px; padding: 0 8px; }
    .cat-btn { padding: 7px 10px; font-size: 11px; gap: 4px; }
    .cat-btn svg { width: 14px; height: 14px; }
    .cat-link { padding: 7px 8px; font-size: 11px; }
    
    /* Hero slider */
    .hero-section { padding: 8px; }
    
    /* Flash Sale */
    .flash-section { padding: 8px; }
    .fs-header { padding: 10px 12px 8px; gap: 6px; }
    .fs-bolt { font-size: 18px; }
    .fs-title { font-size: 14px; letter-spacing: 0.5px; }
    .fs-countdown { gap: 2px; }
    .fs-time-box { min-width: 24px; height: 22px; font-size: 11px; border-width: 1.5px; border-radius: 4px; }
    .fs-time-sep { font-size: 11px; }
    .fs-viewall { font-size: 11px; }
    .fs-scroll { gap: 8px; padding: 0 12px 12px; }
    .fs-card { flex: 0 0 180px; }
    .fs-card-img { border-radius: 10px; }
    .fs-card-img img { padding: 8px; }
    .fs-badge { font-size: 10px; padding: 3px 8px; border-radius: 0 10px 0 8px; }
    .fs-price { font-size: 15px; }
    .fs-orig-price { font-size: 11px; margin-bottom: 3px; }
    .fs-progress { height: 18px; border-radius: 9px; }
    .fs-progress-fill { border-radius: 9px; }
    .fs-progress-text { font-size: 9px; }
    
    /* Featured Products — base small mobile */
    .featured-section { padding: 8px !important; }
    .featured-product-card { flex: 0 0 140px; }
    .featured-product-card .product-name { font-size: 11px; -webkit-line-clamp: 2; }
    .featured-product-card .product-price { font-size: 14px; }
    .featured-product-card .product-info { padding: 6px 8px 8px; }
    
    /* Promo */
    .promo-section { padding: 8px; }
    .promo-card { padding: 14px; }
    .promo-title { font-size: 14px; }
    
    /* Products Grid */
    .products-section { padding: 8px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 8px; }
    .product-info { padding: 8px; }
    .product-name { font-size: 12px; }
    .price-current { font-size: 16px; }
    .price-original { font-size: 11px; }
    .add-cart-btn { padding: 8px; font-size: 12px; }
    
    /* Footer */
    .footer { padding: 20px 12px; }
    .footer-grid { gap: 16px; }
    .footer-logo img { height: 28px; width: auto; max-width: 100px; }
    
    /* Mobile Nav */
    .mobile-nav { padding-top: 4px; }
    .mobile-nav a { font-size: 9px; padding: 3px 6px; }
    .mobile-nav svg { width: 18px; height: 18px; }
    .mobile-nav a.active::before { width: 16px; height: 2px; top: -4px; }
    .rating-stars-mini svg { width: 9px; height: 9px; }
    .rating-text { font-size: 10px; }
    .rating-count { font-size: 9px; }
    .sales-count { font-size: 9px; }
}

/* ===== FLAGSHIP PHONES (390px-480px) — S24 Ultra, iPhone 15 Pro Max ===== */
@media (min-width: 390px) and (max-width: 480px) {
    .container { padding: 0 14px; }

    /* Header slightly bigger */
    .logo img { height: 36px; max-width: 120px; }
    .search-input { padding: 8px 12px; font-size: 14px; }
    .search-input::placeholder { font-size: 13px; }
    .nav-icon .icon-wrap { width: 32px; height: 32px; }

    /* Category nav bigger touch targets */
    .cat-nav-inner { gap: 3px; padding: 0 10px; }
    .cat-btn { padding: 8px 12px; font-size: 12px; }
    .cat-link { padding: 8px 10px; font-size: 12px; }

    /* Flash Sale — bigger cards */
    .fs-header { padding: 12px 14px 10px; }
    .fs-title { font-size: 15px; }
    .fs-scroll { gap: 10px; padding: 0 14px 14px; }
    .fs-card { flex: 0 0 195px; }
    .fs-price { font-size: 16px; }

    /* Featured Products — BIGGER cards for S24 Ultra */
    .featured-section { padding: 10px !important; }
    .featured-products-scroll { gap: 10px; padding: 10px 14px; }
    .featured-product-card { flex: 0 0 160px; }
    .featured-product-card .product-img img { padding: 10px; }
    .featured-product-card .product-name { 
        font-size: 12px; 
        -webkit-line-clamp: 2;
        height: auto;
        max-height: 36px;
    }
    .featured-product-card .product-info { padding: 8px 10px 10px; }
    .featured-product-card .product-price.has-discount .price-current { font-size: 15px; }
    .featured-product-card .product-price.has-discount .price-original { font-size: 11px; }
    .featured-product-card .product-price.has-discount .points-badge { font-size: 9px; }

    /* Section headers */
    .section-header-bar .section-title { font-size: 16px; }

    /* Products Grid — bigger items */
    .products-grid { gap: 10px; padding: 10px; }
    .product-name { font-size: 13px; }
    .price-current { font-size: 17px; }
    .add-cart-btn { padding: 9px; font-size: 13px; }

    /* Footer */
    .footer { padding: 24px 14px; }
    .footer-grid { gap: 20px; }
}

/* ===== VERY SMALL MOBILE (≤360px) ===== */
@media (max-width: 360px) {
    .container { padding: 0 8px; }
    .header-main { gap: 6px; }
    .logo img { height: 28px; max-width: 90px; }
    .search-input { padding: 6px 8px; font-size: 12px; }
    .search-btn { padding: 0 8px; }
    .nav-icon { padding: 3px 4px; }
    .nav-icon .icon-wrap { width: 28px; height: 28px; }
    .icon-wrap-point img { width: 22px; height: 22px; }
    
    .cat-nav-inner { gap: 1px; padding: 0 6px; }
    .cat-btn { padding: 6px 8px; font-size: 10px; }

    .fs-card { flex: 0 0 155px; }
    .fs-title { font-size: 13px; }
    .fs-time-box { min-width: 22px; height: 20px; font-size: 10px; }
    .fs-price { font-size: 14px; }
    
    .featured-products-scroll { gap: 8px; padding: 8px 10px; }
    .featured-product-card { flex: 0 0 128px; }
    .featured-product-card .product-name { font-size: 10px; -webkit-line-clamp: 1; }
    .featured-product-card .product-info { padding: 5px 6px 6px; }
    .featured-product-card .product-price.has-discount {
        padding: 4px 6px;
        min-height: 34px;
    }
    .featured-product-card .product-price.has-discount .price-current { font-size: 12px; }
    .featured-product-card .product-price.has-discount .points-badge { font-size: 7px; padding: 1px 3px; }

    .products-grid { gap: 6px; padding: 6px; }
    .product-name { font-size: 11px; }
    .price-current { font-size: 14px; }

    .footer-logo img { height: 24px; max-width: 80px; }
    .mobile-nav a { font-size: 8px; }
    .mobile-nav svg { width: 16px; height: 16px; }
}

/* ===== TABLET PORTRAIT (481px - 639px) ===== */
@media (min-width: 481px) and (max-width: 639px) {
    .header-login-btn { display: none; }
    .auth-btns { display: none; }
    .fs-card { flex: 0 0 200px; }
    .featured-product-card { flex: 0 0 170px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px; }
}

/* ==========================================
   🔧 Discount Badge Mobile — ป้าย % เล็กลงบนจอเล็ก
   ========================================== */
@media (max-width: 480px) {
    .featured-product-card .product-discount {
        font-size: 9px !important;
        padding: 2px 5px !important;
    }
}

/* ===== Reduced Motion ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}