/* ===================================================
   HW HUB - Shopee-inspired Marketplace Design
   Mobile-first, clean, modern
=================================================== */

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

:root {
    --primary: #f21f1f;
    --primary-dark: #cc1515;
    --primary-light: #ff5252;
    --primary-bg: rgba(242, 31, 31, 0.08);
    --bg: #0d0d0d;
    --bg-2: #141414;
    --bg-3: #1c1c1c;
    --bg-4: #232323;
    --card: #1a1a1a;
    --card-hover: #212121;
    --border: rgba(255,255,255,0.08);
    --border-solid: #2a2a2a;
    --text: #f0f0f0;
    --text-sub: #aaaaaa;
    --text-muted: #666;
    --orange: #ff8a00;
    --green: #00c853;
    --shopee: #ee4d2d;
    --tokopedia: #42b549;
    --tiktok: #010101;
    --lazada: #0f136d;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 99px; }

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===================================================
   NAVBAR - Premium Shopee Style
=================================================== */
.navbar {
    background: linear-gradient(180deg, #d81a1a 0%, var(--primary) 100%);
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(0,0,0,0.15);
}

.nav-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 56px;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo span { color: rgba(255,255,255,0.65); }

.nav-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    max-width: 600px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: box-shadow 0.2s;
}
.nav-search:focus-within {
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.nav-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background: transparent;
}
.nav-search input::placeholder { color: #aaa; }

.nav-search-btn {
    background: var(--primary);
    border: none;
    padding: 8px 16px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    border-radius: 0 20px 20px 0;
    transition: background 0.2s;
    flex-shrink: 0;
}
.nav-search-btn:hover { background: var(--primary-dark); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255,255,255,0.9);
    font-size: 10px;
    gap: 2px;
    padding: 5px 10px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    line-height: 1;
}
.nav-action-btn:hover { background: rgba(255,255,255,0.15); color: white; }
.nav-action-btn svg { display: block; }
.nav-icon-label { font-size: 10px; color: rgba(255,255,255,0.85); line-height: 1; }

/* ===== NOTIF ===== */
.notif-container { position: relative; }
.notif-bell {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-size: 10px;
    gap: 2px;
    padding: 4px 8px;
    border-radius: var(--radius);
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.notif-bell:hover { background: rgba(255,255,255,0.15); }
.notif-badge {
    position: absolute;
    top: 0; right: 2px;
    background: white;
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 99px;
    display: none;
    min-width: 16px;
    text-align: center;
}
.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    background: var(--card);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    overflow: hidden;
}
.notif-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-solid);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
}
.notif-header button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
}
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-solid);
    display: block;
    color: var(--text);
    transition: background 0.2s;
}
.notif-item:hover { background: var(--bg-3); }
.notif-item strong { display: block; font-size: 12px; margin-bottom: 2px; }
.notif-item p { margin: 0; font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ===== NAV LINKS (desktop) ===== */
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
    color: white;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: var(--radius);
    transition: background 0.2s;
    white-space: nowrap;
}
.nav-links a:hover { background: rgba(255,255,255,0.15); }

.btn-primary {
    background: white;
    color: var(--primary) !important;
    font-weight: 700;
    padding: 6px 14px !important;
    border-radius: 4px !important;
    font-size: 13px;
}
.btn-primary:hover { background: #ffeaea !important; }

/* ===================================================
   HERO / BANNER STRIP
=================================================== */
.hero-strip {
    background: url('../images/mobile.webp') center/cover no-repeat;
    position: relative;
    padding: 32px 16px;
    text-align: center;
    z-index: 1;
}
.hero-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: -1;
}

.hero-strip h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
}

.hero-strip p {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===== SEARCH BAR (beranda) ===== */
.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    max-width: 640px;
    margin: 0 auto 16px;
    box-shadow: var(--shadow);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: white;
}

.search-bar select {
    border: none;
    border-left: 1px solid #ddd;
    outline: none;
    padding: 12px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background: white;
    cursor: pointer;
}

.search-bar .btn-search {
    background: var(--primary);
    border: none;
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
}

