/* ════════════════════════════════════════════
   products.css — Products Page Styles
════════════════════════════════════════════ */

/* ── Filter Bar ── */
.filter-bar {
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    background: rgba(10, 10, 15, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
    transition: background var(--duration-base), border-color var(--duration-base), box-shadow var(--duration-base);
}
.filter-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-tab {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-2);
    background: transparent;
    border: 1px solid var(--color-border);
    transition: all var(--duration-fast);
    cursor: pointer;
    white-space: nowrap;
}
.filter-tab:hover { color: var(--color-text); border-color: var(--color-border-2); }
.filter-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(108,99,255,0.3);
}
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-bg-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    transition: border-color var(--duration-fast);
    min-width: 200px;
}
.search-box:focus-within { border-color: var(--color-primary); }
.search-box svg { color: var(--color-text-3); flex-shrink: 0; }
.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--color-text);
    font-size: 0.875rem;
    width: 100%;
    padding: 0;
}
.search-box input::placeholder { color: var(--color-text-3); }

/* ── Products Section ── */
.products-section { padding: 36px 0 72px; }

/* ── Product Grid — Desktop lebar: 5 kolom ── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-3);
    grid-column: 1 / -1;
}
.empty-state svg { margin: 0 auto 20px; opacity: 0.4; }
.empty-state h3 { font-size: 1.2rem; color: var(--color-text-2); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

/* ── 4 kolom (desktop medium 1024–1279px) ── */
@media (max-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

/* ── 3 kolom (tablet landscape 768–1023px) ── */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* ── 2 kolom (tablet portrait) ── */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* ── Mobile: 2 kolom kompak ── */
@media (max-width: 600px) {
    .products-section { padding: 16px 0 56px; }
    .filter-bar { padding: 10px 0; }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Filter bar mobile */
    .filter-wrapper { flex-direction: column; align-items: stretch; gap: 8px; }
    .search-box     { min-width: unset; }
    .filter-tabs    { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .filter-tab     { flex-shrink: 0; }

    /* Page hero mobile compact */
    .page-hero { padding: calc(var(--header-height) + 32px) 0 32px; }
    .page-hero-title { font-size: clamp(1.5rem, 7vw, 2.2rem); }
    .page-hero-desc  { font-size: 0.9rem; }
}

/* ══════════════════════════════════════════════════════════════
   LIGHT MODE OVERRIDES — Products Page
══════════════════════════════════════════════════════════════ */

/* Filter Bar: putih bersih, bukan hitam */
[data-theme="light"] .filter-bar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

/* Filter Tabs: border tipis gelap, teks gelap */
[data-theme="light"] .filter-tab {
    color: #374151;
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .filter-tab:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.05);
}
[data-theme="light"] .filter-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(108, 99, 255, 0.30);
}

/* Search Box: border terlihat, tidak transparan */
[data-theme="light"] .search-box {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .search-box:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Empty State: teks readable di background terang */
[data-theme="light"] .empty-state {
    color: #6b7280;
}
[data-theme="light"] .empty-state h3 {
    color: #374151;
}

/* ════════════════════════════════════════════════════════════
   QRIS PAYMENT BLOCK (inline in order modal & cart modal)
════════════════════════════════════════════════════════════ */
.qris-payment-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeSlideUp 0.35s ease;
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.qris-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--color-bg-3, rgba(255,255,255,0.04));
    border-radius: 12px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.08));
}
.qris-icon { font-size: 2rem; flex-shrink: 0; }
.qris-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text, #fff);
    margin: 0 0 4px;
}
.qris-product-label {
    font-size: 0.8rem;
    color: var(--color-text-3, #888);
    margin: 0;
}
.qris-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-success, #22c55e);
    margin: 0;
}

/* QR image / canvas container */
.qris-canvas-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    border: 3px solid var(--color-primary, #6c63ff);
    box-shadow: 0 0 0 6px rgba(108,99,255,0.12);
}
.qris-img {
    width: 240px;
    height: 240px;
    display: block;
    image-rendering: pixelated;
}
/* qrcodejs renders a table inside the div */
#qrcode-container table,
[id^="qrcode-container"] table { display: block; }
.qris-note {
    font-size: 0.75rem;
    color: #555;
    margin: 0;
    text-align: center;
}

