/* ============================================================
   Maventra — css/cart.css
   Slide-out bag, cart page, single-page checkout with a
   segmented payment tab control, confirm + processing overlays,
   coupon field, quick-view modal.
   ============================================================ */

/* ---------- Bag overlay + slide-out panel ---------- */
.mv-bag-overlay { position: fixed; inset: 0; z-index: 480; background: rgba(22,19,15,.44); opacity: 0; visibility: hidden; transition: opacity var(--t-base), visibility var(--t-base); }
.mv-bag-overlay.is-open { opacity: 1; visibility: visible; }
.mv-bag { position: fixed; top: 0; right: 0; z-index: 485; width: min(400px, 92vw); height: 100%; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--t-slow); box-shadow: -14px 0 40px rgba(22,19,15,.16); }
.mv-bag.is-open { transform: none; }
.mv-bag__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.mv-bag__head h2 { font-size: 1.1rem; }
.mv-bag__close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--text); }
.mv-bag__body { flex: 1; overflow-y: auto; padding: 1rem 1.3rem; }
.mv-bag__foot { border-top: 1px solid var(--line); padding: 1.1rem 1.3rem; background: var(--bg-alt); }

.mv-line { display: grid; grid-template-columns: 72px 1fr; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--line-soft); }
.mv-line__img { width: 72px; height: 90px; object-fit: cover; border: 1px solid var(--line); }
.mv-line__name { font-size: .88rem; font-weight: 600; }
.mv-line__opt { font-size: .76rem; color: var(--text-muted); }
.mv-line__price { font-family: var(--font-latin); font-weight: 600; font-size: .9rem; margin-top: .2rem; }
.mv-line__foot { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; gap: .5rem; }
.mv-line .mv-qty button { width: 38px; min-height: 38px; }
.mv-line .mv-qty input { width: 40px; }
.mv-line__remove { display: inline-flex; align-items: center; gap: .3rem; background: transparent; border: 0; color: var(--text-muted); font-size: .76rem; min-height: 38px; }
.mv-line__remove:hover { color: var(--err); }
.mv-line__remove .mv-ico { width: 16px; height: 16px; }

.mv-shiphint { font-size: .78rem; color: var(--text-muted); margin-bottom: .8rem; text-align: center; }
.mv-shiphint strong { color: var(--ink); }
.mv-bag-subtotal { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .9rem; }
.mv-bag-subtotal strong { font-family: var(--font-latin); font-size: 1.15rem; }

/* ---------- Cart page layout ---------- */
.mv-cartgrid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.4rem; align-items: start; }
.mv-cartitems { border-top: 1px solid var(--line); min-height: 200px; }
.mv-cartitems .mv-line { grid-template-columns: 92px 1fr; }
.mv-cartitems .mv-line__img { width: 92px; height: 115px; }

/* ---------- Summary / coupon ---------- */
.mv-summary { border: 1px solid var(--line); background: var(--surface); padding: 1.4rem; position: sticky; top: calc(var(--nav-h) + 12px); }
.mv-summary h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.mv-sumrow { display: flex; justify-content: space-between; font-size: .9rem; padding: .4rem 0; }
.mv-sumrow--total { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .8rem; font-weight: 700; font-size: 1.05rem; }
.mv-sumrow--total span:last-child { font-family: var(--font-latin); }
.mv-sumrow--discount span:last-child { color: var(--ok); }

