/* Belanja Numart — mobile store UI (ref: dribbble.com/shots/25233291) */

:root {
    --primary: #2d9b6e;
    --primary-dark: #1f7a56;
    --primary-soft: #e8f7f0;
    --accent: #ff7a50;
    --accent-soft: #fff0eb;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #1a1d26;
    --muted: #8b92a8;
    --border: #eceef4;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 2px 8px rgba(26, 29, 38, 0.04);
    --shadow: 0 8px 24px rgba(26, 29, 38, 0.08);
    --shadow-lg: 0 16px 40px rgba(45, 155, 110, 0.18);
    --nav-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body.app-body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    background: var(--bg);
    position: relative;
    box-shadow: 0 0 0 1px var(--border);
}

/* ── Header ── */
.app-header {
    padding: 12px 20px 8px;
    background: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.app-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-header__hello {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
}

.app-header__name {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.app-header__greet .tier-pill {
    margin-top: 6px;
}

.app-header__avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #3eb88a 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.app-header__avatar svg {
    width: 22px;
    height: 22px;
}

/* ── Search pill ── */
.search-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 4px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 999px;
    border: 1px solid var(--border);
}

.search-pill svg {
    width: 20px;
    height: 20px;
    color: var(--muted);
    flex-shrink: 0;
}

.search-pill input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
}

.search-pill input::placeholder { color: var(--muted); }

.search-pill button {
    border: none;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
}

/* ── Page ── */
.page {
    padding: 16px 20px calc(var(--nav-h) + var(--safe-b) + 24px);
}

.page--detail {
    padding-bottom: calc(88px + var(--nav-h) + var(--safe-b));
}

/* ── Hero banner ── */
.hero-banner {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    margin-bottom: 20px;
    overflow: hidden;
    background: linear-gradient(125deg, var(--primary-dark) 0%, var(--primary) 45%, #4ec99a 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.hero-banner::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.hero-banner__tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.hero-banner h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.25;
    max-width: 85%;
}

.hero-banner p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
    max-width: 75%;
}

/* ── Section headers ── */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-head a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.home-section { margin-bottom: 28px; }

/* ── Categories horizontal ── */
.cat-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 0 16px;
    margin: 0 -20px 8px;
    padding-left: 20px;
    padding-right: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar { display: none; }

.cat-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    text-align: center;
    width: 80px;
}

.cat-item__icon {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin: 0 auto 8px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(26, 29, 38, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cat-item__icon-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(145deg, var(--cat-from, #5B8DEF) 0%, var(--cat-to, #7B5BEF) 100%);
    border-radius: inherit;
}

.cat-item__icon--all .cat-item__icon-bg {
    background: linear-gradient(145deg, #2d9b6e 0%, #4ec99a 50%, #5b8def 100%);
}

/* Ikon/emoji di tengah — gaya sebelumnya, ukuran besar */
.cat-item__mark {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

.cat-item__mark--img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.cat-item__mark--letter {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.cat-item__mark--svg {
    display: block;
    color: #fff;
}

.cat-item__mark--svg svg {
    width: 36px;
    height: 36px;
    display: block;
}

.cat-item:active .cat-item__icon {
    transform: scale(0.94);
}

.cat-item.is-active .cat-item__icon {
    transform: scale(1.06);
    box-shadow: 0 10px 22px rgba(45, 155, 110, 0.35);
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.cat-item.is-active .cat-item__icon-bg {
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.cat-item span {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    display: block;
    line-height: 1.25;
    padding: 0 2px;
}

.cat-item.is-active span {
    color: var(--text);
    font-weight: 700;
}

#kategori { scroll-margin-top: 12px; }

/* ── Product grid ── */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
}

.product-card:active {
    transform: scale(0.98);
}

.product-card__img-wrap {
    position: relative;
    aspect-ratio: 1;
    background: #f0f2f8;
    overflow: hidden;
}

.product-card__img-wrap img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(150deg, var(--ph-from, #e8f7f0) 0%, var(--ph-mid, #c5ead8) 100%);
    color: var(--ph-accent, var(--primary));
}

.product-placeholder--hidden {
    display: none !important;
}

.product-placeholder__icon {
    width: 48%;
    max-width: 52px;
    height: auto;
}

.product-placeholder__initials {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    opacity: 0.5;
    text-transform: uppercase;
}

.product-placeholder--detail .product-placeholder__icon {
    max-width: 96px;
    width: 42%;
}

.product-placeholder--detail .product-placeholder__initials {
    font-size: 1.15rem;
    opacity: 0.45;
}

.product-detail-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    background: #f0f2f8;
}

.product-detail-media .product-detail-img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    max-height: none;
    box-shadow: none;
}

.product-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
}

.product-card__body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__body h3 {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: auto;
}

.product-card__price--sale { color: var(--accent); }

.product-card__price-old {
    font-size: 0.72rem;
    color: var(--muted);
    text-decoration: line-through;
    font-weight: 500;
}

/* legacy .card alias */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f0f2f8; }
.card .body { padding: 12px; }
.card h3 { margin: 0 0 6px; font-size: 0.82rem; font-weight: 600; line-height: 1.35; }
.card-placeholder {
    aspect-ratio: 1;
    background: #f0f2f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.75rem;
}

/* ── Tier pill ── */
.tier-pill {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 14px rgba(45, 155, 110, 0.35);
    transition: transform 0.1s, opacity 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn.block { width: 100%; }
.btn.secondary {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}
.btn:disabled { opacity: 0.5; box-shadow: none; }

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── Forms ── */
.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--muted);
}
.field input,
.field textarea,
.field select,
.search-bar input,
.qty-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}
.field input:focus,
.field textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }

.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }

