/* ===== Aarav Innovative Checkout & Order Status ===== */

.checkout-body { background: var(--bg-alt); }
.checkout-main { padding: 30px 18px 80px; }
.checkout-title {
    font-size: 1.7rem;
    color: var(--primary-dark);
    margin-bottom: 6px;
}
.checkout-sub { color: var(--muted); margin-bottom: 24px; }

.checkout-grid { display: grid; gap: 20px; }
.checkout-form-col { display: grid; gap: 18px; align-content: start; }

.ck-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 18px;
    box-shadow: var(--shadow);
}
.ck-step {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ck-step span {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ck-lines { display: grid; gap: 12px; }
.ck-line {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px 14px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}
.ck-line[hidden] { display: none; }
.ck-line-img {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    grid-row: span 2;
}
.ck-line-info strong { display: block; color: var(--primary-dark); }
.ck-line-meta { font-size: .85rem; color: var(--muted); }
.ck-line .qty-stepper { grid-column: 2; }
.ck-line-total {
    grid-column: 2;
    font-weight: 600;
    color: var(--primary-dark);
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    width: fit-content;
}
.step-btn {
    width: 40px; height: 40px;
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.step-btn:hover { background: var(--primary); color: #fff; }
.qty-input {
    width: 80px; height: 40px;
    border: none;
    text-align: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}
.qty-input:focus { outline: none; background: var(--primary-light); }
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-input { -moz-appearance: textfield; appearance: textfield; }

.ck-hint { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.ck-hint.center { text-align: center; }
.field-error { color: var(--danger, #c0392b); font-size: .85rem; display: block; margin-top: 4px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ltr { direction: ltr; unicode-bidi: embed; }
.warn { color: #c0392b; font-style: normal; font-size: .8rem; }

/* payment box */
.pay-box {
    background: #fff8ed;
    border: 1px solid #f3ddba;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.pay-number-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0;
}
.pay-big { font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); letter-spacing: 1px; }
.copy-btn {
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--primary);
    background: #fff;
    color: var(--primary);
    cursor: pointer;
}
.copy-btn:hover { background: var(--primary); color: #fff; }
.pay-hint { font-size: .88rem; color: var(--muted); }

.pay-now {
    background: var(--primary-light);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1.1rem;
    margin-bottom: 18px;
    color: var(--primary-dark);
}
.pay-now strong { font-size: 1.35rem; }

/* brand chips */
.pay-chip input:checked + span { color: #fff; border-color: transparent; }
.pay-bkash input:checked + span { background: #e2136e; }
.pay-nagad input:checked + span { background: #f6921e; }
.pay-rocket input:checked + span { background: #8c3494; }

/* summary */
.summary-card { position: sticky; top: 80px; }
.summary-title { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 14px; }
.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: .95rem;
}
.summary-row.muted { color: var(--muted); font-size: .88rem; }
.summary-total {
    font-size: 1.15rem;
    color: var(--primary-dark);
    border-bottom: none;
    margin-bottom: 14px;
}
#submit-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

@media (min-width: 900px) {
    .checkout-grid { grid-template-columns: 1.5fr 1fr; align-items: start; }
    .ck-line { grid-template-columns: 64px 1fr auto; }
    .ck-line-img { grid-row: span 1; width: 64px; height: 64px; }
    .ck-line .qty-stepper { grid-column: 3; grid-row: 1; }
    .ck-line-total { grid-column: 3; grid-row: 2; text-align: right; }
}

/* ===== Order status page ===== */
.status-body {
    background: var(--bg-alt);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 16px 60px;
}
.status-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    max-width: 620px;
    width: 100%;
    padding: 30px 22px;
    text-align: center;
}
.status-icon {
    width: 84px; height: 84px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.status-icon svg { width: 44px; height: 44px; }
.status-icon.pending { background: var(--primary-light); color: var(--primary); }
.status-icon.paid { background: #e6f7ee; color: #166a43; }
.status-icon.rejected { background: #fdf0ee; color: #c0392b; }
.status-icon.pending::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    animation: ringSpin 1.4s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: .85; }
}

.status-title { font-size: 1.45rem; color: var(--primary-dark); margin-bottom: 8px; }
.status-sub { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }

/* progress steps */
.progress-steps {
    display: flex;
    align-items: flex-start;
    margin: 20px 0 24px;
}
.pstep {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--muted);
    position: relative;
}
.pstep .dot {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 1;
}
.pstep.done .dot { background: #166a43; color: #fff; }
.pstep.active .dot { background: var(--primary); color: #fff; animation: pulse 1.8s ease-in-out infinite; }
.pstep.done, .pstep.active { color: var(--primary-dark); font-weight: 600; }
.pstep::before {
    content: '';
    position: absolute;
    top: 17px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
}
.pstep:first-child::before { display: none; }
.pstep.done::before, .pstep.active::before { background: #166a43; }
.pstep.active::before { background: var(--primary); }

/* order details */
.order-details {
    background: var(--bg-alt);
    border-radius: 12px;
    padding: 18px;
    text-align: left;
    margin-bottom: 20px;
}
.order-details .od-num {
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
    margin-bottom: 12px;
}
.od-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    font-size: .92rem;
}
.od-row dt { color: var(--muted); }
.od-row dd { font-weight: 600; text-align: right; }
.od-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 1.05rem; }
.od-items { margin: 8px 0; border-top: 1px dashed var(--border); padding-top: 8px; }

.status-actions { display: flex; flex-direction: column; gap: 10px; }
.status-actions .btn { padding: 13px 20px; }
.btn-whatsapp {
    background: #16a34a;
    color: #fff;
}
.btn-whatsapp:hover { background: #12813c; color: #fff; }
.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: #fff;
}
.btn-outline:hover { background: var(--primary-light); }

/* delivery scene */
.scene { position: relative; overflow: hidden; border-radius: 14px; height: 170px; margin: 18px 0; background: linear-gradient(180deg, #dce9fb 0%, #f2f7ff 70%); }
.scene .road { position: absolute; bottom: 0; left: 0; right: 0; height: 34%; background: #3f4a56; }
.scene .road::before {
    content: '';
    position: absolute;
    top: 46%; left: 0; right: 0;
    height: 4px;
    background-image: linear-gradient(to right, #fbbf24 0 28px, transparent 28px 56px);
    background-size: 56px 4px;
    animation: roadMove .7s linear infinite;
}
.scene .clouds { position: absolute; top: 8%; left: 0; width: 200%; animation: drift 42s linear infinite; }
.scene .trees { position: absolute; bottom: 34%; left: 0; width: 200%; animation: drift 14s linear infinite; }
.scene .van { position: absolute; bottom: 24%; left: 50%; transform: translateX(-50%); animation: bob 1.6s ease-in-out infinite; width: 150px; }
.scene .wheel { transform-origin: center; transform-box: fill-box; animation: spin .8s linear infinite; }
@keyframes roadMove { from { background-position-x: 0; } to { background-position-x: -56px; } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
    .scene *, .scene .road::before { animation: none !important; }
}

@media (min-width: 640px) {
    .status-actions { flex-direction: row; }
    .status-actions .btn { flex: 1; }
    .scene { height: 220px; }
}

/* ===== Delivery & cart additions ===== */
.summary-row span.muted, .summary-row .muted { color: var(--muted); font-size: .85rem; }
#summary-delivery.muted { font-size: .85rem; color: var(--muted); }

.pay-single { font-size: .95rem; color: var(--ink); margin-bottom: 16px; }
.pay-badge-sm {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 6px;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    vertical-align: middle;
}
.pay-bkash  { background: #e2136e; }
.pay-nagad  { background: #f6921e; }
.pay-rocket { background: #8c3494; }

.cart-remove {
    border: none;
    background: none;
    color: #c0392b;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 8px;
    font-family: inherit;
}
.cart-remove:hover { color: #8e2b20; }

/* ===== Tier pricing ===== */
.tier-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tier-chip {
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: #fff;
    white-space: nowrap;
}
.tier-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.nudge-line {
    font-size: .8rem;
    color: var(--accent-dark);
    font-weight: 600;
    margin: 4px 0 0;
}
.nudge-line.nudge-best { color: #166a43; }
.ck-nudge { grid-column: 1 / -1; }

.tier-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tier-table td { padding: 5px 10px; border: 1px solid var(--border); color: var(--muted); }
.tier-table td:last-child { text-align: right; font-weight: 600; }
.tier-table tr.active td { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
