/* ==========================================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================================== */
:root { 
    --primary: #2980b9; 
    --dark: #2c3e50;
    --accent: #e67e22; 
    --bg: #f4f4f4; 
    --save: #27ae60;
    --danger: #e74c3c;
    --border: #cbd5e1;
    --text-muted: #94a3b8;
	--allbrands: #b98029; 
    
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    background: var(--bg); 
    color: #333; 
    padding-top: 45px; /* Leaves perfect room for the fixed top-bar */
}

.container { 
    max-width: 1100px; 
    margin: 20px auto; 
    padding: 0 15px; 
    box-sizing: border-box; 
}

/* ==========================================================================
   2. GLOBAL FRONTEND HEADER (PRO STACKED MOBILE LAYOUT)
   ========================================================================= */
.top-nav { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    height: 55px; /* Ditambah sedikit biar muat susunan atas-bawah */
    background: #2c3e50; 
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 10px; 
    z-index: 1000; 
    box-sizing: border-box; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); 
}

/* Badge Cabang/Dealer Kiri */
.nav-dealer-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-left: 5px;
    font-size: 11px;
    min-width: 40px;
}
.nav-dealer-badge .dealer-icon {
    font-size: 14px;
    margin-bottom: 2px;
}

/* Wrapper Menu Kanan - Dibagi Rata Secara Otomatis */
.nav-links-wrap { 
    display: flex; 
    flex-grow: 1;
    justify-content: space-around; /* Membagi sisa ruang secara rata adil */
    align-items: center;
    max-width: 85%; /* Menjaga batas agar tidak menabrak kode cabang */
}

/* Item Tombol Individu (Stacked Atas-Bawah) */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ffffff !important;
    font-size: 11px; /* Ukuran teks kecil proporsional */
    font-weight: 600;
    width: 60px;
    height: 48px;
    transition: background 0.2s, transform 0.1s;
    border-radius: 6px;
}

.nav-item:visited {
    color: #ffffff !important;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Pengaturan Ukuran Emoji/Icon Menu */
.nav-icon {
    font-size: 18px; /* Icon di atas terlihat dominan bersih */
    margin-bottom: 2px; /* Jarak tipis ke teks bawahnya */
    line-height: 1;
}

.nav-text {
    line-height: 1;
    white-space: nowrap;
}

/* Solusi Notifikasi Keranjang Bertumpuk Bersih */
.nav-icon-wrapper {
    position: relative;
    display: inline-block;
    line-height: 1;
}

/* Badge Angka Cart diletakkan presisi di pojok kanan atas emoji keranjang */
.cart-badge-mobile {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #e67e22;
    color: white;
    font-size: 9px;
    font-weight: bold;
    border-radius: 10px;
    padding: 1px 4px;
    min-width: 10px;
    text-align: center;
    line-height: 1;
    border: 1px solid #2c3e50; /* Border mengikuti warna bg nav biar kontras */
}

/* Highlight khusus saat user sedang login aktif */
.nav-account-active {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-sizing: border-box;
}

/* ==========================================================================
   3. HOME PAGE SPECIFIC STYLES
   ========================================================================== */
.hero { 
    height: 180px; 
    background: linear-gradient(rgba(41, 128, 185, 0.9), rgba(41, 128, 185, 0.9)), url('../images/hero-bg.jpg'); 
    background-size: cover; 
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
}

.sticky-header { 
    position: sticky; 
    top: 45px; 
    background: white; 
    z-index: 900; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.08); 
    padding: 12px 0; 
}

.search-bar { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 15px; 
    display: flex; 
    gap: 10px; 
    box-sizing: border-box; 
}

.search-bar input { 
    flex: 1; 
    padding: 12px 16px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-size: 14px; 
    outline: none; 
    transition: 0.2s; 
}

.search-bar input:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15); 
}

.search-bar button { 
    background: var(--accent); 
    color: white; 
    border: none; 
    padding: 0 24px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 14px; 
    transition: 0.2s; 
}

.search-bar button:hover { 
    background: #d35400; 
}

.cat-row { 
    max-width: 1100px; 
    margin: 12px auto 0; 
    padding: 0 15px; 
    display: flex; 
    overflow-x: auto; 
    gap: 10px; 
    scrollbar-width: none; 
    box-sizing: border-box; 
}

.cat-row::-webkit-scrollbar { 
    display: none; 
}

.cat-btn { 
    white-space: nowrap; 
    padding: 8px 18px; 
    background: #e2e8f0; 
    border-radius: 20px; 
    text-decoration: none; 
    color: #475569; 
    font-size: 13px; 
    font-weight: 500; 
    transition: 0.2s; 
}

.cat-btn:hover { 
    background: #cbd5e1; 
}

.cat-btn.active { 
    background: var(--primary); 
    color: white; 
}

