/* === KHMART Marketplace CSS === */
:root {
    --primary: #00A859;
    --primary-dark: #008A49;
    --primary-light: #E8F5E9;
    --danger: #E53935;
    --warning: #FF9800;
    --success: #4CAF50;
    --bg: #F5F5F5;
    --white: #FFFFFF;
    --card: #FFFFFF;
    --text: #1A1A1A;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #E0E0E0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1200px;
    --header-height: 80px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container { max-width: var(--max-width); margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border: 2px solid transparent; border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none !important; white-space: nowrap; }
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn-search { background: var(--primary); color: white; border: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 16px; cursor: pointer; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-muted { color: var(--text-muted) !important; }

/* === Header === */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; height: var(--header-height); }
.header-inner { display: flex; align-items: center; gap: 16px; height: 100%; }
.logo { font-size: 24px; font-weight: 700; color: var(--text); text-decoration: none !important; letter-spacing: -0.5px; }
.logo span { color: var(--primary); }
.search-bar { flex: 1; display: flex; max-width: 500px; }
.search-bar input { flex: 1; padding: 10px 14px; border: 2px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-size: 14px; font-family: var(--font); outline: none; }
.search-bar input:focus { border-color: var(--primary); }
.header-nav { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--text-secondary); font-size: 15px; font-weight: 500; padding: 6px 12px; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s; cursor: pointer; }
.nav-auth-buttons { display: flex; align-items: center; gap: 10px; margin-left: 8px; border-left: 1px solid var(--border); padding-left: 20px; height: 36px; }
.nav-auth-buttons .btn { border-radius: 8px; font-size: 14px; padding: 8px 18px; }
.lang-switcher .lang-trigger {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f7f9;
    padding: 0 !important;
}
.lang-trigger-label { display: none; }
.nav-trigger-caret { flex-shrink: 0; }
.lang-switcher .lang-trigger .nav-trigger-caret { display: none; }
.lang-switcher .lang-trigger:hover {
    background: #eaf7ef;
    color: var(--primary);
}
.lang-globe-icon { width: 18px; height: 18px; }
.lang-switcher .lang-dropdown { min-width: 170px !important; }
.lang-item-icon { min-width: 20px; text-align: center; font-size: 15px; }
.lang-code { min-width: 36px; font-weight: 700; color: var(--text-secondary); }
.lang-check { margin-left: auto; color: var(--primary); font-weight: 700; font-size: 13px; }
.lang-active { background: #f0faf5; color: var(--primary) !important; font-weight: 600; }
.nav-link:hover { color: var(--primary); }
.nav-notif { position: relative; }
.badge { background: var(--danger); color: white; font-size: 11px; padding: 2px 6px; border-radius: 10px; font-weight: 600; }
.nav-notif .badge { position: absolute; top: -4px; right: -6px; }
.user-menu { position: relative; }
.user-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; border: none; font-size: 16px; font-weight: 600; cursor: pointer; font-family: var(--font); display: flex; align-items: center; justify-content: center; }
.user-btn-avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; font-size: 16px; font-weight: 600; flex-shrink: 0; }
.user-btn-avatar .user-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-btn-label { display: none; }
.user-btn-caret { display: none; }
.user-dropdown { display: none; position: absolute; right: 0; top: 48px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); min-width: 240px; box-shadow: 0 10px 40px rgba(0,0,0,0.12); z-index: 200; overflow: hidden; }
.user-dropdown.show { display: block; animation: dropdownFade 0.15s ease; }
@keyframes dropdownFade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.user-dropdown .user-info { padding: 14px 16px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.user-dropdown .user-info strong { display: block; font-size: 15px; margin-bottom: 2px; }
.user-dropdown .user-info small { color: var(--text-secondary); font-size: 12px; }
.dropdown-links { padding: 6px 0; }
.dropdown-links a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text); font-size: 14px; transition: all 0.15s; text-decoration: none !important; }
.dropdown-links a:hover { background: #f0faf5; color: var(--primary); }
.dropdown-links a svg { flex-shrink: 0; opacity: 0.6; }
.dropdown-links a:hover svg { opacity: 1; stroke: var(--primary); }
.menu-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: white; font-size: 11px; font-weight: 600; margin-left: auto; }
.dropdown-footer { padding: 6px 0; border-top: 1px solid var(--border); }
.logout-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #dc3545 !important; font-size: 14px; transition: all 0.15s; text-decoration: none !important; }
.logout-link:hover { background: #fff5f5; }
.logout-link svg { stroke: #dc3545; opacity: 0.7; }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; flex-direction: column; gap: 5px; }
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* === Hero === */
.hero-banner { background: linear-gradient(135deg, var(--primary), #00C96E); color: white; padding: 60px 0; text-align: center; }
.hero-banner h1 { font-size: 36px; margin-bottom: 12px; }
.hero-banner p { font-size: 18px; opacity: 0.9; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-primary { background: white; color: var(--primary); border-color: white; }
.hero-actions .btn-primary:hover { background: var(--primary-light); }
.hero-actions .btn-outline { color: white; border-color: rgba(255,255,255,0.5); }
.hero-actions .btn-outline:hover { border-color: white; background: rgba(255,255,255,0.1); }

/* === Categories === */
.categories-section { padding: 40px 0 20px; }
.section-title { font-size: 22px; margin-bottom: 20px; }
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.category-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); text-decoration: none !important; color: var(--text); transition: all 0.2s; }
.category-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.category-icon { color: var(--primary); }
.category-card span { font-size: 12px; font-weight: 500; text-align: center; }

/* === Products Grid === */
.products-section { padding: 30px 0 50px; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); text-decoration: none !important; color: var(--text); transition: all 0.2s; display: block; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-img { aspect-ratio: 1; overflow: hidden; background: #f0f0f0; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 12px; }
.product-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.product-price { font-size: 18px; font-weight: 700; color: var(--primary); }
.product-seller { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* === Product Detail === */
.product-page { padding-top: 24px; padding-bottom: 60px; }
.breadcrumb { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; padding: 12px 16px; background: #f8f9fa; border-radius: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.breadcrumb a { color: var(--primary); font-weight: 500; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-primary); font-weight: 600; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: #f0f0f0; aspect-ratio: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.thumb { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; cursor: pointer; border: 2px solid var(--border); opacity: 0.6; transition: all 0.2s; }
.thumb.active, .thumb:hover { border-color: var(--primary); opacity: 1; }
.product-info-detail h1 { font-size: 24px; margin-bottom: 8px; }
.product-price-lg { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.product-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; font-size: 13px; color: var(--text-secondary); }
.badge-condition { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-new { background: #E3F2FD; color: #1565C0; }
.badge-used { background: #FFF3E0; color: #E65100; }
.product-actions { margin-bottom: 20px; }
.seller-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 20px; flex-wrap: wrap; }
.seller-link { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--text); flex: 1; }
.seller-avatar, .seller-avatar-lg { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.seller-avatar-lg { width: 80px; height: 80px; font-size: 32px; }
.seller-card strong { display: block; }
.seller-card small { color: var(--text-muted); font-size: 12px; }
.product-desc { margin-top: 20px; }
.product-desc h3 { margin-bottom: 8px; }

/* === Warnings === */
.buyer-warning, .seller-warning-banner { background: #FFF8E1; border: 1px solid #FFD54F; border-radius: var(--radius-sm); padding: 16px; margin-bottom: 20px; font-size: 14px; }
.buyer-warning strong { display: block; margin-bottom: 4px; }
.seller-warning-banner { background: #FFEBEE; border-color: #EF9A9A; color: #C62828; font-weight: 500; }
.commission-banner { background: var(--primary-light); border: 1px solid var(--primary); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 20px; font-size: 14px; color: var(--primary-dark); }

/* === Trust Banner === */
.trust-banner { padding: 40px 0; }
.trust-content { background: var(--primary-light); border-radius: var(--radius); padding: 30px; text-align: center; }
.trust-content h3 { margin-bottom: 8px; font-size: 20px; }
.trust-content p { color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

/* === Auth Pages === */
.auth-page { display: flex; justify-content: center; align-items: flex-start; padding-top: 40px; padding-bottom: 40px; }
.auth-card { background: var(--card); border-radius: var(--radius); padding: 40px; max-width: 440px; width: 100%; box-shadow: var(--shadow); }
.auth-card-wide { max-width: 560px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.auth-tabs .tab { flex: 1; text-align: center; padding: 10px; font-weight: 600; font-size: 14px; color: var(--text-secondary); text-decoration: none !important; }
.auth-tabs .tab.active { background: var(--primary); color: white; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* === Forms === */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font); outline: none; transition: border 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 12px; background: var(--bg); border: 2px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-weight: 600; color: var(--text-secondary); }
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; flex: 1; }
.info-box { background: var(--primary-light); border-radius: var(--radius-sm); padding: 16px; font-size: 14px; }
.info-box strong { display: block; margin-bottom: 4px; color: var(--primary-dark); }

/* === Alerts === */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px 0; font-size: 14px; }
.alert-error { background: #FFEBEE; border: 1px solid #EF9A9A; color: #C62828; }
.alert-success { background: #E8F5E9; border: 1px solid #A5D6A7; color: #2E7D32; }

/* === Listing Pages === */
.listing-page { padding-top: 24px; padding-bottom: 60px; }
.listing-count { color: var(--text-muted); margin-bottom: 20px; }
.empty-state { text-align: center; padding: 60px 20px; background: var(--card); border-radius: var(--radius); }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 30px; }
.page-info { font-size: 14px; color: var(--text-secondary); }

/* === Checkout === */
.checkout-page { padding-top: 24px; padding-bottom: 60px; }
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 30px; margin-top: 20px; }
.checkout-form { display: flex; flex-direction: column; gap: 16px; }
.summary-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: sticky; top: calc(var(--header-height) + 20px); }
.summary-card h3 { margin-bottom: 16px; }
.summary-product { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.summary-product strong { display: block; }
.summary-product p { font-size: 13px; color: var(--text-muted); }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-total { border-top: 2px solid var(--border); padding-top: 12px; margin-top: 8px; font-size: 18px; }
.checkout-success { text-align: center; max-width: 500px; margin: 0 auto; }
.checkout-success h1 { color: var(--success); margin-bottom: 10px; }
.qr-payment-card { background: var(--card); border: 2px solid var(--primary); border-radius: var(--radius); padding: 30px; margin: 24px 0; }
.qr-payment-card h2 { color: var(--primary); margin-bottom: 16px; }
.qr-code-box { background: var(--bg); padding: 20px; border-radius: var(--radius-sm); display: inline-block; margin-bottom: 16px; }
.qr-image { max-width: 200px; }
.payment-details p { margin: 6px 0; font-size: 15px; }
.checkout-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* === Orders === */
.orders-list { display: flex; flex-direction: column; gap: 16px; }
.order-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.order-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--bg); font-size: 14px; flex-wrap: wrap; }
.order-id { font-weight: 600; }
.order-date { color: var(--text-muted); flex: 1; }
.order-body { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 16px; }
.order-product { display: flex; align-items: center; gap: 12px; }
.order-product img { border-radius: 6px; object-fit: cover; }
.order-product strong a { color: var(--text); }
.order-product p { font-size: 13px; color: var(--text-muted); }
.order-total { font-size: 18px; font-weight: 700; color: var(--primary); }
.order-actions, .order-shipping-info, .order-notice { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 14px; }
.order-shipping-info { background: #E3F2FD; }
.order-notice { background: #FFF8E1; }

/* === Status Badges === */
.badge-pending_payment { background: #FFF3E0; color: #E65100; }
.badge-paid { background: #E3F2FD; color: #1565C0; }
.badge-shipped { background: #E8EAF6; color: #283593; }
.badge-completed { background: #E8F5E9; color: #2E7D32; }
.badge-cancelled { background: #FFEBEE; color: #C62828; }
.badge-disputed { background: #FCE4EC; color: #AD1457; }
.badge-pending { background: #FFF3E0; color: #E65100; }
.badge-approved { background: #E8F5E9; color: #2E7D32; }
.badge-rejected { background: #FFEBEE; color: #C62828; }
.badge-active { background: #E8F5E9; color: #2E7D32; }
.badge-sold { background: #E3F2FD; color: #1565C0; }

/* === Dashboard / Seller / Admin === */
.dashboard-page { padding-top: 24px; padding-bottom: 60px; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stats-grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card h3 { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-value small { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.seller-nav, .admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 10px 12px; background: var(--bg); font-weight: 600; font-size: 13px; color: var(--text-secondary); border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--primary-light); }
.table-responsive { overflow-x: auto; }

/* === Product Form === */
.product-form { max-width: 700px; display: flex; flex-direction: column; gap: 20px; }
.image-preview-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.image-preview-grid img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* === Seller Profile === */
.seller-profile-page { padding-top: 24px; padding-bottom: 60px; }
.seller-profile-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; padding: 24px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
.seller-profile-info h1 { margin-bottom: 4px; }
.seller-meta { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.seller-desc { color: var(--text-secondary); margin-bottom: 12px; }
.seller-contact { display: flex; gap: 8px; flex-wrap: wrap; }

/* === Chat === */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 500px; background: var(--card); }
.chat-sidebar { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-sidebar h3 { padding: 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.chat-conv-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none !important; color: var(--text); }
.chat-conv-item:hover, .chat-conv-item.active { background: var(--primary-light); }
.chat-conv-item strong { display: block; font-size: 14px; }
.chat-conv-item small { color: var(--text-muted); font-size: 12px; }
.chat-main { display: flex; flex-direction: column; }
.chat-header { padding: 16px; border-bottom: 1px solid var(--border); font-size: 15px; }
.chat-reminder { padding: 8px 16px; background: #FFF8E1; border-bottom: 1px solid #FFD54F; font-size: 12px; color: #795548; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 400px; }
.chat-msg { max-width: 70%; padding: 10px 14px; border-radius: 16px; font-size: 14px; }
.chat-msg small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.msg-sent { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.msg-sent small { color: rgba(255,255,255,0.7); }
.msg-received { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.chat-input-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-input-form input { flex: 1; padding: 10px 14px; border: 2px solid var(--border); border-radius: 20px; font-size: 14px; font-family: var(--font); outline: none; }
.chat-input-form input:focus { border-color: var(--primary); }
.chat-empty { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--text-muted); }

/* === Withdraw Form === */
.withdraw-form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 400px; margin-bottom: 30px; }
.withdraw-form-card h3 { margin-bottom: 16px; }

/* === Notifications === */
.notifications-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.notif-unread { border-left: 3px solid var(--primary); }
.notif-content strong { display: block; margin-bottom: 2px; }
.notif-content p { font-size: 14px; color: var(--text-secondary); }
.notif-content small { color: var(--text-muted); }

/* === Order Detail (Seller) === */
.order-detail-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.ship-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.ship-form h3 { margin-bottom: 12px; }
.ship-form .form-group { margin-bottom: 12px; }

/* === Modal === */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-content { background: var(--white); border-radius: var(--radius); padding: 30px; max-width: 480px; width: 100%; }
.modal-content h3 { margin-bottom: 12px; font-size: 20px; }
.modal-content p { margin-bottom: 12px; font-size: 14px; color: var(--text-secondary); }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }

/* === Footer === */
.site-footer { background: #1A1A1A; color: #CCC; padding: 40px 0 20px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 30px; }
.site-footer h3, .site-footer h4 { color: white; margin-bottom: 12px; }
.site-footer a { display: block; color: #AAA; padding: 3px 0; font-size: 14px; text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer p { font-size: 14px; line-height: 1.7; }
.footer-bottom { border-top: 1px solid #333; padding-top: 20px; text-align: center; font-size: 13px; color: #777; }

/* === Related Products === */
.related-products { margin-top: 50px; }

/* === Responsive === */

/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) {
    .container { padding-left: 20px; padding-right: 20px; }
    .hero-banner h1 { font-size: 26px; }
    .hero-banner p { font-size: 15px; }
    .product-detail { grid-template-columns: 1fr; gap: 20px; }
    .checkout-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
    .seller-profile-header { flex-direction: column; align-items: center; text-align: center; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: repeat(5, 1fr); }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cart-item { flex-wrap: wrap !important; gap: 12px !important; }
    .cart-item .qty-selector { order: 4; }
    .cart-item > div:last-child { order: 5; flex-direction: row !important; align-items: center; gap: 12px; min-width: unset !important; }
    .filter-bar { gap: 8px; }
    .filter-bar select { font-size: 13px; padding: 6px 8px; }
    .listing-page h1 { font-size: 22px; }
}

@media (max-width: 480px) {
    .container { padding-left: 16px; padding-right: 16px; }
    .categories-grid { grid-template-columns: repeat(4, 1fr); }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .product-info { padding: 8px; }
    .product-title { font-size: 13px; }
    .product-price { font-size: 15px; }
    .stats-grid { grid-template-columns: 1fr; }
    h1 { font-size: 20px; }
    .section-title { font-size: 18px; }
}

/* Seller Benefits */
.seller-benefits { background: linear-gradient(135deg, var(--primary-light), #C8E6C9); border: 1px solid var(--primary); }
.benefits-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.benefits-list li { padding: 8px 12px; background: rgba(255,255,255,0.7); border-radius: 8px; font-size: 14px; line-height: 1.5; }
.benefits-list li strong { color: var(--primary-dark); }
.benefits-compare { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.1); }

/* Listing Confirmation Popup */
.confirm-pricing { text-align: left; }
.confirm-pricing p { margin: 6px 0; font-size: 15px; }
.confirm-free { background: var(--primary-light); border-radius: 8px; padding: 12px; margin: 12px 0; }
.confirm-after { background: #FFF8E1; border: 1px solid #FFD54F; border-radius: 8px; padding: 12px; margin: 12px 0; }
.confirm-note { font-size: 13px; color: var(--text-secondary); margin-top: 12px; font-style: italic; }

/* Earnings column */
.earnings-col { font-weight: 600; color: var(--primary-dark); }
.comm-tag { display: inline-block; background: #FFF3E0; color: #E65100; padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-left: 4px; font-weight: 600; }
.free-tag { display: inline-block; background: var(--primary-light); color: var(--primary-dark); padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-left: 4px; font-weight: 600; }

/* Password Toggle */
.password-wrapper { position: relative; display: flex; align-items: stretch; }
.password-wrapper input { flex: 1; padding-right: 44px; }
.toggle-password { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 8px; color: var(--text-muted); display: flex; align-items: center; }
.toggle-password:hover { color: var(--text); }
.required { color: var(--danger); }

/* Logo */
.logo-link { display: flex; align-items: center; text-decoration: none !important; flex-shrink: 0; }
.logo-img { height: 100px; width: auto; object-fit: contain; }
.footer-logo { height: 110px; width: auto; margin-bottom: 12px; }
.footer-brand p { margin-top: 8px; }
.footer-social { display: flex; gap: 12px; margin-top: 12px; }
.footer-social a { color: #AAA; transition: color 0.2s; }
.footer-social a:hover { color: var(--primary); }
.footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }

/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; } .footer-brand { grid-column: 1/-1; text-align: center; padding-bottom: 16px; border-bottom: 1px solid #333; margin-bottom: 8px; } .footer-brand .footer-logo { height: 90px; width: auto; margin: 0 auto 12px; display: block; } .footer-brand p { font-size: 13px; margin: 0 auto; max-width: 340px; line-height: 1.6; } .footer-brand .footer-social { justify-content: center; margin-top: 12px; } .footer-contact-bar { flex-direction: column; align-items: center; gap: 8px; font-size: 13px; } }

/* Static Pages */
.static-page { padding-top: 30px; padding-bottom: 60px; max-width: 800px; }
.static-page h1 { margin-bottom: 8px; }
.static-date { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.static-content h2 { margin-top: 30px; margin-bottom: 12px; font-size: 20px; }
.static-content p, .static-content li { font-size: 15px; line-height: 1.8; color: var(--text-secondary); }
.static-content ul, .static-content ol { padding-left: 24px; margin-bottom: 16px; }
.static-content li { margin-bottom: 6px; }
.lead { font-size: 18px; color: var(--text); font-weight: 500; }

/* About Features */
.about-features { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.about-feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.about-feature h3 { margin-bottom: 6px; font-size: 16px; }
.about-feature p { font-size: 14px; }
@media (max-width: 600px) { .about-features { grid-template-columns: 1fr; } }

/* Payment Steps */
.payment-steps { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.step-card { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.step-card h3 { margin-bottom: 4px; font-size: 16px; }
.step-card p { font-size: 14px; color: var(--text-secondary); }

/* FAQ */
.faq-section { margin-bottom: 30px; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 10px; }
.faq-item h3 { font-size: 15px; margin-bottom: 6px; cursor: pointer; }
.faq-item p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* Benefits highlight */
.benefits-highlight { font-size: 14px; font-weight: 600; color: var(--primary-dark); margin-top: 8px; }

/* Category Nav Bar */
.category-nav-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cat-pill { display: inline-flex; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; color: var(--text-secondary); background: var(--card); border: 1px solid var(--border); white-space: nowrap; text-decoration: none !important; transition: all 0.2s; }
.cat-pill:hover { border-color: var(--primary); color: var(--primary); }
.cat-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Enhanced Mobile Responsive */

/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) {
    .logo-img { height: 72px; }
    .header-inner { gap: 10px; }
    .hero-banner { padding: 40px 0; }
    .hero-banner h1 { font-size: 24px; }
    .hero-banner p { font-size: 14px; }
    .hero-actions .btn { padding: 10px 18px; font-size: 14px; }
    .categories-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
    .category-card { padding: 12px 4px; }
    .category-card span { font-size: 11px; }
    .product-price-lg { font-size: 26px; }
    .product-info-detail h1 { font-size: 20px; }
    .auth-card { padding: 24px; margin: 0 8px; }
    .auth-card-wide { max-width: 100%; }
    .static-page { padding-top: 20px; padding-bottom: 40px; }
    .seller-profile-header { padding: 16px; }
    .checkout-success { padding: 0 8px; }
    .qr-payment-card { padding: 20px; }
    .category-nav-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 12px; gap: 6px; }
    .cat-pill { font-size: 12px; padding: 6px 12px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .about-features { grid-template-columns: 1fr; }
    .modal-content { margin: 16px; padding: 20px; }
    .modal-actions { flex-direction: column; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 6px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
    .order-body { flex-direction: column; align-items: flex-start; }
    .summary-card { position: static; }
}

@media (max-width: 480px) {
    .logo-img { height: 70px; }
    .categories-grid { grid-template-columns: repeat(4, 1fr); }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-info { padding: 8px; }
    .product-title { font-size: 12px; }
    .product-price { font-size: 14px; }
    .hero-banner h1 { font-size: 20px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .auth-tabs .tab { font-size: 13px; padding: 8px; }
    .btn-lg { padding: 12px 20px; font-size: 14px; }
    .payment-steps .step-card { padding: 14px; }
    .faq-item { padding: 14px; }
}

/* Mobile search bar visible */

/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) {
    .site-header { position: relative; padding: 12px 0 0; height: auto; }
    .header-inner { flex-wrap: wrap; gap: 0; padding: 0; justify-content: center; position: relative; }
    .logo-link { order: 1; flex: none; display: flex; justify-content: center; width: 100%; padding: 4px 0 10px; }
    .logo-img { height: 80px; }
    .mobile-toggle { order: 0; position: absolute; right: 16px; top: 20px; z-index: 10; }
    .search-bar { display: flex; order: 10; flex-basis: 100%; margin: 0; padding: 0 16px 12px; }
    .search-bar input { font-size: 15px; padding: 11px 14px; border-radius: 8px 0 0 8px; }
    .btn-search { padding: 0 16px; border-radius: 0 8px 8px 0; }

}

/* Smooth scrolling on mobile category nav */
.category-nav-bar::-webkit-scrollbar { display: none; }
.category-nav-bar { -ms-overflow-style: none; scrollbar-width: none; }

/* Telegram Connect Banner */
.telegram-connect-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(135deg, #e8f4fd 0%, #d4ecfc 100%); border: 1px solid #b8daef; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.tg-connect-content { display: flex; align-items: center; gap: 14px; flex: 1; }
.tg-connect-icon { width: 48px; height: 48px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,136,204,0.15); }
.tg-connect-content strong { display: block; font-size: 15px; margin-bottom: 4px; }
.tg-connect-content p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.btn-connect-tg { display: inline-flex; align-items: center; gap: 8px; background: #0088cc; border-color: #0088cc; white-space: nowrap; flex-shrink: 0; }
.btn-connect-tg:hover { background: #006ba1; }
.telegram-connected-banner { display: flex; align-items: center; gap: 10px; background: #e8f8f0; border: 1px solid #b8e6cf; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 24px; font-size: 14px; }

/* Notification items improved */
.notifications-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; transition: all 0.2s; }
.notif-item:hover { border-color: var(--primary); }
.notif-unread { border-left: 3px solid var(--primary); background: #f0faf5; }
.notif-content strong { display: block; font-size: 14px; margin-bottom: 4px; }
.notif-content p { font-size: 13px; color: var(--text-secondary); margin: 0 0 4px; }
.notif-content small { font-size: 12px; color: #999; }


/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) {
    .telegram-connect-banner { flex-direction: column; align-items: stretch; text-align: center; }
    .tg-connect-content { flex-direction: column; text-align: center; }
    .btn-connect-tg { justify-content: center; }
}

/* Processing status badge */
.badge-processing { background: #fff3cd; color: #856404; }

/* Disabled input */
.input-disabled { background: #f0f0f0; color: #666; cursor: not-allowed; border: 1px solid var(--border); }

/* ========== Live Chat Widget ========== */
.chat-widget { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }

.chat-fab { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0,168,89,0.4); transition: all 0.3s; }
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,168,89,0.5); }
.chat-fab-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: #dc3545; color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid white; }

.chat-window { position: absolute; bottom: 70px; right: 0; width: 370px; height: 500px; background: white; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.15); display: flex; flex-direction: column; overflow: hidden; animation: chatSlideUp 0.25s ease; }
@keyframes chatSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--primary); color: white; flex-shrink: 0; }
.chat-header-info strong { display: block; font-size: 15px; }
.chat-header-info small { opacity: 0.8; font-size: 12px; }
.chat-close { background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 0 4px; opacity: 0.8; }
.chat-close:hover { opacity: 1; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f7f8fa; }
.chat-empty { text-align: center; color: #999; padding: 40px 20px; font-size: 14px; margin: auto; }

.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg small { font-size: 11px; color: #999; margin-top: 2px; padding: 0 4px; }
.chat-msg-mine { align-self: flex-end; align-items: flex-end; }
.chat-msg-other { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.chat-msg-mine .chat-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.chat-msg-other .chat-bubble { background: white; color: var(--text); border: 1px solid #e5e5e5; border-bottom-left-radius: 4px; }

.chat-input { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid #eee; background: white; flex-shrink: 0; }
.chat-input input { flex: 1; border: 1px solid #e0e0e0; border-radius: 20px; padding: 10px 16px; font-size: 14px; outline: none; font-family: var(--font); }
.chat-input input:focus { border-color: var(--primary); }
.chat-send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.2s; }
.chat-send-btn:hover { background: #008a48; }

@media (max-width: 480px) {
    .chat-window { width: calc(100vw - 24px); right: -8px; bottom: 66px; height: 420px; border-radius: 12px; }
    .chat-widget { bottom: 12px; right: 12px; }
}

/* Admin Stat Cards - Clickable */
.stats-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; }
.stat-card-link { display: flex; align-items: center; gap: 16px; text-decoration: none !important; color: var(--text); transition: all 0.2s; border: 1px solid var(--border); position: relative; }
.stat-card-link:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.stat-card-link .stat-content { flex: 1; }
.stat-card-link .stat-content h3 { font-size: 13px; color: var(--text-secondary); font-weight: 500; margin: 0; }
.stat-card-link .stat-content small { font-size: 12px; color: #999; }
.stat-card-link .stat-value { font-size: 28px; font-weight: 700; margin: 0 0 2px; line-height: 1.2; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon-blue { background: #e8f0fe; color: #1a73e8; }
.stat-icon-blue svg { stroke: #1a73e8; }
.stat-icon-green { background: #e6f4ea; color: #00A859; }
.stat-icon-green svg { stroke: #00A859; }
.stat-icon-orange { background: #fef3e0; color: #e67e22; }
.stat-icon-orange svg { stroke: #e67e22; }
.stat-icon-emerald { background: #e0f7f0; color: #0d9488; }
.stat-icon-emerald svg { stroke: #0d9488; }
.stat-icon-red { background: #fce8e8; color: #dc3545; }
.stat-icon-red svg { stroke: #dc3545; }
.stat-icon-yellow { background: #fff8e1; color: #f59e0b; }
.stat-icon-yellow svg { stroke: #f59e0b; }
.stat-arrow { font-size: 20px; color: #ccc; transition: color 0.2s; }
.stat-card-link:hover .stat-arrow { color: var(--primary); }
.stat-card-alert { border-color: #ffc107; background: #fffef5; }
.stat-card-alert:hover { border-color: #e67e22; }


/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) {
    .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .stat-icon { width: 40px; height: 40px; }
    .stat-card-link .stat-value { font-size: 22px; }
}
@media (max-width: 480px) {
    .stats-grid-3 { grid-template-columns: 1fr; }
}

/* Sold count */
.product-sold { color: #e67e22; font-weight: 600; font-size: 14px; }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }

/* Paste Zone */
.paste-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #999;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    outline: none;
}
.paste-zone:hover, .paste-zone:focus {
    border-color: #27ae60;
    background: #f0fff4;
    color: #27ae60;
}
.paste-zone:focus {
    box-shadow: 0 0 0 3px rgba(39,174,96,0.2);
}
.paste-zone svg { flex-shrink: 0; }

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}
.profile-tab {
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.profile-tab:hover { color: #27ae60; }
.profile-tab.active {
    color: #27ae60;
    border-bottom-color: #27ae60;
}
@media (max-width: 480px) {
    .profile-tab { padding: 10px 12px; font-size: 14px; }
}

/* Profile Section */
.profile-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Avatar */
.avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
}
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #27ae60;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-letter {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Header avatar */
.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Sell on KHMART eye-catching CTA button */
.sell-cta {
    background: linear-gradient(135deg, #ff6b35, #f7c948);
    color: #fff !important;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35);
    animation: sellPulse 2s ease-in-out infinite;
}
.sell-cta:hover {
    background: linear-gradient(135deg, #e85d2c, #e6b83e);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5);
    color: #fff !important;
}
@keyframes sellPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35); }
    50% { box-shadow: 0 2px 15px rgba(255, 107, 53, 0.55); }
}

/* Larger QR image on payment pages */
.qr-image-lg {
    width: 320px !important;
    height: auto !important;
    max-width: 100%;
}
.qr-payment-card {
    max-width: 500px;
    margin: 20px auto;
    padding: 30px;
    border: 3px solid #27ae60;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}
.qr-payment-card h2 {
    color: #27ae60;
    font-size: 28px;
    margin-bottom: 20px;
}
.qr-code-box {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.payment-details p {
    margin: 8px 0;
    font-size: 16px;
}
.pay-amount {
    color: #e74c3c;
    font-size: 32px !important;
}

/* Cancel Order button */
.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

/* Order actions row */
.order-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    align-items: center;
}


/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) {
    .sell-cta {
        padding: 6px 14px;
        font-size: 13px;
    }
    .qr-image-lg {
        width: 260px !important;
    }
    .qr-payment-card {
        padding: 20px 15px;
    }
}


/* Categories horizontal scroll */
.categories-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}
.categories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex: 1;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.categories-scroll .category-card {
    min-width: 100px;
    flex-shrink: 0;
}
.cat-scroll-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.2s;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.cat-scroll-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.cat-scroll-btn svg { stroke: currentColor; }

/* Eye toggle for password */
.eye-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}
.eye-toggle:hover { color: #333; }

@media (max-width: 480px) {
    .cat-scroll-btn { width: 28px; height: 28px; }
    .cat-scroll-btn svg { width: 16px; height: 16px; }
    .categories-scroll .category-card { min-width: 80px; }
}

/* Contact Page */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
.contact-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; text-align: center; transition: all 0.2s; }
.contact-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.contact-icon { margin-bottom: 16px; }
.contact-card h3 { margin-bottom: 6px; }
.contact-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 12px; }
.contact-link { font-size: 16px; font-weight: 600; color: var(--primary); }
.contact-info-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.contact-info-section h2 { margin-bottom: 12px; font-size: 18px; }

/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }

/* Review System */
.reviews-section { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--border); }
.review-summary { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; padding: 20px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
.review-avg { text-align: center; min-width: 100px; }
.review-avg .big-rating { font-size: 42px; font-weight: 700; color: var(--text); line-height: 1; }
.review-avg .star-display { color: #f59e0b; font-size: 20px; margin: 4px 0; }
.review-avg small { color: var(--text-muted); }
.review-bars { flex: 1; }
.review-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.review-bar-row span:first-child { width: 20px; text-align: right; }
.review-bar { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.review-bar-fill { height: 100%; background: #f59e0b; border-radius: 4px; }
.review-bar-row span:last-child { width: 24px; color: var(--text-muted); }
.review-item { padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.review-stars { color: #f59e0b; font-size: 14px; }
.review-date { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.review-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-top: 4px; }
.star-rating-input { display: flex; gap: 4px; }
.star-rating-input label { cursor: pointer; font-size: 28px; color: #ddd; transition: color 0.15s; }
.star-rating-input input { display: none; }
.star-rating-input label:hover, .star-rating-input label:hover ~ label, .star-rating-input input:checked ~ label { color: #f59e0b; }
.star-inline { color: #f59e0b; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.star-inline .star-empty { color: #ddd; }
.rating-num { font-size: 13px; color: var(--text-muted); margin-left: 4px; }

/* Quantity Selector */
.qty-selector { display: flex; align-items: center; gap: 0; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; margin-bottom: 16px; }
.qty-btn { width: 40px; height: 40px; border: none; background: var(--bg); cursor: pointer; font-size: 20px; font-weight: 600; color: var(--text); display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.qty-btn:hover { background: var(--primary-light); color: var(--primary); }
.qty-input { width: 60px; height: 40px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; font-size: 16px; font-weight: 600; font-family: var(--font); }
.qty-input:focus { outline: none; }

/* Homepage Stats */
.stats-banner { padding: 40px 0; background: var(--white); }
.stats-row { display: flex; justify-content: center; gap: 60px; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-number { font-size: 36px; font-weight: 700; color: var(--primary); display: block; }
.stat-label { font-size: 14px; color: var(--text-secondary); }

/* Benefits Grid */
.benefits-section { padding: 40px 0; background: var(--bg); }
.benefits-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.benefit-card { background: var(--card); border-radius: var(--radius); padding: 24px; text-align: center; border: 1px solid var(--border); }
.benefit-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.benefit-card h3 { font-size: 15px; margin-bottom: 6px; }
.benefit-card p { font-size: 13px; color: var(--text-secondary); }

/* Categories dropdown */
.nav-dropdown-wrap { position: relative; display: inline-block; }
.nav-dropdown-wrap button { background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; transition: background .2s; }
.nav-dropdown-wrap button:hover { background: #f0f0f0; }
.nav-dropdown-wrap .user-dropdown { min-width: 220px; left: 0; right: auto; top: 100%; }

@media (max-width: 768px) { .benefits-grid { grid-template-columns: repeat(2, 1fr); } .stats-row { gap: 30px; } .stat-number { font-size: 28px; } }
@media (max-width: 480px) { .benefits-grid { grid-template-columns: 1fr 1fr; gap: 12px; } .benefit-card { padding: 16px; } }

/* === Cart Page === */
.cart-select-all { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--text-secondary); font-size: 14px; }
.cart-select-all label { cursor: pointer; }
.cart-select-item { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.cart-item { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid #eee; }
.cart-item-img { flex-shrink: 0; }
.cart-item-img img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 600; color: var(--text); text-decoration: none; display: block; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.cart-item-title:hover { text-decoration: underline; }
.cart-item-shop { font-size: 13px; color: var(--text-muted); }
.cart-item-price { font-weight: 700; color: var(--primary); margin-top: 4px; }
.qty-selector { border: 1px solid #ddd; border-radius: 6px; overflow: hidden; display: flex; flex-shrink: 0; }
.qty-selector button { width: 32px; height: 32px; border: none; background: #f5f5f5; cursor: pointer; font-size: 16px; }
.qty-selector button:active { background: #e0e0e0; }
.qty-selector input { width: 48px; height: 32px; text-align: center; border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; font-size: 14px; }
.cart-item-subtotal { text-align: right; min-width: 80px; flex-shrink: 0; }
.cart-item-subtotal .line-subtotal { font-weight: 700; }
.cart-remove-btn { background: none; border: none; color: #e74c3c; font-size: 12px; cursor: pointer; margin-top: 4px; padding: 2px 0; }
.cart-remove-btn:hover { text-decoration: underline; }
.cart-summary-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 20px; padding: 20px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); }
.cart-selected-count { font-size: 14px; color: var(--text-muted); }
.cart-selected-total { font-size: 24px; font-weight: 700; color: var(--primary); }
.cart-total-note { color: var(--text-muted); display: block; margin-top: 4px; }
.cart-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cart-clear-btn { color: #e74c3c !important; border-color: #e74c3c !important; }

@media (max-width: 768px) {
    .cart-item { flex-wrap: wrap; gap: 12px; padding: 14px 0; }
    .cart-item-img img { width: 64px; height: 64px; }
    .cart-item-info { flex-basis: calc(100% - 100px); }
    .cart-item-subtotal { min-width: unset; text-align: left; display: flex; align-items: center; gap: 10px; }
    .cart-summary-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
    .cart-actions { justify-content: stretch; }
    .cart-actions .btn { flex: 1; min-width: 0; text-align: center; font-size: 13px; padding: 10px 12px; }
    .cart-selected-total { font-size: 20px; }
}

@media (max-width: 480px) {
    .cart-item-img img { width: 56px; height: 56px; }
    .cart-item-title { font-size: 13px; }
    .cart-actions .btn { font-size: 12px; padding: 8px 10px; }
}

/* Filter Bar */
.filter-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-bar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font); background: var(--card); cursor: pointer; }
.filter-bar select:focus { border-color: var(--primary); outline: none; }

/* Forgot Password */
.forgot-link { display: block; text-align: right; margin-top: -8px; font-size: 13px; }

/* Wishlist Heart */
.wishlist-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.9); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; transition: all 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.wishlist-btn:hover { background: #fff; transform: scale(1.1); }
.wishlist-btn.active svg { fill: #e74c3c; stroke: #e74c3c; }
.product-card { position: relative; }
.product-img { position: relative; }

/* Image Zoom */
.gallery-main { cursor: zoom-in; position: relative; overflow: hidden; border-radius: 12px; }

/* Footer Contact Bar */
.footer-contact-bar { display: flex; justify-content: center; gap: 24px; padding: 16px 0; border-top: 1px solid #333; margin-bottom: 0; color: #999; font-size: 13px; flex-wrap: wrap; }
.footer-contact-bar span { display: inline-flex; align-items: center; gap: 6px; }
.footer-contact-bar svg { opacity: 0.6; }



/* Chat Widget v2 - Tokopedia Style */

.chat-widget-v2 { position: fixed; bottom: 20px; right: 20px; z-index: 9999; font-family: var(--font, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif); }

.chat-fab-v2 { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #00a859, #00c96e); border: none; cursor: pointer; box-shadow: 0 4px 16px rgba(0,168,89,0.4); display: flex; align-items: center; justify-content: center; transition: all 0.2s; position: relative; }

.chat-fab-v2:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,168,89,0.5); }

.chat-unread-badge { position: absolute; top: -4px; right: -4px; background: #e74c3c; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }



.chat-panel-v2 { position: absolute; bottom: 70px; right: 0; width: 420px; height: 520px; background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.18); display: none; flex-direction: column; overflow: hidden; animation: chatSlideUp 0.2s ease; }

@keyframes chatSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }



.chat-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: linear-gradient(135deg, #00a859, #00c96e); color: #fff; flex-shrink: 0; }

.chat-panel-header h3 { margin: 0; font-size: 16px; font-weight: 600; }

.chat-close-btn { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px; opacity: 0.8; }

.chat-close-btn:hover { opacity: 1; }



.chat-panel-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }



/* Contacts List */

.chat-contacts { flex: 1; overflow-y: auto; }

.conv-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #f5f5f5; transition: background 0.15s; }

.conv-item:hover { background: #f8faf9; }

.conv-item.active { background: #e8f5e9; }

.conv-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #00a859, #00c96e); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }

.conv-info { flex: 1; min-width: 0; }

.conv-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }

.conv-name { font-weight: 600; font-size: 14px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.conv-time { font-size: 11px; color: #999; flex-shrink: 0; }

.conv-preview { font-size: 13px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }

.conv-unread { background: #e74c3c; color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; flex-shrink: 0; margin-left: auto; }



/* Messages Panel */

.chat-messages-panel { flex: 1; display: none; flex-direction: column; min-height: 0; }

.chat-msg-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #eee; flex-shrink: 0; background: #fafafa; }

.chat-back-btn { background: none; border: none; cursor: pointer; padding: 4px; color: #666; display: flex; align-items: center; }

.chat-back-btn:hover { color: #00a859; }

.chat-msg-header-info { display: flex; flex-direction: column; }

.chat-msg-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: #f9fafb; }

.chat-bubble-v2 { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }

.chat-bubble-v2.mine { background: #00a859; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }

.chat-bubble-v2.theirs { background: #fff; color: #333; align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid #eee; }

.bubble-text { margin: 0; }

.bubble-time { font-size: 10px; opacity: 0.7; margin-top: 2px; text-align: right; }

.chat-msg-input { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #eee; flex-shrink: 0; background: #fff; }

.chat-msg-input input { flex: 1; padding: 10px 14px; border: 1px solid #ddd; border-radius: 20px; font-size: 14px; outline: none; font-family: inherit; }

.chat-msg-input input:focus { border-color: #00a859; }

.chat-send-btn { width: 38px; height: 38px; border-radius: 50%; background: #00a859; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; transition: background 0.15s; flex-shrink: 0; }

.chat-send-btn:hover { background: #00934d; }



/* Mobile responsive */

@media (max-width: 480px) {

    .chat-panel-v2 { width: calc(100vw - 16px); height: calc(100vh - 100px); bottom: 66px; right: -12px; border-radius: 12px; }

    .chat-widget-v2 { bottom: 12px; right: 12px; }

}

/* === Mobile Navigation Polish === */
.nav-item-icon { flex-shrink: 0; opacity: 0.7; }
.mobile-nav-backdrop,
.mobile-nav-close { display: none; }
.lang-trigger-label { display: none; }
.nav-trigger-caret { display: none; }

@media (min-width: 769px) {
    .nav-dropdown-wrap { position: relative; }
    .nav-dropdown-wrap .user-dropdown { min-width: 200px; }
    .lang-switcher .user-dropdown { min-width: 170px; }
}

@media (max-width: 768px) {
    .site-header { height: auto; }

    .header-inner {
        position: relative;
        min-height: 60px;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding-top: 6px;
        padding-bottom: 8px;
    }

    .logo-link { margin-right: auto; }
    .logo-img { height: 52px; }

    .search-bar {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        margin-top: 2px;
    }

    /* Hamburger button */
    .mobile-toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: #fff;
        margin-left: auto;
        padding: 0;
        z-index: 180;
    }
    .mobile-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--text);
        border-radius: 1px;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }
    .mobile-toggle span + span { margin-top: 5px; }
    .mobile-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-toggle.is-open span:nth-child(2) { opacity: 0; }
    .mobile-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Overlay backdrop */
    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(17, 24, 39, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.22s ease, visibility 0.22s ease;
        z-index: 160;
    }
    .mobile-nav-backdrop.show { opacity: 1; visibility: visible; }

    /* Drawer top spacing (close handled by hamburger toggle) */

    /* Drawer panel */
    .header-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: min(320px, 84vw);
        height: 100dvh;
        display: flex !important;
        flex-direction: column;
        gap: 0;
        padding: 12px 0 24px;
        background: #fff;
        box-shadow: -6px 0 24px rgba(0, 0, 0, 0.14);
        transform: translateX(102%);
        visibility: hidden;
        transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.26s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 170;
    }
    .header-nav.open { transform: translateX(0); visibility: visible; }

    /* Nav items in drawer */
    .header-nav .nav-link,
    .header-nav .nav-dropdown-wrap > button {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        min-height: 50px;
        padding: 12px 20px !important;
        font-size: 15px;
        font-weight: 500;
        color: var(--text);
        border-bottom: 1px solid #f0f2f5;
        background: transparent;
        text-decoration: none !important;
        cursor: pointer;
    }
    .header-nav .nav-link:active,
    .header-nav .nav-dropdown-wrap > button:active { background: #f5f7fa; }

    .header-nav .nav-item-icon { width: 20px; height: 20px; opacity: 0.6; }

    /* Caret arrows for expandable items */
    .header-nav .nav-trigger .nav-trigger-caret {
        display: inline-flex;
        margin-left: auto;
        opacity: 0.5;
        transition: transform 0.2s ease;
    }

    /* Language trigger inside drawer */
    .header-nav .lang-trigger {
        width: 100%;
        height: auto;
        border-radius: 0;
        justify-content: flex-start;
        background: transparent;
    }
    .header-nav .lang-trigger .lang-trigger-label {
        display: inline;
        font-weight: 500;
    }

    /* Sub-dropdowns in drawer */
    .header-nav .nav-dropdown-wrap { width: 100%; position: static !important; }
    .header-nav #catDropdown,
    .header-nav #langDropdown {
        position: static !important;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        min-width: 100% !important;
        background: #f7f9fb;
    }
    .header-nav #catDropdown.show,
    .header-nav #langDropdown.show { display: block; }

    .header-nav #catDropdown .dropdown-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .header-nav #langDropdown .dropdown-links {
        display: grid;
        grid-template-columns: 1fr;
    }

    .header-nav #catDropdown .dropdown-links a,
    .header-nav #langDropdown .dropdown-links a {
        padding: 11px 16px 11px 52px;
        border-bottom: 1px solid #edf1f5;
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 400;
    }
    .header-nav #catDropdown .dropdown-links a:active,
    .header-nav #langDropdown .dropdown-links a:active { background: #eef1f5; }

    /* Auth buttons for guests */
    .header-nav .nav-auth-buttons {
        display: flex;
        width: 100%;
        gap: 10px;
        margin: 0;
        padding: 16px 20px 8px;
        border-left: 0;
        height: auto;
    }
    .header-nav .nav-auth-buttons .btn {
        flex: 1;
        justify-content: center;
        padding: 12px 0;
        font-size: 15px;
        border-radius: 8px;
    }

    /* User menu in drawer */
    .header-nav .user-menu { width: 100%; }
    .header-nav .user-btn {
        width: 100%;
        height: auto;
        border-radius: 0;
        padding: 14px 20px;
        justify-content: flex-start;
        border-bottom: 1px solid #f0f2f5;
        gap: 12px;
        background: #f8faf9;
    }
    .header-nav .user-btn-avatar {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }
    .header-nav .user-btn-avatar .user-avatar-img {
        width: 40px;
        height: 40px;
    }
    .header-nav .user-btn-label {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        flex: 1;
        min-width: 0;
    }
    .header-nav .user-btn-name {
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .header-nav .user-btn-hint {
        font-size: 12px;
        font-weight: 400;
        color: var(--text-muted);
    }
    .header-nav .user-btn-caret {
        display: inline-flex;
        margin-left: auto;
        opacity: 0.5;
        flex-shrink: 0;
    }
    .header-nav .user-dropdown {
        position: static;
        min-width: 100%;
        border-radius: 0;
        border: 0;
        border-top: 1px solid #f0f2f5;
        border-bottom: 1px solid #f0f2f5;
        box-shadow: none;
    }

    /* Sell CTA in drawer */
    .header-nav .sell-cta {
        background: var(--primary);
        color: #fff !important;
        border-bottom: none;
        border-radius: 0;
    }

    /* Badges in drawer */
    .header-nav .cart-badge-count,
    .header-nav .nav-notif .badge {
        position: static;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: #e74c3c;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        min-width: 20px;
        height: 20px;
        border-radius: 10px;
        padding: 0 6px;
    }

    body.mobile-menu-open { overflow: hidden; touch-action: none; }
}

/* ================================================
   PRODUCT OPTIONS — Seller Forms
   ================================================ */
.product-options-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.product-options-section > label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.product-options-section > label small { font-weight: 400; color: var(--text-muted); }
.options-intro { font-size: 13px; color: var(--text-muted); margin: 0 0 12px 0; line-height: 1.5; }
.options-intro strong { color: var(--text); }
.quick-add-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.quick-opt-btn { border-style: dashed !important; }

.option-group-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.option-group-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.option-name-input { flex: 1; min-width: 140px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--card); }
.option-req-label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); white-space: nowrap; cursor: pointer; }
.btn-remove-option { background: none; border: none; color: var(--danger); font-size: 22px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.btn-remove-option:hover { background: rgba(231,76,60,0.1); border-radius: 4px; }

.option-help-text { font-size: 12px; color: var(--warning, #e67e22); margin: 0 0 8px 0; background: #fef9e7; padding: 6px 10px; border-radius: var(--radius-sm); border-left: 3px solid var(--warning, #e67e22); }
.option-group-title-row { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.option-group-title-row svg { flex-shrink: 0; }
.option-val-num { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: var(--bg); border-radius: 50%; font-size: 11px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; border: 1px solid var(--border); }
.option-values-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.option-value-row { display: flex; align-items: center; gap: 8px; }
.option-value-row input[type="text"] { flex: 1; min-width: 100px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--card); }
.price-mod-wrap { display: flex; align-items: center; gap: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.price-mod-wrap span { padding: 7px 6px 7px 10px; color: var(--text-muted); font-size: 13px; background: var(--bg); }
.price-mod-wrap input { width: 80px; padding: 7px 8px; border: none; font-size: 14px; background: var(--card); }
.price-mod-wrap input:focus { outline: none; }
.btn-remove-val { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 2px 6px; line-height: 1; }
.btn-remove-val:hover { color: var(--danger); }
.btn-xs { font-size: 12px; padding: 4px 10px; }

/* ================================================
   PRODUCT OPTIONS — Buyer Product Page (pills)
   ================================================ */
.product-options-select { margin: 16px 0; }
.option-select-group { margin-bottom: 14px; }
.option-select-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.option-required { color: var(--danger); }
.option-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.option-pill { padding: 8px 16px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.15s; color: var(--text); }
.option-pill:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.option-pill.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card)); color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pill-price-mod { font-size: 12px; color: var(--text-muted); }
.option-pill.active .pill-price-mod { color: var(--primary); }
.option-warning { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* ================================================
   Cart / Order — variant info tags
   ================================================ */
.cart-item-options { font-size: 12px; color: var(--primary); margin-top: 2px; font-weight: 500; }
.order-variant-info { font-size: 12px; color: var(--primary); font-weight: 500; margin: 2px 0; }
.summary-variant-info { font-size: 12px; color: var(--primary); margin: 2px 0; }

/* ================================================
   Stock wrap in option value rows
   ================================================ */
.stock-wrap { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.stock-wrap input { padding: 6px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; text-align: center; }

/* ================================================
   Search page layout
   ================================================ */
.listing-count { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ================================================
   Admin table improvements
   ================================================ */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.data-table th { background: var(--bg-secondary); font-weight: 600; font-size: 13px; }
.data-table tr:hover { background: var(--bg-secondary); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-pending_payment { background: #fff3cd; color: #856404; }
.badge-paid { background: #d4edda; color: #155724; }
.badge-processing { background: #cce5ff; color: #004085; }
.badge-shipped { background: #d1ecf1; color: #0c5460; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }
.text-danger { color: #dc3545 !important; }

/* ================================================
   Seller reply to reviews
   ================================================ */
.seller-reply { background: var(--bg-secondary); border-left: 3px solid var(--primary); padding: 10px 14px; margin-top: 8px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; }
.seller-reply strong { font-size: 12px; color: var(--primary); display: block; margin-bottom: 4px; }
.seller-reply p { margin: 0; }