.mv-coupon { margin: 1rem 0; padding: 1rem 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.mv-coupon__row { display: flex; gap: .5rem; }
.mv-coupon__row input { flex: 1; min-height: 44px; padding: 0 .7rem; border: 1px solid var(--line); border-radius: var(--r); font-family: var(--font-latin); letter-spacing: .08em; text-transform: uppercase; }
.mv-coupon__msg { font-size: .78rem; margin: .5rem 0 0; min-height: 1em; }
.mv-coupon__msg.is-ok { color: var(--ok); }
.mv-coupon__msg.is-err { color: var(--err); }
.mv-coupon__applied { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: var(--bg-alt); border: 1px dashed var(--ink); padding: .5rem .7rem; font-size: .8rem; margin-top: .6rem; }
.mv-coupon__applied button { background: transparent; border: 0; color: var(--err); font-size: .78rem; text-decoration: underline; min-height: 32px; }
.mv-couponhint { font-size: .72rem; color: var(--text-muted); margin-top: .5rem; }

/* ---------- Checkout ---------- */
.mv-checkout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.4rem; align-items: start; }
.mv-cobox { border: 1px solid var(--line); background: var(--surface); padding: 1.6rem; margin-bottom: 1.4rem; }
.mv-cobox h2 { font-size: 1.15rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.mv-cobox h2 .mv-num { width: 28px; height: 28px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: #fff; font-family: var(--font-latin); font-size: .82rem; border-radius: 50%; }
.mv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.mv-form-grid .mv-field--full { grid-column: 1 / -1; }

/* Segmented payment tabs */
.mv-paytabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.mv-paytab { flex: 1 1 auto; min-width: 104px; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: .82rem; font-weight: 600; color: var(--text); transition: all var(--t-fast); }
.mv-paytab:hover { border-color: var(--ink); }
.mv-paytab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.mv-paytab .mv-chip { font-family: var(--font-latin); font-size: .62rem; letter-spacing: .04em; }
.mv-payhint { font-size: .82rem; color: var(--text-muted); background: var(--bg-alt); border-left: 3px solid var(--ink); padding: .7rem .9rem; margin-bottom: 1rem; min-height: 2.8em; box-sizing: border-box; }
.mv-cardfields { border: 1px solid var(--line-soft); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; }
.mv-cardbrand { font-family: var(--font-latin); font-weight: 600; font-size: .8rem; color: var(--ink); min-height: 1em; }
.mv-cardsafe { font-size: .74rem; color: var(--text-muted); margin-top: .4rem; display: flex; gap: .4rem; }
.mv-cardsafe .mv-ico { width: 15px; height: 15px; flex: 0 0 auto; color: var(--ink); }

.mv-confirm-note { font-size: .82rem; color: var(--text-muted); border: 1px solid var(--line); padding: .9rem 1rem; margin: 1rem 0; }
.mv-cofinal { display: flex; flex-direction: column; gap: .7rem; }

/* ---------- Confirm + processing overlays ---------- */
.mv-overlay { position: fixed; inset: 0; z-index: 600; display: none; }
.mv-overlay.is-open { display: block; }
.mv-overlay__bd { position: absolute; inset: 0; background: rgba(22,19,15,.55); }
.mv-overlay__dlg { position: relative; max-width: 560px; margin: 6vh auto; max-height: 86vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.mv-overlay__hd { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.mv-overlay__hd h2 { font-size: 1.15rem; }
.mv-overlay__x { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--text); }
.mv-overlay__bdy { padding: 1.2rem 1.4rem; }
.mv-overlay__ft { padding: 1.1rem 1.4rem; border-top: 1px solid var(--line); background: var(--bg-alt); display: flex; flex-direction: column; gap: .6rem; }

.mv-crow { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; padding: .3rem 0; }
.mv-crow--total { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .7rem; font-weight: 700; font-size: 1.05rem; }
.mv-csec { margin-bottom: 1.2rem; }
.mv-csec h3 { font-size: .92rem; margin-bottom: .4rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line-soft); }
.mv-csec p { font-size: .86rem; color: var(--text-muted); margin: 0; }
.mv-crule { font-size: .78rem; color: var(--text-muted); background: var(--bg-alt); padding: .8rem 1rem; border-radius: var(--r); }

/* Processing */
.mv-processing { position: fixed; inset: 0; z-index: 650; display: none; align-items: center; justify-content: center; background: rgba(244,241,234,.92); }
.mv-processing.is-open { display: flex; }
.mv-processing__box { text-align: center; }
.mv-spinner { width: 46px; height: 46px; margin: 0 auto 1rem; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: mv-spin .8s linear infinite; }
@keyframes mv-spin { to { transform: rotate(360deg); } }
.mv-processing__box p { font-weight: 600; letter-spacing: .04em; }

/* ---------- Quick view modal ---------- */
.mv-qv-overlay { position: fixed; inset: 0; z-index: 500; display: none; background: rgba(22,19,15,.5); }
.mv-qv-overlay.is-open { display: block; }
.mv-qv { position: fixed; inset: 0; z-index: 505; display: none; align-items: center; justify-content: center; padding: 1rem; pointer-events: none; }
.mv-qv.is-open { display: flex; }
.mv-qv__dlg { position: relative; width: min(820px, 96vw); max-height: 92vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); pointer-events: auto; display: grid; grid-template-columns: 1fr 1fr; }
.mv-qv__close { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.9); border: 1px solid var(--line); color: var(--text); z-index: 2; }
.mv-qv__media { position: relative; }
.mv-qv__media img { width: 100%; height: 100%; object-fit: cover; }
.mv-qv__body { padding: 1.6rem; }
.mv-qv__name { font-size: 1.3rem; margin: .2rem 0 .4rem; }

@media (max-width: 900px) {
  .mv-cartgrid, .mv-checkout { grid-template-columns: 1fr; }
  .mv-summary { position: static; }
  .mv-qv__dlg { grid-template-columns: 1fr; }
  .mv-qv__media { max-height: 44vh; }
}
@media (max-width: 560px) {
  .mv-form-grid { grid-template-columns: 1fr; }
}