/* ── Bottom navigation ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(var(--nav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(26, 29, 38, 0.06);
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--muted);
    padding: 8px 4px;
}

.bottom-nav__item svg {
    width: 24px;
    height: 24px;
}

.bottom-nav__item.is-active { color: var(--primary); }

.bottom-nav__icon-wrap { position: relative; display: inline-flex; }

.bottom-nav__badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    font-style: normal;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Toast alerts ── */
.toast {
    margin: 0 20px 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
}
.toast--ok { background: var(--primary-soft); color: var(--primary-dark); }
.toast--err { background: var(--accent-soft); color: #c0392b; }

.muted { color: var(--muted); font-size: 0.85rem; }
.price { color: var(--primary-dark); font-weight: 800; }
.price--sale { color: var(--accent); font-weight: 800; }
.price-old { font-size: 0.8rem; color: var(--muted); text-decoration: line-through; }
.badge-discount {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

/* ── Product detail ── */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 12px;
}

.detail-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 16px 0 8px;
    letter-spacing: -0.02em;
}

.sticky-cart-bar {
    position: fixed;
    bottom: calc(var(--nav-h) + var(--safe-b));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 12px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 90;
    box-shadow: 0 -8px 24px rgba(26, 29, 38, 0.08);
}

.sticky-cart-bar .qty-input {
    width: 64px;
    padding: 12px;
    text-align: center;
}

/* ── Cart & checkout ── */
.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.cart-item, .summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.summary-row.total {
    font-weight: 800;
    font-size: 1.1rem;
    border-bottom: none;
    padding-top: 12px;
}

.va-box {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 16px 0;
    box-shadow: var(--shadow-lg);
}
.va-box .number {
    font-size: 1.3rem;
    letter-spacing: 2px;
    font-weight: 800;
    word-break: break-all;
}

/* ── Digital card & profile ── */
.digital-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #4ec99a 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-lg);
}
.digital-card__brand { font-size: 0.75rem; opacity: 0.85; font-weight: 600; }
.digital-card__name { font-size: 1.3rem; font-weight: 800; margin: 8px 0; }
.digital-card__meta { font-size: 0.85rem; display: flex; flex-direction: column; gap: 4px; opacity: 0.95; }
.digital-card__barcode {
    width: 100%;
    max-width: 280px;
    background: #fff;
    border-radius: 12px;
    margin: 16px auto 0;
    display: block;
}
.digital-card__points {
    margin-top: 14px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
}

.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.activate-choices { list-style: none; padding: 0; margin: 0 0 16px; }
.activate-choice {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
}
.activate-choice input { margin-top: 4px; accent-color: var(--primary); }

/* ── Auth pages ── */
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-top: 8px;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 800;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 8px;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-size: 0.88rem;
}
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-btn.disabled { opacity: 0.35; pointer-events: none; }
.pagination-meta { text-align: center; font-size: 0.8rem; color: var(--muted); }

.related-section {
    margin-top: 32px;
    padding-top: 8px;
}
.related-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 16px;
}

.add-cart-form { display: flex; gap: 10px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

@media (min-width: 640px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
}
