/* =========================================================
   KOOTZY — MY ORDERS (list + detail)
   Builds on cart.css; tokens only.
   ========================================================= */

.orders-page { padding: 0 0 2.5rem; }

/* ── list cards ── */
.orders-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.order-card {
    display: block;
    background: var(--bg-panel);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md, 14px);
    padding: 0.9rem 1rem;
    box-shadow: var(--card-shadow);
    text-decoration: none;
    transition: var(--transition-smooth);
}
.order-card:hover { border-color: var(--border-color-hover); transform: translateY(-1px); }

.order-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.order-card-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-main);
}
.order-card-date { color: var(--text-muted); font-size: 0.82rem; }

.order-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.order-card-meta { color: var(--text-muted); font-size: 0.88rem; }

/* ── status chip: colour + glyph + text, never colour alone ── */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem 0.25rem 0.3rem;
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-panel);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}
.status-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    line-height: 20px;
    text-align: center;
    flex: 0 0 auto;
}

/* ── detail ── */
.order-chip { margin: 0.25rem 0 0.4rem; }
.od-note { color: var(--text-muted); margin: 0 0 1.25rem; max-width: 46ch; }

.od-subhead {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
    margin: 1.5rem 0 0.75rem;
}

/* timeline */
.od-timeline {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    display: grid;
    gap: 0;
}
.od-timeline li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    position: relative;
}
.od-timeline li.done, .od-timeline li.current { color: var(--text-main); }
.od-timeline li.current { font-weight: 700; }
.od-step-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--paper-2);
    border: 1.5px solid var(--border-color-hover);
    color: #fff;
    font-size: 0.7rem;
    line-height: 20px;
    text-align: center;
    flex: 0 0 auto;
}
.od-timeline li.done .od-step-dot,
.od-timeline li.current .od-step-dot { border-color: transparent; }
/* connecting rail */
.od-timeline li + li::before {
    content: "";
    position: absolute;
    left: 10.25px;
    top: -8px;
    width: 1.5px;
    height: 16px;
    background: var(--border-color-hover);
}
.od-timeline-muted { opacity: 0.45; }

.od-meta { margin-top: 1.25rem; display: grid; gap: 1rem; }
@media (min-width: 640px) { .od-meta { grid-template-columns: 1fr 1fr; align-items: start; } }

.od-address {
    background: var(--paper-2);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md, 14px);
    padding: 0.9rem 1rem;
}
.od-address h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.95rem;
    margin: 0 0 0.35rem;
    color: var(--text-main);
}
.od-address p { margin: 0; color: var(--text-main); font-size: 0.9rem; line-height: 1.5; }
.od-address p + p { margin-top: 0.4rem; font-weight: 700; }

/* ── Google sign-in ── */
.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 48px;
    width: 100%;
    max-width: 320px;
    margin: 0.75rem auto 0;
    padding: 0 1.25rem;
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    border: 1.5px solid var(--text-main);
    box-shadow: 2px 2px 0 var(--text-main);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.google-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--text-main); }
.google-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--text-main); }
.google-btn:disabled { opacity: 0.7; cursor: default; transform: none; }
.google-btn svg { flex: 0 0 auto; }

