/* ═══════════════════════════════════════════════════════════════
   СТРАНИЦА КОРЗИНЫ
   ═══════════════════════════════════════════════════════════════ */

/* ─── Макет страницы ─────────────────────────────────────────── */

.cart-page__title {
  margin-bottom: 53px;
}

.cart-page__grid {
  display: grid;
  grid-template-columns: 1fr 387px;
  gap: 20px;
  align-items: start;
  padding-bottom: 120px;
}

/* ─── Левая колонка ──────────────────────────────────────────── */

.cart-page__left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Подсказка (свайп вправо) ───────────────────────────────── */

.cart-page__advice {
  display: none;
  align-items: center;
  gap: 10px;
}

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

.cart-page__list {
  border: 1px solid #D8D8D8;
  background-color: var(--secondary-light);
}

/* ─── Шапка таблицы ──────────────────────────────────────────── */

.cart-page__header {
  display: grid;
  grid-template-columns: 1fr 140px 142px 140px;
  padding: 14px 20px 11px;
  border-bottom: 1px solid #D8D8D8;
}

.cart-page__header p:last-child {
  text-align: center;
}

/* ─── Элемент корзины ────────────────────────────────────────── */

.cart-item {
  display: grid;
  grid-template-columns: 1fr 140px 142px 140px;
  grid-template-rows: auto auto;
  padding: 20px;
  border-bottom: 1px solid var(--neutral-border);
  align-items: center;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item__content {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-right: 16px;
}

.cart-item__price {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.cart-item__count {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  display: flex;
  align-items: center;
  border: 1px solid var(--neutral-border);
  height: 48px;
  width: fit-content;
}

.cart-item__total-price {
  grid-column: 4;
  grid-row: 1;
  align-self: center;
  text-align: center;
}

.cart-item__btn {
  grid-column: 1;
  grid-row: 2;
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  width: 94px;
  margin-top: 10px;
}

/* ─── Изображение в корзине ──────────────────────────────────── */

.cart-item__img {
  width: 85px;
  height: 72px;
  flex-shrink: 0;
  background-color: #D9D9D9;
  align-self: center;
  overflow: hidden;
}

.cart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ─── Счётчик количества ─────────────────────────────────────── */

.cart-item__count {
  background: var(--neutral);
  height: 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  width: 122px;
}

.cart-item__count-minus,
.cart-item__count-plus {
  width: 36px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  flex-shrink: 0;
  transition: background-color 0.15s;
}


.js-cart-qty {
  width: 100%;
  height: 100%;
  text-align: center;
  color: var(--primary);
}

/* ─── Кнопка очистки корзины ─────────────────────────────────── */

.cart-page__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  align-self: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   БОКОВАЯ ПАНЕЛЬ (ИТОГО)
   ═══════════════════════════════════════════════════════════════ */

.cart__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 25px;
  border: 1px solid #D8D8D8;
  background-color: var(--secondary-light);
}

.cart-info__group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--sand);
}

.cart-info__group:nth-child(3) {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.cart-info__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.cart-info__text {
  color: var(--neutral-caption);
  text-align: center;
}

.cart__info .btn {
  max-width: 100%;
}

.cart-empty {
  margin-top: 60px;
  margin-bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.cart-empty .text-l {
  color: #6A7282;
}

.cart-empty__icon {
  width: 101px;
  height: 101px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: var(--secondary);
}

.cart-empty .btn {
  margin-top: 30px;
}

/* ═══════════════════════════════════════════════════════════════
   АДАПТИВ
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1080px) {
  .cart-page__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 840px) {
  .cart-page__left {
    overflow-x: auto;
    max-width: 100%;
  }

  .cart-page__list {
    overflow-x: auto;
    max-width: 100%;
    
  }

  .cart-page__header,
  .cart-item {
    min-width: 800px;
  }
}

@media (max-width: 768px) {
  .cart-page {
    padding-top: 20px;
  }


  .cart-page__btn {
    order: -2;
    align-self: flex-start;
  }

  .cart-page__advice {
    display: flex;
    order: -1;
  }

  .cart-page__list {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cart-page__list::-webkit-scrollbar {
    display: none;
  }

  .cart__info {
    padding: 10px;
  }

  .cart-page__grid {
    padding-bottom: 60px;
  }

  .cart-empty .btn {
    max-width: 100%;
  }

  .cart-empty__icon {
    width: 50px;
    height: 50px;
  }

  .cart-empty__icon svg {
    width: 27px;
    height: 24px;
  }
}
