/* ===================================================
   1. VARIABLES & THEME (Soft Black Premium)
=================================================== */
:root {
    --primary: #2D3748; 
    --primary-hover: #1A202C;
    --danger: #FF1313;  
    --dark: #1A202C;
    --white: #FFFFFF;
    --bg-light: #F8F8F8;
    --text-muted: #64676C;
    --radius: 18px;
    --shadow: 0 8px 24px rgba(45, 55, 72, 0.06);
}

/* ===================================================
   2. RESET & BASICS
=================================================== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-light);
    color: var(--dark);
    margin: 0;
    padding: 0;
    padding-bottom: 80px; /* Ruang untuk bottom nav mobile */
    transition: all 0.3s ease;
}

/* ===================================================
   3. LAYOUT & TYPOGRAPHY
=================================================== */
.top-header {
    position: sticky;
    top: 0;
    background: rgba(248, 248, 248, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 90;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.header-content h1 { margin: 0; font-size: 20px; font-weight: 800; color: var(--dark); }

.main-content {
    padding: 20px; 
    max-width: 600px; 
    margin: 0 auto;
    transition: margin 0.3s ease, max-width 0.3s ease;
}

.hero-section { margin-bottom: 25px; }
.hero-section h2 { margin: 0 0 5px 0; font-size: 24px; font-weight: 800; }
.hero-section p { margin: 0; color: var(--text-muted); font-size: 14px; font-weight: 600; }

/* Sistem Tab (Halaman SPA) */
.view-section { display: none; animation: fadeIn 0.3s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===================================================
   4. COMPONENTS (Cards, Buttons, Product)
=================================================== */
.product-card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0,0,0,0.02);
}

.product-card:active { transform: scale(0.98); }

.product-img {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    background-color: #eee;
}

.product-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.product-title { margin: 0 0 6px 0; font-size: 15px; font-weight: 700; line-height: 1.3; }

.price-container { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.product-price { color: var(--primary); font-weight: 800; font-size: 16px; margin: 0; }
.product-price-strike { color: var(--text-muted); font-size: 12px; text-decoration: line-through; }

.btn-buy {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 0;
    width: 100%;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.25);
    transition: background 0.2s ease;
}

.btn-buy:hover, .btn-buy:active { 
    background-color: var(--primary-hover); 
}

/* ===================================================
   5. FORMS & INPUTS (Dashboard & Lacak Pesanan)
=================================================== */
.pesanan-card, .form-card {
    background: var(--white); 
    border-radius: var(--radius); 
    padding: 20px; 
    box-shadow: var(--shadow);
}

.input-group { margin-bottom: 15px; }
.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 13px;
    color: var(--dark);
}

.input-form {
    width: 100%; 
    padding: 12px 15px; 
    border-radius: 10px; 
    border: 1px solid #ddd;
    margin-bottom: 15px; 
    font-family: inherit; 
    font-size: 14px; 
    outline: none;
}
.input-form:focus { border-color: var(--primary); }

textarea.input-form, select.input-form {
    resize: vertical;
    background-color: var(--white);
}

.form-section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    margin: 25px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px dashed #ddd;
}

.input-row { display: flex; gap: 12px; }

/* ===================================================
   6. NAVIGATION (Bottom / Mobile)
=================================================== */
.desktop-toggle { display: none; }

.bottom-nav {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%;
    background-color: var(--white); 
    display: flex; 
    justify-content: space-around;
    align-items: center;
    padding: 10px 10px 15px 10px; /* Padding disesuaikan */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.04); 
    z-index: 100;
    border-top-left-radius: 24px; 
    border-top-right-radius: 24px;
}

.nav-item {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-decoration: none; 
    color: var(--text-muted); 
    gap: 4px; 
    padding: 8px 16px; /* Memberi ruang untuk background kapsul */
    border-radius: 14px; /* Bentuk melengkung */
    transition: all 0.3s ease;
}

.nav-item svg { width: 24px; height: 24px; }
.nav-item span { font-size: 11px; font-weight: 600; }