/* Saved addresses */
.addr-book { margin-top: 2rem; }
.addr-book[hidden], .addr-form[hidden] { display: none; }
.addr-book-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.addr-book-head h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 0; }
.addr-add { width: auto; }
.addr-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.addr-card { border: 1.5px solid var(--text-main); border-radius: 14px; padding: 0.85rem 1rem; background: var(--bg-panel, #fff); }
.addr-card-title { font-weight: 800; display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.addr-card-text { color: var(--text-muted); font-size: 0.88rem; margin: 0.25rem 0 0.6rem; }
.addr-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.addr-card-actions button { border: 1.5px solid var(--text-main); background: transparent; border-radius: 10px; padding: 0.35rem 0.75rem; font-weight: 700; cursor: pointer; }
.addr-card-actions .addr-remove { color: var(--primary-strong, #DB0B21); border-color: var(--primary-strong, #DB0B21); }
.addr-form { border: 1.5px dashed var(--text-main); border-radius: 14px; padding: 1rem; margin-top: 0.8rem; }
.addr-form h3 { margin: 0 0 0.6rem; }
.addr-form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.addr-form-actions .state-btn { width: auto; }

/* ── Stall purchase: pay by UPI (js/stall-pay.js) ── */
.stall-pay { background: var(--bg-panel); border: 2px solid #22c55e; border-radius: var(--r-md, 14px); padding: 1.1rem 1.2rem; margin: 0 0 1.5rem; max-width: 34rem; box-shadow: var(--card-shadow); }
.stall-pay-title { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 .25rem; color: var(--text-main); }
.stall-pay-amount { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; margin: 0; color: var(--text-main); }
.stall-pay-note { color: var(--text-muted); font-size: .9rem; margin: .25rem 0 .75rem; }
.stall-pay-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .5rem 0 .9rem; }
.stall-pay-app { display: block; text-align: center; padding: .8rem .5rem; border-radius: 12px; font-weight: 800; text-decoration: none; color: #fff; background: #334155; }
.stall-pay-app.gpay { background: #1a73e8; }
.stall-pay-app.phonepe { background: #5f259f; }
.stall-pay-app.paytm { background: #00b9f1; }
.stall-pay-id { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: var(--text-main); }
.stall-pay-id code { font-size: .95rem; word-break: break-all; }
.stall-pay-copy { padding: .3rem .7rem; border-radius: 8px; border: 1.5px solid var(--border-color); background: transparent; color: var(--text-main); cursor: pointer; }
.stall-pay-utr { display: grid; gap: .5rem; margin-top: .75rem; }
.stall-pay-utr label { font-weight: 700; color: var(--text-main); font-size: .92rem; }
.stall-pay-utr input { padding: .7rem; font-size: 1.15rem; letter-spacing: .12em; border-radius: 10px; border: 1.5px solid var(--border-color); }
.stall-pay-status { margin: 0; font-size: .9rem; color: var(--text-main); min-height: 1.2em; }
.stall-pay-done { margin: 0; font-weight: 800; color: #15803d; }
.stall-pay-steps { margin: .6rem 0 .4rem; padding-left: 1.3rem; display: grid; gap: .55rem; color: var(--text-main); font-size: 1rem; }
.stall-pay-steps .stall-pay-copy { margin-left: .5rem; font-size: .8rem; padding: .15rem .55rem; }
.stall-pay-more { margin-top: 1rem; border-top: 1px dashed var(--border-color); padding-top: .75rem; }
.stall-pay-more summary { cursor: pointer; font-weight: 700; color: var(--text-muted); }

/* Reviews: "Rate this" under each product of a delivered or collected order. */
.rv { margin-top: .55rem; }
.rv-open { padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--primary-strong, #DB0B21); background: #fff; color: var(--primary-strong, #DB0B21); font-weight: 800; cursor: pointer; }
.rv-form { display: grid; gap: .55rem; margin-top: .2rem; }
.rv-stars { display: flex; gap: .15rem; }
.rv-star { font-size: 1.9rem; line-height: 1; padding: .1rem .15rem; border: 0; background: none; color: #cbd5e1; cursor: pointer; }
.rv-star.on { color: #f59e0b; }
.rv-text { width: 100%; box-sizing: border-box; padding: .6rem; border-radius: 10px; border: 1.5px solid var(--border-color); font: inherit; resize: vertical; }
.rv-photo { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--text-main); cursor: pointer; }
.rv-photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rv-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--border-color); }
.rv-send { justify-self: start; padding: .55rem 1.1rem; border-radius: 10px; border: 2px solid #172a33; background: var(--primary-strong, #DB0B21); color: #fff; font-weight: 800; cursor: pointer; }
.rv-send:disabled { opacity: .6; cursor: wait; }
.rv-error { margin: 0; min-height: 1em; color: var(--primary-strong, #DB0B21); font-size: .9rem; }
.rv-done { margin: 0; color: #15803d; font-weight: 700; font-size: .92rem; }
.rv-done-stars { color: #f59e0b; letter-spacing: .05em; }
