/* File: assets/css/style.css */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --dark: #0f172a;
    --text: #1e293b;
    --muted: #64748b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 14px; }
.main-content { flex: 1; padding-bottom: 48px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.muted-text { color: var(--muted); font-size: 0.9rem; }
.small-note { font-size: 0.82rem; }

/* Top Notice Bar */
.notice-bar {
    background: linear-gradient(90deg, #1e1b4b, #4f46e5);
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 0;
    text-align: center;
    font-weight: 500;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--dark); }
.brand-logo { height: 36px; width: auto; border-radius: 8px; object-fit: contain; }

.header-search {
    flex: 1;
    min-width: 220px;
    max-width: 480px;
    display: flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg);
}
.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 14px;
    font-size: 0.9rem;
    outline: none;
}
.header-search button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border-radius: 9px;
    border: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 600;
    background: #fff;
    transition: all 0.2s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 700;
}

/* Category Nav */
.category-nav { background: #fff; border-top: 1px solid #f1f5f9; }
.category-nav-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 9px;
    padding-bottom: 9px;
    scrollbar-width: none;
}
.category-nav-inner::-webkit-scrollbar { display: none; }
.cat-pill {
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
    transition: all 0.2s;
}
.cat-pill:hover, .cat-pill.active { background: var(--primary); color: #fff; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-light { background: #fff; color: var(--dark); }
.btn-sm { padding: 7px 13px; font-size: 0.84rem; }
.btn-xs { padding: 5px 10px; font-size: 0.78rem; border-radius: 7px; }
.btn-lg { padding: 13px 20px; font-size: 0.98rem; }
.btn-block { width: 100%; }

/* Multi-Image Hero Slider */
.hero-slider {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 300px;
    box-shadow: var(--shadow);
    background: var(--dark);
}
.hero-track { position: relative; width: 100%; height: 100%; }
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.15));
    display: flex;
    align-items: flex-end;
    padding: 28px;
    color: #fff;
}
.hero-overlay h2, .hero-fallback-content h2 { font-size: 1.85rem; line-height: 1.2; max-width: 600px; }
.hero-fallback-content { text-align: center; color: #fff; padding: 24px; }
.hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.5);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    z-index: 5;
}
.hero-prev { left: 12px; }
.hero-next { right: 12px; }
.hero-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.hero-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}
.hero-dot.active { background: #fff; width: 22px; border-radius: 999px; }

/* Toolbar & Filters */
.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.section-heading { font-size: 1.45rem; color: var(--dark); }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    font-size: 0.88rem;
}

/* Product Grid — Desktop 3 cols, STRICT 3x3 = 9 Products on Mobile */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-thumb-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    overflow: hidden;
}
.product-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-card:hover .product-thumb-wrap img { transform: scale(1.04); }
.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}
.img-placeholder.large { min-height: 320px; }

.stock-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}
.stock-pill.out { background: var(--danger); }
.stock-pill.goj { background: var(--primary); }

