/* ── Tokens ───────────────────────────────────────────── */
:root {
  --accent: #1a1a1a;
  --accent-light: #f5f5f3;
  --surface: #ffffff;
  --bg: #f8f7f5;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #1a1a1a;
  --text-muted: #666;
  --text-faint: #999;
  --red: #c0392b;
  --green: #27ae60;
  --amber: #b8730a;
  --amber-bg: #fff8ec;
  --amber-border: #e8c46a;
  --deal-bg: #edfaf4;
  --deal-border: #6ecf9d;
  --deal-text: #1a7a4a;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: 0.18s ease;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.09);
}

/* ── Page wrapper ────────────────────────────────────── */
.cart-page {
  font-family: var(--font-body);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Breadcrumb ──────────────────────────────────────── */
.cart-breadcrumb {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-family: var(--font-body);
}

.cart-breadcrumb a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--transition);
}

.cart-breadcrumb a:hover {
  color: var(--text);
}

.cart-breadcrumb svg {
  width: 11px;
  height: 11px;
  opacity: 0.4;
}

/* ── Main container ──────────────────────────────────── */
.cart-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── Page heading ────────────────────────────────────── */
.cart-heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.cart-heading span {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-faint);
  margin-left: 10px;
}

/* ── Greeting Cards deal banner ──────────────────────── */
.deal-banner {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--amber-border);
  background: var(--amber-bg);
}

.deal-banner.deal-active {
  background: var(--deal-bg);
  border-color: var(--deal-border);
}

.deal-banner-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.deal-banner-text {
  flex: 1;
  min-width: 0;
}

.deal-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 2px;
}

.deal-banner.deal-active .deal-banner-title {
  color: var(--deal-text);
}

.deal-banner-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Progress pips */
.deal-pips {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.deal-pip {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background var(--transition);
}

.deal-pip.pip-filled {
  background: #e8a020;
}

.deal-pip.pip-active {
  background: var(--green);
}

/* ── Cart items list ─────────────────────────────────── */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

/* ── Single cart row ─────────────────────────────────── */
.cart-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  align-items: start;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.cart-row:hover {
  box-shadow: var(--shadow-md);
}

/* ── Product image ───────────────────────────────────── */
.cart-row-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--accent-light);
  flex-shrink: 0;
}

.cart-row-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Row body ────────────────────────────────────────── */
.cart-row-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cart-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cart-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  text-decoration: none;
}

.cart-row-name:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cart-row-subtotal {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Size & unit price row */
.cart-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-row-size {
  font-size: 12px;
  font-weight: 500;
  background: var(--accent-light);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 2px 9px;
  color: var(--text-muted);
}

.cart-row-unit-price {
  font-size: 12.5px;
  color: var(--text-faint);
}

.price-was {
  text-decoration: line-through;
  color: var(--text-faint);
  margin-right: 2px;
}

.discount-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--deal-bg);
  border: 1px solid var(--deal-border);
  color: var(--deal-text);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── Qty + remove controls ───────────────────────────── */
.cart-row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.qty-group {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition),
    color var(--transition);
  line-height: 1;
}

.qty-btn:hover {
  background: var(--accent-light);
  color: var(--text);
}

.qty-value {
  width: 36px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0;
  line-height: 32px;
  background: none;
}

.btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-faint);
  padding: 6px 0;
  transition: color var(--transition);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-remove:hover {
  color: var(--red);
}

/* ── Summary card ────────────────────────────────────── */
.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.cart-summary-row:last-of-type {
  border-bottom: none;
}

.cart-summary-discount {
  color: var(--deal-text);
  font-weight: 500;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 4px;
  border-top: 2px solid var(--accent);
}

.cart-summary-total .label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.cart-summary-total .amount {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

/* ── Action buttons ──────────────────────────────────── */
.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    opacity var(--transition),
    transform var(--transition);
}

.btn-checkout:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-checkout svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  background: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-continue:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-light);
}

.btn-continue svg {
  width: 14px;
  height: 14px;
}

/* ── Empty state ─────────────────────────────────────── */
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.cart-empty svg {
  width: 52px;
  height: 52px;
  opacity: 0.15;
  margin-bottom: 18px;
}

.cart-empty h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}

.cart-empty p {
  font-size: 14px;
  margin-bottom: 24px;
}

.cart-empty a {
  display: inline-block;
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--transition);
}

.cart-empty a:hover {
  opacity: 0.85;
}

/* ── Tablet: side-by-side layout ─────────────────────── */
@media (min-width: 640px) {
  .cart-row {
    grid-template-columns: 96px 1fr;
  }

  .cart-row-img {
    width: 96px;
    height: 96px;
  }

  .cart-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
  }

  .cart-summary {
    position: sticky;
    top: 20px;
  }

  .cart-actions {
    margin-top: 16px;
  }
}

/* ── Desktop refinements ─────────────────────────────── */
@media (min-width: 860px) {
  .cart-container {
    padding: 28px 24px 80px;
  }

  .cart-row-img {
    width: 104px;
    height: 104px;
  }

  .cart-layout {
    grid-template-columns: 1fr 320px;
    gap: 32px;
  }
}
