/* Cart page: checkout steps, cart items, order summary with coupon box, recommendations.
   Shared pieces (breadcrumb, buttons, qty, carousel, product card) live in components.css. */
.page-main--cart { --section-gap: clamp(40px, 6.67vw, 96px); }

/* ---- checkout steps ---- */
.steps {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 696px);
  margin-inline: auto;
  padding: 24px;
}
.steps__step { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--c-text-muted); font-weight: 600; line-height: 22px; }
.steps__step:last-child { flex: none; }
.steps__step:not(:last-child)::after { content: ""; flex: 1; min-width: 16px; height: 2px; margin-left: 8px; background: var(--c-divider); }
.steps__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--c-surface);
}
.steps__step[aria-current="step"] .steps__icon, .steps__step--done .steps__icon { background: var(--c-green); color: #fff; }
.steps__step--done::after { background: var(--c-green); }
.steps__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* icons only below 768 */

/* ---- items | summary ---- */
.cart { display: grid; gap: 24px; align-items: start; }
.cart__items { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.cart__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.cart__title { flex: 1 0 100%; font-size: var(--fs-h3); line-height: 1.3125; letter-spacing: 1px; }
.cart__count { flex: 1; font-size: var(--fs-lg); font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.cart__clear { display: inline-flex; align-items: center; gap: 8px; color: var(--c-text-muted); white-space: nowrap; }
.cart__clear:hover { color: var(--c-text); }
.cart__list { display: flex; flex-direction: column; gap: 24px; }

/* one cart line: photo on top below 480 (user 10-05: the title, price and codes broke letter by letter beside a
   104px photo), photo left from 480. Also the checkout steps' lines. */
.cart-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-raised);
}
.cart-item__media { position: relative; aspect-ratio: 2 / 1; background: var(--c-surface-muted); }
.cart-item__media img { position: absolute; inset: 0; width: 100%; height: 100%; padding: clamp(8px, 1.4vw, 20px); object-fit: contain; }
.cart-item__media .tag { position: absolute; top: 18px; left: 18px; }
.cart-item__body { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: clamp(16px, 1.67vw, 24px); }
.cart-item__summary { display: flex; flex-direction: column; gap: 8px; }
.cart-item__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-item__remove { display: grid; place-items: center; width: 16px; height: 16px; color: var(--c-text-muted); }
.cart-item__remove:hover { color: var(--c-text); }
.cart-item__info { display: flex; flex-wrap: wrap; gap: 4px; }
.cart-item__text { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cart-item__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 24px;
}
.cart-item__title a:hover { color: var(--c-green); }
.cart-item__brand { font-size: var(--fs-sm); line-height: 16px; }
.cart-item__brand a { color: var(--c-green); }
.cart-item__bottom { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cart-item .attr-list { row-gap: 4px; }
.cart-item__bottom .qty { flex-basis: 100%; justify-content: center; } /* phones: its own row, centred (user 10-05) */

/* ---- order summary ---- */
.cart__aside { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.cart__aside-actions { display: flex; flex-direction: column; gap: 16px; }
.order-summary { display: flex; flex-direction: column; gap: 24px; padding: 24px; border-radius: var(--radius-md); }
.totals { display: flex; flex-direction: column; gap: 16px; }
.totals div { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.totals dt { color: var(--c-text-muted); }
.totals dd { margin: 0; font-weight: 600; line-height: 22px; text-align: right; }
.totals__grand dd { font-size: var(--fs-xl); line-height: 30px; }

.coupon { display: flex; flex-direction: column; gap: 8px; }
.coupon__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--c-surface-muted);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 20px;
  list-style: none;
  cursor: pointer;
}
.coupon__toggle::-webkit-details-marker { display: none; }
.coupon__toggle span { flex: 1; }
.coupon__toggle .icon { transition: rotate var(--ease); }
.coupon[open] .coupon__toggle .icon { rotate: 180deg; }
.coupon__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-sm);
  background: var(--c-surface-muted);
}
.coupon__field { display: flex; flex-direction: column; gap: 8px; }
.coupon__field label { font-size: var(--fs-md); font-weight: 600; line-height: 20px; }
.coupon .inline-form { gap: 24px; padding: 4px; border-radius: var(--radius-xs); background: var(--c-surface); }
.coupon input {
  flex: 1;
  min-width: 0;
  padding-inline: 8px;
  border: 0;
  background: none;
  font-size: var(--fs-md);
  line-height: 20px;
}
.coupon input::placeholder { color: var(--c-text-muted); opacity: 1; }

@media (min-width: 480px) {
  .cart-item { flex-direction: row; }
  .cart-item__media { flex: 0 0 clamp(104px, 16vw, 230px); aspect-ratio: auto; }
  .cart-item__bottom .qty { flex-basis: auto; justify-content: flex-start; margin-left: auto; } /* at the right also when the row wraps */
}
@media (min-width: 768px) {
  .steps__label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .cart__title { flex-basis: auto; flex-grow: 0; }
}
@media (min-width: 1024px) {
  .cart { grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 432px); }
}
