* { margin: 0; padding: 0; box-sizing: border-box; }
img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; user-select: none; }
html, body { overscroll-behavior-x: none; overflow-x: hidden; }
body { -webkit-overflow-scrolling: touch; }

:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: rgba(5,150,105,0.08);
    --accent: #DC2626;
    --accent-light: rgba(234,88,12,0.08);
    --success: #10B981;
    --bg: #f8fafb;
    --card: #ffffff;
    --text: #0F172A;
    --text2: #475569;
    --text3: #94a3b8;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme: Ocean Blue */
[data-theme="blue"] {
    --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: rgba(37,99,235,0.08); --accent: #f59e0b;
}

/* Theme: Emerald Green (default) */
[data-theme="green"] {
    --primary: #059669; --primary-dark: #047857; --primary-light: rgba(5,150,105,0.08); --accent: #EA580C;
}

/* Theme: Rose Pink */
[data-theme="pink"] {
    --primary: #e11d48; --primary-dark: #be123c; --primary-light: rgba(225,29,72,0.08); --accent: #6366f1;
}

/* Theme: Amber Orange */
[data-theme="orange"] {
    --primary: #d97706; --primary-dark: #b45309; --primary-light: rgba(217,119,6,0.08); --accent: #059669;
}

/* Theme: Indigo */
[data-theme="indigo"] {
    --primary: #6366f1; --primary-dark: #4f46e5; --primary-light: rgba(99,102,241,0.08); --accent: #f59e0b;
}

/* Theme: Dark Mode */
[data-theme="dark"] {
    --primary: #34d399; --primary-dark: #10B981; --primary-light: rgba(52,211,153,0.12);
    --accent: #fb923c;
    --bg: #0f172a; --card: #1e293b; --text: #f1f5f9; --text2: #94a3b8; --text3: #64748b;
    --border: #334155; --shadow-sm: 0 1px 3px rgba(0,0,0,0.2); --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
}