.allbrands-btn { 
    white-space: nowrap; 
    padding: 8px 18px; 
    background: #e67e22; 
    border-radius: 20px; 
    text-decoration: none; 
    color: white; 
    font-size: 13px; 
    font-weight: 500; 
    transition: 0.2s;
}





.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 15px; 
}

.p-card { 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    text-decoration: none; 
    color: inherit; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    display: flex; 
    flex-direction: column; 
    transition: 0.2s; 
    border: 1px solid #e2e8f0; 
}

.p-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 6px 12px rgba(0,0,0,0.08); 
    border-color: #cbd5e1; 
}

.img-box { 
    aspect-ratio: 1/1; 
    background: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 10px; 
    border-bottom: 1px solid #f1f5f9; 
}

.img-box img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

.p-info { 
    padding: 12px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
}

.p-brand { 
    font-size: 10px; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    margin-bottom: 4px; 
    font-weight: bold; 
    letter-spacing: 0.5px; 
}

.p-name { 
    font-size: 13px; 
    font-weight: 600; 
    height: 34px; 
    overflow: hidden; 
    line-height: 1.3; 
    margin-bottom: 8px; 
    color: #1e293b; 
}

.p-price { 
    color: var(--accent); 
    font-weight: 700; 
    font-size: 15px; 
    margin-top: auto; 
}

/* ==========================================================================
   4. PRODUCT DETAIL PAGE SPECIFIC STYLES
   ========================================================================== */
.product-layout { 
    display: flex; 
    gap: 50px; 
    flex-wrap: wrap; 
}

.gallery-wrap { 
    flex: 1.2; 
    min-width: 320px; 
}

.main-frame { 
    width: 100%; 
    aspect-ratio: 1/1; 
    background: white; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border: 1px solid #eee; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); 
}

.main-frame img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

.thumb-nav { 
    display: flex; 
    gap: 10px; 
    margin-top: 15px; 
}

.thumb-nav img { 
    width: 70px; 
    height: 70px; 
    border: 2px solid #eee; 
    border-radius: 8px; 
    cursor: pointer; 
    object-fit: cover; 
    transition: 0.2s; 
}

.thumb-nav img:hover { 
    border-color: var(--accent); 
}

.price-box { 
    background: #fff; 
    padding: 20px; 
    border-radius: 10px; 
    border: 1px solid #eee; 
    margin: 20px 0; 
    border-left: 5px solid var(--accent); 
}

.old-price { 
    font-size: 16px; 
    color: #999; 
    text-decoration: line-through; 
    margin-bottom: 5px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.discount-tag { 
    background: #e74c3c; 
    color: white; 
    font-size: 11px; 
    font-weight: bold; 
    padding: 2px 8px; 
    border-radius: 4px; 
}

.current-price { 
    font-size: 38px; 
    color: var(--accent); 
    font-weight: 800; 
    line-height: 1; 
}

.save-notice { 
    color: var(--save); 
    font-weight: bold; 
    font-size: 14px; 
    margin-top: 8px; 
}

.details-wrap { 
    flex: 1; 
    min-width: 320px; 
}

.brand-tag { 
    color: #3498db; 
    font-weight: bold; 
    text-transform: uppercase; 
    font-size: 13px; 
    letter-spacing: 1px; 
}

.stock-badge { 
    padding: 8px 15px; 
    border-radius: 6px; 
    display: inline-block; 
    font-weight: bold; 
    font-size: 13px; 
    margin-bottom: 20px; 
    width: 100%; 
    box-sizing: border-box; 
}

.stock-badge.ready { 
    background: #e8f5e9; 
    color: #2e7d32; 
}

.stock-badge.po { 
    background: #fff3e0; 
    color: #ef6c00; 
}

.cart-interactive-section { 
    background: white; 
    border: 1px solid #e2e8f0; 
    padding: 20px; 
    border-radius: 12px; 
    margin-bottom: 15px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.02); 
}

.qty-container { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    margin-bottom: 15px; 
}

.qty-btn { 
    background: #e2e8f0; 
    border: none; 
    font-size: 18px; 
    font-weight: bold; 
    width: 40px; 
    height: 40px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: 0.1s; 
}

.qty-btn:active { 
    background: #cbd5e1; 
}

.qty-input { 
    width: 60px; 
    height: 40px; 
    text-align: center; 
    font-size: 16px; 
    font-weight: bold; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    outline: none; 
}

.btn-add-cart { 
    background: var(--dark); 
    color: white; 
    padding: 16px; 
    border: none; 
    border-radius: 10px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    font-weight: bold; 
    font-size: 16px; 
    width: 100%; 
    cursor: pointer; 
    transition: 0.2s; 
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.15); 
}

.btn-add-cart:hover { 
    background: #1a252f; 
    transform: translateY(-1px); 
}

