/* ============================================
   JANANI GROUP — SWIGGY-STYLE PAYMENT PAGE
   ============================================ */

:root {
    --orange: #FC8019;
    --orange-dark: #E3731A;
    --orange-light: #FFF3E8;
    --green: #60B246;
    --green-light: #EAF7E2;
    --red: #E23744;
    --dark: #1C1C1C;
    --text: #3D4152;
    --sub: #686B78;
    --border: #E9E9EB;
    --bg: #F2F2F2;
    --white: #FFFFFF;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 16px;
    --radius-sm: 8px;
    --font: 'Nunito', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ---- TOP NAV ---- */
.top-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--orange);
    letter-spacing: -0.5px;
}
.nav-brand i { font-size: 1.6rem; }

/* Steps */
.nav-steps {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.82rem;
    font-weight: 700;
}
.step {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #aaa;
    padding: 4px 0;
}
.step span {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #E0E0E0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #aaa;
}
.step.done { color: var(--green); }
.step.done span { background: var(--green); color: white; }
.step.active { color: var(--orange); }
.step.active span { background: var(--orange); color: white; }
.step-line {
    width: 40px; height: 2px;
    background: #E0E0E0;
    margin: 0 6px;
}
.step-line.done { background: var(--green); }

/* ---- PAGE LAYOUT ---- */
.page-wrapper {
    max-width: 90%;
    margin: 28px auto;
    padding: 0 16px 60px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

/* ---- CARD ---- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.card-title i { color: var(--orange); font-size: 1.1rem; }
.card-title h2 { font-size: 1.1rem; font-weight: 800; color: var(--dark); }

/* ---- ADDRESS TILES ---- */
.address-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.address-tile {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    background: var(--white);
}
.address-tile:hover { border-color: var(--orange); background: #FFFAF5; }
.address-tile.selected { border-color: var(--green); background: var(--green-light); }

.addr-radio { padding-top: 2px; }
.radio-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: white;
    transition: all 0.2s;
    flex-shrink: 0;
}
.radio-dot.checked {
    border-color: var(--green);
    background: var(--green);
    box-shadow: inset 0 0 0 3px white;
}

.addr-info { flex: 1; }
.addr-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.addr-name { font-weight: 800; font-size: 0.95rem; color: var(--dark); }
.addr-type-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--orange-light);
    color: var(--orange);
    padding: 2px 8px;
    border-radius: 20px;
}
.default-tag {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--green-light);
    color: var(--green);
    padding: 2px 8px;
    border-radius: 20px;
}
.addr-line { font-size: 0.84rem; color: var(--sub); line-height: 1.5; margin-bottom: 4px; }
.addr-phone { font-size: 0.82rem; color: var(--sub); display: flex; align-items: center; gap: 5px; }
.addr-phone i { font-size: 0.75rem; color: var(--orange); }

.select-btn {
    background: var(--orange);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
    align-self: center;
    flex-shrink: 0;
}
.select-btn:hover { background: var(--orange-dark); transform: translateY(-1px); }
.address-tile.selected .select-btn { background: var(--green); }