[data-theme="dark"] .topbar { background: rgba(30,41,59,0.92); border-bottom-color: var(--border); }
[data-theme="dark"] .search-bar input { background: var(--card); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .search-bar input::placeholder { color: var(--text3); }
[data-theme="dark"] .cat-chip { background: var(--card); border-color: var(--border); color: var(--text2); }
[data-theme="dark"] .product-card { background: var(--card); }
[data-theme="dark"] .product-img { background: linear-gradient(145deg, #1e293b, #334155); }
[data-theme="dark"] .hscroll-card { background: var(--card); }
[data-theme="dark"] .hscroll-img { background: linear-gradient(145deg, #1e293b, #334155); }
[data-theme="dark"] .overlay-content { background: var(--card); }
[data-theme="dark"] .input-wrap input { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .toggle-btn { color: var(--text3); }
[data-theme="dark"] .toggle-group { background: #0f172a; }
[data-theme="dark"] .toggle-btn.active { background: var(--card); }
[data-theme="dark"] .order-card, [data-theme="dark"] .review-card, [data-theme="dark"] .write-review { background: var(--card); }
[data-theme="dark"] .order-input, [data-theme="dark"] textarea { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .site-footer { background: var(--card); border-top-color: var(--border); }
[data-theme="dark"] .lang-current { background: var(--card); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .lang-menu { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .sort-select { background: var(--card); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .profile-input { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .content-overlay { background: var(--bg); }
[data-theme="dark"] .content-overlay-topbar { background: rgba(15,23,42,0.92); }
[data-theme="dark"] .cp-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .cp-contact-row { background: #1e293b; }
[data-theme="dark"] .content-overlay ul li { background: #1e293b; }
[data-theme="dark"] .detail-gallery { background: linear-gradient(145deg, #1e293b, #334155); }
[data-theme="dark"] .detail-fav-btn { background: #1e293b; border-color: var(--border); }
[data-theme="dark"] .detail-action-btn { background: #1e293b; border-color: var(--border); }
[data-theme="dark"] .detail-action-btn svg { color: var(--text); }
[data-theme="dark"] .detail-qty-inline { background: #1e293b; border-color: var(--border); }
[data-theme="dark"] .detail-actions-bar { background: var(--card); }
[data-theme="dark"] .detail-share-btn { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .popup-card { background: var(--card); }
[data-theme="dark"] .popup-body h3 { color: var(--text); }
[data-theme="dark"] .popup-body p { color: var(--text2); }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh; min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    padding-top: calc(70px + var(--safe-top));
    padding-bottom: calc(68px + var(--safe-bottom));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

.hidden { display: none !important; }

.page { max-width: 600px; margin: 0 auto; }

/* ===== TOP BAR ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding-top: var(--safe-top);
}

.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; max-width: 600px; margin: 0 auto;
}

.topbar-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.welcome-name {
    font-size: 12px; font-weight: 600; color: var(--text2);
    background: none; -webkit-text-fill-color: var(--text2);
    margin-left: 4px; max-width: 100px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

.lang-switcher { display: flex; gap: 4px; }

/* Language picker */
.lang-picker { position: relative; }

.lang-current {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 10px;
    background: var(--card); color: var(--text);
    font-size: 12px; font-weight: 600; cursor: pointer;
}

.lang-current:active { border-color: var(--primary); }

.lang-menu {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--card); border: 1.5px solid var(--border);
    border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    overflow: hidden; z-index: 50; min-width: 140px;
    max-width: calc(100vw - 32px);
}

.lang-option {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; font-size: 13px; font-weight: 600;
    color: var(--text); cursor: pointer; transition: background 0.15s;
}

.lang-option:hover, .lang-option:active { background: var(--primary-light); }
.lang-option.active { color: var(--primary); background: var(--primary-light); }

/* Theme toggle */
.theme-toggle svg { width: 18px; height: 18px; }

.icon-btn {
    position: relative; width: 38px; height: 38px;
    border: none; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}

.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(0.92); }

.badge {
    position: absolute; top: -2px; right: -2px;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ===== SEARCH ===== */
.search-bar { position: relative; margin: 0 16px 8px; }

.search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--text3); pointer-events: none;
}
[dir="rtl"] .search-icon { left: auto; right: 14px; }

.search-bar input {
    width: 100%; padding: 12px 16px 12px 42px;
    border: 1.5px solid var(--border); border-radius: 24px;
    font-size: 15px; color: var(--text);
    background: var(--card); outline: none; transition: all 0.2s;
}
[dir="rtl"] .search-bar input { padding: 12px 42px 12px 16px; }

.search-bar input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light);
}

/* ===== BANNER CAROUSEL ===== */
.banner-container {
    margin: 4px 16px 10px; position: relative; overflow: hidden;
    border-radius: 16px; aspect-ratio: 2 / 1;
}

.banner-track {
    display: flex; transition: transform 0.4s ease;
    height: 100%;
}

.banner-slide {
    min-width: 100%; height: 100%; padding: 20px 24px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: space-between;
    color: #fff;
    cursor: pointer; user-select: none;
    background-size: cover; background-position: center;
    position: relative; overflow: hidden;
}

.banner-slide.has-image {
    padding: 0;
}

.banner-slide.has-image .banner-text {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 1;
}

.banner-slide.has-image .banner-img {
    width: 100%; height: 100%; object-fit: cover;
    position: absolute; inset: 0;
}

.banner-text { flex: 1; }

.banner-tag {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    padding: 3px 10px; border-radius: 20px;
    font-size: 10px; font-weight: 800;
    letter-spacing: 1px; margin-bottom: 6px;
}

.banner-text h3 {
    font-size: 20px; font-weight: 800; margin-bottom: 2px;
    line-height: 1.2;
}

.banner-text p {
    font-size: 13px; opacity: 0.9;
}

.banner-emoji {
    font-size: 48px; flex-shrink: 0; margin-left: 12px;
}
[dir="rtl"] .banner-emoji { margin-left: 0; margin-right: 12px; }

.banner-dots {
    display: flex; justify-content: center; gap: 6px;
    padding: 10px 0 2px;
}

.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border); transition: all 0.3s; cursor: pointer;
}

.dot.active {
    background: var(--primary); width: 20px; border-radius: 4px;
}

/* ===== PRODUCT SECTIONS (horizontal scroll) ===== */
.product-section {
    margin-bottom: 14px;
}

.section-head {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 16px 8px;
}

.section-icon { font-size: 18px; }

.section-head h3 {
    font-size: 16px; font-weight: 800; color: var(--text);
    flex: 1;
}

.section-see-all {
    font-size: 12px; font-weight: 700; color: var(--primary);
    cursor: pointer;
}

.hscroll {
    display: flex; gap: 10px;
    padding: 0 16px 12px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.hscroll::-webkit-scrollbar { display: none; }

.hscroll-card {
    flex-shrink: 0;
    width: 150px;
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
    scroll-snap-align: start;
}

.hscroll-card:active { transform: scale(0.97); }

.hscroll-img {
    width: 100%; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
    overflow: hidden;
}

.hscroll-info {
    padding: 8px 10px 10px;
}

.hscroll-name {
    font-size: 12px; font-weight: 700; color: var(--text);
    line-height: 1.2; margin-bottom: 3px;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}

.hscroll-price {
    font-size: 14px; font-weight: 800; color: var(--primary);
}

.hscroll-price .old-price {
    text-decoration: line-through; color: var(--text3);
    font-size: 10px; font-weight: 600;
    margin-right: 4px;
}

.hscroll-price .sale-badge {
    background: #fef2f2; color: #dc2626;
    font-size: 9px; font-weight: 800;
    padding: 1px 5px; border-radius: 6px;
    margin-left: 4px;
}

.hscroll-rating {
    font-size: 10px; color: #f59e0b; margin-top: 2px;
}

/* ===== CATEGORIES ===== */
.categories {
    display: flex; gap: 8px; padding: 4px 16px 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }

.cat-chip {
    flex-shrink: 0; padding: 7px 16px;
    border: 1.5px solid var(--border); border-radius: 50px;
    background: var(--card); color: var(--text2);
    font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}

.cat-chip.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}

/* ===== SECTION TITLE ===== */
.section-title {
    padding: 12px 16px 8px; font-size: 18px; font-weight: 800; color: var(--text);
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; padding: 6px 16px 24px;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
    cursor: pointer;
    height: 100%;
}
.product-card:active { transform: scale(0.97); box-shadow: var(--shadow-md); }
@media (hover: hover) {
    .product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
    .hscroll-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
}

.product-img {
    width: 100%; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px;
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
    overflow: hidden; position: relative;
}

/* Progressive image loading — skeleton shimmer → fade in */
.prog-img {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.prog-img.prog-loaded {
    opacity: 1;
}
/* Skeleton shimmer behind images while loading */
.product-img,
.banner-slide,
.hscroll-card .product-img,
.cart-item-img {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
    background-size: 400% 100%;
    animation: imgShimmer 1.4s ease infinite;
}
.product-img:has(.prog-loaded),
.banner-slide:has(.prog-loaded) {
    animation: none;
    background: var(--bg);
}
@keyframes imgShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Favourite button on card */
.fav-btn {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.9); border: none;
    font-size: 16px; color: var(--text3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.fav-btn.fav-active { color: #ef4444; }
.fav-btn:active { transform: scale(1.2); }

/* Detail page fav button */
/* Actions bar: Fav + Share + Qty in one row */
.detail-actions-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.detail-action-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    font-size: 20px; color: var(--text3); flex-shrink: 0;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
}
.detail-action-btn:active { transform: scale(1.1); }
.detail-action-btn svg { color: var(--text3); }
.detail-actions-spacer { flex: 1; }
.detail-qty-inline {
    display: flex; align-items: center; gap: 0;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
.detail-qty-inline .qty-btn {
    width: 44px; height: 44px; border: none;
    background: none; font-size: 18px; font-weight: 700;
    color: var(--text); cursor: pointer; transition: background 0.2s;
    touch-action: manipulation;
}
.detail-qty-inline .qty-btn:active { background: var(--border); }
.detail-qty-inline span {
    min-width: 32px; text-align: center;
    font-size: 16px; font-weight: 800; color: var(--text);
}
.detail-float-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.92); border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.detail-float-btn:active { transform: scale(1.15); }
.detail-float-btn svg { color: var(--text3); }

.detail-fav-btn {
    font-size: 20px; color: var(--text3);
}
.detail-fav-btn.fav-active { color: #ef4444; background: #fef2f2; border-color: #fecaca; }
.detail-fav-btn:active { transform: scale(1.15); }

.product-img img, .hscroll-img img, .thumb img, .detail-main-img img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.product-info {
    padding: 10px 12px 12px;
    display: flex; flex-direction: column; flex: 1; gap: 3px;
}

.social-badge {
    display: inline-flex; align-items: center; gap: 3px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 6px;
    line-height: 1.3; width: fit-content;
}

.product-name {
    font-size: 13px; font-weight: 700; color: var(--text);
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.product-category {
    font-size: 10px; font-weight: 600; color: var(--primary);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.product-desc {
    font-size: 11px; color: var(--text3); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; flex: 1;
}

.product-bottom {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto; padding-top: 4px;
    border-top: 1px solid var(--border);
}

.product-price {
    font-size: 15px; font-weight: 800; color: var(--primary);
    letter-spacing: -0.3px;
}

.product-discount-pct {
    font-size: 10px; font-weight: 800; color: #dc2626;
    background: #fef2f2; padding: 1px 5px; border-radius: 4px;
}

/* ===== RANK BADGE (Most Ordered / 2nd Most Ordered) ===== */
.rank-badge {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; border-radius: 8px;
    font-size: 10px; font-weight: 800; line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.rank-badge.rank-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}
.rank-badge.rank-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}
.rank-badge.rank-best {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
}
.rank-badge.rank-trending {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

/* ===== FEATURED CARD (single product) ===== */
.featured-product {
    grid-column: 1 / -1;
    display: flex; flex-direction: column;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.featured-product .featured-img {
    width: 100%; aspect-ratio: 4 / 3;
    overflow: hidden; position: relative;
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
}
.featured-product .featured-img img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.featured-product .featured-body {
    padding: 16px 20px 20px;
    display: flex; flex-direction: column; gap: 6px;
}
.featured-product .featured-body .product-category {
    font-size: 11px;
}
.featured-product .featured-body .product-name {
    font-size: 18px; -webkit-line-clamp: 2;
}
.featured-product .featured-body .product-desc {
    font-size: 12px; -webkit-line-clamp: 2; color: var(--text3);
}
.featured-product .featured-price {
    font-size: 22px; font-weight: 800; color: var(--primary);
    margin-top: 4px;
}
.featured-product .featured-cta {
    display: flex; gap: 8px; margin-top: 8px;
}
.featured-cta .btn-order {
    flex: 1; padding: 12px 0;
    border: none; border-radius: 12px;
    background: var(--primary); color: #fff;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.featured-cta .btn-order:active { transform: scale(0.97); }
.featured-cta .btn-cart {
    width: 48px; height: 48px;
    border: 2px solid var(--border); border-radius: 12px;
    background: var(--card); color: var(--text);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.featured-cta .btn-cart:active { transform: scale(0.95); }

/* ===== IMPROVED EMPTY STATE ===== */
.empty-products {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; text-align: center; gap: 12px;
}
.empty-products-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin-bottom: 4px;
}
.empty-products-title {
    font-size: 16px; font-weight: 700; color: var(--text);
}
.empty-products-sub {
    font-size: 13px; color: var(--text3); max-width: 260px;
}

.add-btn {
    width: 36px; height: 36px;
    border: none; border-radius: 12px;
    background: var(--accent, var(--primary)); color: #fff;
    font-size: 20px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(234,88,12,0.3);
    flex-shrink: 0;
}
.add-btn:active { transform: scale(0.9); }

.add-btn:active { transform: scale(0.88); }

/* Duo action buttons on product card */
.card-actions-duo {
    display: flex; gap: 4px; flex-shrink: 0;
}

.cart-icon-btn {
    background: var(--primary-light); color: var(--primary);
    box-shadow: none; border: 1.5px solid var(--primary);
    width: 32px; height: 32px; border-radius: 8px;
}
.cart-icon-btn:active { background: var(--primary); color: #fff; }

.buy-now-btn {
    background: var(--primary); color: #fff;
    width: 32px; height: 32px; border-radius: 8px;
}
.buy-now-btn:active { background: var(--primary-dark); }

/* ===== DETAIL PAGE STICKY BOTTOM BAR ===== */
.detail-sticky-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 160;
    display: flex; gap: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    padding: 10px 16px calc(10px + var(--safe-bottom));
    max-width: 600px; margin: 0 auto;
}

.detail-cart-btn-sticky {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 14px; border: 2px solid var(--primary);
    border-radius: 12px 0 0 12px;
    background: var(--card); color: var(--primary);
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.detail-cart-btn-sticky:active { background: var(--primary-light); }
.detail-cart-btn-sticky:disabled { opacity: 0.4; cursor: not-allowed; }

.detail-buy-btn-sticky {
    flex: 1.3; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 14px; border: none;
    border-radius: 0 12px 12px 0;
    background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff;
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(99,102,241,0.3);
}
.detail-buy-btn-sticky:active { opacity: 0.85; transform: scale(0.98); }
.detail-buy-btn-sticky:disabled { opacity: 0.4; cursor: not-allowed; }

[data-theme="dark"] .detail-sticky-bar { background: var(--card); border-top-color: var(--border); }
[data-theme="dark"] .detail-cart-btn-sticky { background: var(--card); }

/* Product card mini rating */
.product-rating {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 6px;
}

.mini-stars { color: #f59e0b; font-size: 11px; letter-spacing: -1px; }
.mini-rating-text { font-size: 11px; color: var(--text3); }

/* ===== PRODUCT DETAIL PAGE ===== */
.detail-page {
    position: fixed; inset: 0; z-index: 150;
    background: var(--bg);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding-top: 0 !important;
    animation: pageSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes pageSlide {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.back-btn {
    position: fixed; top: calc(8px + var(--safe-top)); left: 8px; z-index: 160;
    width: 48px; height: 48px;
    padding: 8px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.95); color: var(--text);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}
[dir="rtl"] .back-btn { left: auto; right: 8px; }
.back-btn svg { width: 22px; height: 22px; }
.back-btn:active { transform: scale(0.9); background: rgba(240,240,240,0.95); }

/* Detail photo - main image + thumbnails (Coupang style) */
.detail-gallery {
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
}

.detail-main-img {
    width: 100%; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 100px; user-select: none;
    cursor: pointer; position: relative;
    transition: background 0.2s;
    overflow: hidden;
}

.detail-main-img:active { background: rgba(0,0,0,0.02); }

.zoom-hint {
    position: absolute; bottom: 10px; right: 12px;
    background: rgba(0,0,0,0.5); color: #fff;
    padding: 4px 10px; border-radius: 16px;
    font-size: 11px; font-weight: 600;
    display: flex; align-items: center; gap: 4px;
    pointer-events: none;
}

.zoom-hint svg { width: 14px; height: 14px; }

.detail-thumbs {
    display: flex; gap: 8px;
    padding: 8px 16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--card);
}

.detail-thumbs::-webkit-scrollbar { display: none; }

.thumb {
    flex-shrink: 0;
    width: 56px; height: 56px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; cursor: pointer;
    background: #f1f5f9;
    border: 2.5px solid transparent;
    transition: all 0.2s;
    overflow: hidden;
}

.thumb.active {
    border-color: var(--primary);
    background: #eef2ff;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.thumb:active { transform: scale(0.92); }

/* Photo counter */
.photo-counter {
    position: absolute; bottom: 10px; left: 12px;
    background: rgba(0,0,0,0.5); color: #fff;
    padding: 4px 10px; border-radius: 16px;
    font-size: 11px; font-weight: 700;
    pointer-events: none;
}

/* ===== FULLSCREEN ZOOM VIEWER ===== */
.zoom-viewer {
    position: fixed; inset: 0; z-index: 500;
    background: #000;
    display: flex; flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.zoom-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-top));
    color: #fff; flex-shrink: 0;
}

.zoom-counter { font-size: 15px; font-weight: 700; }

.zoom-close {
    width: 42px; height: 42px; border: none; border-radius: 50%;
    background: rgba(255,255,255,0.2); color: #fff;
    font-size: 26px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.zoom-close:active { background: rgba(255,255,255,0.4); }

.zoom-body {
    flex: 1; overflow: hidden; position: relative;
    display: flex; align-items: center; justify-content: center;
    touch-action: none;
}

.zoom-img-container {
    font-size: 140px;
    transform-origin: center center;
    transition: transform 0.1s ease;
    user-select: none;
}

.zoom-thumbs {
    display: flex; gap: 8px; justify-content: center;
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-bottom));
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.zoom-thumb {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; cursor: pointer;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.zoom-thumb.active {
    border-color: #fff;
    background: rgba(255,255,255,0.2);
}

.detail-dots .dot.active {
    background: var(--primary); width: 20px; border-radius: 4px;
}

/* Detail body */
.detail-body {
    padding: 20px 16px calc(80px + var(--safe-bottom));
    max-width: 600px; margin: 0 auto;
}

.detail-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; margin-bottom: 8px;
}

.detail-header h1 {
    font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2;
}

.detail-category {
    font-size: 12px; color: var(--text3); margin-top: 2px;
}

.detail-price {
    font-size: 24px; font-weight: 800; color: var(--primary);
    white-space: nowrap; flex-shrink: 0;
}

.detail-rating-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}

.stars-display { color: #f59e0b; font-size: 18px; letter-spacing: -1px; }
.rating-text { font-size: 13px; color: var(--text2); }

.detail-desc {
    font-size: 14px; color: var(--text2); line-height: 1.6;
    margin-bottom: 16px;
}

/* Tier pricing table */
.tier-table {
    background: var(--card); border-radius: var(--radius);
    border: 1.5px solid var(--primary-light); overflow: hidden;
    margin-bottom: 14px;
}

.tier-table-head {
    background: var(--primary-light); padding: 8px 14px;
    font-size: 13px; font-weight: 700; color: var(--primary);
}

.tier-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.tier-row:last-child { border-bottom: none; }
.tier-qty-label { color: var(--text2); font-weight: 600; }
.tier-price-label { font-weight: 800; color: var(--primary); }
.tier-save { font-size: 11px; color: #059669; font-weight: 700; }

/* Detail content */
.detail-content {
    background: var(--card); border-radius: var(--radius);
    padding: 16px; margin-bottom: 14px;
    font-size: 14px; color: var(--text2); line-height: 1.7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    white-space: pre-wrap;
}

/* Detail images */
.detail-images {
    margin-bottom: 14px;
}

.detail-images img {
    width: 100%; border-radius: var(--radius);
    margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.detail-add-btn { margin-bottom: 24px; }

/* Reviews Section */
.reviews-section { margin-top: 8px; }

.reviews-title {
    font-size: 18px; font-weight: 800; color: var(--text);
    margin-bottom: 14px;
}

/* Write review */
.write-review {
    background: var(--card); border-radius: var(--radius);
    padding: 16px; margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.write-review h4 {
    font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px;
}

.star-picker {
    display: flex; gap: 6px; margin-bottom: 10px;
}

.pick-star {
    font-size: 28px; cursor: pointer; color: #d1d5db;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
}

.pick-star.active { color: #f59e0b; }
.pick-star:active { transform: scale(1.2); }

textarea {
    width: 100%; padding: 12px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 14px; color: var(--text);
    background: #f8fafc; outline: none; resize: vertical;
    font-family: inherit; transition: border-color 0.2s;
    margin-bottom: 10px;
}

textarea::placeholder { color: #cbd5e1; }
textarea:focus { border-color: var(--primary); background: #fff; }

.btn-sm { padding: 10px; font-size: 14px; }

/* Review card */
.review-card {
    background: var(--card); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.review-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}

.review-user {
    display: flex; align-items: center; gap: 8px;
}

.review-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff; font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.review-name { font-size: 13px; font-weight: 700; color: var(--text); }
.review-date { font-size: 11px; color: var(--text3); }
.review-stars { color: #f59e0b; font-size: 13px; letter-spacing: -1px; margin-bottom: 4px; }
.review-comment { font-size: 13px; color: var(--text2); line-height: 1.5; }

.no-reviews { text-align: center; color: var(--text3); font-size: 13px; padding: 20px 0; }

/* ===== OVERLAY / AUTH MODAL ===== */
.overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: flex-end; justify-content: center;
    /* Prevent mobile keyboard from pushing content */
    height: 100%; height: 100dvh;
}

.overlay-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}

.overlay-content {
    position: relative; width: 100%; max-width: 440px;
    max-height: 85vh; max-height: 85dvh;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--card);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px calc(20px + var(--safe-bottom));
    animation: slideUp 0.35s ease;
}
/* Prevent iOS zoom on input focus inside overlay */
.overlay-content input, .overlay-content select, .overlay-content textarea {
    font-size: 16px !important;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.close-btn {
    position: absolute; top: 12px; right: 16px;
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: #f1f5f9; color: var(--text2); font-size: 22px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
[dir="rtl"] .close-btn { right: auto; left: 16px; }

.auth-card { animation: none; }
.brand { text-align: center; margin-bottom: 20px; }
.brand h2 { font-size: 22px; font-weight: 800; color: var(--text); }
.brand p { font-size: 13px; color: var(--text3); margin-top: 2px; }

/* ===== TOGGLE ===== */
.toggle-group {
    display: flex; background: #f1f5f9;
    border-radius: 12px; padding: 4px; margin-bottom: 16px;
}

.toggle-btn {
    flex: 1; padding: 10px; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 600; color: var(--text3);
    background: transparent; cursor: pointer; transition: all 0.25s;
}

.toggle-btn.active {
    background: #fff; color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== FORM INPUTS ===== */
.form-group { margin-bottom: 12px; }

.input-wrap { position: relative; display: flex; align-items: center; }

.input-icon {
    position: absolute; left: 14px;
    width: 18px; height: 18px; color: var(--text3);
    pointer-events: none; transition: color 0.2s;
}
[dir="rtl"] .input-icon { left: auto; right: 14px; }

.input-wrap input {
    width: 100%; padding: 13px 14px 13px 42px;
    border: 2px solid var(--border); border-radius: 12px;
    font-size: 15px; color: var(--text);
    background: #f8fafc; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
[dir="rtl"] .input-wrap input { padding: 13px 42px 13px 14px; }

.input-wrap input::placeholder { color: #cbd5e1; }

.input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: #fff;
}

.eye-btn {
    position: absolute; right: 12px;
    background: none; border: none; cursor: pointer;
    padding: 4px; color: var(--text3); display: flex; transition: color 0.2s;
}
[dir="rtl"] .eye-btn { right: auto; left: 12px; }
.eye-btn svg { width: 20px; height: 20px; }

/* ===== BUTTONS ===== */
.btn {
    width: 100%; padding: 14px; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: all 0.25s; margin-top: 4px;
}

.btn-primary {
    background: var(--primary); color: #fff;
    box-shadow: 0 4px 16px rgba(5,150,105,0.3);
    transition: all var(--transition);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(5,150,105,0.4); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.95); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ===== MESSAGES ===== */
.message { margin-top: 10px; border-radius: 10px; font-size: 13px; text-align: center; }

.message.error {
    background: #fef2f2; color: #dc2626; padding: 10px; border: 1px solid #fecaca;
}

.message.success {
    background: #f0fdf4; color: #16a34a; padding: 10px; border: 1px solid #bbf7d0;
}

.switch-text {
    text-align: center; margin-top: 16px;
    font-size: 13px; color: var(--text3);
}

.switch-text a { color: var(--primary); text-decoration: none; font-weight: 700; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: calc(80px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #1e293b, #334155); color: #fff;
    padding: 12px 20px; border-radius: 14px;
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 300; animation: toastIn 0.3s ease; white-space: nowrap;
}

.toast svg { width: 20px; height: 20px; color: #4ade80; flex-shrink: 0; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== POPUP NOTICE ===== */
.popup-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.25s ease;
}

.popup-card {
    background: var(--card); border-radius: 20px;
    max-width: 360px; width: 100%;
    overflow: hidden; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.35s ease;
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.popup-close {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.4); color: #fff;
    border: none; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

.popup-close:active { background: rgba(0,0,0,0.6); }

.popup-img {
    width: 100%; max-height: 280px; object-fit: cover;
    display: block; cursor: pointer;
}

.popup-body {
    padding: 18px 20px 8px;
}

.popup-body h3 {
    font-size: 18px; font-weight: 800; color: var(--text);
    margin-bottom: 6px;
}

.popup-body p {
    font-size: 13px; color: var(--text2); line-height: 1.5;
}

.popup-actions {
    padding: 10px 20px 16px;
    display: flex; flex-direction: column; gap: 6px;
}

.popup-btn {
    width: 100%; padding: 11px; border-radius: 10px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    border: none; transition: all 0.2s;
}

.popup-btn-primary {
    background: var(--primary); color: #fff;
}

.popup-btn-primary:active { opacity: 0.8; }

.popup-btn-ghost {
    background: transparent; color: var(--text3);
    font-size: 12px;
}

.popup-btn-ghost:active { background: #f1f5f9; }

/* ===== SPINNER ===== */
.btn .spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spin 0.6s linear infinite; vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Button action states */
.btn-loading,.btn-success,.btn-error{pointer-events:none;transition:background .2s,color .2s,border-color .2s;}
.btn-loading{opacity:.85;}
.btn-success{animation:btnPop .3s ease;}
.btn-error{animation:btnShake .4s ease;}
@keyframes btnPop{0%{transform:scale(1)}50%{transform:scale(1.05)}100%{transform:scale(1)}}
@keyframes btnShake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-4px)}40%,80%{transform:translateX(4px)}}
.add-btn .spinner,.icon-btn .spinner{width:16px;height:16px;border-width:2px;}
.add-btn.btn-success,.icon-btn.btn-success{font-size:16px;font-weight:800;}
.add-btn.btn-error,.icon-btn.btn-error{font-size:14px;font-weight:800;}

/* ===== ORDER PAGE ===== */
.order-body {
    padding: 60px 16px calc(20px + var(--safe-bottom));
    max-width: 600px; margin: 0 auto;
}

.order-title {
    font-size: 22px; font-weight: 800; color: var(--text);
    margin-bottom: 16px;
}

.order-card {
    background: var(--card); border-radius: var(--radius);
    padding: 16px; margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.order-card h3 {
    font-size: 15px; font-weight: 800; color: var(--text);
    margin-bottom: 12px;
}

.order-product-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 12px;
}

.order-product-emoji { font-size: 40px; }
.order-product-name { font-size: 15px; font-weight: 700; color: var(--text); }
.order-product-price { font-size: 13px; color: var(--text2); }

.order-qty-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-top: 1px solid var(--border);
}

.order-qty-row label { font-size: 14px; font-weight: 600; color: var(--text); }

.qty-control {
    display: flex; align-items: center; gap: 12px;
}

.qty-btn {
    width: 32px; height: 32px; border: 2px solid var(--border);
    border-radius: 8px; background: var(--card); color: var(--text);
    font-size: 18px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.qty-btn:active { background: var(--primary-light); border-color: var(--primary); }

#order-qty { font-size: 16px; font-weight: 700; min-width: 24px; text-align: center; }

.order-total-row {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 10px; border-top: 1px solid var(--border);
    margin-top: 4px;
}

.order-total-row span:first-child { font-size: 14px; font-weight: 600; }
.order-total { font-size: 20px; font-weight: 800; color: var(--primary); }

/* Bank card */
.bank-card { border-left: 4px solid var(--primary); }

.bank-info { margin-bottom: 14px; }

.bank-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.bank-label { font-size: 12px; color: var(--text3); min-width: 80px; font-weight: 600; }
.bank-value { font-size: 14px; color: var(--text); font-weight: 700; }
.bank-account-no { font-family: monospace; font-size: 15px; letter-spacing: 0.5px; }

.copy-btn {
    padding: 4px 12px; border: 1.5px solid var(--primary);
    border-radius: 6px; background: transparent;
    color: var(--primary); font-size: 11px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; margin-left: auto;
}

.copy-btn:active { background: var(--primary); color: #fff; }

.bank-steps h4 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

.bank-steps ol {
    padding-left: 20px; font-size: 13px; color: var(--text2); line-height: 1.8;
}

/* Upload area */
.upload-hint { font-size: 12px; color: var(--text3); margin-bottom: 10px; }

.upload-area {
    display: block; border: 2px dashed var(--border); border-radius: 12px;
    padding: 20px; text-align: center; cursor: pointer;
    transition: all 0.2s; background: #f8fafc;
}

.upload-area:active { border-color: var(--primary); background: var(--primary-light); }

.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.upload-placeholder svg { width: 32px; height: 32px; color: var(--text3); }
.upload-placeholder span { font-size: 13px; color: var(--text3); font-weight: 600; }

.receipt-preview {
    width: 100%; max-height: 200px; object-fit: contain;
    border-radius: 8px;
}

.order-input {
    width: 100%; padding: 12px 14px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 14px; color: var(--text);
    background: #f8fafc; outline: none; transition: all 0.2s;
}

.order-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: #fff; }
.order-input::placeholder { color: #cbd5e1; }

.order-submit-btn { margin-bottom: 10px; }

.btn-outline {
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:active { background: var(--primary-light); }

/* ===== MY ORDERS LIST ===== */
.order-item {
    background: var(--card); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.order-item-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}

.order-item-name { font-size: 15px; font-weight: 700; color: var(--text); }

.order-status {
    padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
}

.order-status.pending { background: #fef3c7; color: #d97706; }
.order-status.receipt-uploaded { background: #dbeafe; color: #2563eb; }
.order-status.confirmed { background: #d1fae5; color: #059669; }
.order-status.shipped { background: #e0e7ff; color: #4f46e5; }
.order-status.delivered { background: #d1fae5; color: #059669; }

.order-item-details {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: var(--text2); margin-bottom: 8px;
}

.order-item-actions { display: flex; gap: 8px; }

.order-action-btn {
    padding: 8px 14px; border: 1.5px solid var(--primary);
    border-radius: 8px; background: transparent;
    color: var(--primary); font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}

.order-action-btn:active { background: var(--primary); color: #fff; }

/* Order status tracker */
.order-tracker {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin: 12px 0 8px; position: relative;
    padding: 0 4px;
}

.order-tracker::before {
    content: ''; position: absolute;
    top: 8px; left: 20px; right: 20px;
    height: 3px; background: var(--border);
    z-index: 0;
}

.track-step {
    display: flex; flex-direction: column; align-items: center;
    position: relative; z-index: 1; flex: 1;
}

.track-dot {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--border); border: 3px solid var(--bg);
    margin-bottom: 4px; transition: all 0.3s;
}

.track-step.done .track-dot {
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.track-label {
    font-size: 9px; font-weight: 600; color: var(--text3);
    text-align: center; line-height: 1.2; max-width: 60px;
}

.track-step.done .track-label { color: var(--primary); font-weight: 700; }

.order-cancelled { opacity: 0.6; }
.order-status.cancelled { background: #fef2f2; color: #dc2626; }

.cancel-order-btn {
    width: 100%; padding: 10px; margin-top: 10px;
    border: 1.5px solid #fecaca; border-radius: 10px;
    background: #fef2f2; color: #dc2626;
    font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.cancel-order-btn:active { background: #dc2626; color: #fff; }

.no-orders { text-align: center; color: var(--text3); padding: 40px 0; font-size: 14px; }

/* Notification items */
.notif-item {
    background: var(--card); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border-left: 4px solid var(--border);
}
.notif-item.unread { border-left-color: var(--primary); background: #fafafe; }
.notif-item.type-warning { border-left-color: #f59e0b; }
.notif-item.type-success { border-left-color: #10b981; }
.notif-item.type-info { border-left-color: #3b82f6; }
.notif-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.notif-message { font-size: 13px; color: var(--text2); line-height: 1.5; }
.notif-order-link {
    font-size: 12px; font-weight: 700; color: var(--primary);
    margin-top: 6px;
}
.notif-date { font-size: 11px; color: var(--text3); margin-top: 4px; }
.no-notifs { text-align: center; color: var(--text3); padding: 40px 0; font-size: 14px; }

/* ===== RESPONSIVE ===== */
/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Large phones (≤480px) */
@media (max-width: 480px) {
    .topbar-inner { padding: 8px 12px; }
    #topbar-logo { width: 40px !important; height: 40px !important; border-radius: 10px !important; }
    .topbar-actions { gap: 4px; }
    .icon-btn { width: 34px; height: 34px; }
    .icon-btn svg { width: 18px; height: 18px; }
    .lang-current { padding: 4px 8px !important; font-size: 11px !important; }
    .banner-text h3 { font-size: 18px; }
    .banner-text p { font-size: 12px; }
    .banner-emoji { font-size: 40px; }
    .detail-cart-btn-sticky, .detail-buy-btn-sticky { padding: 12px; font-size: 13px; }
    .overlay-content { padding: 20px 16px calc(16px + var(--safe-bottom)); }
    .brand h2 { font-size: 20px; }
}

/* iPhone standard (≤375px) */
@media (max-width: 375px) {
    .topbar-inner { padding: 7px 10px; }
    #topbar-logo { width: 38px !important; height: 38px !important; }
    .topbar-actions { gap: 3px; }
    .icon-btn { width: 32px; height: 32px; }
    .icon-btn svg { width: 16px; height: 16px; }
    .lang-current { padding: 3px 6px !important; font-size: 10px !important; }
    .products-grid { gap: 8px; padding: 6px 12px 20px; }
    .search-bar { margin: 4px 12px 10px; }
    .banner-text h3 { font-size: 16px; }
    .banner-emoji { font-size: 36px; }
    .detail-cart-btn-sticky, .detail-buy-btn-sticky { padding: 10px 8px; font-size: 12px; gap: 4px; }
    .detail-cart-btn-sticky svg, .detail-buy-btn-sticky svg { width: 16px; height: 16px; }
    .footer-links { gap: 12px; }
    .footer-link { font-size: 12px; }
    .overlay-content { padding: 16px 14px calc(14px + var(--safe-bottom)); }
    .cart-item-img { width: 60px !important; height: 60px !important; }
}

/* Small phones (≤360px) */
@media (max-width: 360px) {
    .topbar-inner { padding: 6px 8px; }
    #topbar-logo { width: 34px !important; height: 34px !important; }
    .products-grid { gap: 6px; padding: 4px 8px 16px; }
    .product-img { font-size: 36px; }
    .search-bar { margin: 4px 8px 8px; }
    .categories { padding: 4px 8px 8px; }
    .banner-container { margin: 6px 8px 8px; }
    .banner-slide { padding: 14px; }
    .banner-text h3 { font-size: 15px; }
    .banner-text p { font-size: 11px; }
    .banner-emoji { font-size: 32px; }
    .section-title { padding: 6px 8px 4px; }
    .section-head { padding: 6px 8px 8px; }
    .hscroll { padding: 0 8px 10px; }
    .filter-bar { padding: 0 8px 8px; }
    .cat-section-head { padding: 8px 8px 6px; }
    .cat-section-products { padding: 0 8px 10px; }
    .detail-cart-btn-sticky, .detail-buy-btn-sticky { padding: 10px 6px; font-size: 11px; }
    .footer-links { gap: 8px; flex-wrap: wrap; }
    .footer-link { font-size: 11px; padding: 6px 2px; }
    .cart-item { gap: 8px; padding: 10px; }
    .cart-item-img { width: 56px !important; height: 56px !important; }
}

/* Tablets and above (≥600px) */
@media (min-width: 600px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== FILTER BAR ===== */
.filter-bar {
    padding: 0 16px 8px;
}

.filter-bar-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 4px;
}

.filter-count {
    font-size: 12px; color: var(--text3); font-weight: 600;
}

.filter-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 20px;
    background: var(--card); color: var(--text2);
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.filter-chip:active, .filter-chip.active {
    border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}

.sort-select {
    padding: 6px 28px 6px 10px; border: 1.5px solid var(--border);
    border-radius: 20px; background: var(--card); color: var(--text);
    font-size: 12px; font-weight: 600; cursor: pointer; outline: none;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
}

.filter-panel {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px;
    margin-top: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    animation: filterSlide 0.2s ease;
}
@keyframes filterSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-group {
    margin-bottom: 12px;
}
.filter-group label {
    font-size: 11px; font-weight: 700; color: var(--text3);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 6px; display: block;
}

.filter-input {
    flex: 1; padding: 8px 10px; border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 13px; color: var(--text);
    background: var(--bg); outline: none; min-width: 0;
    transition: border-color 0.2s;
}
.filter-input:focus { border-color: var(--primary); }
.filter-input::placeholder { color: var(--text3); font-size: 12px; }

.filter-stars, .filter-stocks {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.fstar, .fstock {
    padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 20px;
    background: var(--card); color: var(--text2);
    font-size: 11px; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.fstar.active, .fstock.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.fstar:active, .fstock:active { transform: scale(0.95); }

.filter-apply-btn {
    flex: 1; padding: 10px; border: none; border-radius: 10px;
    background: var(--primary); color: #fff;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.filter-apply-btn:active { opacity: 0.85; }

.filter-clear-btn {
    padding: 10px 16px; border: 1.5px solid var(--border); border-radius: 10px;
    background: var(--card); color: var(--text2);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.filter-clear-btn:active { border-color: var(--primary); color: var(--primary); }

[data-theme="dark"] .filter-panel { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .filter-input { background: #0f172a; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .filter-chip { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .fstar, [data-theme="dark"] .fstock { background: var(--card); border-color: var(--border); }

/* ===== SHARE BUTTON ===== */
.detail-share-btn {
    width: 44px; height: 44px; border-radius: 50%;
    border: 2px solid var(--border); background: var(--card);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: all 0.2s;
    color: var(--text2);
}
.detail-share-btn svg { width: 20px; height: 20px; }
.detail-share-btn:active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ===== PROFILE PAGE ===== */
.profile-page {
    padding: 60px 16px calc(20px + var(--safe-bottom));
    max-width: 600px; margin: 0 auto;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: var(--radius); padding: 24px 20px; margin-bottom: 16px;
    color: #fff; text-align: center;
}

.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: #fff;
    margin: 0 auto 12px;
    border: 3px solid rgba(255,255,255,0.4);
}

.profile-name {
    font-size: 20px; font-weight: 800; margin-bottom: 4px;
}

.profile-contact {
    font-size: 13px; opacity: 0.85;
}

.profile-stats {
    display: flex; gap: 12px; margin-top: 16px;
}

.profile-stat {
    flex: 1; background: rgba(255,255,255,0.15);
    border-radius: 10px; padding: 10px;
    text-align: center;
}

.profile-stat-num {
    font-size: 20px; font-weight: 800;
}

.profile-stat-label {
    font-size: 11px; opacity: 0.85; margin-top: 2px;
}

.profile-card {
    background: var(--card); border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.profile-card h3 {
    font-size: 14px; font-weight: 800; color: var(--text);
    margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.profile-input {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 14px; color: var(--text); background: #f8fafc;
    outline: none; transition: border-color 0.2s; margin-bottom: 10px;
}

.profile-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: #fff;
}

.profile-input::placeholder { color: var(--text3); }

.profile-save-btn {
    width: 100%; padding: 13px; border: none; border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.25s; margin-top: 4px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.profile-save-btn:active { opacity: 0.85; transform: scale(0.98); }
.profile-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.profile-logout-btn {
    width: 100%; padding: 13px; border: 1.5px solid #fecaca;
    border-radius: 11px; background: #fef2f2; color: #dc2626;
    font-size: 14px; font-weight: 700; cursor: pointer;
    transition: all 0.2s; margin-top: 4px;
}

.profile-logout-btn:active { background: #dc2626; color: #fff; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--card); border-top: 1px solid var(--border);
    padding: 20px 16px calc(80px + var(--safe-bottom));
    text-align: center; margin-top: 12px;
    position: relative; z-index: 1;
}

.footer-links {
    display: flex; justify-content: center; gap: 16px; margin-bottom: 10px;
    flex-wrap: wrap;
}

.footer-link {
    font-size: 13px; color: var(--text2); text-decoration: none;
    font-weight: 600; cursor: pointer; transition: color 0.2s;
    padding: 8px 4px; -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.footer-link:hover, .footer-link:active { color: var(--primary); }

.footer-copy {
    font-size: 11px; color: var(--text3);
}

/* ===== STATIC CONTENT OVERLAY ===== */
.content-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: var(--bg); overflow-y: auto;
}

.content-overlay-inner {
    max-width: 600px; margin: 0 auto;
    padding: 60px 16px calc(40px + var(--safe-bottom));
}

.content-overlay-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 201;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(var(--safe-top) + 12px) 16px 12px;
}

.content-overlay-topbar h2 {
    font-size: 17px; font-weight: 800; color: var(--text);
}

/* Content page hero banner */
.cp-hero {
    background: linear-gradient(135deg, var(--primary), #047857);
    border-radius: var(--radius); padding: 28px 24px;
    margin-bottom: 20px; color: #fff; text-align: center;
}
.cp-hero-icon { font-size: 40px; margin-bottom: 8px; }
.cp-hero h2 { font-size: 22px; font-weight: 900; color: #fff; margin: 0 0 6px; }
.cp-hero p { font-size: 13px; color: rgba(255,255,255,0.85); margin: 0; line-height: 1.5; }

/* Content page cards */
.cp-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.cp-card-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.cp-card-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
    background: var(--primary-light, #ecfdf5);
}
.cp-card-title {
    font-size: 15px; font-weight: 800; color: var(--text);
}

/* Content page text styling */
.content-overlay h2 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.content-overlay h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
.content-overlay p { font-size: 14px; color: var(--text2); line-height: 1.8; margin-bottom: 10px; }
.content-overlay ul { padding-left: 0; list-style: none; }
.content-overlay ul li {
    font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 6px;
    padding: 8px 12px 8px 16px; position: relative;
    background: var(--bg); border-radius: 8px;
}
.content-overlay ul li::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 4px; height: 60%; border-radius: 2px; background: var(--primary);
}
.content-overlay strong, .content-overlay b { color: var(--text); }

/* Contact info row */
.cp-contact-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--bg);
    border-radius: 12px; margin-bottom: 8px;
    transition: all 0.2s;
}
.cp-contact-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.cp-contact-label { font-size: 11px; color: var(--text3); font-weight: 600; }
.cp-contact-value { font-size: 14px; color: var(--text); font-weight: 700; }

/* Terms numbered sections */
.cp-section-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 8px;
    background: var(--primary); color: #fff;
    font-size: 12px; font-weight: 800; margin-right: 8px; flex-shrink: 0;
}

/* Footer inside content pages */
.cp-footer {
    text-align: center; padding: 20px; margin-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text3);
}
.cp-footer strong { color: var(--primary); }

/* ===== PULL TO REFRESH ===== */
.ptr-indicator {
    text-align: center; padding: 10px 0;
    font-size: 12px; color: var(--text3); font-weight: 600;
    letter-spacing: 0.3px; transition: opacity 0.3s;
    opacity: 0;
}

.ptr-indicator.visible { opacity: 1; }

/* ===== STOCK BADGE ===== */
.stock-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; border-radius: 8px;
    font-size: 10px; font-weight: 700;
    background: #ecfdf5; color: #059669;
}

.stock-badge.stock-low {
    background: #fef9c3; color: #ca8a04;
}

.stock-badge.stock-out {
    background: #fee2e2; color: #dc2626;
}

.stock-badge.stock-urgent {
    background: #dc2626; color: #fff;
    animation: urgentPulse 1.5s ease-in-out infinite;
    font-weight: 800;
}

@keyframes urgentPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

/* Stock badge position on product card image */
.product-img .stock-badge {
    position: absolute; bottom: 6px; left: 6px; z-index: 2;
}

/* ===== CART PAGE ===== */
.cart-item {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--card); border-radius: var(--radius);
    padding: 12px; margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cart-item-img {
    width: 72px; height: 72px; border-radius: 10px;
    object-fit: cover; flex-shrink: 0;
    background: var(--bg);
}

.cart-item-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 4px;
}

.cart-item-name {
    font-size: 14px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 12px; color: var(--text2);
}

.cart-qty-control {
    display: flex; align-items: center; gap: 10px; margin-top: 4px;
}

.cart-qty-control .qty-btn {
    width: 36px; height: 36px; font-size: 16px;
    touch-action: manipulation;
}

.cart-qty-control span {
    font-size: 14px; font-weight: 700; min-width: 20px; text-align: center;
}

.cart-item-right {
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0;
}

.cart-subtotal {
    font-size: 15px; font-weight: 800; color: var(--primary);
}

.cart-remove {
    border: none; background: transparent; cursor: pointer;
    color: var(--text3); padding: 4px; border-radius: 6px;
    transition: all 0.2s;
}

.cart-remove:active { color: #dc2626; background: #fee2e2; }

.cart-summary {
    background: var(--card); border-radius: var(--radius);
    padding: 16px; margin-top: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cart-summary-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 15px; font-weight: 700; color: var(--text);
}

.cart-total {
    font-size: 20px; font-weight: 800; color: var(--primary);
}

/* Dark mode cart */
[data-theme="dark"] .cart-item { background: var(--card); }
[data-theme="dark"] .cart-summary { background: var(--card); }
[data-theme="dark"] .cart-item-img { background: #334155; }

/* ===== ORDER CONFIRMATION PAGE ===== */
.confirm-check {
    width: 80px; height: 80px; margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #34d399);
    display: flex; align-items: center; justify-content: center;
    animation: confirmPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.3);
}
.confirm-check svg {
    width: 40px; height: 40px; color: #fff;
    stroke-dasharray: 50; stroke-dashoffset: 50;
    animation: checkDraw 0.6s ease 0.3s forwards;
}
@keyframes confirmPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes checkDraw { to { stroke-dashoffset: 0; } }
.confirm-order-id {
    font-size: 28px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.confirm-item-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.confirm-item-row:last-child { border-bottom: none; }
.confirm-item-left { display: flex; align-items: center; gap: 10px; }
.confirm-item-emoji {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.confirm-item-name { font-weight: 600; }
.confirm-item-qty { color: var(--text3); font-size: 11px; }
.confirm-item-subtotal { font-weight: 700; color: var(--primary); }
.confirm-shipping {
    margin-top: 8px; padding: 10px 12px;
    background: #f8fafc; border-radius: 10px;
    font-size: 12px; color: var(--text2); line-height: 1.6;
}
[data-theme="dark"] .confirm-shipping { background: #0f172a; }
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-actions .btn { flex: 1; padding: 14px; font-size: 14px; }

/* ===== SKELETON LOADING ===== */
.skeleton-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; padding: 4px 16px 20px;
}
.skeleton-card { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.skeleton-img {
    width: 100%; aspect-ratio: 1/1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
.skeleton-text {
    height: 12px; border-radius: 6px; margin: 10px 12px 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
.skeleton-text.short { width: 60%; }
.skeleton-text:last-child { margin-bottom: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
[data-theme="dark"] .skeleton-img, [data-theme="dark"] .skeleton-text {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}

/* Out of stock disabled */
.add-btn:disabled, .detail-buy-btn:disabled, .detail-cart-btn:disabled,
.detail-buy-btn-sticky:disabled, .detail-cart-btn-sticky:disabled {
    opacity: 0.4; cursor: not-allowed; pointer-events: none;
}

/* Out of Stock overlay on product card */
.oos-card { opacity: 0.85; }
.oos-overlay {
    position: absolute; inset: 0; z-index: 3;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    border-radius: 16px 16px 0 0;
}
.oos-overlay span {
    background: #dc2626; color: #fff;
    padding: 6px 16px; border-radius: 8px;
    font-size: 12px; font-weight: 800; letter-spacing: 1px;
}

/* Out of Stock label replacing action buttons */
.oos-label {
    background: #fef2f2; color: #dc2626;
    padding: 5px 12px; border-radius: 8px;
    font-size: 11px; font-weight: 700;
    white-space: nowrap;
}

/* Detail page sticky bar OOS */
.oos-sticky {
    flex: 1; text-align: center;
    padding: 14px; border-radius: 12px;
    background: #fef2f2; color: #dc2626;
    font-size: 14px; font-weight: 700;
}

/* Address auto-fill badge */
.autofill-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; color: #059669;
    background: #ecfdf5; padding: 3px 8px; border-radius: 6px; margin-bottom: 8px;
}
.autofill-badge svg { width: 12px; height: 12px; }

/* Order items breakdown in My Orders */
.order-items-breakdown {
    margin: 8px 0; padding: 8px 10px;
    background: var(--primary-light); border-radius: 10px; font-size: 12px;
}
.order-items-breakdown .oi-row {
    display: flex; justify-content: space-between;
    padding: 4px 0; border-bottom: 1px solid rgba(99,102,241,0.1);
}
.order-items-breakdown .oi-row:last-child { border-bottom: none; }
.oi-name { color: var(--text); font-weight: 600; }
.oi-price { color: var(--primary); font-weight: 700; }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; align-items: center;
    height: 60px; padding-bottom: var(--safe-bottom);
    max-width: 600px; margin: 0 auto;
}
.bnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; border: none; background: none; cursor: pointer;
    color: var(--text3); font-size: 10px; font-weight: 600;
    padding: 8px 0; position: relative; transition: color 0.2s;
}
.bnav-item svg { width: 22px; height: 22px; transition: transform 0.2s; }
.bnav-item.active { color: var(--primary); }
.bnav-item.active svg { transform: scale(1.1); }
.bnav-item:active svg { transform: scale(0.9); }
.bnav-badge {
    position: absolute; top: 2px; right: calc(50% - 20px);
    background: #ef4444; color: #fff; font-size: 9px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
[data-theme="dark"] .bottom-nav { background: rgba(30,41,59,0.97); border-top-color: var(--border); }

/* ===== SEARCH SUGGESTIONS ===== */
.search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--card); border: 1.5px solid var(--border);
    border-radius: 0 0 14px 14px; border-top: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: min(400px, 50vh); overflow-y: auto; z-index: 50;
}
.search-sug-item {
    padding: 10px 14px; font-size: 13px; color: var(--text);
    cursor: pointer; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid #f1f5f9; transition: background 0.15s;
}
.search-sug-item:last-child { border-bottom: none; }
.search-sug-item:hover, .search-sug-item:active { background: var(--primary-light); }
.search-sug-icon { color: var(--text3); flex-shrink: 0; }
.search-sug-name { font-weight: 600; }
.search-sug-cat { font-size: 11px; color: var(--text3); margin-left: auto; }
[data-theme="dark"] .search-suggestions { background: var(--card); border-color: var(--border); }

/* ===== EMPTY STATES ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty-state-emoji { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 4px; }

/* ===== CUSTOMER VIEW TOGGLE ===== */
.cust-view-toggle {
    display: flex; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden;
}
.cvt-btn {
    padding: 5px 8px; border: none; background: var(--card); color: var(--text3);
    cursor: pointer; display: flex; align-items: center; transition: all 0.15s;
}
.cvt-btn:not(:last-child) { border-right: 1px solid var(--border); }
.cvt-btn.active { background: var(--primary); color: #fff; }

/* Product list view */
.products-list {
    display: flex; flex-direction: column; gap: 8px;
    padding: 6px 12px 24px;
}

.product-list-item {
    display: flex; gap: 12px; align-items: center;
    background: var(--card); border-radius: 12px;
    padding: 10px 12px; border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s;
}
.product-list-item:active { transform: scale(0.98); }

.product-list-img {
    width: 64px; height: 64px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; background: linear-gradient(145deg, #f8fafc, #eef2ff);
    overflow: hidden; flex-shrink: 0; position: relative;
}
.product-list-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }

.product-list-info { flex: 1; min-width: 0; }
.product-list-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-list-meta { font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.product-list-price { font-size: 15px; font-weight: 800; color: var(--primary); }
.product-list-old { text-decoration: line-through; color: var(--text3); font-size: 11px; font-weight: 400; margin-right: 4px; }

.product-list-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }

[data-theme="dark"] .product-list-item { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .product-list-img { background: linear-gradient(145deg, #1e293b, #334155); }

@media (hover: hover) {
    .product-list-item:hover { transform: translateX(4px); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
}

/* ===== BROWSE BY CATEGORY ===== */
.category-browse {
    padding: 0 0 8px;
}

.cat-section {
    margin-bottom: 16px;
}

.cat-section-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px 8px; cursor: pointer;
}

.cat-section-icon { font-size: 20px; }
.cat-section-name { font-size: 15px; font-weight: 800; color: var(--text); flex: 1; }
.cat-section-count { font-size: 11px; color: var(--text3); font-weight: 600; }
.cat-section-arrow { color: var(--text3); transition: transform 0.2s; }
.cat-section-arrow.open { transform: rotate(90deg); }

.cat-section-products {
    display: flex; gap: 10px;
    padding: 0 16px 12px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cat-section-products::-webkit-scrollbar { display: none; }

/* ===== MY ORDERS TOOLBAR ===== */
.myorders-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; gap: 8px;
}

/* Order list compact view */
.orders-list-view .order-list-row {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border-radius: 12px;
    padding: 10px 12px; margin-bottom: 6px;
    border: 1px solid var(--border); cursor: pointer;
    transition: all 0.2s;
}
.orders-list-view .order-list-row:active { transform: scale(0.98); }
.order-list-status { flex-shrink: 0; }
.order-list-info { flex: 1; min-width: 0; }
.order-list-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-list-detail { font-size: 11px; color: var(--text3); }
.order-list-price { font-size: 14px; font-weight: 800; color: var(--primary); flex-shrink: 0; }

/* Receipt alert banner */
.receipt-alert {
    background: #fef3c7; border: 1.5px solid #fbbf24; border-radius: 10px;
    padding: 10px 12px; margin: 8px 0; display: flex; align-items: flex-start; gap: 8px;
    font-size: 12px; color: #92400e;
}
.receipt-alert-icon { font-size: 20px; flex-shrink: 0; }
.receipt-alert-text { flex: 1; }
.receipt-alert-text b { display: block; margin-bottom: 2px; font-size: 13px; }

[data-theme="dark"] .receipt-alert { background: #451a03; border-color: #78350f; color: #fbbf24; }
[data-theme="dark"] .orders-list-view .order-list-row { background: var(--card); border-color: var(--border); }

/* Reorder button */
.reorder-btn {
    width: 100%; padding: 11px; margin-top: 8px;
    border: 2px solid var(--primary); border-radius: 10px;
    background: var(--primary-light); color: var(--primary);
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.reorder-btn:active { background: var(--primary); color: #fff; }

/* ===== RICH SEARCH RESULTS ===== */
.search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:active { background: var(--primary-light); }

.sr-img {
    width: 48px; height: 48px; border-radius: 10px;
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.sr-info { flex: 1; min-width: 0; }
.sr-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-meta { font-size: 10px; color: var(--text3); margin-top: 1px; }
.sr-price { font-size: 13px; margin-top: 2px; }
.sr-actions { flex-shrink: 0; }
.sr-cart {
    width: 32px; height: 32px; border: none; border-radius: 8px;
    background: var(--primary); color: #fff; font-size: 14px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.sr-cart:active { transform: scale(0.9); }

[data-theme="dark"] .search-result-item:hover { background: var(--primary-light); }
[data-theme="dark"] .sr-img { background: linear-gradient(145deg, #1e293b, #334155); }

/* ===== ADDRESS CARDS ===== */
.addr-card {
    background: var(--card); border: 1.5px solid var(--border); border-radius: 12px;
    padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
    position: relative;
}
.addr-card.selected, .addr-card:active { border-color: var(--primary); background: var(--primary-light); }
.addr-card-label { font-size: 10px; font-weight: 700; color: var(--primary); text-transform: uppercase; margin-bottom: 2px; }
.addr-card-name { font-size: 14px; font-weight: 700; }
.addr-card-addr { font-size: 12px; color: var(--text2); margin-top: 2px; }
.addr-card-phone { font-size: 11px; color: var(--text3); margin-top: 2px; }
.addr-card-default { position: absolute; top: 8px; right: 8px; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 8px; font-size: 9px; font-weight: 700; }
.addr-card-actions { display: flex; gap: 6px; margin-top: 6px; }
.addr-card-actions button { background: none; border: none; color: var(--text3); font-size: 11px; cursor: pointer; padding: 2px 4px; }
.addr-card-actions button:active { color: var(--primary); }
.addr-result-item { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 12px; }
.addr-result-item:hover, .addr-result-item:active { background: var(--primary-light); }
.addr-result-road { font-weight: 700; color: var(--text); }
.addr-result-jibun { font-size: 11px; color: var(--text3); margin-top: 1px; }
.addr-result-zip { font-size: 10px; color: var(--primary); }
[data-theme="dark"] .addr-card { background: var(--card); border-color: var(--border); }

/* ===== CART POPUP ===== */
.cart-popup{position:fixed;inset:0;z-index:200;display:flex;align-items:flex-end;justify-content:center;}
.cart-popup.hidden{display:none!important;}
.cart-popup-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4);animation:cpFadeIn .2s ease;}
.cart-popup-sheet{position:relative;background:var(--card);border-radius:20px 20px 0 0;width:100%;max-width:480px;max-height:85vh;overflow-y:auto;padding:0;animation:cpSlideUp .3s ease;box-shadow:0 -4px 30px rgba(0,0,0,.15);}
@keyframes cpFadeIn{from{opacity:0}to{opacity:1}}
@keyframes cpSlideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.cart-popup-header{display:flex;align-items:center;gap:10px;padding:16px 20px;border-bottom:1px solid var(--border);}
.cart-popup-check{width:28px;height:28px;border-radius:50%;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;flex-shrink:0;}
.cart-popup-title{font-size:16px;font-weight:700;flex:1;}
.cart-popup-close{background:none;border:none;font-size:24px;color:var(--text3);cursor:pointer;padding:0 4px;line-height:1;}
.cart-popup-added{padding:16px 20px;display:flex;gap:14px;align-items:center;}
.cart-popup-added-img{width:72px;height:72px;border-radius:12px;overflow:hidden;flex-shrink:0;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:32px;}
.cart-popup-added-img img{width:100%;height:100%;object-fit:cover;}
.cart-popup-added-info{flex:1;min-width:0;}
.cart-popup-added-name{font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.cart-popup-added-cat{font-size:11px;color:var(--text3);margin-top:2px;}
.cart-popup-added-price{font-size:16px;font-weight:800;color:var(--primary);margin-top:4px;}
.cart-popup-divider{height:6px;background:var(--bg);}
.cart-popup-section-title{font-size:11px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.5px;padding:12px 20px 6px;}
.cart-popup-items{padding:0 20px 8px;max-height:200px;overflow-y:auto;}
.cart-popup-item{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border);}
.cart-popup-item:last-child{border-bottom:none;}
.cart-popup-item-img{width:40px;height:40px;border-radius:8px;overflow:hidden;flex-shrink:0;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:18px;}
.cart-popup-item-img img{width:100%;height:100%;object-fit:cover;}
.cart-popup-item-name{flex:1;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.cart-popup-item-qty{font-size:11px;color:var(--text3);white-space:nowrap;}
.cart-popup-item-price{font-size:12px;font-weight:700;color:var(--primary);white-space:nowrap;}
.cart-popup-actions{padding:12px 20px 20px;display:flex;flex-direction:column;gap:8px;}
.cart-popup-btn-primary{width:100%;padding:14px;border:none;border-radius:12px;background:var(--primary);color:#fff;font-size:15px;font-weight:700;cursor:pointer;transition:transform .15s;}
.cart-popup-btn-primary:active{transform:scale(.97);}
.cart-popup-btn-secondary{width:100%;padding:12px;border:2px solid var(--border);border-radius:12px;background:var(--card);color:var(--text);font-size:14px;font-weight:600;cursor:pointer;transition:border-color .15s;}
.cart-popup-btn-secondary:hover{border-color:var(--primary);color:var(--primary);}
.cart-popup-item-highlight{background:var(--primary-light,rgba(5,150,105,0.08));border-radius:8px;padding-left:8px!important;padding-right:8px!important;margin:0 -8px;border-bottom-color:transparent!important;}
@media(min-width:481px){.cart-popup{align-items:center;}.cart-popup-sheet{border-radius:20px;max-height:70vh;}}

/* ===== MOBILE KEYBOARD FIX — All overlays/popups ===== */
/* Prevent all fixed overlays from jumping when mobile keyboard opens */
.overlay,
.popup-overlay,
.content-overlay,
.cart-popup,
.zoom-viewer,
[style*="position:fixed"][style*="inset:0"],
[style*="position: fixed"] {
    height: 100%; height: 100dvh;
}
/* All inputs in overlays must be 16px+ to prevent iOS auto-zoom */
.overlay input, .overlay select, .overlay textarea,
.popup-overlay input, .popup-overlay select, .popup-overlay textarea,
.content-overlay input, .content-overlay select, .content-overlay textarea,
.cart-popup input, .cart-popup select, .cart-popup textarea,
.detail-page input, .detail-page select, .detail-page textarea {
    font-size: 16px !important;
}
/* Scrollable content inside overlays — stable on keyboard open */
.overlay-content,
.popup-card,
.cart-popup-body {
    max-height: 85vh; max-height: 85dvh;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}

/* ===== PRINT STYLES ===== */
/* ===== DESKTOP / TABLET RESPONSIVE (>768px) ===== */
/* Mobile app in WebView never hits this — viewport always <500px */
@media (min-width: 768px) {
    .page { max-width: 960px; }
    .topbar-inner { max-width: 960px; }
    .detail-body { max-width: 960px; }
    .detail-sticky-bar { max-width: 960px; }
    .order-body { max-width: 960px; }
    .profile-page { max-width: 960px; }
    .content-overlay-inner { max-width: 960px; }
    .bottom-nav { max-width: 960px; }
    .site-footer { max-width: 960px; margin: 0 auto; }
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .hscroll-card { min-width: 180px; }
    .detail-gallery { max-width: 960px; margin: 0 auto; }
    .banner-container { max-width: 960px; margin: 0 auto; border-radius: 0 0 16px 16px; }
}

@media (min-width: 1080px) {
    .page { max-width: 1200px; }
    .topbar-inner { max-width: 1200px; }
    .detail-body { max-width: 1200px; }
    .detail-sticky-bar { max-width: 1200px; }
    .order-body { max-width: 800px; }
    .profile-page { max-width: 800px; }
    .content-overlay-inner { max-width: 800px; }
    .bottom-nav { max-width: 1200px; }
    .site-footer { max-width: 1200px; }
    .products-grid { grid-template-columns: repeat(4, 1fr); }
    .hscroll-card { min-width: 200px; }
    .detail-gallery { max-width: 1200px; }
    .banner-container { max-width: 1200px; }
    .category-browse { max-width: 1200px; margin: 0 auto; }
}

@media (min-width: 1400px) {
    .products-grid { grid-template-columns: repeat(5, 1fr); }
}

@media print {
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { padding: 0; background: #fff; color: #000; font-size: 12pt; }
    .topbar, .bottom-nav, .search-bar, .banner-container, .banner-dots,
    .categories, .filter-bar, .hscroll, .product-section, .site-footer,
    .btn, .icon-btn, .fav-btn, .overlay-backdrop, .splash-screen,
    .cust-view-toggle, .lang-picker, .theme-toggle, .notif-btn,
    #fav-page-btn, #notif-btn, .ptr-indicator { display: none !important; }
    .page, .overlay-content, .content-overlay { max-width: 100%; margin: 0; padding: 10px; }
    .order-card, .card { break-inside: avoid; border: 1px solid #ddd; margin-bottom: 12px; box-shadow: none; }
    .modal-bg { position: static; background: none; }
    .modal { box-shadow: none; border: 1px solid #ddd; max-width: 100%; }
    a { text-decoration: none; color: #000; }
    img { max-width: 100%; }
}
