/* КнигДекор — корзина v2. Мягкий commerce-паттерн поверх общей дизайн-системы. */
.cart-page {
  --cart-surface: #ffffff;
  --cart-wash: #f3f2ee;
  --cart-rose: #f4e8e9;
  --cart-ink: #1d211e;
  --cart-muted: #70736d;
  --cart-line: #dedfd9;
  --cart-accent: #7b2835;
  background: var(--cart-wash);
  color: var(--cart-ink);
}

.cart-page main { min-height: 62vh; }
.cart-page .cart-page__container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.cart-page__hero { padding: 42px 0 28px; }
.cart-page__eyebrow {
  margin: 0 0 8px;
  color: var(--cart-accent);
  font: 700 12px/1.2 var(--f-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cart-page__title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.cart-page__title-row h1 {
  margin: 0;
  font-family: var(--f-sans);
  font-size: clamp(2.55rem, 5vw, 4.75rem);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: .98;
}
.cart-page__title-row p { max-width: 42ch; margin: 0; color: var(--cart-muted); font-size: 15px; line-height: 1.55; }
.cart-page__body { padding: 0 0 88px; }

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 28px; align-items: start; }
.cart-products { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.cart-product {
  display: grid;
  grid-template-columns: 166px minmax(0, 1fr);
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(29, 33, 30, .075);
  border-radius: 26px;
  background: var(--cart-surface);
  box-shadow: 0 14px 38px rgba(31, 32, 29, .045);
}
.cart-product__media { display: block; min-height: 100%; overflow: hidden; background: #ece8de; }
.cart-product__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-product--art .cart-product__media img { object-fit: contain; }
.cart-product__content { display: flex; min-width: 0; flex-direction: column; padding: 20px; }
.cart-product__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.cart-product__type { margin: 0 0 6px; color: var(--cart-accent); font-size: 11px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.cart-product__title { color: var(--cart-ink); font-size: clamp(20px, 2.1vw, 28px); font-weight: 650; letter-spacing: -.035em; line-height: 1.08; text-decoration: none; }
.cart-product__title:hover { color: var(--cart-accent); }
.cart-product__remove {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #858781;
  cursor: pointer;
}
.cart-product__remove svg { width: 20px; height: 20px; }
.cart-product__remove:hover { background: #f2f1ed; color: var(--cart-accent); }
.cart-product__remove:focus-visible,
.cart-quantity button:focus-visible,
.cart-gift:has(input:focus-visible),
.cart-delivery__option:has(input:focus-visible) { outline: 3px solid rgba(123, 40, 53, .22); outline-offset: 2px; }

.cart-product__commerce { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: auto; padding-top: 18px; }
.cart-quantity { display: inline-grid; grid-template-columns: 42px 36px 42px; align-items: center; overflow: hidden; border: 1px solid var(--cart-line); border-radius: 999px; background: #fafaf8; }
.cart-quantity button { width: 42px; height: 42px; background: transparent; color: var(--cart-ink); font-size: 20px; cursor: pointer; }
.cart-quantity button:hover { background: #efeee9; }
.cart-quantity span { text-align: center; font-size: 15px; font-weight: 700; }
.cart-product__price { display: flex; align-items: flex-end; flex-direction: column; gap: 2px; }
.cart-product__price strong { font-size: 20px; line-height: 1.1; white-space: nowrap; }
.cart-product__price small { color: var(--cart-muted); font-size: 11px; }
.cart-product:has(.cart-gift) { grid-template-rows: auto auto; }
.cart-product:has(.cart-gift) .cart-product__media { grid-row: 1 / -1; }

.cart-gift {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  grid-column: 2;
  margin: 0 20px 18px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--cart-line);
  border-radius: 16px;
  background: #faf9f7;
  cursor: pointer;
}
.cart-gift:hover { border-color: rgba(123, 40, 53, .35); }
.cart-gift.is-selected { border-color: var(--cart-accent); background: var(--cart-rose); }
.cart-gift input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cart-gift__check { display: grid; width: 34px; height: 34px; place-items: center; border: 1.5px solid #9a9c97; border-radius: 11px; background: #fff; color: transparent; font-size: 17px; font-weight: 800; }
.cart-gift.is-selected .cart-gift__check { border-color: var(--cart-accent); background: var(--cart-accent); color: #fff; }
.cart-gift__copy { display: flex; min-width: 0; flex-direction: column; }
.cart-gift__copy b { font-size: 13px; line-height: 1.25; }
.cart-gift__copy small { margin-top: 2px; color: var(--cart-muted); font-size: 11px; line-height: 1.25; }
.cart-gift > strong { color: var(--cart-accent); font-size: 13px; white-space: nowrap; }

.cart-order {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid rgba(123, 40, 53, .08);
  border-radius: 28px;
  background: var(--cart-rose);
  box-shadow: 0 20px 50px rgba(60, 29, 33, .07);
}
.cart-order__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.cart-order__head h2 { margin: 0; font-family: var(--f-sans); font-size: 25px; font-weight: 650; letter-spacing: -.035em; }
.cart-order__head span { color: var(--cart-muted); font-size: 12px; }
.cart-order__rows { display: grid; gap: 8px; margin-top: 22px; padding-bottom: 18px; border-bottom: 1px solid rgba(123, 40, 53, .13); }
.cart-order__rows > div { display: flex; justify-content: space-between; gap: 16px; color: var(--cart-muted); font-size: 13px; }
.cart-order__rows strong { color: var(--cart-ink); font-weight: 600; }

.cart-order__delivery-next { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 18px; padding-bottom: 18px; border-bottom: 1px solid rgba(123, 40, 53, .13); }
.cart-order__delivery-next span { color: var(--cart-muted); font-size: 13px; }
.cart-order__delivery-next strong { max-width: 20ch; color: var(--cart-accent); font-size: 12px; font-weight: 650; text-align: right; }

.cart-order__total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 20px 0 18px; }
.cart-order__total span { max-width: 14ch; font-size: 15px; font-weight: 650; }
.cart-order__total strong { color: var(--cart-ink); font-size: 28px; font-weight: 700; letter-spacing: -.04em; }
.cart-primary-action,
.cart-secondary-action { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; padding: 0 22px; border-radius: 999px; font-size: 14px; font-weight: 650; text-align: center; text-decoration: none; }
.cart-primary-action { background: var(--cart-accent); color: #fff; box-shadow: 0 10px 24px rgba(123, 40, 53, .15); }
.cart-primary-action:hover { background: #68212d; color: #fff; transform: translateY(-1px); }
.cart-secondary-action { border: 1px solid var(--cart-line); background: #fff; color: var(--cart-ink); }
.cart-secondary-action:hover { border-color: var(--cart-accent); color: var(--cart-accent); }
.cart-order__continue { align-self: center; margin-top: 13px; color: var(--cart-accent); font-size: 12px; font-weight: 600; text-underline-offset: 3px; }
.cart-order__assurances { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; color: #3f684a; font-size: 11px; font-weight: 650; }

.cart-empty-v2 { display: flex; min-height: 480px; align-items: center; flex-direction: column; justify-content: center; padding: 54px 24px; overflow: hidden; border-radius: 32px; background: linear-gradient(145deg, #f3e7e8 0%, #faf7ef 72%); text-align: center; }
.cart-empty-v2__visual { display: flex; height: 112px; align-items: flex-end; gap: 6px; margin-bottom: 28px; }
.cart-empty-v2__visual span { display: block; width: 34px; border-radius: 8px 8px 4px 4px; box-shadow: 0 12px 22px rgba(47, 35, 29, .09); transform: rotate(var(--tilt, 0deg)); transform-origin: bottom; }
.cart-empty-v2__visual span:nth-child(1) { height: 85px; --tilt: -6deg; background: #d5cab5; }
.cart-empty-v2__visual span:nth-child(2) { height: 105px; background: #8e9d87; }
.cart-empty-v2__visual span:nth-child(3) { height: 92px; --tilt: 3deg; background: #7b2835; }
.cart-empty-v2__visual span:nth-child(4) { height: 76px; --tilt: 8deg; background: #d4a657; }
.cart-empty-v2__eyebrow { margin: 0 0 8px; color: var(--cart-accent); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.cart-empty-v2 h2 { margin: 0; font-family: var(--f-sans); font-size: clamp(32px, 5vw, 54px); font-weight: 650; letter-spacing: -.05em; }
.cart-empty-v2 > p:not(.cart-empty-v2__eyebrow) { max-width: 43ch; margin: 14px 0 0; color: var(--cart-muted); font-size: 15px; line-height: 1.55; }
.cart-empty-v2__actions { display: flex; gap: 10px; margin-top: 28px; }
@media (max-width: 900px) {
  .cart-page .cart-page__container { width: min(100% - 28px, 720px); }
  .cart-page__hero { padding: 30px 0 22px; }
  .cart-page__title-row { display: block; }
  .cart-page__title-row h1 { font-size: clamp(2.5rem, 11vw, 4.1rem); }
  .cart-page__title-row p { margin-top: 10px; }
  .cart-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cart-order { position: static; top: auto; }
}

@media (max-width: 580px) {
  .cart-page .cart-page__container { width: min(100% - 24px, 520px); }
  .cart-page__hero { padding-top: 24px; }
  .cart-page__eyebrow { font-size: 10px; }
  .cart-page__title-row p { font-size: 13px; }
  .cart-page__body { padding-bottom: 54px; }
  .cart-product { grid-template-columns: 112px minmax(0, 1fr); min-height: 168px; border-radius: 22px; }
  .cart-product__content { padding: 14px; }
  .cart-product__head { gap: 8px; }
  .cart-product__type { margin-bottom: 4px; font-size: 9px; }
  .cart-product__title { display: -webkit-box; overflow: hidden; font-size: 18px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .cart-product__remove { width: 42px; height: 42px; flex-basis: 42px; margin: -6px -6px 0 0; }
  .cart-product__commerce { gap: 8px; padding-top: 12px; }
  .cart-quantity { grid-template-columns: 38px 28px 38px; }
  .cart-quantity button { width: 38px; height: 40px; }
  .cart-product__price strong { font-size: 17px; }
  .cart-product__price small { font-size: 9px; }
  .cart-gift { grid-column: 1 / -1; min-height: 58px; margin: 0 14px 14px; }
  .cart-product:has(.cart-gift) .cart-product__media { grid-row: 1; }
  .cart-order { padding: 20px; border-radius: 24px; }
  .cart-order__head h2 { font-size: 23px; }
  .cart-order__assurances { flex-wrap: wrap; }
  .cart-empty-v2 { min-height: 440px; padding: 42px 18px; border-radius: 26px; }
  .cart-empty-v2__actions { width: 100%; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-primary-action { transition: none; }
}
