/* ═══════════════════════════════════════════════════════════════════════════
   Cart page only (redesign approved in the Design chat, 2026-11-02). A money
   page: this file only restyles what renderCart() and Cart.shipBarHtml() emit —
   the table, ids, handlers and totals are the live ones. Opens light under the
   navy pill; the shared .dissolve (lower zone only) fades it into the footer.
   Breakpoints: 900 (summary under the items) / 768 (phone) / 600 (row layout).
   Text #1b2340 / #444466, labels #8a90a8, gold as text #996E13, hairline
   rgba(27,35,64,.12).
   ═══════════════════════════════════════════════════════════════════════════ */

.cartpage .cart-section { --dz-h: 440px; --dz-tilt: 4deg; --dz2-bottom: 0px; --mid-top: 0px; --mid: 240px;
  padding: 170px var(--pad) 360px; }
.cartpage .cart-page { max-width: 1100px; margin: 0 auto; }
.cartpage .cart-page h1 {
  margin: 0 0 48px; text-align: center;
  font-size: 54px; font-weight: 500; letter-spacing: -.02em; line-height: 1.08; color: #1b2340;
}
.cartpage .cart-page h1 .sc-ul { left: -2%; width: 104%; bottom: -10px; height: 16px; }

.cartpage .cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 28px; align-items: start; }
.cartpage .cart-layout > div:first-child, .cartpage .cart-total-box, .cartpage .empty-cart {
  background: #fff; border-radius: 24px; border: 1px solid rgba(27,35,64,.08);
  box-shadow: 0 14px 40px rgba(27,35,64,.07); color: #1b2340;
}
.cartpage .cart-layout > div:first-child { padding: 28px 32px 12px; }

/* free-delivery bar: the shared page look is in css/site.css */
.cartpage .cart-ship-slot:not(:empty) { margin-bottom: 22px; }

/* ═══ items: the live <table>, laid out as the mockup's grid ═══════════════
   cells in source order: × | picture | name | price | qty | total */
.cartpage .cart-table, .cartpage .cart-table thead, .cartpage .cart-table tbody { display: block; width: 100%; margin: 0; }
.cartpage .cart-table tr {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 90px 124px 90px 36px; gap: 14px; align-items: center;
  grid-template-areas: "img name price qty total rm";
}
.cartpage .cart-table th, .cartpage .cart-table td { padding: 0; border: 0; text-align: left; }
.cartpage .cart-table :is(th, td):nth-child(1) { grid-area: rm; }
.cartpage .cart-table :is(th, td):nth-child(2) { grid-area: img; }
.cartpage .cart-table :is(th, td):nth-child(3) { grid-area: name; }
.cartpage .cart-table :is(th, td):nth-child(4) { grid-area: price; }
.cartpage .cart-table :is(th, td):nth-child(5) { grid-area: qty; }
.cartpage .cart-table :is(th, td):nth-child(6) { grid-area: total; }
.cartpage .cart-table thead tr { padding: 0 0 12px; }
.cartpage .cart-table th { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8a90a8; }
.cartpage .cart-table tbody tr { padding: 16px 0; }
.cartpage .cart-table tbody tr + tr { border-top: 1px solid rgba(27,35,64,.12); }
/* pre-order rows keep their live tint (inline style); round it off inside the card */
.cartpage .cart-table tbody tr[style*="background"] { margin: 0 -12px; padding: 16px 12px; border-radius: 16px; }