/* ===================================================
   CATEGORY CHIPS
=================================================== */
.category-strip {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0;
}
.category-strip::-webkit-scrollbar { display: none; }

.category-list {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    white-space: nowrap;
}

.cat-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cat-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 138, 0, 0.05);
}
.cat-btn.active {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.2);
}

/* ===================================================
   SECTION TITLE
=================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.section-link {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

/* ===================================================
   PRODUCT GRID - Shopee style
=================================================== */
.main-content { padding: 8px 0 80px; }

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-solid);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(242,31,31,0.3);
}

.card-img {
    width: 100%;
    padding-top: 100%; /* square */
    background-size: cover;
    background-position: center;
    background-color: var(--bg-3);
    position: relative;
    overflow: hidden;
}

.card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.3));
}

.badge.premium {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff8a00, var(--primary));
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
    letter-spacing: 0.3px;
}
.badge.packaging {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}
.badge.packaging.segel { background: rgba(0,0,0,0.6); }
.badge.packaging.loose { background: rgba(244,67,54,0.8); }

.card-body {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.card-store {
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-store a { color: var(--orange); }
.card-store a:hover { text-decoration: underline; }

.card-cond {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.tag-brand { background: rgba(255,255,255,0.08); color: var(--text-sub); }
.tag-type { background: rgba(242,31,31,0.12); color: var(--primary-light); }

.card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.btn-chat-sm {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border-solid);
    border-radius: 4px;
    background: transparent;
    color: var(--text-sub);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.btn-chat-sm:hover { border-color: var(--primary); color: var(--primary); }

.btn-buy-sm {
    flex: 2;
    padding: 6px;
    border: none;
    border-radius: 4px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-buy-sm:hover { background: var(--primary-dark); }

/* EMPTY STATE */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 14px;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ===================================================
   MODAL - Shopee Bottom Sheet style
=================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.7);
    align-items: flex-end;
    justify-content: center;
    animation: fadeInModal 0.2s ease;
}

.modal.open { display: flex; }

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-sheet {
    background: var(--card);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 20px;
    animation: slideUp 0.25s ease;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border-solid);
    border-radius: 99px;
    margin: 0 auto 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.modal-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--bg-3);
    margin-bottom: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--border-solid);
    transition: all 0.2s;
    text-decoration: none;
}
.modal-link:hover { background: var(--primary); color: white; border-color: var(--primary); }

.modal-close-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-sub);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
}

/* For desktop center alignment */
@media (min-width: 768px) {
    .modal { align-items: center; }
    .modal-sheet {
        border-radius: 16px;
        max-width: 400px;
        margin: 20px;
    }
}

/* ===================================================
   BOTTOM NAV - Mobile
=================================================== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-2);
    border-top: 1px solid var(--border-solid);
    z-index: 490;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 10px;
    gap: 3px;
    padding: 4px 12px;
    border-radius: 8px;
    transition: color 0.2s;
    text-decoration: none;
}
.mobile-nav .nav-item svg {
    stroke: var(--text-muted);
    transition: stroke 0.2s;
    display: block;
}
.mobile-nav .nav-item.active, .mobile-nav .nav-item:hover {
    color: var(--primary);
}
.mobile-nav .nav-item.active svg, .mobile-nav .nav-item:hover svg {
    stroke: var(--primary);
}
.mobile-nav .label { font-size: 10px; }

/* ===================================================
   FORM STYLES
=================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    background: var(--bg-3);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus { border-color: var(--primary); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; }

select.form-control option { background: var(--bg-3); }

.link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

/* ===================================================
   TABS
=================================================== */
.tab-list {
    display: flex;
    border-bottom: 1px solid var(--border-solid);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 20px;
}
.tab-list::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-btn:hover { color: var(--text); }

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

/* ===================================================
   SELLER / DASHBOARD CARD
=================================================== */
.dashboard-card {
    background: var(--card);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.dashboard-card h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-solid);
}

