/* ============================================
   ORDER PAGE — login gate, cart, checkout steps, success
   Sits on theme.css. The class names below are the ones order.js builds
   and toggles, so they cannot be renamed.
   ============================================ */

.order-page-body { background: var(--bg); min-height: 100dvh; }

/* ---------- Login gate ---------- */
.login-gate {
    position: fixed; inset: 0; z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: var(--bg);
    overflow: hidden;
}
.login-gate.hidden { display: none; }
.lg-blob {
    position: absolute; border-radius: 50%;
    filter: blur(60px); opacity: 0.55; pointer-events: none;
    animation: blob 14s ease-in-out infinite alternate;
}
.lg-blob.b1 { width: 340px; height: 340px; background: #ff7a18; top: -90px; left: -80px; }
.lg-blob.b2 { width: 300px; height: 300px; background: #f43f5e; bottom: -80px; right: -60px; animation-delay: -5s; }
.lg-blob.b3 { width: 220px; height: 220px; background: #f5b50b; top: 42%; left: 55%; opacity: 0.35; animation-delay: -9s; }
[data-theme="dark"] .lg-blob { opacity: 0.3; }
@keyframes blob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.12); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
}
.lg-content {
    position: relative; z-index: 1;
    width: 100%; max-width: 380px;
    padding: 32px 24px 26px;
    text-align: center;
    border-radius: 30px;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    animation: rise 0.8s var(--ease-out) both;
}
.lg-logo {
    width: 84px; height: 84px; margin: 0 auto 14px;
    border-radius: 26px; object-fit: cover;
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--brand-line), var(--shadow-md);
    animation: pop 0.8s var(--ease-spring) 0.2s both;
}
.lg-title {
    font-family: var(--font-display); font-size: 2rem; font-weight: 900; letter-spacing: -0.03em;
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}
.lg-tagline { font-size: 0.84rem; color: var(--text-2); margin-bottom: 18px; }
.lg-divider { width: 56px; height: 3px; border-radius: 3px; background: var(--grad-brand); margin: 0 auto 18px; }
.lg-prompt { font-size: 0.94rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.lg-footer { font-size: 0.72rem; color: var(--text-3); margin-top: 16px; }
.lg-google-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%; max-width: 300px; height: 50px; margin: 0 auto;
    border-radius: 14px;
    background: var(--surface); border: 1px solid var(--line-2);
    color: var(--text); font-size: 0.94rem; font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease-spring);
}
.lg-google-btn:active { transform: scale(0.97); }

