:root {
   --bg: #1C1310;
   --surface: #241A16;
   --surface-raised: #2E2119;
   --line: #40302A;
   --cream: #F3E7D8;
   --muted: #9C8676;
   --ember: #E0793C;
   --ember-dim: #C4632E;
   --plum: #6E4A5E;
   --ok: #7A9B6E;
}

* { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--cream);
    font-family: 'Montserrat', sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Fredoka', serif; font-weight: 700; margin: 0; }

a { color: inherit; }

  /* ---------- Top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--line);
}
.topbar .brand {
    font-family: 'Fredoka', serif;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}
.topbar .brand span { color: var(--ember); }
.topbar .step {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- Layout ---------- */
.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 32px 96px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    align-items: start;
}
@media (max-width: 860px) {
    .wrap { grid-template-columns: 1fr; padding: 32px 20px 72px; }
}
.section-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ember);
    margin-bottom: 12px;
    display: block;
}

/* ---------- Left: details + payment ---------- */
.block { margin-bottom: 40px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 14px; }
#addressField { display: none; }
.otp-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 14px;
}
.otp-row .field {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.otp-field {
    flex: 1;
    min-width: 0;
}
.field label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
}
.field input, .field select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--cream);
    padding: 12px 14px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.15s ease;
}
.field input:focus, .field select:focus {
    border-color: var(--ember);
}

/* Pickup vs delivery toggle */
.toggle-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.toggle-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.toggle-btn.active {
    border-color: var(--ember);
    color: var(--ember);
    background: rgba(224, 121, 60, 0.08);
}

/* Payment methods */
.pay-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    background: var(--surface);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.pay-option:hover { border-color: #5a463c; }
.pay-option.selected {
    border-color: var(--ember);
    background: rgba(224, 121, 60, 0.07);
}
.pay-option input[type="radio"] {
    accent-color: var(--ember);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.pay-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
}
.pay-text { flex: 1; }
.pay-text .name { font-size: 0.92rem; font-weight: 500; }
.pay-text .sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

.qris-box {
    display: none;
    margin-top: 10px;
    padding: 20px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
}
.qris-box.show { display: block; }
.qris-box .qr-placeholder {
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
    background: var(--surface-raised);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--line);
    font-size: 0.7rem;
}

/* ---------- Right: receipt summary ---------- */
.receipt {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 28px 24px;
    position: sticky;
    top: 24px;
}
.receipt-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}
.receipt-head h2 { font-size: 1.1rem; }
.receipt-head .count { font-size: 0.78rem; color: var(--muted); }

.item-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.88rem;
}
.item-row:last-of-type { border-bottom: none; }
.item-row .name { font-weight: 500; }
.item-row .qty { color: var(--muted); font-size: 0.78rem; }
.item-row .price { color: var(--muted); white-space: nowrap; }

.cost-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.86rem;
    color: var(--muted);
    padding: 6px 0;
}
.cost-line.total {
    color: var(--cream);
    font-size: 1.05rem;
    font-weight: 700;
    border-top: 1px solid var(--line);
    margin-top: 10px;
    padding-top: 14px;
}
.cost-line.total .amount { color: var(--ember); }

.pay-btn {
    width: 100%;
    margin-top: 22px;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: var(--ember);
    color: #241209;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}
.send-otp-btn {
    width: 160px;
    min-width: 160px;
    height: 48px;
    margin: 0;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
}
.pay-btn:hover { background: var(--ember-dim); }
.pay-btn:disabled {
    background: var(--surface-raised);
    color: var(--muted);
    cursor: not-allowed;
}

.lock-note {
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 12px;
}

.confirm-banner {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(122, 155, 110, 0.12);
    border: 1px solid var(--ok);
    color: var(--ok);
    font-size: 0.82rem;
}

.confirm-banner.show { display: block; }