/*
 * CSS Lengkap untuk Portal Pelanggan - Multibelimaindo
 * Versi: 1.2.0 (Revisi Tampilan Mizan Store)
 * Desain: Modern, Bersih, dan Responsif (Mobile-First)
 */

/* === FONT IMPORT & VARIABLE CSS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --background-color: #f1f5f9; /* Slate 100 */
    --card-background: #ffffff;
    --text-dark: #1e293b;      /* Slate 800 */
    --text-medium: #64748b;     /* Slate 500 */
    --text-light: #94a3b8;      /* Slate 400 */
    --border-color: #e2e8f0;    /* Slate 200 */
}

/* === DASAR & LAYOUT UTAMA === */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-dark);
    margin: 0;
}

#marketplace-app-container {
    max-width: 500px; /* Lebar maksimal seperti layar ponsel */
    margin: 0 auto;
    background-color: var(--card-background); /* Ganti BG utama jadi putih seperti Mizan */
    min-height: 100vh;
    box-shadow: 0 0 25px rgba(0,0,0,0.08);
    overflow-x: hidden;
    position: relative;
}

/* Kontainer untuk semua view/halaman */
#view-container {
    padding-bottom: 96px; /* Memberi ruang untuk bottom nav */
}

/* Ubah BG view agar konsisten */
.app-view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    background-color: var(--background-color); /* Latar belakang view tetap abu-abu */
}
.app-view#view-home {
    background-color: var(--card-background); /* Khusus home, latar putih */
    padding-top: 0;
}

.app-view.active {
    display: block; /* View yang aktif akan ditampilkan */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === HEADER APLIKASI === */
#app-header {
    position: sticky;
    top: 0;
    background-color: var(--card-background);
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: 64px;
    display: none; /* Ditampilkan oleh JS saat diperlukan */
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

#header-title {
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
}

/* Memberi padding atas pada kontainer saat header muncul */
#view-container.with-header {
    padding-top: 64px;
}


/* === NAVIGASI BAWAH (BOTTOM NAVIGATION) === */
#bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    height: 72px;
    background-color: var(--card-background);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 0.75rem; /* 12px */
    margin-top: 4px;
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}


/* === KOMPONEN UMUM: KARTU, TOMBOL, FORM === */
.marketplace-card {
    background-color: var(--card-background);
    padding: 1rem;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid var(--border-color);
}

.marketplace-button {
    width: 100%;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 0.5rem; /* 8px */
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.marketplace-button:hover {
    background-color: var(--primary-hover);
}
.marketplace-button:disabled {
    background-color: #a5b4fc; /* indigo-300 */
    cursor: not-allowed;
}

.marketplace-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: #f8fafc; /* Slate 50 */
    box-sizing: border-box;
}

/* === MODAL & BACKDROP === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    display: none; /* Diubah ke flex oleh JS */
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
    animation: fadeInBackdrop 0.3s;
}

.modal-content {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    animation: slideInUp 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === STYLE SPESIFIK UNTUK HALAMAN HOME === */
#home-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6d28d9 100%); /* Gradient Indigo to Purple */
    color: white;
    padding: 1.5rem;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

/* === STYLE UNTUK BANNER SLIDER (Utama & User) === */
.banner-slide img {
    aspect-ratio: 2 / 1; /* Rasio landscape, bisa disesuaikan */
    object-fit: cover;
}
.banner-dot {
    transition: all 0.3s ease;
}
.banner-dot.active {
    background-color: white;
    transform: scale(1.2);
}


/* === STYLE UNTUK HALAMAN TOKO/MARKETPLACE (DIREVISI) === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Membuat 2 kolom */
    gap: 1rem; /* Jarak antar produk */
}

.product-card {
    background-color: var(--card-background);
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1 / 1; /* Membuat gambar menjadi kotak */
    background-color: #f8fafc; /* Slate 50 */
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Memastikan gambar memenuhi area tanpa distorsi */
}

.product-info {
    padding: 0.75rem; /* 12px */
    flex-grow: 1;
}

