/* ============================================
   Block: cart-page — страница корзины
   ============================================ */

.b-cart-page {
  padding: 48px 0 72px;
  background: var(--bg, #F7F3EC);
  color: var(--text, #3B3437);
  font-family: 'Manrope', sans-serif;
}

.b-cart-page__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 500;
  margin: 0 0 36px;
}

.b-cart-page__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 40px;
  align-items: start;
}

/* --- Список товаров --- */

.b-cart-page__list {
  display: flex;
  flex-direction: column;
}

.b-cart-page__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto 32px;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line, #E4DCD2);
}

.b-cart-page__item:first-child {
  border-top: 1px solid var(--line, #E4DCD2);
}

.b-cart-page__item-photo {
  display: block;
  width: 96px;
  height: 128px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2, #F1EBE2);
}

.b-cart-page__item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.b-cart-page__item-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text, #3B3437);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 6px;
}

.b-cart-page__item-name:hover {
  color: var(--accent, #6E5A7E);
}

.b-cart-page__item-meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #8A7F7A);
  line-height: 1.5;
}

/* Количество */

.b-cart-page__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line, #E4DCD2);
  border-radius: 4px;
  background: var(--surface, #FDFBF7);
}

.b-cart-page__qty-btn {
  width: 34px;
  height: 38px;
  border: 0;
  background: transparent;
  font-size: 18px;
  color: var(--text, #3B3437);
  cursor: pointer;
  transition: color .2s;
}

.b-cart-page__qty-btn:hover {
  color: var(--accent, #6E5A7E);
}

.b-cart-page__qty-input {
  width: 36px;
  height: 38px;
  border: 0;
  border-left: 1px solid var(--line, #E4DCD2);
  border-right: 1px solid var(--line, #E4DCD2);
  text-align: center;
  font: inherit;
  font-size: 14px;
  color: var(--text, #3B3437);
  background: transparent;
}

.b-cart-page__qty-input:focus {
  outline: none;
}

.b-cart-page__item-price {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.b-cart-page__remove {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted, #8A7F7A);
  cursor: pointer;
  transition: color .2s, background .2s;
}

.b-cart-page__remove:hover {
  color: var(--accent, #6E5A7E);
  background: var(--lavender-soft, #E9E1EF);
}

/* --- Карточка «Ваш заказ» --- */

.b-cart-page__summary {
  background: var(--surface, #FDFBF7);
  border: 1px solid var(--line, #E4DCD2);
  border-radius: 16px;
  padding: 28px;
  position: sticky;
  top: 24px;
}

.b-cart-page__summary-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 20px;
}

.b-cart-page__promo {
  margin-bottom: 20px;
}

.b-cart-page__promo-label {
  display: block;
  font-size: 13px;
  color: var(--muted, #8A7F7A);
  margin-bottom: 8px;
}

.b-cart-page__promo-row {
  display: flex;
  gap: 8px;
}

.b-cart-page__promo-input {
  flex: 1;
  min-width: 0;
}

.b-cart-page__promo-btn {
  flex-shrink: 0;
  padding-inline: 14px; /* компактнее базовой .btn, чтобы плейсхолдер поля помещался */
}

.b-cart-page__totals {
  margin: 0 0 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line, #E4DCD2);
  border-bottom: 1px solid var(--line, #E4DCD2);
}

.b-cart-page__totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}

.b-cart-page__totals-row dt {
  color: var(--muted, #8A7F7A);
}

.b-cart-page__totals-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.b-cart-page__totals-row--discount dd {
  color: var(--accent, #6E5A7E);
}

.b-cart-page__totals-note {
  font-weight: 400 !important;
  font-size: 12px;
  color: var(--muted, #8A7F7A);
  max-width: 170px;
}

.b-cart-page__totals-row--grand {
  padding-top: 12px;
  font-size: 18px;
}

.b-cart-page__totals-row--grand dt {
  color: var(--text, #3B3437);
  font-weight: 600;
}

.b-cart-page__totals-row--grand dd {
  font-size: 22px;
}

.b-cart-page__checkout-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 14px;
}

.b-cart-page__continue {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--accent, #6E5A7E);
  text-decoration: none;
}

.b-cart-page__continue:hover {
  color: var(--accent-hover, #5C4B6B);
  text-decoration: underline;
}

/* --- Пустая корзина --- */

.b-cart-page__empty {
  display: none;
  text-align: center;
  padding: 64px 0;
}

.b-cart-page.is-empty .b-cart-page__layout {
  display: none;
}

.b-cart-page.is-empty .b-cart-page__empty {
  display: block;
}

.b-cart-page__empty-icon {
  color: var(--lavender, #B9A7C9);
  margin-bottom: 20px;
}

.b-cart-page__empty-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 500;
  margin: 0 0 12px;
}

.b-cart-page__empty-text {
  color: var(--muted, #8A7F7A);
  font-size: 15px;
  margin: 0 0 28px;
}

/* --- Адаптив --- */

@media (max-width: 768px) {
  .b-cart-page {
    padding: 32px 0 56px;
  }

  .b-cart-page__layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .b-cart-page__summary {
    position: static;
  }

  .b-cart-page__item {
    grid-template-columns: 80px minmax(0, 1fr) 32px;
    grid-template-areas:
      "photo info remove"
      "photo qty remove"
      "photo price remove";
    gap: 8px 16px;
  }

  .b-cart-page__item-photo {
    grid-area: photo;
    width: 80px;
    height: 108px;
  }

  .b-cart-page__item-info { grid-area: info; }
  .b-cart-page__qty { grid-area: qty; justify-self: start; }
  .b-cart-page__item-price { grid-area: price; }
  .b-cart-page__remove { grid-area: remove; align-self: start; }
}

@media (max-width: 480px) {
  .b-cart-page__title {
    margin-bottom: 24px;
  }

  .b-cart-page__promo-row {
    flex-direction: column;
  }

  .b-cart-page__summary {
    padding: 20px;
  }
}
