.cart-page {
  padding-top: 32px;
  padding-bottom: 3rem;
}

.cart-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.cart-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  color: #9ca3af;
}

.cart-breadcrumb a {
  color: #6b7280;
  text-decoration: none;
}

.cart-breadcrumb a:hover {
  color: var(--color-primary);
}

.cart-breadcrumb span[aria-current] {
  color: #374151;
}

.cart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.cart-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

.cart-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  gap: 1.5rem;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto auto auto;
  gap: 1rem 1.25rem;
  align-items: center;
  padding: 1.125rem;
  background: #fff;
  border: 1px solid #ececec;
}

.cart-item-media {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  background: #f3f4f6;
  border: 1px solid #ececec;
  overflow: hidden;
}

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

.cart-item-name {
  margin: 0 0 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.cart-item-name a {
  color: #1f2937;
  text-decoration: none;
}

.cart-item-name a:hover {
  color: var(--color-primary);
}

.cart-item-options {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #6b7280;
}

.cart-item-design {
  padding: 0;
  border: none;
  background: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cart-item-qty-label,
.cart-item-price-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
}

.cart-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.cart-qty-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: #f9fafb;
  font-size: 1rem;
  line-height: 1;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cart-qty-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.cart-qty-input {
  width: 2.5rem;
  height: 2rem;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  color: #111827;
  -moz-appearance: textfield;
}

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

.cart-item-price {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}

.cart-item-remove {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #ececec;
  background: #fff;
  color: #9ca3af;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.cart-item-remove:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.cart-summary-box {
  position: sticky;
  top: calc(10.5rem + 1.5rem);
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #ececec;
}

.cart-summary-title {
  margin: 0 0 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid #ececec;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.cart-coupon {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ececec;
}

.cart-coupon-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
}

.cart-coupon-row {
  display: flex;
  gap: 0.5rem;
}

.cart-coupon-input {
  flex: 1;
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 0.8125rem;
  color: #111827;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cart-coupon-input::placeholder {
  color: #9ca3af;
}

.cart-coupon-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.cart-coupon-btn {
  flex-shrink: 0;
  min-width: 5rem;
  height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid var(--color-primary);
  background: var(--color-primary-light);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cart-coupon-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.cart-coupon-message {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
}

.cart-coupon-message.is-success {
  color: #059669;
}

.cart-coupon-message.is-error {
  color: #dc2626;
}

.cart-summary-lines {
  margin: 0 0 1rem;
}

.cart-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.625rem;
}

.cart-summary-line dt,
.cart-summary-line dd {
  margin: 0;
  font-size: 0.875rem;
  color: #4b5563;
}

.cart-summary-free {
  color: #059669;
  font-weight: 600;
}

.cart-summary-discount {
  color: #dc2626;
  font-weight: 600;
}

.cart-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid #ececec;
}

.cart-summary-total span {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.cart-summary-total strong {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827;
}

.cart-summary-note {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #9ca3af;
}

.cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6875rem 1.125rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cart-btn + .cart-btn {
  margin-top: 0.625rem;
}

.cart-btn--primary {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.cart-btn--primary:hover {
  border-color: var(--color-primary-dark);
  background: var(--color-primary-dark);
}

.cart-btn--ghost {
  border-color: #d1d5db;
  background: #fff;
  color: #374151;
}

.cart-btn--ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

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

  .cart-summary-box {
    position: static;
  }
}

@media (max-width: 768px) {
  .cart-page {
    padding-top: 24px;
  }

  .cart-inner {
    padding: 0 1rem;
  }

  .cart-item {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    grid-template-areas:
      "media body"
      "media qty"
      "price price"
      "remove remove";
    gap: 0.875rem 1rem;
  }

  .cart-item-media {
    grid-area: media;
    width: 5.5rem;
    height: 5.5rem;
  }

  .cart-item-body {
    grid-area: body;
  }

  .cart-item-qty {
    grid-area: qty;
  }

  .cart-item-price-wrap {
    grid-area: price;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
    border-top: 1px solid #f3f4f6;
  }

  .cart-item-remove {
    grid-area: remove;
    width: 100%;
    height: 2.5rem;
  }
}
