/* Full cart page: steps, line items, summary. Loaded after store.css on checkout pages. */
.cart-steps {
  display: flex;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.cart-steps[hidden] {
  display: none;
}

.cart-steps__item {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
  color: var(--color-text-muted);
  font-weight: 600;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.cart-steps__number {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-strong);
  color: var(--color-text);
  font-size: 0.85rem;
  transition: background var(--transition), color var(--transition);
}

.cart-steps__item.is-current {
  border-color: var(--color-primary);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.cart-steps__item.is-current .cart-steps__number {
  background: var(--color-primary);
  color: var(--color-white);
}

.cart-steps__item.is-done .cart-steps__number {
  background: var(--color-success);
  color: var(--color-white);
}

.cart-steps__item.is-done .cart-steps__number::before {
  content: "\2713";
}

.cart-steps__item.is-done .cart-steps__number {
  font-size: 0;
}

.cart-steps__item.is-done .cart-steps__number::before {
  font-size: 0.9rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line.is-gone {
  opacity: 0.75;
}

.cart-line__image {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.cart-line__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-line__image .product-placeholder {
  width: 100%;
  height: 100%;
  font-size: 0.65rem;
}

.cart-line__body {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.cart-line__body h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
}

.cart-line__body h3 a {
  color: inherit;
  text-decoration: none;
}

.cart-line__body h3 a:hover {
  text-decoration: underline;
}

.cart-line__body p {
  margin: 0;
}

.cart-line__unit {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.cart-line__unit--muted {
  font-weight: 600;
}

.cart-line__notice {
  margin-top: 6px;
  padding: 8px 12px;
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-sm);
  background: #fff7e8;
  color: var(--color-text);
  font-size: 0.88rem;
}

.cart-line__notice--error {
  border-left-color: var(--color-danger);
  background: #fdecea;
}

.cart-line__note {
  margin-top: 8px;
  font-size: 0.88rem;
}

.cart-line__note summary {
  width: fit-content;
  color: var(--color-text-muted);
  cursor: pointer;
}

.cart-line__note summary:hover,
.cart-line__note summary:focus-visible {
  color: var(--color-primary);
}

.cart-line__note textarea {
  width: 100%;
  margin-top: 6px;
  min-height: 56px;
}

.cart-line__side {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 10px;
}

.cart-stepper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-background);
}

.cart-stepper button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--transition);
}

.cart-stepper button:hover:not(:disabled),
.cart-stepper button:focus-visible {
  background: var(--color-surface);
}

.cart-stepper button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.cart-stepper input {
  width: 54px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.cart-stepper input::-webkit-outer-spin-button,
.cart-stepper input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.cart-line__subtotal {
  display: grid;
  justify-items: end;
  margin: 0;
  font-size: 1.05rem;
}

.cart-line__subtotal span {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.cart-line__remove {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  text-decoration: underline;
  cursor: pointer;
}

.cart-line__remove:hover,
.cart-line__remove:focus-visible {
  color: var(--color-danger);
}

.cart-undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-graphite);
  color: var(--color-white);
}

.cart-undo[hidden] {
  display: none;
}

.cart-undo button {
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--color-white);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.checkout-block-reason {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-sm);
  background: #fff7e8;
  font-size: 0.9rem;
}

.checkout-block-reason[hidden] {
  display: none;
}

.checkout-auth-gate {
  margin-bottom: 0;
}

.checkout-card[hidden] {
  display: none;
}

@media (min-width: 981px) {
  .checkout-summary {
    position: sticky;
    top: calc(var(--public-header-height, 140px) + 16px);
    align-self: start;
  }
}

@media (max-width: 720px) {
  .cart-steps__item span:last-child {
    font-size: 0.82rem;
  }

  .cart-steps__item {
    flex-direction: column;
    gap: 6px;
    padding: 10px 6px;
    text-align: center;
  }

  .cart-line {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .cart-line__image {
    width: 72px;
    height: 72px;
  }

  .cart-line__side {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .cart-line__subtotal {
    justify-items: start;
  }

  .cart-line__remove {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cart-steps__item,
  .cart-steps__number,
  .cart-stepper button {
    transition: none;
  }
}

.store-page-header {
  padding: 26px 0 22px;
}

.store-page-header h1 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
}

.store-page-header .lede {
  margin: 0;
  font-size: 1rem;
}

.store-page-header + .section {
  padding-top: 26px;
}