/* Status bar */
.qris-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(108,99,255,0.08);
    border: 1px solid rgba(108,99,255,0.2);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--color-text-2, #aaa);
}
.qris-spinner-mini {
    width: 14px; height: 14px;
    border: 2px solid rgba(108,99,255,0.3);
    border-top-color: var(--color-primary, #6c63ff);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ref ID row */
.qris-ref-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-3, rgba(255,255,255,0.04));
    border-radius: 8px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.08));
}
.qris-ref-label { font-size: 0.75rem; color: var(--color-text-3, #666); }
.qris-ref-value {
    flex: 1;
    font-size: 0.78rem;
    color: var(--color-text, #fff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qris-copy-ref {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.qris-copy-ref:hover { background: rgba(255,255,255,0.08); }

/* Info row (auto-check notice) */
.qris-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: rgba(34,197,94,0.07);
    border: 1px solid rgba(34,197,94,0.18);
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--color-text-2, #aaa);
}
.qris-info-row svg { color: #22c55e; flex-shrink: 0; }

/* Telegram notice pill */
.qris-tg-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(42,171,238,0.08);
    border: 1px solid rgba(42,171,238,0.2);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--color-text-2, #aaa);
}

.qris-cancel-btn {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    font-size: 0.82rem;
    opacity: 0.7;
}

/* PAID banner inside QRIS wrap (cart flow) */
.qris-paid-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    text-align: center;
    animation: fadeSlideUp 0.4s ease;
}
.qris-paid-banner h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #22c55e;
    margin: 0;
}
.qris-paid-banner p { font-size: 0.85rem; color: var(--color-text-2, #aaa); margin: 0; }

/* Inline QRIS wrap (cart result) */
.qris-inline-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.08));
    margin-top: 10px;
}
.qris-label {
    font-size: 0.83rem;
    color: var(--color-text-2, #aaa);
    margin: 0;
    text-align: center;
}
.qris-inline-img {
    width: 200px; height: 200px;
    border-radius: 8px;
    background: #fff;
    image-rendering: pixelated;
}
.qris-timer {
    font-size: 0.78rem;
    color: var(--color-text-3, #666);
    margin: 0;
}
.qris-hint {
    font-size: 0.75rem;
    color: var(--color-text-3, #666);
    margin: 0;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════
   ORDER SUCCESS SCREEN
════════════════════════════════════════════════════════════ */
.order-success-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 8px 4px 4px;
    animation: fadeSlideUp 0.4s ease;
}
.order-success-icon-wrap {
    width: 80px; height: 80px;
    background: rgba(34,197,94,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(34,197,94,0.3);
}
.order-success-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text, #fff);
    margin: 0;
    text-align: center;
}
.order-success-ref {
    font-size: 0.78rem;
    color: var(--color-text-3, #666);
    margin: 0;
    letter-spacing: 0.05em;
}
.order-success-details {
    width: 100%;
    border: 1px solid var(--color-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    overflow: hidden;
}
.osd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
}
.osd-row:last-child { border-bottom: none; }
.osd-row span:first-child { color: var(--color-text-3, #666); }
.osd-row strong { color: var(--color-text, #fff); font-weight: 600; }
.badge-paid-inline {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(34,197,94,0.25);
}

/* Account data box on success screen */
.order-success-account {
    width: 100%;
    border: 1px solid rgba(108,99,255,0.25);
    border-radius: 10px;
    overflow: hidden;
}
.osa-header {
    background: rgba(108,99,255,0.1);
    padding: 9px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary, #6c63ff);
    border-bottom: 1px solid rgba(108,99,255,0.15);
}
.osa-pre {
    margin: 0;
    padding: 12px 14px;
    font-size: 0.78rem;
    color: var(--color-text, #fff);
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    background: rgba(255,255,255,0.02);
    max-height: 120px;
    overflow-y: auto;
}

/* TG delivery notice on success */
.order-success-tg-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(42,171,238,0.07);
    border: 1px solid rgba(42,171,238,0.18);
    border-radius: 10px;
    font-size: 0.83rem;
    color: var(--color-text-2, #aaa);
    width: 100%;
}
.order-success-tg-notice strong { color: #2AABEE; }

.order-success-actions { width: 100%; display: flex; flex-direction: column; }

/* Legacy payment success (Gomerch redirect) */
.payment-success-legacy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 8px;
    text-align: center;
    animation: fadeSlideUp 0.3s ease;
}
.payment-success-legacy h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text, #fff);
    margin: 0;
}
.mono { font-family: monospace; }
