/* ---------- Корзина / Карточки товаров ---------- */

.page-title {
  margin-bottom: 20px;
}

/* Общий контейнер списка */
.cart-items {
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 800px;
  overflow: hidden;
}

/* Карточка. Селектор привязан к .cart-items: на странице корзины есть и карточки
   каталога («Вы недавно смотрели») с тем же классом .product-card, а их стили
   (flex-direction: column) подключаются позже и иначе перебивают эти */
.cart-items .product-card {
  display: flex;
  flex-direction: row;
  gap: 16px;
  width: 100%;
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 16px;
  box-sizing: border-box;
}

/* У последней карточки убираем нижнюю линию */
.cart-items .product-card:last-child {
  border-bottom: none;
}

/* Контейнер картинки */
.product-card__image-container {
  width: 100px;
  height: 100px;
  background-color: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  flex-shrink: 0;
  overflow: hidden;
}

.product-card__image-container {
  display: block;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.product-card__image-container:hover .product-card__image {
  transform: scale(1.05);
}

/* Правая часть карточки */
.product-card__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  min-width: 0;
}

/* Блок информации */
.product-card__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* Верхняя строка: название слева, цена+счётчик справа */
.product-card__top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  margin-bottom: 6px;
}

.product-card__title {
  font-family: Archivo, Inter, sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 0;
  flex: 1;
  min-width: 0;
}

/* Ссылка на страницу товара */
.product-card__link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.product-card__link:hover,
.product-card__link:focus-visible {
  color: var(--accent);
}

/* Группа цена + счётчик справа */
.product-card__top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Цена */
.product-card__price-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.product-card__price {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.product-card__old-price {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: line-through;
}

.product-card__discount {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Размер */
.product-card__size {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
}

.product-card__size span {
  color: var(--ink);
  font-weight: 500;
}

/* Футер (кнопки действия) */
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

/* Счётчик */
.product-card__counter {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2px;
  background-color: var(--bg-soft);
  flex-shrink: 0;
}

.product-card__counter-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  transition: background-color 0.15s ease;
}

.product-card__counter-btn:hover {
  background-color: var(--bg);
}

.product-card__counter-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 28px;
  text-align: center;
}

/* Кнопка удаления */
.product-card__btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background-color: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.product-card__btn-delete:hover {
  background-color: var(--bg-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.product-card__btn-delete svg {
  width: 18px;
  height: 18px;
}

/* ---------- Мобильная адаптивность ---------- */
@media (max-width: 640px) {
  .cart-items .product-card {
    padding: 12px;
    gap: 12px;
  }

  .product-card__image-container {
    width: 80px;
    height: 80px;
  }

  .product-card__top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .product-card__title {
    font-size: 15px;
  }

  .product-card__price {
    font-size: 15px;
  }
}