/* --- TAMPILAN MENU TERPILIH (Inversi Warna) --- */
.nav-item.active { 
    color: var(--white); 
    background-color: var(--primary);
    box-shadow: 0 4px 10px rgba(45, 55, 72, 0.15);
}

/* ===================================================
   7. SKELETON LOADING
=================================================== */
.skeleton-card { 
    background: var(--white); border-radius: var(--radius); padding: 14px; 
    margin-bottom: 16px; display: flex; gap: 16px; box-shadow: var(--shadow); 
}
.skeleton { 
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%); 
    border-radius: 5px; background-size: 200% 100%; animation: 1.5s shine linear infinite; 
}
.skeleton-img { width: 90px; height: 90px; border-radius: 12px; }
.skeleton-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.skeleton-text { height: 14px; }
.skeleton-btn { height: 32px; width: 100%; border-radius: 10px; margin-top: auto; }
@keyframes shine { to { background-position-x: -200%; } }

/* ===================================================
   8. MEDIA QUERIES (Responsive Desktop / PC)
=================================================== */
@media (min-width: 768px) {
    body { 
        padding-bottom: 0; 
        display: flex; /* Menggunakan Flexbox untuk memisahkan Sidebar & Konten */
        min-height: 100vh;
    }
    
    .mobile-only { display: none; }
    
    /* SIDEBAR DESKTOP */
    .bottom-nav {
        position: fixed; /* Tetap menempel di kiri */
        top: 0; 
        left: 0; 
        width: 240px; 
        height: 100vh;
        flex-direction: column; 
        justify-content: flex-start;
        align-items: stretch; /* Agar menu memenuhi lebar sidebar */
        padding: 20px 15px; 
        border-radius: 0;
        border-right: 1px solid rgba(0,0,0,0.05);
        background-color: var(--white);
        transition: width 0.3s ease;
        z-index: 100;
    }
    
    /* State Minimized Sidebar */
    .bottom-nav.minimized { 
        width: 80px; 
        padding-left: 10px;
        padding-right: 10px;
    }
    .bottom-nav.minimized .nav-item span { display: none; }
    
    /* Tombol Toggle Menu */
    .desktop-toggle {
        display: flex; 
        align-items: center;
        justify-content: center;
        background: none; 
        border: none; 
        cursor: pointer;
        color: var(--dark); 
        margin-bottom: 40px; 
        width: 40px; 
        height: 40px;
        border-radius: 10px; 
        transition: background 0.2s;
        align-self: flex-start; /* Nempel ke kiri */
    }
    .desktop-toggle:hover { background: var(--bg-light); }
    .desktop-toggle svg { width: 24px; height: 24px; }
    .bottom-nav.minimized .desktop-toggle { align-self: center; } /* Ketengah saat minimize */

    /* Item Menu di Desktop */
    .nav-item { 
        flex-direction: row; 
        padding: 12px 16px; 
        gap: 15px; 
        margin-bottom: 8px;
        justify-content: flex-start; /* Rata Kiri */
    }
    .nav-item span { font-size: 14px; font-weight: 700; }
    .bottom-nav.minimized .nav-item { justify-content: center; padding: 12px 0; }

    /* AREA KONTEN UTAMA (Tengah Layar) */
    .main-content {
        margin-left: 240px; /* Jarak untuk sidebar terbuka */
        padding: 40px 30px; 
        width: calc(100% - 240px); /* Ambil sisa lebar layar */
        max-width: 800px; /* Batas maksimal agar tidak terlalu melar */
        margin-right: auto; /* Mendorong ke tengah */
        transition: margin-left 0.3s ease, width 0.3s ease;
    }
    
    /* Saat Sidebar ditutup, area konten melebar */
    .main-content.expanded { 
        margin-left: 80px; 
        width: calc(100% - 80px);
    }
    
    /* Perbesar sedikit ukuran font untuk PC */
    .hero-section h2 { font-size: 28px; }
    .hero-section p { font-size: 15px; }
}