.product-name {
    font-weight: 600;
    font-size: 0.875rem; /* 14px */
    color: var(--text-dark);
    line-height: 1.3;
    /* Batasi nama produk menjadi 2 baris */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
    min-height: 2.6em; /* 2 baris x 1.3 line-height */
}

.product-price {
    font-weight: 700;
    font-size: 1rem; /* 16px */
    color: var(--primary-color);
    margin-top: 0.25rem;
}

/* Tombol Add to Cart (Revisi dari kode asli) */
.product-card .btn-request-quote,
.product-card .btn-add-to-cart-grid {
    width: calc(100% - 1.5rem);
    margin: 0 0.75rem 0.75rem 0.75rem;
    padding: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: #eef2ff; /* indigo-50 */
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
}
.product-card .btn-request-quote:hover,
.product-card .btn-add-to-cart-grid:hover {
    background-color: var(--primary-color);
    color: white;
}
.product-card .btn-request-quote:disabled,
.product-card .btn-add-to-cart-grid:disabled {
    background-color: var(--border-color);
    border-color: var(--text-light);
    color: var(--text-light);
    cursor: not-allowed;
}

/* === TOMBOL KERANJANG (FLOATING ACTION BUTTON) === */
#btn-cart {
    position: fixed;
    bottom: 90px;
    right: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    transition: transform 0.2s ease-out;
}
#btn-cart:hover {
    transform: scale(1.05);
}

#cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ef4444; /* red-500 */
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}
/* === STYLE SPESIFIK UNTUK MODE KATALOG PUBLIK === */

#katalog-header {
    background-color: var(--card-background);
    padding: 0 1rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.katalog-logo {
    height: 40px;
    width: 120px;
    /* Ganti dengan URL logo Anda */
    background-image: url('https://placehold.co/120x40/e2e8f0/64748b?text=MBI-Logo');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
}

.katalog-login-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.katalog-login-button:hover {
    background-color: var(--primary-hover);
}

/* Judul Sesi seperti "Kategori", "Promo", "Produk" */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

/* === STYLE UNTUK KATEGORI (Scroll Horizontal) === */
.kategori-scroll-container {
    display: flex;
    overflow-x: auto;
    padding: 0 1rem 1rem 1rem;
    gap: 0.75rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.kategori-scroll-container::-webkit-scrollbar {
    display: none;
}

.kategori-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    width: 80px;
    cursor: pointer;
}

.kategori-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.kategori-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.kategori-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-top: 0.5rem;
    line-height: 1.2;
}

/* === BARU: STYLE STANDING BANNER (Scroll Horizontal) === */
.standing-banner-container {
    display: flex;
    overflow-x: auto;
    padding: 0 1rem 1rem 1rem;
    gap: 0.75rem; /* Jarak antar banner */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.standing-banner-container::-webkit-scrollbar {
    display: none;
}
.standing-banner-item {
    flex-shrink: 0;
    width: 150px; /* Lebar banner portrait */
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}
.standing-banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 9 / 16; /* Rasio portrait */
}

/* === BARU: STYLE PRODUCT SCROLLER (Dashboard) === */
.product-scroll-container {
    display: flex;
    overflow-x: auto;
    padding: 0 1rem 1rem 1rem;
    gap: 0.75rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.product-scroll-container::-webkit-scrollbar {
    display: none;
}
/* Menggunakan .product-card tapi dengan lebar tetap */
.product-scroll-container .product-card {
    flex-shrink: 0;
    width: 160px; /* Lebar kartu produk di scroller */
}

/* === BARU: STYLE FOOTER === */
#app-footer {
    background-color: var(--text-dark);
    color: var(--text-light);
    padding: 2rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    /* Pastikan footer nempel di bawah jika konten pendek */
    margin-top: auto; 
}
#app-footer h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-top: 0;
    margin-bottom: 0.75rem;
}
#app-footer p, #app-footer ul {
    margin-bottom: 1rem;
}
#app-footer ul {
    list-style: none;
    padding-left: 0;
}
#app-footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}
#app-footer a:hover {
    color: white;
}
#app-footer .footer-bottom {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--text-medium);
    text-align: center;
    font-size: 0.75rem;
}