/* ---------- Top bar ---------- */
.order-nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid var(--line);
}
.order-nav-inner {
    max-width: var(--col); margin: 0 auto;
    display: flex; align-items: center; gap: 0.6rem;
    padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 1rem 0.6rem;
}
.order-nav-brand { flex: 1; font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.order-nav-brand span {
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-profile-link {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 4px 10px 4px 4px; border-radius: 99px;
    background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.nav-profile-link span { font-size: 0.76rem; font-weight: 700; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Layout ---------- */
.order-main { max-width: var(--col); margin: 0 auto; padding: 18px 16px calc(var(--dock-space) + 96px); }

/* ---------- Stepper ---------- */
.step-indicators { display: flex; align-items: center; padding: 0 8%; margin-bottom: 8px; }
.step-dot {
    position: relative; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface); border: 2px solid var(--line-2);
    color: var(--text-3); font-size: 0.8rem; font-weight: 800;
    transition: all 0.45s var(--ease-spring);
}
.step-dot.active { background: var(--grad-brand); border-color: transparent; color: #fff; transform: scale(1.08); box-shadow: var(--shadow-brand); }
.step-dot.active::after {
    content: ''; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid var(--brand); opacity: 0;
    animation: ring 1.8s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(0.8); opacity: 0.6; } 100% { transform: scale(1.35); opacity: 0; } }
.step-dot.done { background: var(--ok-2); border-color: transparent; color: #fff; }
.step-dot.done span { display: none; }
.step-dot.done::before {
    content: ''; width: 15px; height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;
    animation: pop 0.45s var(--ease-spring);
}
.step-line { flex: 1; height: 4px; margin: 0 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.step-line-fill { width: 0%; height: 100%; border-radius: 4px; background: var(--grad-brand); transition: width 0.6s var(--ease-out); }
.step-labels { display: flex; justify-content: space-between; padding: 0 calc(8% - 22px); margin-bottom: 18px; }
.step-label {
    width: 78px; text-align: center;
    font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-3); transition: color 0.3s ease;
}
.step-label.active { color: var(--brand); }
.step-label.done { color: var(--ok); }

/* ---------- Cards ---------- */
.order-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 18px 16px;
    box-shadow: var(--shadow-sm);
    animation: rise 0.5s var(--ease-out);
}
.order-step.hidden { display: none; }
.order-step { padding-bottom: 12px; }
.menu-select-label { font-family: var(--font-display); font-size: 1.18rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin-bottom: 4px; }

/* Kitchen + category labels (built by order.js) */
.menu-hotel-header {
    display: flex; align-items: center; gap: 10px;
    margin: 22px 0 4px; padding: 12px;
    border-radius: 18px;
    background: radial-gradient(120% 160% at 0 0, var(--brand-soft), transparent 60%), var(--surface-2);
    border: 1px solid var(--line);
}
#menu-items-container > .menu-hotel-header:first-child { margin-top: 10px; }
.mh-emoji {
    width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 1.35rem;
    background: var(--surface); border: 1px solid var(--line);
}
.mh-name { font-family: var(--font-display); font-size: 1.04rem; font-weight: 800; color: var(--text); }
.mh-sub { font-size: 0.72rem; font-weight: 600; color: var(--text-2); }
.menu-category-header {
    display: flex; align-items: center; gap: 8px;
    margin: 16px 0 2px;
    font-size: 0.7rem; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--text-2);
}
.menu-category-header::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.mc-dot { font-size: 0.7rem; }
.mc-veg { color: var(--veg); }
.mc-nonveg { color: var(--nonveg); }

.cart-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cart-head-title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 800; color: var(--text); }
.cart-head-sub { margin-left: auto; font-size: 0.72rem; font-weight: 600; color: var(--text-3); }
.cart-divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.add-more-btn {
    width: 100%; height: 46px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    border-radius: 14px;
    background: var(--surface-2); border: 1.5px dashed var(--line-2);
    color: var(--text-2); font-size: 0.84rem; font-weight: 800;
}

/* ---------- Dish rows: Swiggy-style, photo on the right, ADD over it ---------- */
.cart-item-card { padding: 16px 0; border-bottom: 1px dashed var(--line-2); animation: rise 0.5s var(--ease-out) both; }
.cart-item-card:last-child { border-bottom: 0; }
.ci-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 116px;
    grid-template-areas: "info img" "info act";
    column-gap: 14px;
    align-items: start;
}
.ci-info { grid-area: info; min-width: 0; }
.ci-img {
    grid-area: img;
    width: 116px; height: 116px; border-radius: 18px; object-fit: cover;
    background: var(--surface-3);
    box-shadow: var(--shadow-md);
}
.ci-actions {
    grid-area: act; justify-self: center;
    position: relative; z-index: 1; margin-top: -20px;
    display: flex; flex-direction: column; align-items: center;
}
.ci-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ci-veg, .ci-nonveg { display: inline-flex; align-items: center; gap: 5px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; }
.ci-veg { color: var(--veg); }
.ci-nonveg { color: var(--nonveg); }
.ci-new { font-size: 0.6rem; font-weight: 900; letter-spacing: 0.06em; color: #fff; background: var(--grad-hot); padding: 2px 7px; border-radius: 6px; }
.ci-rating { font-size: 0.66rem; color: var(--text-2); }
.ci-name { font-size: 1rem; font-weight: 800; line-height: 1.3; color: var(--text); margin-bottom: 4px; }
.ci-desc {
    font-size: 0.78rem; line-height: 1.45; color: var(--text-3); margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ci-price-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ci-price { font-size: 1rem; font-weight: 800; color: var(--text); }
.ci-old { font-size: 0.78rem; color: var(--text-3); text-decoration: line-through; }
.ci-off { font-size: 0.64rem; font-weight: 900; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; }

.ci-add-btn {
    position: relative; overflow: hidden;
    min-width: 96px; height: 38px; padding: 0 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--grad-brand); border: 0;
    color: #fff; font-size: 0.9rem; font-weight: 900; letter-spacing: 0.05em;
    box-shadow: 0 8px 20px rgba(241, 90, 10, 0.35);
    transition: transform 0.2s var(--ease-spring);
}
.ci-add-btn:active { transform: scale(0.92); }
.ci-qty-controls {
    min-width: 96px; height: 38px;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 12px; overflow: hidden;
    background: var(--grad-brand); border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(241, 90, 10, 0.35);
    animation: pop 0.4s var(--ease-spring);
}
.ci-qty-btn { width: 32px; height: 100%; border: 0; background: none; color: #fff; font-size: 1.15rem; font-weight: 900; }
.ci-qty-btn:active { background: rgba(255, 255, 255, 0.18); }
.ci-qty-num { min-width: 22px; text-align: center; font-size: 0.95rem; font-weight: 900; color: #fff; }

.ci-extras {
    margin-top: 12px; padding: 12px;
    border-radius: 16px;
    background: var(--surface-2); border: 1px solid var(--line);
    animation: rise 0.4s var(--ease-out);
}
.ci-extras-title { font-size: 0.72rem; font-weight: 800; color: var(--text-2); margin-bottom: 8px; }
.extras-list { display: flex; flex-wrap: wrap; gap: 8px; }
.extra-chip { cursor: pointer; }
.extra-chip input { display: none; }
.chip-inner {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 99px;
    background: var(--surface); border: 1.5px solid var(--line-2);
    font-size: 0.78rem; font-weight: 700; color: var(--text-2);
    transition: all 0.2s var(--ease-out);
}
.chip-inner b { color: var(--text); font-weight: 800; }
.extra-chip input:checked + .chip-inner { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.extra-chip input:checked + .chip-inner::before { content: '✓'; font-weight: 900; }

/* ---------- Floating cart bar ---------- */
.order-total-bar {
    position: fixed; z-index: 99;
    left: 12px; right: 12px;
    bottom: calc(var(--dock-space) - 2px);
    max-width: calc(var(--col) - 24px); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 10px 10px 18px;
    border-radius: 20px;
    background: var(--grad-brand); color: #fff;
    border: 1px solid transparent;
    box-shadow: var(--shadow-brand);
    animation: barIn 0.6s var(--ease-spring) both;
    transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
@keyframes barIn { from { opacity: 0; transform: translateY(40px) scale(0.96); } to { opacity: 1; transform: none; } }
.total-left { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: start; column-gap: 8px; }
.total-label { grid-column: 1 / -1; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.total-amount { font-family: var(--font-display); font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.cart-count-badge {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--brand); font-size: 0.7rem; font-weight: 900;
    animation: pop 0.4s var(--ease-spring);
}
.order-total-bar .next-btn { height: 46px; padding: 0 16px; background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.35); box-shadow: none; }
/* Empty cart: calm grey bar instead of a loud orange one */
.order-total-bar:has(#btn-to-step2[disabled]) { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-lg); }
.order-total-bar:has(#btn-to-step2[disabled]) .next-btn { background: var(--surface-3); color: var(--text-3); border-color: transparent; }

/* ---------- Buttons ---------- */
.next-btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 48px; padding: 0 20px;
    border-radius: 14px; border: 0;
    background: var(--grad-brand); color: #fff;
    font-size: 0.92rem; font-weight: 800;
    box-shadow: var(--shadow-brand);
    transition: transform 0.2s var(--ease-spring), opacity 0.2s ease;
}
.next-btn:active { transform: scale(0.96); }
.next-btn[disabled] { cursor: not-allowed; }
.back-step-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 48px; padding: 0 16px;
    border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--text-2); font-size: 0.86rem; font-weight: 700;
}
.step-actions, .substep-actions {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* ---------- Step 2: location + details ---------- */
.substep-panel { animation: substepIn 0.45s var(--ease-out); }
.substep-panel[style*="display: none"], .substep-panel[style*="display:none"] { animation: none; }
@keyframes substepIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.substep-center {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; min-height: 300px; padding: 18px 6px;
}
.detect-hero-icon {
    position: relative;
    width: 104px; height: 104px; margin-bottom: 22px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand-soft) 0 62%, transparent 63%);
}
.detect-hero-icon svg { animation: spinSlow 14s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.detect-hero-icon::before, .detect-hero-pulse {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--brand);
    animation: radar 2.4s ease-out infinite;
}
.detect-hero-icon::before { animation-delay: 1.2s; }
@keyframes radar { 0% { transform: scale(0.7); opacity: 0.7; } 100% { transform: scale(1.65); opacity: 0; } }
.substep-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin-bottom: 6px; }
.substep-hint { font-size: 0.85rem; line-height: 1.5; color: var(--text-2); max-width: 300px; margin: 0 auto 18px; }
#substep-address .substep-hint, #edit-info-form .substep-hint, #saved-info-card .substep-hint { margin-left: 0; }
.detect-btn-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; max-width: 300px; height: 54px; margin: 0 auto;
    border-radius: 16px; border: 0;
    background: var(--grad-brand); color: #fff;
    font-size: 0.98rem; font-weight: 800;
    box-shadow: var(--shadow-brand);
    transition: transform 0.2s var(--ease-spring), background 0.3s ease;
}
.detect-btn-hero:active { transform: scale(0.97); }
.detect-btn-hero.detected { background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 12px 28px rgba(22, 163, 74, 0.32); }
.detect-btn-hero.out-of-range { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 12px 28px rgba(220, 38, 38, 0.3); }
.substep-skip {
    margin-top: 14px; padding: 8px 12px;
    background: none; border: 0;
    color: var(--text-3); font-size: 0.8rem; font-weight: 700;
    text-decoration: underline; text-underline-offset: 3px;
}
.step2-back-home { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.detect-btn { display: none; }
.location-result {
    display: flex; align-items: center; gap: 10px;
    width: 100%; max-width: 320px; margin-top: 14px;
    padding: 12px 14px; border-radius: 16px;
    background: var(--ok-soft); text-align: left;
    animation: rise 0.4s var(--ease-out);
}
.loc-icon { font-size: 1.2rem; }
.loc-info { display: flex; flex-direction: column; }
.loc-status { font-size: 0.82rem; font-weight: 800; color: var(--ok); }
.loc-coords { font-size: 0.72rem; color: var(--text-2); }

.saved-details-card { margin-bottom: 18px; padding: 4px 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.saved-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.saved-row + .saved-row { border-top: 1px dashed var(--line-2); }
.saved-label { font-size: 0.8rem; font-weight: 700; color: var(--text-2); }
.saved-value { font-size: 0.95rem; font-weight: 800; color: var(--text); }

.form-fields { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 0.78rem; font-weight: 800; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%; padding: 13px 14px;
    border-radius: 14px;
    background: var(--surface-2); border: 1.5px solid var(--line);
    color: var(--text); font-size: 0.95rem; font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Step 3: review + pay ---------- */
.step-title { font-family: var(--font-display); font-size: 1.28rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin-bottom: 14px; }
.review-summary { padding: 14px 16px; margin-bottom: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.bill-title { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }

/* Placeholder rows while order.js fetches the menu */
#menu-items-container:empty { min-height: 360px; }
#menu-items-container:empty::before {
    content: ''; display: block; height: 340px; margin-top: 12px; border-radius: 18px;
    background:
        linear-gradient(var(--surface) 0 0) 0 128px / 100% 12px no-repeat,
        linear-gradient(var(--surface) 0 0) 0 256px / 100% 12px no-repeat,
        linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%) 0 0 / 400% 100%;
    animation: skel 1.3s ease infinite;
}
@media (min-width: 1024px) { .order-nav-inner { max-width: var(--wide); } }
.review-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.review-row.sub { font-size: 0.82rem; color: var(--text-2); }
.review-row.total { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 1.06rem; font-weight: 900; }
.free-label { color: var(--ok); font-weight: 800; }
.review-delivery {
    position: relative;
    padding: 14px 16px 14px 56px; margin-bottom: 18px;
    border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line);
}
.review-delivery::before {
    content: '📍'; position: absolute; left: 14px; top: 14px;
    width: 30px; height: 30px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--brand-soft); font-size: 0.9rem;
}
.review-delivery h4 { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.review-delivery p { font-size: 0.86rem; line-height: 1.45; color: var(--text-2); margin-bottom: 3px; }
.review-delivery p:first-of-type { color: var(--text); font-weight: 800; }
.review-landmark { color: var(--brand-ink) !important; font-weight: 700; }

.payment-pick > label { display: block; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-opt input { display: none; }
.pay-card {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    height: 100%; padding: 14px 14px 14px;
    border-radius: 18px;
    background: var(--surface); border: 1.5px solid var(--line-2);
    font-size: 0.88rem; font-weight: 800; color: var(--text);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}
.pay-card small { font-size: 0.7rem; font-weight: 700; color: var(--ok) !important; }
.pay-card::after {
    content: ''; position: absolute; top: 12px; right: 12px;
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--line-2);
    transition: border 0.3s var(--ease-spring);
}
.pay-opt input:checked + .pay-card { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 4px var(--brand-soft); }
.pay-opt input:checked + .pay-card::after { border: 6px solid var(--brand); }

.place-btn {
    position: relative; overflow: hidden; flex: 1;
    height: 54px; padding: 0 18px;
    border: 0; border-radius: 16px;
    background: var(--grad-brand); color: #fff;
    font-size: 1rem; font-weight: 800;
    box-shadow: var(--shadow-brand);
    transition: transform 0.2s var(--ease-spring), opacity 0.2s ease;
}
.place-btn:active { transform: scale(0.97); }
.place-btn:disabled { cursor: not-allowed; }
.place-loader { display: flex; gap: 5px; justify-content: center; }
.place-loader .dot { width: 8px; height: 8px; background: #fff; border-radius: 50%; animation: dotBounce 0.6s ease-in-out infinite; }
.place-loader .dot:nth-child(2) { animation-delay: 0.1s; }
.place-loader .dot:nth-child(3) { animation-delay: 0.2s; }
@keyframes dotBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Success ---------- */
.success-card { position: relative; overflow: hidden; text-align: center; padding: 30px 18px 24px; }
.success-card::before {
    content: ''; position: absolute; left: 50%; top: -130px;
    width: 380px; height: 380px; transform: translateX(-50%);
    border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, var(--ok-soft), transparent 65%);
}
.success-icon { position: relative; display: inline-grid; place-items: center; margin-bottom: 14px; animation: pop 0.7s var(--ease-spring); }
.success-icon svg { filter: drop-shadow(0 8px 20px rgba(22, 163, 74, 0.3)); }
.success-card h2 { position: relative; font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; letter-spacing: -0.02em; color: var(--text); margin-bottom: 6px; }
.success-card > p { position: relative; font-size: 0.9rem; color: var(--text-2); margin-bottom: 18px; }
.success-details { padding: 6px 16px; margin-bottom: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; }
.s-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 0.86rem; color: var(--text-2); }
.s-row + .s-row { border-top: 1px dashed var(--line-2); }
.s-row strong { color: var(--text); font-weight: 800; }
.code-box { margin-bottom: 14px; padding: 16px; border-radius: 18px; text-align: center; background: var(--ok-soft); border: 1.5px dashed var(--ok-2); }
.code-box-label { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.12em; color: var(--text-2); }
.code-box-value { font-family: var(--font-display); font-size: 2.3rem; font-weight: 900; letter-spacing: 0.28em; line-height: 1.2; color: var(--ok); margin: 2px 0; }
.code-box-hint { font-size: 0.74rem; color: var(--text-2); }
.loyalty-note { margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 0.8rem; font-weight: 800; text-align: center; }
.share-loc {
    align-items: center; justify-content: center; gap: 6px;
    width: 100%; height: 46px; margin: 6px 0;
    border-radius: 14px;
    background: var(--info-soft); color: var(--info);
    font-size: 0.84rem; font-weight: 800;
}
#wa-confirm-btn { height: 48px; border-radius: 14px !important; box-shadow: 0 10px 24px rgba(37, 211, 102, 0.3); }
.track-link { width: 100%; height: 52px; margin: 10px 0 8px; }
.profile-link {
    display: flex; align-items: center; justify-content: center;
    height: 48px; border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--text); font-size: 0.88rem; font-weight: 800;
}
.back-home-link { display: inline-block; margin-top: 14px; font-size: 0.84rem; font-weight: 700; color: var(--text-3); transition: color 0.15s ease; }
.back-home-link:hover { color: var(--brand); }

