/* Cart page (ported from src/pages/cos.astro). Root: .cart-page, rendered by woocommerce/cart/cart.php
   inside page.php's wrapper; the cart draws its own title and spacing. */

.cart-page { padding: calc(var(--header-h) + clamp(28px, 6vw, 64px)) 0 clamp(64px, 10vw, 120px); color: var(--cream); }
.cart-page__layout { display: grid; gap: 32px; margin-top: clamp(24px, 4vw, 48px); align-items: start; }
@media (min-width: 980px) { .cart-page__layout { grid-template-columns: 1fr 420px; gap: 48px; } }
.cart-page.is-busy .cart-page__layout { opacity: 0.6; pointer-events: none; transition: opacity 0.2s; }

/* WooCommerce notices (cart updated, removed + undo, coupon messages) in the brand's voice */
.cart-page .woocommerce-notices-wrapper:empty { display: none; }
.cart-page .woocommerce-message,
.cart-page .woocommerce-info,
.cart-page .woocommerce-error {
  margin: clamp(16px, 3vw, 24px) 0 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: rgb(253 248 242 / 0.1);
  color: var(--cream);
  list-style: none;
  font-size: 0.95rem;
}
.cart-page .woocommerce-message::before,
.cart-page .woocommerce-info::before,
.cart-page .woocommerce-error::before { display: none; }
.cart-page .woocommerce-error { background: rgb(179 18 26 / 0.35); }
.cart-page .woocommerce-message a,
.cart-page .woocommerce-info a { color: var(--cream); font-weight: 700; margin-left: 6px; }

.cart-page__list { display: grid; gap: 10px; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  grid-template-areas: "media info remove" "media qty line";
  align-items: center;
  gap: 6px 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgb(4 12 39 / 0.45);
  border: 1px solid rgb(253 248 242 / 0.08);
  animation: cart-in 0.4s var(--ease-out);
}
@keyframes cart-in { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 640px) {
  .cart-item { grid-template-columns: 76px 1fr auto auto auto; grid-template-areas: "media info qty line remove"; }
}
.cart-item__media { grid-area: media; position: relative; width: 64px; height: 64px; border-radius: 14px; background: #fff; overflow: hidden; }
.cart-item__media img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.cart-item__info { grid-area: info; min-width: 0; display: grid; gap: 2px; }
.cart-item__name { font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.cart-item__name a { text-decoration: none; }
@media (hover: hover) { .cart-item__name a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.cart-item__detail { color: var(--muted); font-size: 0.88rem; }
.cart-item__edit { font-size: 0.85rem; font-weight: 700; width: fit-content; }
.cart-item__info .backorder_notification { font-size: 0.82rem; color: var(--muted); }
.cart-item__qty { grid-area: qty; justify-self: start; }
.cart-item__qty--one { color: var(--muted); font-size: 0.9rem; }
.cart-item__val {
  width: 2.6em;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.cart-item__val::-webkit-outer-spin-button,
.cart-item__val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item__val:focus-visible { outline: 2px solid var(--cream); outline-offset: -2px; border-radius: 8px; }
.cart-item__line { grid-area: line; justify-self: end; font-size: 1.1rem; min-width: 5ch; text-align: right; }
.cart-item__remove {
  grid-area: remove;
  justify-self: end;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
}
.cart-item__remove:hover { background: rgb(253 248 242 / 0.1); color: var(--cream); }

.cart-page__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 14px; }
.cart-page__update,
.cart-page__clear { border: 0; background: none; padding: 6px 0; color: var(--muted); text-decoration: underline; font-size: 0.95rem; }
html.js .cart-page__update { display: none; }
.cart-page__coupon { flex-basis: 100%; color: var(--muted); }
.cart-page__coupon summary { width: fit-content; cursor: pointer; padding: 6px 0; text-decoration: underline; }
.cart-page__coupon-row { display: flex; gap: 10px; margin-top: 8px; max-width: 420px; }
.cart-page__coupon-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid rgb(253 248 242 / 0.25);
  border-radius: 12px;
  background: rgb(4 12 39 / 0.35);
  color: var(--cream);
}
.cart-page__coupon-row input:focus { outline: none; border-color: var(--cream); }

.cart-page__summary {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: grid;
  gap: 16px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: 24px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 30px 60px rgb(4 12 39 / 0.4);
}
.cart-page__summary :focus-visible { outline-color: var(--blue-700); }
.cart-page__summary .eyebrow { color: rgb(11 29 79 / 0.6); }
.cart-page__totals { margin: 0; display: grid; gap: 8px; }
.cart-page__totals div { display: flex; justify-content: space-between; gap: 12px; }
.cart-page__totals dt { color: rgb(11 29 79 / 0.7); }
.cart-page__totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-page__promo dt { color: var(--red-600); font-weight: 600; }
.cart-page__promo dd { color: var(--red-600); font-weight: 800; }
.cart-page__coupon-remove { margin-left: 4px; color: var(--red-600); text-decoration: none; font-weight: 800; }
.cart-page__grand { margin-top: 4px; padding-top: 12px; border-top: 1.5px dashed rgb(11 29 79 / 0.2); align-items: baseline; }
.cart-page__grand dt { color: var(--ink); font-weight: 800; }
.cart-page__grand dd { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.cart-page__hint { font-size: 0.85rem; color: var(--blue-700); font-weight: 600; }
.cart-page__gift { font-size: 0.88rem; padding: 10px 12px; border-radius: 12px; background: rgb(1 42 130 / 0.08); }
.cart-page__checkout { width: 100%; }
.cart-page__fine { color: rgb(11 29 79 / 0.65); }

.cart-page__empty { display: grid; justify-items: start; gap: 12px; padding: 24px 0; margin-top: clamp(24px, 4vw, 48px); }
.cart-page__empty img { width: 200px; animation: cart-spin 30s linear infinite; }
@keyframes cart-spin { to { rotate: 360deg; } }
.cart-page__empty-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 8px; }
.cart-page__muted { color: var(--muted); }