.wish-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.wish-btn.active { color: #e11d48; }

.product-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-cat { font-size: 0.72rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.product-price { margin-top: auto; padding-top: 4px; font-size: 1.02rem; font-weight: 800; color: var(--dark); }
.product-price small { font-weight: 500; font-size: 0.75rem; color: var(--muted); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.page-link {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 600;
    font-size: 0.88rem;
}
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Product Detail Page */
.breadcrumb { font-size: 0.85rem; color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.main-gallery-frame {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.main-gallery-frame img { width: 100%; height: 100%; object-fit: cover; }
.thumb-strip { display: flex; gap: 10px; margin-top: 12px; }
.thumb-item {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    border: 2px solid var(--border);
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: #fff;
}
.thumb-item.active { border-color: var(--primary); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }

.info-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-badge { display: inline-block; background: #eef2ff; color: var(--primary); font-weight: 700; font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; }
.btn-wish-inline { position: static; width: auto; height: auto; border-radius: 999px; padding: 5px 12px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--border); background: #fff; }
.detail-title { font-size: 1.65rem; margin: 10px 0 6px; color: var(--dark); }
.detail-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.detail-price { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stock-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.detail-desc { color: #334155; font-size: 0.95rem; margin-bottom: 18px; }

/* Goj Kapor Calculator */
.goj-calc-box {
    background: #f8fafc;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.calc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.preset-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.preset-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
}
.preset-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.custom-goj-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.goj-live-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.94rem;
}
.calc-total { color: var(--primary); font-size: 1.15rem; }

.dual-action-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Forms & Cards */
.card-box, .summary-card, .payment-box, .success-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.payment-box, .success-card { max-width: 540px; margin: 0 auto; }
.success-card { text-align: center; }
.success-icon {
    width: 60px; height: 60px; border-radius: 50%; background: #dcfce7; color: var(--success);
    font-size: 1.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.tracking-box { background: #f8fafc; border: 1px dashed var(--primary); padding: 14px; border-radius: 10px; }
.tracking-box strong { font-size: 1.35rem; color: var(--primary); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; color: #334155; }
.field input, .field select, .field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 0.92rem; background: #fff;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Cart & Checkout */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px;
    display: grid; grid-template-columns: 80px 1fr auto; gap: 14px; align-items: center;
}
.cart-thumb img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.meta-chip { background: #f1f5f9; padding: 2px 8px; border-radius: 6px; font-size: 0.78rem; color: #334155; }
.cart-controls { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-btn { width: 30px; height: 30px; border: none; background: #f8fafc; font-weight: 700; cursor: pointer; }
.qty-val { min-width: 30px; text-align: center; font-weight: 700; font-size: 0.9rem; }
.cart-line-total { font-weight: 800; color: var(--dark); }
.remove-btn { border: none; background: none; color: var(--danger); font-size: 0.8rem; cursor: pointer; font-weight: 600; }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.radio-card {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px;
    border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.radio-card strong { display: block; font-size: 0.92rem; }
.sub-radio-box { margin-top: 12px; padding: 12px; background: #f8fafc; border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coupon-row { display: flex; gap: 8px; margin-top: 10px; }
.coupon-row input { flex: 1; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 9px; text-transform: uppercase; }
.coupon-feedback { margin-top: 8px; font-size: 0.86rem; font-weight: 600; }
.coupon-feedback.ok { color: var(--success); }
.coupon-feedback.err { color: var(--danger); }

.summary-row { display: flex; justify-content: space-between; margin: 8px 0; font-size: 0.93rem; }
.summary-divider { height: 1px; background: var(--border); margin: 12px 0; }
.total-row { font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.mini-item { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 0.88rem; }

/* Account Dashboard */
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
.account-sidebar { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.account-avatar-box { text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.avatar-img, .avatar-fallback {
    width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 8px; object-fit: cover;
}
.avatar-fallback { background: var(--primary); color: #fff; font-size: 1.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.uid-pill { display: inline-block; background: #eef2ff; color: var(--primary); padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; margin-top: 4px; }
.account-nav { display: flex; flex-direction: column; gap: 4px; }
.account-nav a { padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; color: #334155; }
.account-nav a:hover, .account-nav a.active { background: #eef2ff; color: var(--primary); }
.account-nav a.danger-link { color: var(--danger); }

.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-val { font-size: 1.55rem; color: var(--dark); }
.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-list > div { display: flex; justify-content: space-between; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; gap: 10px; }

/* Orders & Badges */
.orders-stack { display: flex; flex-direction: column; gap: 14px; }
.order-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.order-card-head, .order-card-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.order-items-list { margin: 12px 0; padding: 10px 0; border-top: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; display: flex; flex-direction: column; gap: 8px; }
.order-item-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; }

.status-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.status-badge.success, .status-badge.complete, .status-badge.delivered { background: #dcfce7; color: #15803d; }
.status-badge.pending { background: #fef3c7; color: #b45309; }
.status-badge.processing { background: #dbeafe; color: #1d4ed8; }
.status-badge.danger, .status-badge.cancelled { background: #fee2e2; color: #b91c1c; }

/* Empty / Maintenance / Alerts / Toast */
.empty-state, .maintenance-card {
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    padding: 44px 20px; text-align: center;
}
.maint-icon { font-size: 2.4rem; margin-bottom: 8px; }
.maintenance-card p, .empty-state p { color: var(--muted); margin: 8px 0 18px; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; font-weight: 500; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--dark); color: #fff; padding: 12px 16px; border-radius: 10px;
    font-size: 0.88rem; font-weight: 600; box-shadow: 0 10px 28px rgba(0,0,0,.22);
    animation: slideUp 0.25s ease;
}
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Footer */
.site-footer { background: var(--dark); color: #cbd5e1; margin-top: auto; padding-top: 34px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding-bottom: 26px; }
.site-footer h3, .site-footer h4 { color: #fff; margin-bottom: 8px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 14px 0; text-align: center; font-size: 0.84rem; color: #94a3b8; }

/* Responsive — STRICT 3x3 = 9 Products Mobile Grid with legible, balanced cards */
@media (max-width: 900px) {
    .product-detail-grid, .cart-layout, .checkout-layout, .account-layout, .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .container { padding: 0 10px; }
    .hide-sm { display: none; }
    .hero-slider { height: 195px; }
    .hero-overlay h2, .hero-fallback-content h2 { font-size: 1.2rem; }
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .product-card { border-radius: 10px; }
    .product-body { padding: 7px 6px 8px; gap: 3px; }
    .product-cat { font-size: 0.62rem; }
    .product-title { font-size: 0.78rem; line-height: 1.25; min-height: 2em; }
    .product-price { font-size: 0.84rem; }
    .wish-btn { width: 24px; height: 24px; font-size: 0.82rem; top: 5px; right: 5px; }
    .stock-pill { font-size: 0.58rem; padding: 2px 5px; top: 5px; left: 5px; }
    .form-grid-2, .radio-cards, .sub-radio-box, .stat-cards { grid-template-columns: 1fr; }
    .cart-item-card { grid-template-columns: 64px 1fr; }
    .cart-controls { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