.cartpage .cart-item-img { display: block; width: 84px; height: 84px; padding: 8px; object-fit: contain; border-radius: 16px; background: #f4f6fb; }
.cartpage .cart-item-name { font-size: 16.5px; font-weight: 600; color: #1b2340; }
.cartpage .cart-item-meta { margin-top: 3px; font-size: 13.5px; color: #444466; }
.cartpage .cart-table td:nth-child(4) { font-size: 15.5px; color: #1b2340; }
.cartpage .cart-table td:nth-child(6), .cartpage .cart-table td:nth-child(6) strong { font-size: 15.5px; font-weight: 600; color: #1b2340; white-space: nowrap; }
/* the pre-order badge: a small tracked label in the site's red, on its own line under
   the name; it may wrap (the name column is narrow; the shared badge never wraps) */
.cartpage .cart-item-name .po-badge {
  display: block; margin: 4px 0 0; padding: 0; border: 0; background: none; white-space: normal;
  font-size: 10.5px; letter-spacing: .1em; line-height: 1.4; font-weight: 700 !important;
}

/* quantity: a pill stepper */
.cartpage .cart-qty {
  display: inline-flex; align-items: center; height: 42px; width: auto; overflow: hidden;
  border: 1.5px solid rgba(27,35,64,.12); border-radius: 999px; background: #fff;
}
.cartpage .cart-qty button {
  width: 38px; height: 100%; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 18px; font-weight: 400; color: #1b2340; transition: background-color .15s;
}
.cartpage .cart-qty button:hover { background: #f4f6fb; }
.cartpage .cart-qty input {
  width: 40px; height: 100%; border: 0; padding: 0; text-align: center; background: transparent;
  font: inherit; font-size: 15px; font-weight: 600; color: #1b2340; outline: none; -moz-appearance: textfield;
}
.cartpage .cart-qty input::-webkit-inner-spin-button, .cartpage .cart-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* remove: a round hairline button with the live × */
.cartpage .remove-btn {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(27,35,64,.12); background: #fff; cursor: pointer;
  font: inherit; font-size: 18px; line-height: 1; color: #8a90a8; transition: border-color .2s, color .2s;
}
.cartpage .remove-btn:hover { border-color: #ff4444; color: #ff4444; background: #fff; }

/* ═══ summary: the live .cart-total-box ═══════════════════════════════════ */
.cartpage .cart-total-box { position: sticky; top: 124px; padding: 32px 32px 28px; }
.cartpage .cart-total-box h3 { margin: 0 0 18px; padding: 0; border: 0; font-size: 22px; font-weight: 500; color: #1b2340; }
.cartpage .total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 9px 0; font-size: 15px; color: #1b2340; }
.cartpage .total-row .label { color: #444466; }
.cartpage .total-row .free { color: var(--green-icon); font-weight: 600; }
.cartpage #cartShipping:not(.free) { color: #8a90a8 !important; text-align: right; }   /* the script sets the mid tone inline */
.cartpage .cart-discount-row { font-weight: 600; }
.cartpage .total-row.final { margin-top: 8px; padding-top: 16px; border: 0; font-size: 17px; font-weight: 600; align-items: center; }
.cartpage .total-row.final span:last-child { font-size: 26px; letter-spacing: -.02em; }
.cartpage .cart-total-box .rg-bundle-note { border-radius: 14px; border-width: 1px; margin-bottom: 4px; }

/* promo code: a pill input + a white pill button */
.cartpage .cart-promo-wrap { margin: 10px 0 4px; }
.cartpage .cart-promo-input-row { display: flex; gap: 8px; }
.cartpage .cart-promo-input-row input {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(27,35,64,.12); background: #f4f6fb; color: #1b2340;
  font: inherit; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.cartpage .cart-promo-input-row input:placeholder-shown { text-transform: none; letter-spacing: 0; }
.cartpage .cart-promo-input-row input::placeholder { color: #8a90a8; }
.cartpage .cart-promo-input-row input:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(246,177,30,.15); }
.cartpage .cart-promo-input-row input.error { border-color: #ff4444; }
.cartpage .cart-promo-input-row input.success { border-color: #22bb55; }
.cartpage .cart-promo-apply-btn {
  height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid #1b2340;
  background: #fff; color: #1b2340; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s;
}
.cartpage .cart-promo-apply-btn:hover { background: #1b2340; color: #fff; }
.cartpage .cart-promo-apply-btn:disabled { opacity: .5; cursor: not-allowed; }
.cartpage .cart-promo-msg { margin-top: 8px; font-size: 12.5px; font-weight: 600; }
.cartpage .cart-promo-msg:empty { display: none; }
.cartpage .cart-promo-msg.ok { color: #22bb55; }
.cartpage .cart-promo-msg.err { color: #ff4444; }
/* the applied code: a light pill, the ✕ a small round button */
.cartpage .cart-promo-applied-row {
  align-items: center; justify-content: space-between; gap: 10px; margin-top: 0;
  padding: 7px 7px 7px 16px; border-radius: 999px; border: 1px solid rgba(27,35,64,.12); background: #f4f6fb;
}
.cartpage .cart-promo-applied-code { font-size: 13.5px; font-weight: 700; color: #22bb55; }
.cartpage .cart-promo-remove-btn {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(27,35,64,.12); background: #fff; cursor: pointer;
  font-size: 13px; line-height: 1; color: #8a90a8; transition: border-color .2s, color .2s;
}
.cartpage .cart-promo-remove-btn:hover { border-color: #ff4444; color: #ff4444; }

/* pre-order notice (renderCart, when a line is a pre-order) */
.cartpage .cart-po-notice {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 14px;
  background: #fff0f0; border: 1px solid #c12d4e; color: #7a1d34;
  font-size: 13px; font-weight: 600; line-height: 1.55;
}

.cartpage .cart-total-box .btn-pink { display: flex; width: 100%; height: 56px; margin-top: 18px; padding: 0 20px; font-size: 16px; }
.cartpage .continue-link { display: block; margin-top: 14px; text-align: center; font-size: 14px; color: #444466; }
.cartpage .continue-link:hover { color: #996E13; }
.cartpage .cart-trust { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; padding: 0; border: 0; }
.cartpage .cart-trust span { font-size: 13.5px; font-weight: 500; color: #444466; }

/* ═══ empty cart: one white card ══════════════════════════════════════════ */
.cartpage .empty-cart { max-width: 560px; margin: 0 auto; padding: 56px 40px; text-align: center; }
.cartpage .empty-cart .empty-icon { margin-bottom: 14px; font-size: 56px; opacity: 1; }
.cartpage .empty-cart h2 { margin: 0 0 8px; font-size: 28px; font-weight: 500; color: #1b2340; }
.cartpage .empty-cart p { margin: 0 0 24px; font-size: 16px; color: #444466; }

/* ═══ RESPONSIVE ════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .cartpage .cart-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cartpage .cart-total-box { position: static; }
}
@media (max-width: 768px) {
  .cartpage .cart-section { --dz-h: 300px; --mid: 200px; padding: 130px 22px 230px; }
  .cartpage .cart-page h1 { margin-bottom: 30px; font-size: 40px; }
  .cartpage .cart-layout > div:first-child { padding: 20px 18px 8px; }
  .cartpage .cart-total-box { padding: 26px 20px 22px; }
}
/* phones: picture | name + size, × top right; the qty pill and the line total under the name.
   The unit price shows only when it carries more (a promotion, a pre-order date). */
@media (max-width: 600px) {
  .cartpage .cart-table thead { display: none; }
  .cartpage .cart-table tbody tr {
    position: relative; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 6px 14px;
    grid-template-areas: "img name name" "img price price" "img qty total";
  }
  .cartpage .cart-table td:nth-child(2) { align-self: start; }
  /* the × sits in the row's top-right corner, so the name gets the full width beside the picture */
  .cartpage .cart-table td:nth-child(1) { position: absolute; top: 16px; right: 0; }
  .cartpage .cart-table tbody tr[style*="background"] td:nth-child(1) { right: 12px; }
  .cartpage .cart-table td:nth-child(3) { padding-right: 46px; }
  .cartpage .cart-table td:nth-child(4) { font-size: 13.5px; color: #444466; }
  .cartpage .cart-table td:nth-child(4):not(:has(div)) { display: none; }
  .cartpage .cart-table td:nth-child(6) { justify-self: end; }
  .cartpage .cart-table td:nth-child(6), .cartpage .cart-table td:nth-child(6) strong { font-size: 15px; }
  .cartpage .cart-item-img { width: 72px; height: 72px; padding: 7px; }
  .cartpage .cart-qty { height: 38px; }
  .cartpage .empty-cart { padding: 44px 24px; }
}
