* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99,102,241,0.1);
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1e293b;
    --text2: #64748b;
    --text3: #94a3b8;
    --border: #e2e8f0;
    --radius: 14px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: -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(60px + var(--safe-top));
    padding-bottom: var(--safe-bottom);
}

.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: 20px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.lang-switcher { display: flex; gap: 4px; }

.lang-btn {
    padding: 4px 10px; border: 1.5px solid var(--border); border-radius: 16px;
    background: transparent; color: var(--text3);
    font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}

.lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.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: 12px 16px; }

.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: 2px solid var(--border); border-radius: var(--radius);
    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: 8px 16px 12px; position: relative; overflow: hidden;
    border-radius: 16px;
}

.banner-track {
    display: flex; transition: transform 0.4s ease;
}

.banner-slide {
    min-width: 100%; padding: 20px 24px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: space-between;
    color: #fff; min-height: 120px;
    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));
}

.banner-slide.has-image .banner-img {
    width: 100%; height: 100%; object-fit: cover;
    min-height: 120px;
}

.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: 15px; 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 4px;
    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: 140px;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: transform 0.2s;
    scroll-snap-align: start;
}

.hscroll-card:active { transform: scale(0.97); }

.hscroll-img {
    width: 100%; height: 100px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
}

.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: 8px 18px;
    border: 1.5px solid var(--border); border-radius: 20px;
    background: var(--card); color: var(--text2);
    font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}

.cat-chip.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ===== SECTION TITLE ===== */
.section-title {
    padding: 8px 16px 6px; font-size: 17px; font-weight: 800; color: var(--text);
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; padding: 6px 16px 24px;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column;
}

.product-card:active { transform: scale(0.97); }

.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;
}

/* 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); }

.product-img { position: relative; }

/* Detail page fav button */
.detail-fav-btn {
    width: 50px; height: auto; flex-shrink: 0;
    border: 2px solid #fecaca; border-radius: 12px;
    background: #fef2f2; color: var(--text3);
    font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.detail-fav-btn.fav-active { color: #ef4444; border-color: #ef4444; background: #fef2f2; }
.detail-fav-btn:active { transform: scale(1.1); }

.product-img img, .hscroll-img img, .thumb img, .detail-main-img img {
    width: 100%; height: 100%; object-fit: cover;
}

.product-info {
    padding: 10px 12px 12px;
    display: flex; flex-direction: column; flex: 1;
}

.product-name {
    font-size: 13px; font-weight: 700; color: var(--text);
    line-height: 1.3; margin-bottom: 2px;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}

.product-desc {
    font-size: 11px; color: var(--text3); line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; flex: 1;
}

.product-bottom {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto;
}

.product-price {
    font-size: 16px; font-weight: 800; color: var(--primary);
}

.add-btn {
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 20px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
    flex-shrink: 0;
}

.add-btn:active { transform: scale(0.88); }

/* 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: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.back-btn {
    position: fixed; top: calc(12px + var(--safe-top)); left: 12px; z-index: 160;
    width: 42px; height: 42px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.95); color: var(--text);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
[dir="rtl"] .back-btn { left: auto; right: 12px; }
.back-btn svg { width: 24px; height: 24px; }
.back-btn:active { transform: scale(0.9); }

/* 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;
}

.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: 10px 16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.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;
}

.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(20px + 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;
}

.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: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff; font-size: 13px; 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;
}

.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: 90vh; overflow-y: auto;
    background: var(--card);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px calc(20px + var(--safe-bottom));
    animation: slideUp 0.35s ease;
}

@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: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.5); }
.btn-primary:active { transform: translateY(0); }
.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(24px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #fff;
    padding: 12px 20px; border-radius: 12px;
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px 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); } }

/* ===== 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 ===== */
@media (max-width: 360px) {
    .products-grid { gap: 8px; padding: 6px 10px 20px; }
    .product-img { font-size: 36px; }
    .search-bar { margin: 8px 10px; }
    .categories { padding: 4px 10px 8px; }
    .banner-container { margin: 8px 10px 10px; }
    .banner-slide { min-height: 100px; padding: 16px; }
    .banner-text h3 { font-size: 17px; }
    .section-title { padding: 6px 10px 4px; }
}

@media (min-width: 600px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== SORT DROPDOWN ===== */
.sort-row {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 0 16px 6px; gap: 8px;
}

.sort-label {
    font-size: 12px; color: var(--text3); font-weight: 600; white-space: nowrap;
}

.sort-select {
    padding: 7px 12px; border: 1.5px solid var(--border);
    border-radius: 10px; background: var(--card); color: var(--text);
    font-size: 13px; 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 10px center;
    padding-right: 28px;
}

/* ===== 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(20px + var(--safe-bottom));
    text-align: center; margin-top: 12px;
}

.footer-links {
    display: flex; justify-content: center; gap: 20px; margin-bottom: 10px;
}

.footer-link {
    font-size: 13px; color: var(--text2); text-decoration: none;
    font-weight: 600; cursor: pointer; transition: color 0.2s;
}

.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 20px 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-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: 18px 0 6px; }
.content-overlay p { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 8px; }
.content-overlay ul { padding-left: 18px; }
.content-overlay ul li { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 4px; }

/* ===== 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; }