/* ===================================================
   PRODUCT DETAIL PAGE
=================================================== */
.product-page {
    max-width: 960px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.product-gallery {
    background: var(--bg-2);
    position: relative;
}

.gallery-main {
    width: 100%;
    aspect-ratio: 1/1;
    max-height: 480px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: var(--bg-2);
    border-top: 1px solid var(--border-solid);
    scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumbs img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
}
.gallery-thumbs img.active, .gallery-thumbs img:hover {
    border-color: var(--primary);
}

.product-info-panel {
    background: var(--card);
    padding: 16px;
    margin-bottom: 8px;
}

.product-price-big {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.product-title-big {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.meta-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-solid);
    color: var(--text-sub);
}

.specs-panel {
    background: var(--card);
    padding: 16px;
    margin-bottom: 8px;
}
.specs-panel h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-sub);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.specs-table { width: 100%; border-collapse: collapse; }
.specs-table tr td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-solid);
    font-size: 13px;
}
.specs-table tr:last-child td { border-bottom: none; }
.specs-table td:first-child { color: var(--text-sub); width: 40%; }

.desc-panel {
    background: var(--card);
    padding: 16px;
    margin-bottom: 8px;
}
.desc-panel h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}
.desc-text {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.store-panel {
    background: var(--card);
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-solid);
    border-left: 3px solid var(--primary);
    border-radius: 0;
    transition: background 0.2s;
}
.store-panel:hover { background: var(--card-hover); }

.store-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.store-info { flex: 1; min-width: 0; }
.store-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.store-info p { font-size: 12px; color: var(--text-sub); }

.store-visit-btn {
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}
.store-visit-btn:hover { background: var(--primary); color: white; }

/* ===== STICKY BUY BAR ===== */
.sticky-buy-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border-solid);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    gap: 10px;
    z-index: 480;
    max-width: 960px;
    margin: 0 auto;
}

.btn-chat-main {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-chat-main:hover { background: var(--primary-bg); }

.btn-buy-main {
    flex: 2;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}
.btn-buy-main:hover { background: var(--primary-dark); }
.btn-buy-main.disabled { background: var(--bg-4); color: var(--text-muted); cursor: not-allowed; }

/* ===================================================
   CHAT PAGE
=================================================== */
.chat-page {
    display: flex;
    height: calc(100vh - 56px); /* minus navbar */
    max-width: 1000px;
    margin: 0 auto;
    border: 1px solid var(--border-solid);
    border-top: none;
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-solid);
    background: var(--bg-2);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-solid);
    font-weight: 700;
    font-size: 15px;
    background: var(--card);
}

.contact-list { flex: 1; overflow-y: auto; }

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-solid);
    cursor: pointer;
    transition: background 0.2s;
}
.contact-item:hover, .contact-item.active { background: var(--primary-bg); }
.contact-item.active { border-left: 3px solid var(--primary); }

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.contact-name { font-size: 13px; font-weight: 600; }
.contact-preview { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    min-width: 0;
}

.chat-header-bar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-solid);
    background: var(--card);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-back-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.msg-left {
    align-self: flex-start;
    background: var(--bg-3);
    border-bottom-left-radius: 2px;
    color: var(--text);
}

.msg-right {
    align-self: flex-end;
    background: var(--primary);
    border-bottom-right-radius: 2px;
    color: white;
}

.chat-input-bar {
    padding: 10px 12px;
    border-top: 1px solid var(--border-solid);
    background: var(--card);
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.chat-input-field {
    flex: 1;
    padding: 10px 14px;
    border-radius: 24px;
    border: 1px solid var(--border-solid);
    background: var(--bg-3);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input-field:focus { border-color: var(--primary); }

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.chat-send-btn:hover { background: var(--primary-dark); }

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
}
.chat-empty .icon { font-size: 48px; }

/* ===================================================
   STORE PAGE
=================================================== */
.store-header-band {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 24px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.store-header-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    border: 3px solid white;
    flex-shrink: 0;
}

.store-header-info h2 { font-size: 18px; font-weight: 700; }
.store-header-info p { font-size: 13px; color: rgba(255,255,255,0.8); }

.store-links-bar {
    background: var(--card);
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-solid);
    scrollbar-width: none;
}
.store-links-bar::-webkit-scrollbar { display: none; }