.wa-btn { 
    background: #25d366; 
    color: white; 
    padding: 14px; 
    text-decoration: none; 
    border-radius: 10px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    font-weight: bold; 
    font-size: 15px; 
    transition: 0.3s; 
    text-align: center; 
}

.wa-btn:hover { 
    background: #128c7e; 
}

.desc-box { 
    margin-top: 35px; 
    border-top: 2px solid #f0f0f0; 
    padding-top: 25px; 
}

/* ==========================================================================
   5. VIEW CART SPECIFIC STYLES
   ========================================================================== */
.cart-layout { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.cart-card { 
    background: white; 
    border-radius: 10px; 
    padding: 15px; 
    display: flex; 
    gap: 15px; 
    align-items: center; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.02); 
}

.item-thumb { 
    width: 80px; 
    height: 80px; 
    object-fit: contain; 
    background: #fff; 
    border: 1px solid #eee; 
    border-radius: 6px; 
}

.item-details { 
    flex-grow: 1; 
}

.item-name { 
    font-weight: bold; 
    font-size: 15px; 
    margin-bottom: 4px; 
}

.item-sku { 
    font-size: 11px; 
    color: var(--text-muted); 
    font-weight: bold; 
}

.item-price { 
    font-size: 14px; 
    color: var(--accent); 
    font-weight: bold; 
    margin-top: 4px; 
}

.quantity-control-form { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

.summary-box { 
    background: white; 
    border-radius: 10px; 
    padding: 20px; 
    border: 1px solid #e2e8f0; 
    margin-top: 20px; 
    text-align: right; 
}

.total-label { 
    font-size: 16px; 
    color: #64748b; 
}

.total-amount { 
    font-size: 28px; 
    color: var(--accent); 
    font-weight: 800; 
    margin: 5px 0 20px 0; 
}

.btn-checkout { 
    background: #27ae60; 
    color: white; 
    padding: 15px 35px; 
    border: none; 
    border-radius: 8px; 
    font-weight: bold; 
    font-size: 16px; 
    text-decoration: none; 
    display: inline-block; 
    transition: 0.2s; 
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.2); 
}

.btn-checkout:hover { 
    background: #219653; 
    transform: translateY(-1px); 
}

.empty-cart { 
    text-align: center; 
    padding: 80px 20px; 
    color: var(--text-muted); 
}

.empty-cart span { 
    font-size: 60px; 
    display: block; 
    margin-bottom: 15px; 
}

/* ==========================================================================
   6. CHECKOUT PAGE SPECIFIC STYLES
   ========================================================================== */
.alert-error { 
    background: #fee2e2; 
    border: 1px solid #fca5a5; 
    color: #991b1b; 
    padding: 12px; 
    border-radius: 6px; 
    margin-bottom: 20px; 
    font-size: 14px; 
    font-weight: bold; 
}

.checkout-box { 
    background: white; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    padding: 25px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
}

.form-group { 
    margin-bottom: 18px; 
}

.form-group label { 
    display: block; 
    font-size: 13px; 
    font-weight: bold; 
    color: #475569; 
    margin-bottom: 6px; 
}

.form-group input, 
.form-group textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    box-sizing: border-box; 
    font-size: 14px; 
    outline: none; 
    transition: 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus { 
    border-color: var(--accent); 
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15); 
}

.btn-action { 
    background: var(--save); 
    color: white; 
    border: none; 
    padding: 15px; 
    border-radius: 6px; 
    font-weight: bold; 
    font-size: 16px; 
    width: 100%; 
    cursor: pointer; 
    transition: 0.2s; 
    margin-top: 10px; 
}

.btn-action:hover { 
    background: #219653; 
}

.total-banner { 
    background: #e2e8f0; 
    border-radius: 6px; 
    padding: 12px 15px; 
    margin-bottom: 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: bold; 
    font-size: 14px; 
    color: var(--dark); 
}

.notice-banner { 
    background: #eff6ff; 
    border: 1px solid #bfdbfe; 
    border-radius: 6px; 
    padding: 12px; 
    font-size: 12px; 
    color: #1e40af; 
    line-height: 1.5; 
    margin-bottom: 15px; 
}

/* Tab controls if you decide to keep the multi-tab alternative option */
.tab-nav { 
    display: flex; 
    background: white; 
    border-radius: 8px 8px 0 0; 
    border: 1px solid #cbd5e1; 
    border-bottom: none; 
    overflow: hidden; 
}

.tab-btn { 
    flex: 1; 
    padding: 15px 10px; 
    background: #e2e8f0; 
    border: none; 
    font-weight: bold; 
    font-size: 14px; 
    cursor: pointer; 
    color: #64748b; 
    transition: 0.2s; 
    text-align: center; 
}

.tab-btn.active { 
    background: white; 
    color: var(--accent); 
    border-top: 3px solid var(--accent); 
}

