/* ==========================================================================
   HealthLife Supplements & Vitamins - Modern Responsive CSS Design System
   Auto-sizing & optimized for ALL smartphones (iPhone SE, Pro Max, Galaxy, Tablets, Desktop)
   Palette: Emerald, Mint, Slate, Crisp White, Glassmorphism
   Typography: Outfit (Latin) & Kantumruy Pro (Khmer)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #059669;        /* Emerald 600 */
    --primary-hover: #047857;  /* Emerald 700 */
    --primary-light: #d1fae5;  /* Emerald 100 */
    --primary-50: #ecfdf5;     /* Emerald 50 */
    --accent: #0ea5e9;         /* Sky 500 */
    --accent-warm: #f59e0b;    /* Amber 500 */
    --dark: #0f172a;           /* Slate 900 */
    --dark-muted: #334155;     /* Slate 700 */
    --text: #1e293b;           /* Slate 800 */
    --text-muted: #64748b;     /* Slate 500 */
    --border: #e2e8f0;         /* Slate 200 */
    --bg-light: #f8fafc;       /* Slate 50 */
    --bg-card: #ffffff;
    --danger: #ef4444;
    --success: #10b981;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 30px -5px rgba(5, 150, 105, 0.15);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Kantumruy Pro', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* Announcement Bar */
.announcement-bar {
    background: linear-gradient(90deg, #065f46 0%, #047857 50%, #059669 100%);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 12px;
    text-align: center;
    line-height: 1.4;
}

/* Header & Navigation */
.header-main {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--dark);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, #34d399 100%);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

.search-box {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--bg-light);
    font-family: inherit;
    font-size: 0.88rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.85rem;
}

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

.lang-switch {
    display: flex;
    background: var(--bg-light);
    padding: 2px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.lang-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

.lang-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(5, 150, 105, 0.2);
}

.btn-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 50%;
    border: 1px solid var(--primary-light);
    font-size: 1.15rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-cart:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: var(--radius-full);
    border: 2px solid #ffffff;
    line-height: 1;
}

/* Nav Menu (Horizontal Touch-Scroll on Mobile) */
.nav-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid #f1f5f9;
}

.nav-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    padding: 8px 4px;
    white-space: nowrap;
}

.nav-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--dark-muted);
    padding: 6px 2px;
    position: relative;
    display: inline-block;
}

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

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

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    z-index: 999;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
}

.mobile-bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 8px;
    position: relative;
}

.mobile-nav-item i {
    font-size: 1.15rem;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--primary);
}

.mobile-nav-badge {
    position: absolute;
    top: 0;
    right: 12px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: var(--radius-full);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-align: center;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4);
}

.btn-secondary {
    background: #ffffff;
    color: var(--dark);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #e6fffa 50%, #f8fafc 100%);
    padding: 40px 0 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 32px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--primary-light);
    margin-bottom: 16px;
    max-width: 100%;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw + 1rem, 3rem);
    font-weight: 800;
    color: var(--dark);
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: clamp(0.92rem, 1.5vw + 0.5rem, 1.12rem);
    color: var(--text-muted);
    margin-bottom: 28px;
    max-width: 520px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.hero-image-wrapper {
    position: relative;
    max-width: 100%;
}

.hero-img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.hero-floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-card-1 {
    bottom: -15px;
    left: -15px;
}

.hero-card-2 {
    top: 15px;
    right: -15px;
}

/* Trust Bar */
.trust-bar {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: -30px;
    position: relative;
    z-index: 10;
    padding: 24px;
    border: 1px solid var(--border);
}

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

.trust-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.trust-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.trust-content h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.trust-content p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Section Header */
.section-header {
    text-align: center;
    max-width: 650px;
    margin: 40px auto 30px auto;
    padding: 0 10px;
}

.section-tag {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: block;
}