.store-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-solid);
    font-size: 12px;
    color: var(--text-sub);
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.store-link:hover { border-color: var(--primary); color: var(--primary); }

.store-filter-bar {
    background: var(--bg-2);
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-solid);
}

.store-filter-bar input,
.store-filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    background: var(--bg-3);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.store-filter-bar input { flex: 1; }
.store-filter-bar input:focus,
.store-filter-bar select:focus { border-color: var(--primary); }

.store-stats {
    display: flex;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border-solid);
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-right: 1px solid var(--border-solid);
}
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 18px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); }

/* ===================================================
   RESPONSIVE - DESKTOP
=================================================== */
@media (min-width: 640px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    body { font-size: 15px; }
}

@media (min-width: 1024px) {
    .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .mobile-nav { display: none !important; }
    .nav-actions .nav-action-btn:not(.notif-trigger) { display: flex; }
    .product-page {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding-bottom: 0;
    }
    .product-gallery { position: sticky; top: 56px; height: fit-content; }
    .product-right { overflow-y: auto; }
    .sticky-buy-bar {
        position: sticky;
        bottom: 0;
        border-top: 1px solid var(--border-solid);
        border-radius: 0;
    }
    body { padding-bottom: 0; }
    .hero-strip {
        background: linear-gradient(rgba(0,0,0,0.9), rgba(0,0,0,0.9)), url('../images/desktop.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        padding: 48px 24px;
    }
    .hero-strip h1 { font-size: 2.8rem; }
}

@media (max-width: 768px) {
    .mobile-nav { display: flex; }
    body { padding-bottom: 65px; }
    .nav-links { display: none; }

    /* Chat mobile */
    .chat-page {
        height: calc(100vh - 56px);
        flex-direction: column;
    }
    .chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-solid);
        flex: 1;
    }
    .chat-main { display: none; }
    .chat-back-btn { display: block; }

    .chat-page.mobile-chat-active .chat-sidebar { display: none; }
    .chat-page.mobile-chat-active .chat-main {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 600;
        background: var(--bg);
    }
}

/* ===================================================
   SMART SELECT — Searchable Dropdown Component
=================================================== */
.smart-select {
    position: relative;
    width: 100%;
}

.ss-display {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    background: var(--bg-3);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: border-color 0.2s;
    outline: none;
    min-height: 42px;
}
.ss-display:hover,
.ss-display:focus { border-color: var(--primary); }
.ss-display.open { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(242,31,31,0.15); }
.ss-display-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-display-text.placeholder { color: var(--text-muted); }
.ss-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s; }
.ss-display.open .ss-arrow { transform: rotate(180deg); }

.ss-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 500;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ssSlideDown 0.15s ease-out;
}

@keyframes ssSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ss-search {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border-solid);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.ss-search::placeholder { color: var(--text-muted); }

.ss-options {
    flex: 1;
    overflow-y: auto;
    max-height: 240px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-4) transparent;
}
.ss-options::-webkit-scrollbar { width: 6px; }
.ss-options::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }

.ss-option {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ss-option:hover,
.ss-option.highlighted {
    background: var(--primary-bg);
    color: var(--text);
}
.ss-option.selected {
    color: var(--primary);
    font-weight: 600;
    background: rgba(242,31,31,0.05);
}
.ss-option mark {
    background: rgba(242,31,31,0.25);
    color: var(--primary);
    border-radius: 2px;
    padding: 0 1px;
}

.ss-option-manual {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--orange);
    font-weight: 600;
    border-top: 1px solid var(--border-solid);
    background: rgba(255,138,0,0.04);
    position: sticky;
    bottom: 0;
}
.ss-option-manual:hover { background: rgba(255,138,0,0.1); }
.ss-option-manual svg { flex-shrink: 0; stroke: var(--orange); }