.tab-panel { 
    background: white; 
    border: 1px solid #cbd5e1; 
    border-radius: 0 0 8px 8px; 
    padding: 25px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
    display: none; 
}

.tab-panel.active { 
    display: block; 
}

/* ==========================================================================
   7. CUSTOMER DASHBOARD (MY_ORDERS.PHP) STYLES
   ========================================================================== */
.account-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.account-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Password automatic registration flash notification styling box */
.password-alert-box { 
    background: #eff6ff; 
    border: 2px dashed #3b82f6; 
    border-radius: 8px; 
    padding: 18px; 
    color: #1e40af; 
    margin-bottom: 25px; 
    line-height: 1.6; 
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.password-alert-box h4 { 
    margin: 0 0 6px 0; 
    font-size: 16px; 
    color: #1d4ed8; 
}

/* Profile summary specs layout card matrix */
.profile-card { 
    background: white; 
    border-radius: 8px; 
    border: 1px solid #cbd5e1; 
    padding: 20px; 
    margin-bottom: 25px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}

.profile-card h3 { 
    margin: 0 0 15px 0; 
    color: var(--dark); 
    font-size: 18px; 
    border-bottom: 2px solid #f1f5f9; 
    padding-bottom: 8px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Inline Logout Button sitting directly inside Account Summary title bar */
.logout-btn-inline {
    background: #fee2e2;
    color: var(--danger);
    text-decoration: none;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid #fca5a5;
    transition: 0.2s;
}

.logout-btn-inline:hover {
    background: var(--danger);
    color: white;
}

.meta-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 10px; 
    font-size: 14px; 
}

@media(min-width: 480px) { 
    .meta-grid { grid-template-columns: 130px 1fr; } 
}

.meta-label { 
    font-weight: bold; 
    color: #64748b; 
}

.meta-value { 
    color: #1e293b; 
}

/* Invoice history table alternative styling cards rows */
.section-title { 
    font-size: 18px; 
    color: var(--dark); 
    margin: 30px 0 15px 0; 
    font-weight: bold; 
}

.order-card { 
    background: white; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    padding: 15px; 
    margin-bottom: 15px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}

.order-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
    border-bottom: 1px solid #f1f5f9; 
    padding-bottom: 8px; 
}

.invoice-no { 
    font-weight: bold; 
    color: #1e293b; 
    font-size: 14px; 
}

.order-date { 
    font-size: 11px; 
    color: var(--text-muted); 
    font-weight: 500; 
}

.order-body { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
}

.order-total { 
    font-size: 18px; 
    color: var(--accent); 
    font-weight: 800; 
}

/* Status Flag Indicators colors definitions */
.badge { 
    font-size: 11px; 
    font-weight: bold; 
    padding: 4px 10px; 
    border-radius: 4px; 
    display: inline-block; 
    text-transform: uppercase; 
}

.status-unpaid { background: #fef2f2; color: var(--danger); border: 1px solid #fee2e2; }
.status-paid { background: #f0fdf4; color: var(--save); border: 1px solid #dcfce7; }
.status-pending { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.status-completed { background: #f0fdfa; color: var(--primary); border: 1px solid #ccfbf1; }

.empty-state { 
    text-align: center; 
    padding: 40px 20px; 
    background: white; 
    border-radius: 8px; 
    border: 1px solid #cbd5e1; 
    color: var(--text-muted); 
}


/* Branch Sidebar */
        .branch-card { 
            background: white; border-radius: 12px; padding: 20px; 
            margin-bottom: 15px; cursor: pointer; border: 2px solid transparent;
            transition: 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }
        .branch-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
        .branch-card.active { border-color: var(--primary); background: #f0f7fc; }
        .branch-card h3 { margin: 0 0 10px; color: var(--primary); font-size: 17px; }
        .branch-info { font-size: 13px; color: #666; line-height: 1.5; }

        /* Map Display Area */
        .map-display { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
        .map-frame { width: 100%; height: 450px; background: #eee; position: relative; }
        
        /* Ensure the iframe fills the container properly */
        .map-frame iframe { width: 100% !important; height: 100% !important; border: 0; display: block; }
        
		
/* ==========================================================================
   8. DETIL INVOICE (ORDER_DETAIL.PHP)
   ========================================================================== */
.order-card-link {
    transition: transform 0.2s;
}
.order-card-link:hover .order-card {
    border-color: var(--accent);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.detail-item-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.detail-item-row:last-child {
    border-bottom: none;
}
.detail-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}
.detail-info {
    flex-grow: 1;
}
.detail-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}
.detail-qty-price {
    font-size: 12px;
    color: #64748b;
}
.detail-subtotal {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    text-align: right;
}
.btn-back-dashboard {
    display: block;
    text-align: center;
    background: var(--dark);
    color: white !important;
    text-decoration: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    margin-top: 20px;
}