.empty-addr {
    text-align: center;
    padding: 30px;
    color: var(--sub);
}
.empty-addr i { font-size: 2.5rem; color: #ddd; display: block; margin-bottom: 10px; }

.add-addr-btn {
    width: 100%;
    padding: 12px;
    background: none;
    border: 1.5px dashed var(--orange);
    border-radius: var(--radius-sm);
    color: var(--orange);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.add-addr-btn:hover { background: var(--orange-light); }

/* ---- PAY TABS ---- */
.pay-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.pay-tab {
    flex: 1;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.pay-tab:hover { border-color: var(--orange); color: var(--orange); }
.pay-tab.active {
    border-color: var(--orange);
    background: var(--orange-light);
    color: var(--orange);
}
.pay-tab i { font-size: 1rem; }

/* ---- PAY PANELS ---- */
.pay-panel { display: none; }
.pay-panel.active { display: block; animation: fadeUp 0.25s ease; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #FFF8E7;
    border-left: 3px solid #FFB800;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.5;
}
.info-banner i { color: #FFB800; font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.cod-banner { background: #F0FFF4; border-left-color: var(--green); }
.cod-banner i { color: var(--green); }

.cta-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(252,128,25,0.3);
    letter-spacing: 0.2px;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(252,128,25,0.4); }
.cta-btn:active { transform: translateY(0); }
.cta-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; transform: none; }

.cod-btn {
    background: linear-gradient(135deg, #60B246, #47963A);
    box-shadow: 0 4px 16px rgba(96,178,70,0.3);
}
.cod-btn:hover { box-shadow: 0 6px 24px rgba(96,178,70,0.4); }

.powered-by {
    text-align: center;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--sub);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.powered-by img { width: 14px; height: 14px; border-radius: 2px; }
.powered-by i { color: var(--sub); }

/* ---- SUMMARY CARD ---- */
.summary-card { position: sticky; top: 80px; }

.restaurant-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--orange-light);
    color: var(--orange);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.item-list { margin-bottom: 20px; }
.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}
.order-item:last-child { border-bottom: none; }

.item-img-wrap {
    width: 52px; height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.item-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.item-meta { flex: 1; }
.item-name { font-size: 0.88rem; font-weight: 700; color: var(--dark); margin-bottom: 3px; }
.item-sub { font-size: 0.78rem; color: var(--sub); }
.item-msg { font-size: 0.78rem; color: var(--orange); font-style: italic; margin-top: 3px; }
.item-price { font-size: 0.9rem; font-weight: 800; color: var(--dark); white-space: nowrap; }

/* ---- BILL SECTION ---- */
.bill-section {
    background: #FAFAFA;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}
.bill-title {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}
.bill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--sub);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.bill-row:last-child { border-bottom: none; }
.bill-row.discount { color: var(--green); }
.bill-row.discount span:first-child { display: flex; align-items: center; gap: 5px; }
.bill-row.total-row {
    font-size: 1rem;
    font-weight: 900;
    color: var(--dark);
    padding-top: 10px;
    margin-top: 4px;
}

.delivery-eta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--sub);
    padding: 10px 0;
    border-top: 1px dashed var(--border);
    margin-bottom: 10px;
}
.delivery-eta i { color: var(--orange); }
.delivery-eta strong { color: var(--dark); }

.help-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--sub);
}
.help-line i { color: var(--orange); }
.help-line a { color: var(--orange); font-weight: 700; text-decoration: none; }
.help-line a:hover { text-decoration: underline; }

/* ---- MODAL ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
    border-radius: var(--radius) var(--radius) 0 0;
}
.modal-head h3 { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.modal-head h3 i { color: var(--orange); }
.close-modal {
    background: #F2F2F2;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--sub);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.close-modal:hover { background: #E0E0E0; }
.modal-body { padding: 24px; }

.field-group.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.field input, .field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.88rem;
    color: var(--dark);
    background: var(--white);
    transition: border-color 0.2s;
    outline: none;
}
.field input:focus, .field select:focus { border-color: var(--orange); }
.field select { appearance: none; cursor: pointer; }

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.checkbox-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.checkbox-field label { font-size: 0.88rem; font-weight: 600; color: var(--text); cursor: pointer; }

.modal-save-btn {
    width: 100%;
    padding: 14px;
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s;
}
.modal-save-btn:hover { background: var(--orange-dark); }

/* ---- TOAST NOTIFICATIONS ---- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--white);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    min-width: 280px;
    max-width: 360px;
    pointer-events: all;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
    opacity: 0;
    border-left: 4px solid #ccc;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast i { font-size: 1.1rem; flex-shrink: 0; }
.toast span { flex: 1; font-size: 0.88rem; font-weight: 600; color: var(--dark); line-height: 1.4; }
.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 0.75rem;
    padding: 2px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover { color: var(--dark); }
.toast-success { border-left-color: var(--green); }
.toast-success i { color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-error i { color: var(--red); }
.toast-info { border-left-color: #2196F3; }
.toast-info i { color: #2196F3; }
.toast-warning { border-left-color: #FFB800; }
.toast-warning i { color: #FFB800; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .page-wrapper {
        grid-template-columns: 1fr;
    }
    .right-col { order: -1; }
    .summary-card { position: static; }
    .nav-steps { display: none; }
}
@media (max-width: 540px) {
    .nav-inner { padding: 12px 16px; }
    .card { padding: 16px; }
    .field-group.two-col { grid-template-columns: 1fr; }
    .pay-tabs { flex-direction: column; }
    .address-tile { flex-wrap: wrap; }
    .select-btn { width: 100%; }
    .toast-container { right: 10px; left: 10px; }
    .toast { max-width: 100%; min-width: unset; }
}