/* =================================================================
   PROJECT: ADMM MARKETPLACE (MOBILE FIRST)
   VERSION: 1.0 (Master Fix)
   AUTHOR: ADMM DEV TEAM
   ================================================================= */

/* -----------------------------------------------------------------
   1. VARIABLES & RESET (PENGATURAN WARNA UTAMA)
   ----------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Identitas Warna (Biru ADMM Clean) */
    --primary: #0ea5e9;       /* Sky 500 */
    --primary-dark: #0284c7;  /* Sky 600 */
    --primary-light: #e0f2fe; /* Sky 100 */
    --primary-glow: rgba(14, 165, 233, 0.4);
    
    /* Warna Netral */
    --bg-body: #e2e8f0;       /* Abu latar luar (PC) */
    --bg-app: #f8fafc;        /* Latar dalam aplikasi (HP) */
    --white: #ffffff;
    --text-main: #0f172a;     /* Slate 900 */
    --text-body: #334155;     /* Slate 700 */
    --text-muted: #94a3b8;    /* Slate 400 */
    
    /* Dimensi & Radius */
    --radius-card: 16px;
    --radius-sm: 8px;
    --header-height: 60px;
    --footer-height: 70px;    /* Tinggi Navigasi Bawah */
    --app-width: 480px;       /* Lebar Maksimal Tampilan HP */
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
}

/* --- 1. SETTINGAN DASAR --- */
body {
    font-family: 'Inter', sans-serif;
    
    /* PENTING: Samakan warna body dengan warna aplikasi */
    /* Jangan Putih (#ffffff), tapi pakai Abu Terang (#f1f5f9) */
    background-color: #f1f5f9; 
    
    margin: 0;
    padding: 0;
    color: #1e293b;
    
    /* Hapus padding-bottom di body, kita pindah ke container */
    padding-bottom: 0; 
}

/* --- 2. APP CONTAINER --- */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    
    /* PENTING: Pastikan warnanya sama dengan Body */
    background-color: #f1f5f9; 
    
    /* PENTING: Minimal tinggi 100% layar HP */
    min-height: 100vh; 
    
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
    
    /* PENTING: INI PENGGANTI SPACER KOSONG */
    /* Memberi bantalan di bawah agar konten terakhir tidak ketutup footer */
    /* Tapi warnanya tetap Abu-abu (nyatu), bukan putih */
    padding-bottom: 100px; 
}

/* -----------------------------------------------------------------
   3. HEADER & SEARCH BAR (STICKY)
   ----------------------------------------------------------------- */
.header-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    padding: 10px 16px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.brand-logo {
    font-weight: 800;
    color: var(--white);
    font-size: 18px;
    letter-spacing: -0.5px;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    background: var(--white);
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.header-icon-btn {
    position: relative;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444; /* Merah */
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
}

/* -----------------------------------------------------------------
   4. SLIDER & BANNERS
   ----------------------------------------------------------------- */
.slider-container {
    padding: 16px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.banner-item {
    flex: 0 0 90%; /* Lebar banner 90% layar */
    height: 160px;
    border-radius: var(--radius-card);
    overflow: hidden;
    scroll-snap-align: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* -----------------------------------------------------------------
   5. KATEGORI MENU (GRID ICONS)
   ----------------------------------------------------------------- */
.category-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Kolom Rata */
    gap: 16px 8px;
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.cat-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 18px; /* Squircle Style */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--white);
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: all 0.2s;
}

.cat-item:active .cat-icon-box {
    transform: scale(0.9);
    border-color: var(--primary);
    background: var(--primary-light);
}

.cat-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-body);
    text-align: center;
    line-height: 1.2;
}

/* -----------------------------------------------------------------
   6. PRODUK CARD & SECTION
   ----------------------------------------------------------------- */
.section-header {
    padding: 0 16px 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Kolom */
    gap: 12px;
    padding: 0 16px 24px 16px;
}

.card {
    background: var(--white);
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.1s;
}

.card:active { transform: scale(0.98); }

.card-img-wrapper {
    width: 100%;
    aspect-ratio: 4/3; /* Persegi panjang landscape */
    position: relative;
    background: #e2e8f0;
}

.card-img { width: 100%; height: 100%; object-fit: cover; }

.badge-discount {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #ef4444;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-body { padding: 12px; }

.card-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price { font-size: 13px; font-weight: 700; color: var(--primary); }

.btn-add {
    width: 24px; height: 24px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: bold;
}

/* -----------------------------------------------------------------
   7. NAVIGASI BAWAH (BOTTOM NAVBAR FIX) - 5 KOLOM
   ----------------------------------------------------------------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: var(--white);
    
    /* PENTING: Agar tetap di tengah layar PC */
    max-width: var(--app-width);
    margin: 0 auto;
    
    border-top: 1px solid #f1f5f9;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
    
    /* GRID SYSTEM 5 KOLOM PRESISI */
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

/* PENTING: KUNCI UKURAN SVG AGAR TIDAK RAKSASA */
.nav-item svg {
    width: 24px !important;
    height: 24px !important;
    margin-bottom: 4px;
    stroke-width: 2px;
    fill: none;
    transition: all 0.2s;
}

/* State Active (Menu Terpilih) */
.nav-item.active { color: var(--primary); }
.nav-item.active svg {
    transform: translateY(-4px);
    stroke: var(--primary);
    filter: drop-shadow(0 4px 8px var(--primary-glow));
}
.nav-item.active span { font-weight: 800; }

/* -----------------------------------------------------------------
   8. TOMBOL TENGAH FLOATING (BELI CEPAT)
   ----------------------------------------------------------------- */
.nav-item.center-floating {
    position: relative;
    overflow: visible; /* Biarkan tombol keluar kotak */
}

.floating-btn-circle {
    position: absolute;
    top: -28px; /* Naik ke atas navbar */
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    
    /* Gradient Warna Utama */
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Border Putih Tebal biar terpisah dari garis navbar */
    border: 5px solid var(--white);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
    transition: transform 0.1s;
}

.floating-btn-circle svg {
    stroke: white !important; /* Icon Putih */
    margin: 0 !important;
    width: 26px !important;
    height: 26px !important;
}

.nav-item.center-floating span {
    margin-top: 30px; /* Jarak teks di bawah tombol bulat */
    color: var(--primary);
    font-weight: 700;
}

.floating-btn-circle:active { transform: translateX(-50%) scale(0.9); }

/* -----------------------------------------------------------------
   9. FORM ELEMENTS (LOGIN / REGISTER STYLE)
   ----------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    background: var(--white);
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover { background: var(--primary-dark); }