/* Cart page */

.cart-main {
  background: var(--color-surface);
  min-height: 60vh;
  padding-bottom: 5rem;
}

/* Two-column layout */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
  padding-top: 3rem;
}

/* ── Left: Items ── */
.cart-items-section {
  min-width: 0;
}

.cart-header-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.cart-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cart-item-count {
  font-size: 0.82rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* Cart item row */
.cart-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: box-shadow var(--transition);
}

.cart-item:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.cart-item-media {
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface);
  flex-shrink: 0;
}

.cart-item-media img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  display: block;
}

/* Individual set images (Info shots) — contain so they aren't cropped */
.cart-item.is-set .cart-item-media {
  background: #f0f0f0;
}
.cart-item.is-set .cart-item-media img {
  object-fit: contain;
  padding: 6px;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cart-item-theme {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}

.cart-item-name {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.cart-item-meta {
  margin: 0 0 auto;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Qty control */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  height: 36px;
}

.qty-btn {
  width: 36px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-black);
  background: var(--color-white);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--color-surface);
}

.qty-input {
  width: 42px;
  height: 100%;
  text-align: center;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  font: 600 0.88rem var(--font);
  color: var(--color-black);
  background: var(--color-white);
  -moz-appearance: textfield;
  outline: none;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  appearance: none;
}

.cart-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.cart-remove-btn:hover {
  color: #cc0000;
}

/* Item price */
.cart-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 0.2rem;
  gap: 0.3rem;
  min-width: 90px;
}

.cart-item-total {
  font-size: 1rem;
  font-weight: 700;
}

.cart-item-unit {
  font-size: 0.72rem;
  color: var(--color-muted);
}

/* Empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  color: var(--color-muted);
  gap: 0.75rem;
}

.cart-empty-title {
  margin: 0.5rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-black);
}

.cart-empty-sub {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

/* Continue shopping link */
.continue-shopping {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  transition: color var(--transition);
}

.continue-shopping:hover {
  color: var(--color-black);
}

/* Fade out animation */
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ── Right: Summary ── */
.cart-summary {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  position: sticky;
  top: calc(96px + 1.5rem);
}

.summary-title {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.summary-lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.summary-line span:last-child {
  font-weight: 600;
  color: var(--color-black);
}

.summary-free {
  color: var(--color-save) !important;
  font-weight: 700 !important;
}

.summary-discount {
  color: var(--color-save) !important;
}

/* Promo code */
.promo-row {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.promo-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.promo-input-group {
  display: flex;
  gap: 0.5rem;
}

.promo-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font: 0.85rem var(--font);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  outline: none;
  transition: border-color var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.promo-input:focus {
  border-color: var(--color-black);
}

.promo-input:disabled {
  background: var(--color-surface);
  color: var(--color-muted);
}

.promo-apply-btn {
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.promo-apply-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.promo-message {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
}

.promo-success { color: var(--color-save); }
.promo-error   { color: #cc0000; }
.promo-info {
  color: #0d5c3d;
  font-weight: 500;
  line-height: 1.45;
}

/* Total row */
.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.summary-total-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.summary-total-value {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.summary-tax-note {
  margin: 0 0 1.5rem;
  font-size: 0.72rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.checkout-btn {
  padding: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

/* Trust row */
.summary-trust {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-align: center;
}

/* ── Upsell ── */
.cart-upsell {
  padding: 3rem 0 0;
  background: var(--color-surface);
}

.cart-upsell .upsell-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* Responsive */
@media (max-width: 960px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  .cart-upsell .upsell-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cart-item {
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
  }

  .cart-item-media img {
    width: 80px;
    height: 80px;
  }

  .cart-item-price {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .cart-upsell .upsell-grid {
    grid-template-columns: 1fr;
  }

  /* Reward code: stacked layout + tap-friendly sizing */
  .promo-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .promo-input {
    flex: none;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 0.9rem;
    font-size: 1rem; /* avoids iOS zoom on focus */
  }

  .promo-apply-btn {
    width: 100%;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
  }
}
