:root {
    --primary: #FF6B35;
    --primary-dk: #e55a24;
    --bg: #F7F4EF;
    --card-bg: #FFFFFF;
    --text-main: #1A1A2E;
    --text-sub: #6B7280;
    --border: #E5E0D8;
    --success: #22C55E;
    --header-h: 112px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding-bottom: 90px;
}

/* ── STICKY HEADER ── */
#sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.search-wrap {
    padding: 12px 16px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    flex: 1;
}

.search-box i {
    color: var(--text-sub);
    font-size: 1.1rem;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: .95rem;
    width: 100%;
    color: var(--text-main);
}

.search-box input::placeholder {
    color: var(--text-sub);
}

/* total bar */
#total-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 10px;
    background: var(--primary);
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    animation: slideDown .25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── PRODUCT LIST ── */
#product-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#main-content {
    margin-top: var(--header-h);
}

.card-produk {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    transition: border-color .2s, box-shadow .2s, transform .15s;
    position: relative;
    overflow: hidden;
}

.card-produk.checked {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(255, 107, 53, .15);
}

.card-produk:active {
    transform: scale(.985);
}

.img-wrap {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    cursor: pointer;
}

.img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFE4D6, #FFD0B5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2rem;
}

.check-overlay {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: rgba(255, 107, 53, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.check-overlay i {
    color: #fff;
    font-size: 2rem;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .3));
}

.card-produk.checked .check-overlay {
    opacity: 1;
}

.info {
    flex: 1;
    min-width: 0;
}

.info .nama {
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.info .harga {
    font-size: .88rem;
    color: var(--primary);
    font-weight: 600;
}

.qty-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-qty {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
    padding: 0;
    line-height: 1;
}

.btn-qty:not(:disabled):hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-qty:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.qty-num {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: .95rem;
}

.subtotal {
    font-size: .78rem;
    color: var(--text-sub);
    font-weight: 500;
}

.card-produk.checked .subtotal {
    color: var(--primary);
    font-weight: 600;
}

/* ── EMPTY STATE ── */
#empty-state {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-sub);
}

#empty-state i {
    font-size: 3rem;
    opacity: .4;
}

#empty-state p {
    margin-top: 12px;
    font-size: .95rem;
}

/* ── FOOTER ── */
#footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}

/* shop button — icon only */
#btn-shop {
    position: relative;
    background: none;
    border: none;
    cursor: default;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: all .25s;
    padding: 0;
}

#btn-shop.active {
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 53, .35);
}

#btn-shop i {
    font-size: 1.5rem;
}

#shop-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--text-main);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

#btn-shop.active #shop-badge {
    opacity: 1;
    transform: scale(1);
}

/* reset button */
#btn-reset {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all .25s;
    opacity: .35;
    pointer-events: none;
}

#btn-reset.active {
    opacity: 1;
    pointer-events: auto;
    border-color: #ef4444;
    color: #ef4444;
}

#btn-reset.active:hover {
    background: #ef4444;
    color: #fff;
}

/* ── MODAL ── */
.modal-content {
    border-radius: 20px;
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
}

.modal-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.modal-title i {
    color: var(--primary);
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-sub);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 50%;
    transition: color .2s, background .2s;
}

.btn-close-modal:hover {
    color: var(--text-main);
    background: var(--border);
}

.modal-body {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-item:last-child {
    border-bottom: none;
}

.modal-item-img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.modal-item-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FFE4D6, #FFD0B5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.modal-item-info {
    flex: 1;
}

.modal-item-info .mn {
    font-weight: 700;
    font-size: .9rem;
}

.modal-item-info .mq {
    font-size: .8rem;
    color: var(--text-sub);
    margin-top: 2px;
}

.modal-item-price {
    font-weight: 700;
    color: var(--primary);
    font-size: .9rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 20px 20px;
    background: var(--bg);
}

.modal-grand {
    font-size: .85rem;
    color: var(--text-sub);
}

.modal-grand span {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    display: block;
}

/* load more */
#load-more-wrap {
    text-align: center;
    padding: 8px 16px 16px;
}

#btn-load-more {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 10px 28px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all .2s;
}

#btn-load-more:hover {
    border-color: var(--primary);
    color: var(--primary);
}
