/* ═══════════════════════════════════════════════════════════════════════
   STUDYRIA — CART 2.0 STYLES
   Paper Cream · Maroon · Gold — premium, conversion-friendly, responsive
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Page shells ─────────────────────────────────────────────────────── */
#page-cart { padding-bottom: 64px; }
.cart-wrap {
  max-width: 1080px; margin: 0 auto; padding: 28px 20px 10px;
  display: grid; grid-template-columns: 1fr; gap: 24px;
}

.cart-title-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.cart-h1 {
  font-size: 1.7rem; font-weight: 800; color: var(--hp-ink, #291814);
  display: flex; align-items: center; gap: 10px; margin: 0; letter-spacing: -0.02em;
}
.cart-sub { font-size: 0.85rem; color: var(--hp-ink, #291814); opacity: 0.55; }

/* Clear cart — quiet text button, confirm state turns red */
.cart-clear-btn {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 0.8rem; font-weight: 600; color: var(--hp-ink, #291814);
  opacity: 0.5; padding: 6px 10px; border-radius: 6px; transition: all .15s ease;
}
.cart-clear-btn:hover:not(:disabled) { opacity: 1; background: rgba(163, 22, 33, 0.06); }
.cart-clear-btn:disabled { opacity: 0.25; cursor: default; }
.cart-clear-btn.cart-clear-confirm { color: #a31621; opacity: 1; background: rgba(163, 22, 33, 0.1); }

/* ── Layout: two columns on desktop, stacked on mobile (§33) ──────────── */
@media (min-width: 900px) {
  .cart-wrap { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .cart-summary { position: sticky; top: 96px; }
}

/* ── Banners ─────────────────────────────────────────────────────────── */
.cart-banner {
  border-radius: 10px; padding: 11px 14px; font-size: 0.83rem; font-weight: 600;
  margin-bottom: 14px; border: 1px solid;
}
.cart-banner-warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); color: #92600a; }
.cart-banner-ok   { background: rgba(16, 137, 62, 0.07);  border-color: rgba(16, 137, 62, 0.25); color: #0d5c30; }

/* ── Item list ───────────────────────────────────────────────────────── */
.cart-list { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--hp-paper, #fff); border: 1px solid rgba(28, 27, 26, 0.09);
  border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(28, 27, 26, 0.04);
  transition: box-shadow .15s ease;
}
.cart-item:hover { box-shadow: 0 4px 16px rgba(28, 27, 26, 0.08); }
.cart-item-dead { opacity: 0.62; background: rgba(28, 27, 26, 0.02); }
.cart-item-owned { background: rgba(16, 137, 62, 0.035); border-color: rgba(16, 137, 62, 0.2); }

.cart-item-img {
  flex: 0 0 64px; width: 64px; height: 82px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #f4ece1, #eadfce); position: relative;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-noimg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.cart-item-body { flex: 1; min-width: 0; }
.cart-item-title {
  font-size: 0.98rem; font-weight: 700; color: var(--hp-ink, #291814);
  cursor: pointer; line-height: 1.35; letter-spacing: -0.01em;
}
.cart-item-title:hover { color: var(--hp-red, #930205); }
.cart-item-cat {
  margin-top: 3px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--hp-ink, #291814); opacity: 0.45;
}
.cart-item-warn { margin-top: 5px; font-size: 0.78rem; font-weight: 700; color: #b45309; }
.cart-item-owned-note { margin-top: 5px; font-size: 0.78rem; font-weight: 600; color: #0d5c30; }

.cart-item-actions {
  margin-top: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.cart-qty {
  font-size: 0.75rem; font-weight: 700; color: var(--hp-ink, #291814);
  background: rgba(28, 27, 26, 0.05); border-radius: 6px; padding: 4px 9px; cursor: help;
}
.cart-item-link, .cart-item-remove {
  background: none; border: none; cursor: pointer; font-size: 0.8rem;
  font-weight: 600; padding: 4px 2px; border-radius: 5px; transition: color .12s ease;
}
.cart-item-link { color: var(--hp-red, #930205); }
.cart-item-link:hover { text-decoration: underline; }
.cart-item-remove { color: var(--hp-ink, #291814); opacity: 0.5; }
.cart-item-remove:hover { color: #a31621; opacity: 1; }

.cart-item-price {
  flex: 0 0 auto; text-align: right; min-width: 74px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.cart-price-now { font-size: 1.05rem; font-weight: 800; color: var(--hp-ink, #291814); }
.cart-price-was { font-size: 0.75rem; text-decoration: line-through; opacity: 0.4; }
.cart-price-old { font-size: 0.85rem; font-weight: 700; color: #b45309; }
.cart-price-owned { font-size: 0.85rem; font-weight: 800; color: #0d5c30; }
.cart-price-upd {
  font-size: 0.68rem; font-weight: 700; color: #930205;
  background: rgba(147, 2, 5, 0.07); border-radius: 5px; padding: 3px 7px; margin-top: 3px;
}

/* ── Summary card ────────────────────────────────────────────────────── */
.cart-summary-card {
  background: var(--hp-paper, #fff); border: 1px solid rgba(28, 27, 26, 0.09);
  border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(28, 27, 26, 0.04);
}
.cart-sum-title {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--hp-red, #930205); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid rgba(28, 27, 26, 0.07);
}
.cart-sum-row {
  display: flex; justify-content: space-between; font-size: 0.87rem;
  color: var(--hp-ink, #291814); padding: 5px 0;
}
.cart-sum-row span:last-child { font-weight: 700; }
.cart-sum-save span { color: #0d5c30; }
.cart-sum-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; padding-top: 12px; border-top: 1px dashed rgba(28, 27, 26, 0.15);
  font-size: 1.02rem; font-weight: 800; color: var(--hp-ink, #291814);
}
.cart-sum-total span:last-child { font-size: 1.25rem; color: var(--hp-red, #930205); }
.cart-sum-note {
  margin-top: 12px; font-size: 0.7rem; line-height: 1.5;
  color: var(--hp-ink, #291814); opacity: 0.5; text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.cart-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 8px; padding: 12px 22px; font-size: 0.92rem; font-weight: 700;
  cursor: pointer; transition: all .15s ease; border: 1px solid transparent;
  font-family: inherit; text-decoration: none;
}
.cart-btn-primary {
  background: linear-gradient(135deg, #a31621, #930205); color: #fff;
  box-shadow: 0 3px 12px rgba(147, 2, 5, 0.25);
}
.cart-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(147, 2, 5, 0.32); }
.cart-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.cart-btn-ghost {
  background: none; color: var(--hp-red, #930205);
  border-color: rgba(147, 2, 5, 0.35);
}
.cart-btn-ghost:hover { background: rgba(147, 2, 5, 0.05); }
.cart-checkout-btn { width: 100%; margin-top: 14px; }

/* ── Empty + success states ──────────────────────────────────────────── */
.cart-empty {
  grid-column: 1 / -1; text-align: center; padding: 64px 20px 40px; max-width: 560px;
  margin: 0 auto;
}
.cart-empty-ico {
  width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(147, 2, 5, 0.07), rgba(212, 175, 55, 0.1));
  border: 1px solid rgba(147, 2, 5, 0.12); color: var(--hp-red, #930205);
}
.cart-empty-title { font-size: 1.35rem; font-weight: 800; color: var(--hp-ink, #291814); margin: 0 0 8px; letter-spacing: -0.02em; }
.cart-empty-sub { font-size: 0.92rem; color: var(--hp-ink, #291814); opacity: 0.6; line-height: 1.6; margin: 0 0 24px; }
.cart-empty-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cart-success .cart-empty-ico { background: linear-gradient(135deg, rgba(16, 137, 62, 0.08), rgba(212, 175, 55, 0.1)); border-color: rgba(16, 137, 62, 0.2); font-size: 2rem; }

/* ── Skeletons (§34) ──────────────────────────────────────────────────── */
.cart-skel {
  display: flex; gap: 14px; background: var(--hp-paper, #fff);
  border: 1px solid rgba(28, 27, 26, 0.07); border-radius: 14px; padding: 14px;
}
.cart-skel-img { flex: 0 0 64px; width: 64px; height: 82px; border-radius: 8px; background: rgba(28, 27, 26, 0.06); }
.cart-skel-line { height: 12px; border-radius: 6px; background: rgba(28, 27, 26, 0.06); margin-bottom: 9px; }
.cart-skel-line:last-child { margin-bottom: 0; }

.cart-error-box {
  grid-column: 1 / -1; text-align: center; padding: 56px 20px;
  font-size: 0.95rem; font-weight: 600; color: var(--hp-ink, #291814);
}

/* ── PDP add-to-cart button ───────────────────────────────────────────── */
.pdp-cart-secondary {
  width: 100%; margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 10px; font-size: 0.92rem; font-weight: 700;
  cursor: pointer; background: var(--hp-paper, #fff);
  border: 1.5px solid rgba(147, 2, 5, 0.4); color: var(--hp-red, #930205);
  transition: all .15s ease; font-family: inherit;
}
.pdp-cart-secondary:hover { background: rgba(147, 2, 5, 0.05); }
.pdp-cart-added {
  background: rgba(16, 137, 62, 0.08); border-color: rgba(16, 137, 62, 0.45); color: #0d5c30;
}

/* ── Mobile refinements (§32: 360–430px, no overflow, no clipped CTAs) ── */
@media (max-width: 560px) {
  .cart-wrap { padding: 18px 14px 10px; gap: 18px; }
  .cart-h1 { font-size: 1.4rem; }
  .cart-item { padding: 12px; gap: 11px; border-radius: 12px; }
  .cart-item-img { flex-basis: 52px; width: 52px; height: 70px; }
  .cart-item-title { font-size: 0.9rem; }
  .cart-item-price { min-width: 60px; }
  .cart-price-now { font-size: 0.95rem; }
  .cart-summary-card { padding: 16px; }
  .cart-checkout-btn { width: 100%; }
  .cart-empty { padding: 48px 12px 32px; }
  .cart-empty-ctas { flex-direction: column; align-items: stretch; }
}
