/* =========================================================
   RESET & CSS DASAR - ADY BRATA STORE (DARK NAVY THEME)
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    padding-bottom: 75px !important; /* Pas di atas menu navigasi bawah */
}

/* =========================================================
   1. HEADER DARK NAVY BLUE PREMIUM
   ========================================================= */
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 16px 16px 20px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
}

.header-user-info {
    max-width: 1100px;
    margin: 0 auto 12px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
}

.greeting-text,
header .greeting-text {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

.user-name {
    color: #ffffff !important; 
    font-weight: 800 !important;
    font-size: 1.1rem;
}

.points-badge-mini {
    background-color: rgba(255, 255, 255, 0.1);
    color: #facc15;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(250, 204, 21, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --- KOLOM PENCARIAN LEBIH BESAR & TINGGI --- */
.search-box {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 48px 12px 18px;
    border-radius: 28px;
    border: 1px solid #334155;
    background-color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-box input::placeholder {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.search-icon-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
}

/* =========================================================
   2. CONTAINER KATALOG & CARDS PRODUK (2 KOLOM RINGKAS)
   ========================================================= */
.container {
    max-width: 1100px;
    margin: 12px auto;
    padding: 0 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 4px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.total-item-info {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

/* --- TAMPILAN KATALOG 2 KOLOM (HP/MOBILE) --- */
.grid-katalog,
.grid-katalog-2col {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
    padding-bottom: 0px !important; /* Dihilangkan agar tidak ada ruang kosong berlebih */
}

@media (min-width: 768px) {
    .grid-katalog,
    .grid-katalog-2col {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
        gap: 12px !important;
    }
}

.card-produk {
    background: #ffffff !important;
    border-radius: 10px !important;
    padding: 8px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    height: 100% !important;
    width: 100% !important;
}

.card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* BINGKAI FOTO PRODUK (DIPERBESAR) */
.foto-produk {
    width: 100%;
    height: 150px !important;
    background-color: #ffffff;
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.65rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.foto-produk img {
    max-width: 100% !important;
    max-height: 145px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto;
    background-color: #ffffff;
}

/* BADGE KATEGORI */
.badge-kategori {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
}

/* BADGE POIN */
.badge-poin-direct {
    position: absolute;
    top: 4px !important;
    right: 4px !important;
    bottom: auto !important;
    background-color: #f59e0b !important;
    color: #ffffff !important;
    font-size: 0.65rem !important;
    font-weight: 900 !important;
    padding: 2px 6px !important;
    border-radius: 5px !important;
    z-index: 5 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(2px);
    margin: 0 !important;
}

/* NAMA PRODUK (MAKSIMAL 2 BARIS) */
.nama-produk {
    font-size: 0.75rem !important;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px !important;
    line-height: 1.2 !important;
    height: 2.4em !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* DROPDOWN SATUAN */
.pilih-satuan {
    width: 100%;
    padding: 4px 6px !important;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.7rem !important;
    font-weight: 700;
    margin-bottom: 4px !important;
    background-color: #f8fafc;
    color: #1e293b;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    outline: none;
}

.pilih-satuan:focus {
    border-color: #2563eb;
    background-color: #ffffff;
}

.harga-box {
    margin-bottom: 6px !important;
    min-height: 1.1em;
    margin-top: auto;
}

.harga-dinamis {
    font-size: 0.8rem !important;
    font-weight: 800;
    color: #16a34a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TOMBOL AKSI TAMBAH KERANJANG */
.btn-tambah {
    width: 100%;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 6px 8px !important;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem !important;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
}

.btn-tambah:hover {
    background-color: #1d4ed8;
}

/* --- TOMBOL QUANTITY (- 1 +) DENGAN INPUT NUMERIK --- */
.qty-control {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background-color: #ffffff !important;
    border: 1px solid #2563eb !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    height: 28px !important;
    width: 100% !important;
    margin-top: 2px !important;
}

.qty-btn {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    width: 30px !important;
    height: 100% !important;
    font-size: 0.85rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.qty-input {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* =========================================================
   3. BOTTOM NAVIGATION
   ========================================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    border-top: 1px solid #f1f5f9;
    z-index: 999;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    width: 20%;
    gap: 3px;
    transition: color 0.2s ease;
}

.nav-item .nav-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.nav-item.active {
    color: #2563eb !important;
    font-weight: 800;
}

.loading-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 0.85rem;
}