.ss-no-result {
    padding: 16px 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.ss-manual-wrap {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-solid);
    background: var(--bg-2);
}
.ss-manual-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    background: var(--bg-3);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.ss-manual-input:focus { border-color: var(--primary); }
.ss-manual-confirm {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.ss-manual-confirm:hover { background: var(--primary-dark); }

/* ===================================================
   CONDITION SLIDER — Persentase Kemulusan
=================================================== */
.condition-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.condition-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.condition-slider-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-4);
    outline: none;
}
.condition-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(242,31,31,0.3);
    transition: transform 0.15s;
}
.condition-slider-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.condition-slider-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(242,31,31,0.3);
}
.condition-pct-display {
    min-width: 56px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(242,31,31,0.08);
    border: 1px solid rgba(242,31,31,0.2);
    border-radius: var(--radius);
    padding: 6px 10px;
}
.condition-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 2px;
}
.condition-desc-badge {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 2px;
}
.cond-perfect { background: rgba(0,200,83,0.15); color: #00c853; }
.cond-great { background: rgba(76,175,80,0.15); color: #4caf50; }
.cond-good { background: rgba(255,193,7,0.15); color: #ffc107; }
.cond-fair { background: rgba(255,152,0,0.15); color: #ff9800; }
.cond-poor { background: rgba(244,67,54,0.15); color: #f44336; }

/* Smart Select: Mobile responsive */
@media (max-width: 768px) {
    .ss-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 60vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        z-index: 700;
        animation: ssSlideUp 0.2s ease-out;
    }
    @keyframes ssSlideUp {
        from { opacity: 0; transform: translateY(100%); }
        to { opacity: 1; transform: translateY(0); }
    }
    .ss-search { padding: 14px 16px; font-size: 15px; }
    .ss-option { padding: 13px 16px; font-size: 14px; }
    .ss-manual-wrap { padding: 12px 16px; }
}
/* ===================================================
   ADVANCED FILTER MODAL
=================================================== */
.filter-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.filter-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.filter-modal {
    background: var(--bg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 600px) {
    .filter-modal-overlay { align-items: center; }
    .filter-modal { border-radius: 16px; max-height: 85vh; }
}
@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.filter-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-solid);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.filter-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.filter-close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }

.filter-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

/* Chips for Multi-select */
.filter-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-chip {
    padding: 8px 16px;
    background: var(--bg-3);
    border: 1px solid var(--border-solid);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.filter-chip.active {
    background: rgba(242,31,31,0.1);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.filter-chip:hover { border-color: var(--primary); }

/* Range Slider */
.filter-range-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.filter-range-wrap input[type="range"] {
    flex: 1;
    accent-color: var(--primary);
}
.filter-range-val {
    min-width: 60px;
    text-align: center;
    padding: 6px 12px;
    background: var(--bg-3);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--border-solid);
}

.filter-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-solid);
    display: flex;
    gap: 12px;
}
.btn-filter-reset {
    flex: 1;
    padding: 12px;
    background: var(--bg-3);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}
.btn-filter-apply {
    flex: 2;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* Button in search bar */
.btn-adv-filter {
    background: transparent;
    border: none;
    color: #888;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border-left: 1px solid #eee;
    border-radius: 0;
}
.btn-adv-filter:hover {
    color: var(--primary);
    background: #f9f9f9;
}
.btn-adv-filter .filter-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    display: none;
}
.btn-adv-filter.has-filters .filter-count { display: inline-block; }

@media (max-width: 600px) {
    .btn-adv-filter { padding: 0 12px; gap: 4px; }
    .btn-adv-filter .filter-text { display: none; }
    .btn-adv-filter .filter-count { font-size: 10px; padding: 2px 5px; }
}

/* PRODUCT CAROUSEL */
.product-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 16px; margin-top: 16px; margin-bottom: 24px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.product-carousel::-webkit-scrollbar { display: none; }
.product-carousel .product-card { flex: 0 0 160px; scroll-snap-align: start; }
.view-more-card { flex: 0 0 160px; scroll-snap-align: start; background: rgba(255,255,255,0.05); border: 1px dashed var(--border-color); border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--primary); font-weight: 600; padding: 20px; text-align: center; transition: all 0.2s; }
.view-more-card:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); }
.view-more-card svg { margin-bottom: 8px; }