.section-title {
    font-size: clamp(1.4rem, 2.5vw + 0.8rem, 2.1rem);
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.section-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.category-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 16px 10px;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.category-icon-wrapper {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary-50) 0%, #e0f2fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 10px;
    transition: var(--transition);
}

.category-card:hover .category-icon-wrapper {
    transform: scale(1.08);
    background: var(--primary);
    color: #ffffff;
}

.category-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
    line-height: 1.3;
}

.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Product Cards & Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.product-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-sale {
    background: #ef4444;
    color: #ffffff;
}

.badge-bestseller {
    background: #f59e0b;
    color: #ffffff;
}

.product-image-container {
    position: relative;
    background: #f8fafc;
    padding: 14px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-container img {
    max-height: 150px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

.product-info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}

.product-form-pill {
    display: inline-block;
    align-self: flex-start;
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.stars {
    color: #f59e0b;
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.product-pricing {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.original-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 6px;
}

/* Product Detail Page */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border);
    margin-bottom: 36px;
}

.gallery-main {
    background: #f8fafc;
    border-radius: var(--radius-md);
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    padding: 20px;
}

.gallery-main img {
    max-height: 320px;
    object-fit: contain;
}

.supplement-facts-box {
    border: 2px solid #000000;
    padding: 14px 16px;
    background: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    margin: 18px 0;
    border-radius: 4px;
    max-width: 100%;
    overflow-x: auto;
}

.facts-header {
    border-bottom: 8px solid #000000;
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.facts-header h3 {
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
}

.facts-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #94a3b8;
    padding: 5px 0;
    font-size: 0.88rem;
}

.facts-row.bold {
    font-weight: 700;
    border-bottom: 4px solid #000000;
}

/* Tabs with horizontal swipe on mobile */
.tabs-nav {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.tab-btn {
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    font-family: inherit;
    flex-shrink: 0;
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Responsive Catalog Layout (Sidebar + Grid) */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

/* Cart Page */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin: 24px 0 50px 0;
}

.cart-table-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    padding: 20px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.cart-item-img {
    width: 64px;
    height: 64px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    object-fit: contain;
    padding: 4px;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qty-btn {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.order-summary-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 22px;
    height: fit-content;
    box-shadow: var(--shadow-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.92rem;
}

.summary-total {
    border-top: 2px dashed var(--border);
    padding-top: 14px;
    margin-top: 14px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dark);
}

/* Checkout Page */
.checkout-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    margin: 24px 0 50px 0;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-family: inherit;
    font-size: 0.92rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.payment-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 14px 0;
}

.payment-option-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-option-card:hover, .payment-option-card.active {
    border-color: var(--primary);
    background: var(--primary-50);
}

/* Footer */
.footer-main {
    background: #0f172a;
    color: #e2e8f0;
    padding: 50px 0 24px 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.88rem;
}

.footer-links a:hover {
    color: #34d399;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
}

/* Toast Alerts */
.toast-alert {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    font-size: 0.9rem;
}

.toast-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Responsive grid helper classes */
.grid-2col-responsive {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==========================================================================
   SUPERIOR SMARTPHONE & TABLET RESPONSIVE SYSTEM
   Breakpoints:
   - <= 992px: Tablets & small laptops
   - <= 768px: Mobile landscape & large smartphones
   - <= 640px: Main smartphone view (Portrait)
   - <= 480px: Compact smartphones (iPhone SE, Galaxy A, etc.)
   ========================================================================== */

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 28px;
    }
    .hero-cta {
        justify-content: center;
    }
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    .product-detail-grid, .cart-layout, .checkout-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 65px; /* Clear space for sticky bottom navigation */
    }
    .mobile-bottom-nav {
        display: block;
    }
    .hero-img {
        height: 280px;
    }
    /* Prevent floating cards from overflowing screen width */
    .hero-floating-card {
        position: static;
        margin: 10px auto;
        max-width: 90%;
    }
    .hero-card-1, .hero-card-2 {
        position: static;
        transform: none;
    }
    .trust-bar {
        margin-top: 20px;
        padding: 18px;
    }
    .product-detail-grid {
        padding: 18px;
        gap: 20px;
    }
    .gallery-main {
        height: 280px;
        padding: 12px;
    }
    .gallery-main img {
        max-height: 240px;
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .announcement-bar {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }
    .brand-logo {
        font-size: 1.2rem;
    }
    .brand-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .search-input {
        padding: 8px 14px 8px 34px;
        font-size: 0.84rem;
    }
    .trust-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    .trust-item {
        gap: 8px;
    }
    .trust-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .trust-content h4 {
        font-size: 0.82rem;
    }
    .trust-content p {
        display: none; /* Hide verbose text on small phones for ultra-clean UI */
    }

    /* 2 Clean Columns on Smartphones (Like Shopee/Lazada) */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-card {
        border-radius: var(--radius-sm);
    }
    .product-image-container {
        height: 140px;
        padding: 10px;
    }
    .product-image-container img {
        max-height: 120px;
    }
    .product-info {
        padding: 10px 10px 12px 10px;
    }
    .product-title {
        font-size: 0.86rem;
        height: 2.7em;
        margin-bottom: 4px;
    }
    .product-form-pill {
        font-size: 0.68rem;
        padding: 1px 5px;
        margin-bottom: 4px;
    }
    .product-rating {
        font-size: 0.72rem;
        margin-bottom: 6px;
    }
    .current-price {
        font-size: 1.1rem;
    }
    .original-price {
        font-size: 0.78rem;
    }
    .product-actions .btn {
        padding: 6px 8px;
        font-size: 0.78rem;
    }

    /* 3 or 4 Compact Category Cards on Smartphones */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .category-card {
        padding: 12px 6px;
        border-radius: var(--radius-sm);
    }
    .category-icon-wrapper {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        margin-bottom: 6px;
    }
    .category-name {
        font-size: 0.76rem;
    }
    .category-count {
        font-size: 0.68rem;
    }

    /* Responsive 2-column form grids collapse to 1-col */
    .grid-2col-responsive {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Cart Item Card for Smartphones */
    .cart-table-card {
        padding: 14px;
    }
    .cart-item-row {
        gap: 10px;
        padding: 12px 0;
    }
    .cart-item-img {
        width: 54px;
        height: 54px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 400px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-title {
        font-size: 1.65rem;
    }
}

/* ==========================================================================
   FLASH SALE & PROMOTION COUNTDOWN STYLES
   ========================================================================== */
.flash-sale-section {
    padding: 48px 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #064e3b 100%);
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.flash-sale-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.12) 0%, rgba(16, 185, 129, 0.08) 50%, transparent 70%);
    pointer-events: none;
    animation: rotateGlow 20s linear infinite;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.flash-sale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
}

.flash-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.countdown-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
}

.countdown-num {
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1;
    color: #fbbf24;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.countdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 4px;
}

.countdown-sep {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ef4444;
    margin-top: -6px;
}

.flash-sale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
    position: relative;
    z-index: 2;
}

.flash-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    color: #1e293b;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.flash-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.35);
}

.flash-img-wrap {
    position: relative;
    padding-top: 80%;
    background: #f8fafc;
    overflow: hidden;
}

.flash-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.flash-card:hover .flash-img-wrap img {
    transform: scale(1.08);
}

.flash-deal-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
    z-index: 3;
}

.flash-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.flash-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.flash-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.flash-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.flash-current-price {
    font-size: 1.45rem;
    font-weight: 900;
    color: #dc2626;
}

.flash-old-price {
    font-size: 0.95rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.flash-stock-bar {
    margin-bottom: 14px;
}

.flash-bar-track {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}

.flash-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ef4444 100%);
    border-radius: 9999px;
    transition: width 0.6s ease;
}

.flash-stock-text {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

.btn-grab-deal {
    width: 100%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-grab-deal:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}