/* ---------- Toast (slides down from the top) ---------- */
.toast {
    position: fixed; left: 50%; z-index: 8000;
    top: calc(76px + env(safe-area-inset-top, 0px));
    transform: translate(-50%, calc(-100% - 110px));
    display: flex; align-items: center; gap: 8px;
    max-width: calc(100% - 32px);
    padding: 11px 16px; border-radius: 16px;
    background: var(--text); color: var(--bg);
    font-size: 0.86rem; font-weight: 700;
    box-shadow: var(--shadow-lg);
    transition: transform 0.55s var(--ease-spring);
}
.toast.visible { transform: translate(-50%, 0); }

/* ---------- Closed notice ---------- */
.closed-banner {
    position: fixed; z-index: 98;
    left: 12px; right: 12px;
    top: calc(74px + env(safe-area-inset-top, 0px));
    max-width: calc(var(--col) - 24px); margin: 0 auto;
    padding: 12px 14px; border-radius: 16px;
    background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff;
    text-align: center;
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.35);
    animation: rise 0.5s var(--ease-spring);
}
.closed-banner p { font-size: 0.86rem; font-weight: 800; margin: 0 0 2px; }
.closed-banner span { font-size: 0.72rem; opacity: 0.88; }

/* Dock + WhatsApp appear only after sign-in */
.bottom-nav { display: none; }
.bottom-nav.show { display: flex; }
.wa-fab { display: none; }
.wa-fab.show { display: flex; }
body:has(#orderTotalBar[style*="flex"]) .wa-fab { bottom: calc(var(--dock-space) + 88px); }

@media (max-width: 380px) {
    .order-main { padding-left: 12px; padding-right: 12px; }
    .order-card { padding: 16px 14px; }
    .ci-row { grid-template-columns: minmax(0, 1fr) 100px; }
    .ci-img { width: 100px; height: 100px; }
    .field-row { grid-template-columns: 1fr; }
    .pay-options { grid-template-columns: 1fr; }
    .step-actions { flex-direction: column-reverse; }
    .step-actions .back-step-btn, .step-actions .next-btn, .step-actions .place-btn { width: 100%; justify-content: center; }
}

/* ---------- Line icons (instead of emoji) ---------- */
.lg-footer .ic { width: 14px; height: 14px; vertical-align: -2px; }
.menu-select-label .ic, .substep-title .ic { width: 20px; height: 20px; color: var(--brand); vertical-align: -3px; }
.mh-emoji .ic { width: 22px; height: 22px; color: var(--brand); }
.cart-head-ic { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.cart-head-ic .ic { width: 17px; height: 17px; }
.menu-category-header .veg-mark, .menu-category-header .nonveg-mark { width: 13px; height: 13px; }
.ci-veg::before, .ci-nonveg::before { content: ''; width: 13px; height: 13px; flex-shrink: 0; background: var(--mark-veg) center/contain no-repeat; }
.ci-nonveg::before { background-image: var(--mark-nonveg); }
.loc-icon .ic { width: 22px; height: 22px; color: var(--ok); }
.saved-label { display: inline-flex; align-items: center; gap: 6px; }
.saved-label .ic { width: 15px; height: 15px; color: var(--brand); }
.next-btn .ic, .share-loc .ic, .profile-link .ic { width: 17px; height: 17px; }
.substep-skip .ic { width: 14px; height: 14px; vertical-align: -2px; }
.profile-link { gap: 6px; }
.pay-ic { width: 24px; height: 24px; color: var(--brand); margin-bottom: 2px; }
.toast-icon { display: inline-grid; }
.toast-icon .ic { width: 18px; height: 18px; color: var(--ok-2); }

/* ============================================
   ORDER v2 — closed card, search + kitchen tabs, cart highlight
   ============================================ */
/* Closed notice now sits in the page instead of floating over the stepper */
.closed-banner {
    position: relative; top: auto; left: auto; right: auto; z-index: auto;
    max-width: none; margin: 0 0 16px; padding: 14px;
    border-radius: 20px; text-align: left; color: var(--text);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 0.05));
    border: 1px solid rgba(248, 113, 113, 0.3);
    box-shadow: none;
}
.cb-row { display: flex; align-items: center; gap: 12px; }
.cb-ic { position: relative; flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(248, 113, 113, 0.16); color: #f87171; }
.cb-ic .ic { width: 22px; height: 22px; }
.cb-ic::after { content: ''; position: absolute; inset: -4px; border-radius: 18px; border: 2px solid rgba(248, 113, 113, 0.45); animation: cbPulse 2.2s ease-out infinite; }
@keyframes cbPulse { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.25); opacity: 0; } }
.cb-text { flex: 1; min-width: 0; }
.closed-banner .cb-text p { margin: 0; font-size: 0.94rem; font-weight: 800; color: var(--text); }
.closed-banner .cb-text span { font-size: 0.75rem; color: var(--text-2); opacity: 1; }
.cb-count {
    flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
    padding: 7px 11px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line);
    line-height: 1.15; white-space: nowrap;
}
.cb-count small { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.closed-banner .cb-count span { font-family: var(--font-display); font-size: 0.98rem; font-weight: 900; color: var(--brand-ink); }

/* Sticky search + kitchen tabs */
.menu-tools {
    position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 50;
    margin: -6px -16px 14px; padding: 10px 16px 10px;
    background: var(--glass);
    backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid var(--line);
    animation: rise 0.5s var(--ease-out);
}
.menu-find {
    display: flex; align-items: center; gap: 9px;
    height: 46px; padding: 0 14px; border-radius: 15px;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.menu-find:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 4px var(--brand-soft); }
.menu-find .ic { width: 18px; height: 18px; color: var(--brand); }
.menu-find input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 0.92rem; font-weight: 600; color: var(--text); }
.menu-find input::placeholder { color: var(--text-3); font-weight: 500; }
.menu-find input::-webkit-search-cancel-button { filter: invert(0.6); }
.ktabs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.ktabs::-webkit-scrollbar { display: none; }
.ktab {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 6px 0 13px; border-radius: 99px;
    background: var(--surface); border: 1px solid var(--line);
    color: var(--text-2); font-size: 0.8rem; font-weight: 800;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.ktab b { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 0.7rem; }
.ktab.active { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(241, 90, 10, 0.3); }
.ktab.active b { background: rgba(255, 255, 255, 0.25); color: #fff; }
.menu-hotel-header { scroll-margin-top: 170px; }
.find-empty { padding: 26px 8px; text-align: center; font-size: 0.9rem; font-weight: 700; color: var(--text-2); }

/* The section header already says VEG — each dish just shows the mark */
.ci-veg, .ci-nonveg { font-size: 0; gap: 0; }
.ci-veg::before, .ci-nonveg::before { width: 15px; height: 15px; }

/* A dish that is in the cart gets a soft orange edge */
.cart-item-card { transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.cart-item-card:has(.ci-qty-controls[style*="flex"]) {
    margin: 0 -16px; padding-left: 16px; padding-right: 16px;
    background: linear-gradient(90deg, var(--brand-soft), transparent 75%);
    box-shadow: inset 3px 0 0 var(--brand);
}
.ci-img { transition: transform 0.5s var(--ease-out); }
@media (hover: hover) { .cart-item-card:hover .ci-img { transform: scale(1.04); } }

/* Total bounces when it changes */
.order-total-bar.bump .total-amount { animation: pop 0.45s var(--ease-spring); }

/* ============================================
   ORDER v3 — closed ADD, success celebration, desktop bill summary
   ============================================ */
/* Shop or kitchen closed: ADD tells you when it opens (label from order-ui.js) */
.shop-closed .ci-add-btn, .kc-closed .ci-add-btn {
    font-size: 0; min-width: 104px; padding: 0 10px;
    background: var(--surface-2); color: var(--text-3);
    border: 1px dashed var(--line-2); box-shadow: none;
    pointer-events: none;
}
.shop-closed .ci-add-btn::after, .kc-closed .ci-add-btn::after { content: var(--closed-label); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.02em; }
.shop-closed .ci-img, .kc-closed .ci-img { filter: saturate(0.6) brightness(0.85); }

/* Order placed */
.success-card:has(.success-chef) .success-icon { display: none; }
.success-chef { position: relative; width: 170px; margin: -8px auto 6px; animation: chefPop 0.9s var(--ease-spring) both; }
.success-chef .chef-svg { display: block; width: 100%; height: auto; }
.success-chef .sign-text { font-size: 16px; letter-spacing: 1px; }
@keyframes chefPop { from { opacity: 0; transform: translateY(40px) scale(0.8); } to { opacity: 1; transform: none; } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9500; }

/* Desktop: menu on the left, a sticky bill summary on the right */
.ob-summary { display: none; }
@media (min-width: 1024px) {
    body:has(#orderTotalBar[style*="flex"]) .order-main { max-width: 1120px; padding-right: 384px; }
    .order-total-bar {
        left: auto; right: max(24px, calc((100vw - 1120px) / 2 + 16px));
        top: calc(92px + env(safe-area-inset-top, 0px)); bottom: auto;
        width: 340px; max-width: none; margin: 0;
        flex-direction: column; align-items: stretch; gap: 14px;
        padding: 18px; border-radius: 24px;
        background: var(--surface); color: var(--text);
        border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    }
    .order-total-bar .total-left { padding-top: 12px; border-top: 1px dashed var(--line-2); }
    .order-total-bar .total-amount { color: var(--text); }
    .order-total-bar .cart-count-badge { background: var(--grad-brand); color: #fff; }
    .order-total-bar .next-btn { width: 100%; height: 52px; background: var(--grad-brand); border: 0; box-shadow: var(--shadow-brand); }
    .ob-summary { display: block; }
    .obs-title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 800; margin-bottom: 8px; }
    .obs-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.86rem; color: var(--text-2); }
    .obs-row b { color: var(--text); font-weight: 800; }
    .obs-empty { font-size: 0.82rem; color: var(--text-3); line-height: 1.5; }
}
