/* ========================================
   CART — Корзина
   ======================================== */

/* --- Layout --- */
.cart-items-panel {
  flex: 1;
  min-width: 0;
  border-radius: 48px;
}

.cart-summary {
  width: 420px;
  flex-shrink: 0;
  border-radius: 48px;
  position: sticky;
  top: 108px;
  align-self: flex-start;
}

/* --- Счётчик в заголовке --- */
.cart-count {
  font-weight: 400;
  font-size: 16px;
  color: var(--gray-text);
  margin-left: 8px;
}

.cart-empty {display: flex; flex-direction: column; gap: 12px;}

/* --- Товар в корзине --- */
.cart-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Блок 1: фото + текст */
.cart-item__info-block {
  flex: 1;
  display: flex;
  gap: 16px;
  min-width: 0;
}

.cart-item__image {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-light);
}

.cart-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.cart-item__title {
  font-family: 'Onest', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item__subtitle {
  font-family: 'Onest', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--gray-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Блок 2: счётчик + цена */
.cart-item__actions-block {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.cart-item__counter {
  flex-shrink: 0;
}

/* --- Цены --- */
.cart-item__prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 90px;
}

.cart-item__price {
  font-family: 'Onest', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--black);
  white-space: nowrap;
}

.cart-item__old-price {
  font-family: 'Onest', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--gray-text);
  text-decoration: line-through;
  white-space: nowrap;
}

/* --- Удалить --- */
.cart-item__remove {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--gray-text);
  transition: background 0.15s, color 0.15s;
}

.cart-item__remove:hover {
  background: var(--gray-light);
  color: var(--red-btn);
}

/* --- Итого (как на checkout) --- */
.cart-summary-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-row__label {
  font-family: 'Onest', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--gray-text);
}

.summary-row__value {
  font-family: 'Onest', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--black);
}

.summary-row__value--discount {
  color: var(--red-btn);
}

.summary-row--total .summary-row__label {
  font-weight: 700;
  font-size: 18px;
  color: var(--black);
}

.summary-row--total .summary-row__value {
  font-weight: 800;
  font-size: 22px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .cart-main {
    flex-direction: column;
  }

  .cart-items-panel {
    width: 100%;
    border-radius: 32px;
  }

  .cart-summary {
    width: 100%;
    border-radius: 32px;
    position: static;
  }
}

@media (max-width: 768px) {
  /* Карточка товара — колонка */
  .cart-item {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  /* Фото + текст — строка */
  .cart-item__info-block {
    gap: 12px;
  }

  .cart-item__image {
    width: 72px;
    height: 72px;
  }

  .cart-item__info {
    padding-right: 36px; /* место под кнопку удаления */
  }

  .cart-item__title {
    font-size: 15px;
  }

  .cart-item__subtitle {
    font-size: 13px;
  }

  /* Счётчик + цена — строка, space-between */
  .cart-item__actions-block {
    justify-content: space-between;
    gap: 16px;
  }

  .cart-item__prices {
    align-items: flex-end;
    min-width: auto;
  }

  /* Удалить — абсолютно в правом верхнем углу */
  .cart-item__remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
  }
}
