/* =============================================================
   TechZone BD — Cart & Checkout Pages
============================================================= */

/* ---------------- Shared page shell ---------------- */
.cart-page, .checkout-page, .order-success-page { background: #f5f7fb; padding: 1rem 0 4rem; }

.cart-heading, .checkout-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #dfe5ee; padding-bottom: 1.1rem; margin-bottom: 1.5rem; }
.cart-heading h1, .checkout-heading h1 { color: #0f172a; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.7px; margin: .3rem 0 0; }
.cart-heading p, .checkout-heading p { color: #64748b; font-size: .85rem; margin: 0; }

/* ---------------- Checkout steps ---------------- */
.checkout-steps { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.75rem; }
.checkout-step { display: flex; align-items: center; gap: .5rem; color: #94a3b8; font-size: .78rem; font-weight: 700; }
.checkout-step .step-num { width: 26px; height: 26px; border-radius: 50%; background: #e5e7eb; color: #64748b; display: flex; align-items: center; justify-content: center; font-size: .75rem; flex-shrink: 0; }
.checkout-step.active { color: #1d4ed8; }
.checkout-step.active .step-num { background: #1d4ed8; color: #fff; }
.checkout-step.done .step-num { background: #16a34a; color: #fff; }
.checkout-step.done .step-num::before { content: '\f633'; font-family: 'bootstrap-icons'; }
.checkout-step-line { flex: 1; height: 2px; background: #e5e7eb; min-width: 24px; }

/* =====================================================================
   CART PAGE
===================================================================== */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.4rem; align-items: start; }

.cart-items-panel { background: #fff; border: 1px solid #e1e7ef; }
.cart-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid #e8edf3; }
.cart-panel-head h2 { color: #0f172a; font-size: 1rem; font-weight: 800; margin: 0; }
.cart-panel-head a { color: #64748b; font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; }
.cart-panel-head a:hover { color: #1d4ed8; }

.cart-item { display: grid; grid-template-columns: 78px minmax(0, 1fr) 110px 130px 110px; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; border-bottom: 1px solid #edf1f5; }
.cart-item:last-child { border-bottom: 0; }
.cart-item-img { width: 78px; height: 78px; background: linear-gradient(145deg, #f7faff, #eef3fb); border: 1px solid #e1e7ef; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #5d86c8; flex-shrink: 0; overflow: hidden; }
.cart-item-img img, .checkout-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-info { min-width: 0; }
.cart-item-brand { display: block; color: #1d4ed8; font-size: .62rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; margin-bottom: .2rem; }
.cart-item-info h3 { color: #0f172a; font-size: .86rem; font-weight: 700; line-height: 1.4; margin: 0 0 .5rem; }
.cart-item-remove { background: none; border: 0; color: #94a3b8; font-size: .74rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; padding: 0; cursor: pointer; transition: color .2s ease; }
.cart-item-remove:hover { color: #dc2626; }
.cart-item-price { color: #64748b; font-size: .82rem; font-weight: 600; text-align: center; }
.cart-item-total { color: #1d4ed8; font-size: .95rem; font-weight: 800; text-align: right; }

.cart-qty { display: flex; align-items: center; border: 1px solid #cbd5e1; background: #fff; width: fit-content; }
.cart-qty .qty-btn { width: 32px; height: 32px; background: none; border: 0; color: #334155; font-size: .95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cart-qty .qty-btn:hover { color: #1d4ed8; background: #f3f6fc; }
.cart-qty .qty-input { width: 40px; border: 0; border-left: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; text-align: center; font-size: .8rem; font-weight: 700; color: #0f172a; height: 32px; appearance: textfield; -moz-appearance: textfield; }
.cart-qty .qty-input::-webkit-outer-spin-button, .cart-qty .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Empty cart */
.cart-empty-state, .checkout-empty-state { background: #fff; border: 1px solid #e1e7ef; text-align: center; padding: 4rem 1.5rem; }
.cart-empty-state i, .checkout-empty-state i { font-size: 4rem; color: #cbd5e1; }
.cart-empty-state h2, .checkout-empty-state h2 { color: #0f172a; font-size: 1.3rem; font-weight: 800; margin: 1rem 0 .5rem; }
.cart-empty-state p, .checkout-empty-state p { color: #64748b; font-size: .88rem; margin-bottom: 1.4rem; }

/* Summary panel (cart + checkout share look) */
.cart-summary, .checkout-summary { background: #fff; border: 1px solid #e1e7ef; padding: 1.25rem; position: sticky; top: 90px; }
.cart-summary h2, .checkout-summary h2 { color: #0f172a; font-size: 1rem; font-weight: 800; margin: 0 0 1rem; padding-bottom: .9rem; border-bottom: 1px solid #e8edf3; }
.summary-row { display: flex; justify-content: space-between; align-items: center; font-size: .84rem; color: #475569; margin-bottom: .7rem; }
.summary-row strong { color: #0f172a; font-weight: 700; }
.summary-row.discount-row { color: #16a34a; }
.summary-row.discount-row strong { color: #16a34a; }
.summary-total-row { display: flex; justify-content: space-between; align-items: baseline; padding-top: .9rem; margin-top: .3rem; border-top: 1px solid #e8edf3; }
.summary-total-row span { color: #0f172a; font-size: .92rem; font-weight: 700; }
.summary-total-row strong { color: #1d4ed8; font-size: 1.4rem; font-weight: 800; letter-spacing: -.5px; }

.promo-box { margin: 1rem 0; }
.promo-form { display: flex; gap: .5rem; }
.promo-form input { flex: 1; border: 1px solid #d8e0ea; padding: .55rem .7rem; font-size: .8rem; color: #334155; }
.promo-form button { background: #0f172a; border: 0; color: #fff; font-size: .78rem; font-weight: 700; padding: 0 .9rem; cursor: pointer; white-space: nowrap; }
.promo-form button:hover { background: #1d4ed8; }
.promo-msg { color: #dc2626; font-size: .74rem; margin-top: .4rem; min-height: 1em; }
.promo-active { display: none; align-items: center; justify-content: space-between; gap: .5rem; background: #f0fdf4; border: 1px dashed #16a34a; color: #15803d; font-size: .76rem; font-weight: 700; padding: .55rem .7rem; margin-top: .6rem; }
.promo-active .promo-remove { background: none; border: 0; color: #15803d; cursor: pointer; font-size: .9rem; padding: 0; line-height: 1; }

.btn-checkout { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; background: #1d4ed8; border: 2px solid #1d4ed8; color: #fff; font-size: .9rem; font-weight: 700; padding: .8rem 1rem; margin-top: 1.1rem; cursor: pointer; transition: all .2s ease; }
.btn-checkout:hover { background: #1e3a8a; border-color: #1e3a8a; color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(29,78,216,.28); }

.summary-trust { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.1rem; color: #94a3b8; font-size: 1.15rem; }
.summary-trust-note { display: flex; align-items: center; justify-content: center; gap: .35rem; color: #64748b; font-size: .72rem; margin-top: .6rem; }
.summary-trust-note i { color: #16a34a; }

/* =====================================================================
   CHECKOUT PAGE
===================================================================== */
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.4rem; align-items: start; }

.checkout-section { background: #fff; border: 1px solid #e1e7ef; padding: 1.25rem 1.4rem; margin-bottom: 1.1rem; }
.checkout-section-title { display: flex; align-items: center; gap: .55rem; color: #0f172a; font-size: 1rem; font-weight: 800; margin: 0 0 1.1rem; }
.checkout-section-title .sec-num { width: 26px; height: 26px; border-radius: 50%; background: #e9f0ff; color: #1d4ed8; font-size: .78rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.checkout-section label.form-label { color: #334155; font-size: .78rem; font-weight: 700; margin-bottom: .35rem; }
.checkout-section .form-control, .checkout-section .form-select { border: 1px solid #d8e0ea; border-radius: 0; font-size: .84rem; padding: .55rem .75rem; }
.checkout-section .form-control:focus, .checkout-section .form-select:focus { border-color: #1d4ed8; box-shadow: 0 0 0 .18rem rgba(29,78,216,.15); }
.checkout-section .invalid-feedback { font-size: .72rem; }

/* Payment method cards */
.payment-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.payment-option { position: relative; border: 1px solid #d8e0ea; background: #fbfcfe; padding: 1rem .8rem; text-align: center; cursor: pointer; transition: all .2s ease; }
.payment-option:hover { border-color: #93b4f5; }
.payment-option.selected { border-color: #1d4ed8; background: #eef4ff; box-shadow: 0 0 0 1px #1d4ed8 inset; }
.payment-option input[type="radio"] { position: absolute; top: .6rem; right: .6rem; accent-color: #1d4ed8; }
.payment-option i { font-size: 1.6rem; color: #64748b; display: block; margin-bottom: .5rem; }
.payment-option.selected i { color: #1d4ed8; }
.payment-option strong { display: block; color: #0f172a; font-size: .82rem; font-weight: 700; }
.payment-option span { color: #94a3b8; font-size: .68rem; }

.checkout-terms { display: flex; align-items: flex-start; gap: .55rem; font-size: .8rem; color: #475569; margin: .3rem 0 1rem; }
.checkout-terms input { accent-color: #1d4ed8; width: 15px; height: 15px; margin-top: .2rem; flex-shrink: 0; }
.checkout-terms a { color: #1d4ed8; font-weight: 700; }

.btn-place-order { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; background: #f97316; border: 2px solid #f97316; color: #fff; font-size: .92rem; font-weight: 700; padding: .85rem 1rem; cursor: pointer; transition: all .2s ease; }
.btn-place-order:hover { background: #ea580c; border-color: #ea580c; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(249,115,22,.3); }

/* Order review items inside checkout summary */
.checkout-item { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid #edf1f5; }
.checkout-item:last-child { border-bottom: 0; }
.checkout-item-img { position: relative; width: 52px; height: 52px; background: linear-gradient(145deg, #f7faff, #eef3fb); border: 1px solid #e1e7ef; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #5d86c8; flex-shrink: 0; }
.checkout-item-qty { position: absolute; top: -7px; right: -7px; background: #1d4ed8; color: #fff; font-size: .62rem; font-weight: 800; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.checkout-item-info { flex: 1; min-width: 0; }
.checkout-item-info h4 { color: #0f172a; font-size: .78rem; font-weight: 700; line-height: 1.4; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.checkout-item-info span { color: #1d4ed8; font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.checkout-item-total { color: #0f172a; font-size: .8rem; font-weight: 700; white-space: nowrap; }

/* Success panel */
.order-success-card { background: #fff; border: 1px solid #e1e7ef; text-align: center; padding: 3.5rem 1.5rem; }
.order-success-card .success-icon { width: 84px; height: 84px; border-radius: 50%; background: #dcfce7; color: #16a34a; font-size: 2.6rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.3rem; }
.order-success-card h2 { color: #0f172a; font-size: 1.5rem; font-weight: 800; margin-bottom: .6rem; }
.order-success-card p { color: #64748b; font-size: .9rem; max-width: 480px; margin: 0 auto .3rem; }
.order-success-card .order-id { display: inline-block; background: #f3f4f6; color: #0f172a; font-weight: 800; font-size: .95rem; padding: .4rem 1rem; margin: 1rem 0 1.6rem; }
.order-success-card .success-actions { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; }

/* Order summary recap table on the success page */
.order-success-summary { background: #fff; border: 1px solid #e1e7ef; padding: 1.25rem 1.4rem; margin-top: 1.1rem; }
.order-success-summary h3 { color: #0f172a; font-size: .92rem; font-weight: 800; margin: 0 0 1rem; padding-bottom: .8rem; border-bottom: 1px solid #e8edf3; }
.order-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.order-meta-item { background: #f8fafc; border: 1px solid #edf1f5; padding: .75rem .9rem; }
.order-meta-item span { display: block; color: #94a3b8; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: .25rem; }
.order-meta-item strong { color: #0f172a; font-size: .82rem; }
@media (max-width: 700px) { .order-meta-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 430px) { .order-meta-grid { grid-template-columns: 1fr; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 1199px) {
    .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 991px) {
    .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .cart-summary, .checkout-summary { position: static; }
    .payment-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .cart-item { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "img info" "img qty" "img price"; row-gap: .6rem; padding: 1rem; }
    .cart-item-img { grid-area: img; width: 64px; height: 64px; font-size: 1.6rem; }
    .cart-item-info { grid-area: info; }
    .cart-qty { grid-area: qty; }
    .cart-item-price { grid-area: price; text-align: left; display: flex; align-items: center; gap: .4rem; }
    .cart-item-price::before { content: 'Unit:'; color: #94a3b8; font-weight: 600; font-size: .7rem; }
    .cart-item-total { display: none; }
    .payment-options { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
    .cart-page, .checkout-page { padding-top: .5rem; }
    .cart-panel-head, .checkout-section { padding: .9rem; }
    .checkout-steps { font-size: .68rem; }
    .checkout-step span.step-label { display: none; }
    .payment-options { grid-template-columns: 1fr; }
    .summary-total-row strong { font-size: 1.2rem; }
}
