/* =============================================================================
   STOREFRONT CSS (DISC-F2)
   -----------------------------------------------------------------------------
   Diekstrak dari inline <style> layouts/public.blade.php (~685 baris) agar
   cacheable/minifiable/reusable. Token dari public/css/design-tokens.css (dimuat
   SEBELUM file ini). Rebrand tetap via partials/brand-head (SESUDAH file ini).
   ============================================================================ */

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* ============================================
   CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   NAVBAR
   ============================================ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,.92);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 16px;
}
.site-brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.site-brand span { color: var(--gray-900); }

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.site-nav a, .site-nav button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    border: none;
    background: none;
    cursor: pointer;
    transition: all .2s var(--ease);
    white-space: nowrap;
}
.site-nav a:hover, .site-nav button:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}
.site-nav a.active {
    background: var(--primary-50);
    color: var(--primary);
}

.nav-cart-badge {
    position: relative;
}
.nav-cart-badge .badge-count {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}
.nav-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    transition: all .2s var(--ease);
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { opacity: .9; }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px 10px; }
.btn-disabled { opacity: .5; cursor: default; }

.btn-google {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-google:hover { background: var(--gray-50); }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all .3s var(--ease);
}
.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.card-body { padding: 20px; }
.card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--gray-100);
}
.card-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 40px;
}

/* ============================================
   DATA TABLE
   ============================================ */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-500);
    font-weight: 700;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table .text-right { text-align: right; }

/* Definition list for key/value detail panels */
.detail-list { width: 100%; }
.detail-list th {
    text-align: left;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    width: 40%;
    vertical-align: top;
}
.detail-list td {
    padding: 10px 0;
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 500;
}
.detail-list tr + tr th, .detail-list tr + tr td {
    border-top: 1px solid var(--gray-100);
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.alert-error, .alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}
.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-digital {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

/* ============================================
   GRID HELPERS
   ============================================ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-1 { flex: 1; }
.d-inline { display: inline; }
.ml-1 { margin-left: 4px; }
.text-dark { color: var(--gray-900); }
.img-cover { width: 100%; height: 100%; object-fit: cover; }
.sticky-card { position: sticky; top: 88px; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

/* ============================================
   SECTION HELPERS
   ============================================ */
.section { padding: 48px 0; }
.section-sm { padding: 24px 0; }
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.section-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 28px;
}

/* ============================================
   PAGE WRAPPER
   ============================================ */
.page {
    min-height: calc(100vh - 68px - 200px);
    padding: 32px 0 48px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--gray-300); }

/* ============================================
   PRICE
   ============================================ */
.price {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}
.price-old {
    font-size: 14px;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 400;
}
.price-tag {
    color: var(--primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state-icon {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
}
.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 48px 0 24px;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-brand {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}
.footer-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-400);
}
.footer-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}
.footer-links {
    list-style: none;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    font-size: 14px;
    color: var(--gray-400);
    transition: color .2s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeInUp .5s var(--ease) forwards;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .section { padding: 32px 0; }

    .nav-toggle { display: block; }
    .site-nav-main {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--gray-200);
        flex-direction: column;
        padding: 12px 20px;
        box-shadow: var(--shadow-lg);
    }
    .site-nav-main.open { display: flex; }
    .site-nav-main a { padding: 12px 0; }

    .site-nav-auth {
        display: none;
        position: absolute;
        top: 68px;
        right: 0;
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-md);
        padding: 12px;
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        gap: 8px;
        min-width: 200px;
        margin-right: 20px;
    }
    .site-nav-auth.open { display: flex; }

    .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .site-header .container { height: 60px; }
    .container { padding: 0 16px; }
}

/* ============================================
   UTILITY
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
/* DISC-F4: color text utilities (mengisi celah — dulu dipaksa via inline style). */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-warning { color: var(--warning); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Paginator Bootstrap-4 (Paginator::useBootstrapFour) — storefront tak
   memuat CSS Bootstrap, jadi beri gaya minimal agar rapi. */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; list-style: none; padding: 0; margin: 16px 0 0; }
.pagination .page-item .page-link { display: block; padding: 8px 13px; border: 1px solid #e5e7eb; border-radius: 8px; color: var(--primary); background: #fff; text-decoration: none; font-size: 14px; line-height: 1; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-item.disabled .page-link { color: #9ca3af; background: #f9fafb; }

/* ============================================
   PAGE COMPONENTS (DISC-F4) — dulu inline style="…"
   ============================================ */
/* Home — hero */
.hero { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%); color: #fff; padding: 64px 0; }
.hero-content { max-width: 640px; }
.hero-title { font-size: 40px; font-weight: 800; line-height: 1.2; margin-bottom: 16px; letter-spacing: -0.5px; }
.hero-text { font-size: 17px; line-height: 1.7; opacity: .9; margin-bottom: 28px; }
.btn-hero-solid { background: #fff; color: var(--primary); border-color: #fff; font-weight: 700; }
.btn-hero-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); backdrop-filter: blur(4px); }

/* Section & kartu umum */
.section--white { background: #fff; }
.card-link { text-decoration: none; }
.card-body--tight { padding: 14px 16px; }
.icon-lead { margin-right: 8px; }
.min-w-0 { min-width: 0; }

/* Kartu kategori (home) */
.cat-thumb { aspect-ratio: 16 / 10; }
.cat-name { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.cat-count { font-size: 12px; color: var(--gray-500); }

/* CTA banner (home PPOB) */
.cta-banner { background: linear-gradient(135deg, #1e1b4b, #312e81); border: none; padding: 40px; color: #fff; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.cta-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.cta-text { font-size: 15px; opacity: .8; max-width: 500px; }

/* Halaman PPOB */
.ppob-hero { background: linear-gradient(135deg, #1e1b4b, #312e81); border: none; padding: 32px; color: #fff; margin-bottom: 24px; }
.ppob-hero-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.ppob-hero-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.ppob-hero-sub { font-size: 15px; opacity: .8; }
.ppob-search { display: flex; gap: 8px; min-width: 280px; }
.ppob-search-input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.ppob-search-btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.ppob-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.ppob-section { margin-bottom: 32px; }
.ppob-sec-title { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--primary-50); }
.ppob-sec-icon { color: var(--primary); margin-right: 6px; }
.ppob-sec-count { font-size: 13px; font-weight: 400; color: var(--gray-400); margin-left: 8px; }
.ppob-item { display: flex; align-items: center; gap: 14px; padding: 16px; }
.ppob-item-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; flex-shrink: 0; }
.ppob-item-name { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppob-item-desc { font-size: 12px; color: var(--gray-500); margin: 0; }
.ppob-item-price-col { text-align: right; flex-shrink: 0; }
.ppob-item-price { font-size: 15px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.ppob-item-price-unit { color: var(--gray-400); font-weight: 400; font-size: 13px; }
