/* Корзина автохимии. Отдельный файл, а не кусок styles.css витрины:
   витринный лист весит под 90 КБ и тянет за собой сетку каталога,
   фильтры и модалки, которых на этой странице нет.
   Тёмная тема каталога, те же цвета — страница должна читаться как
   продолжение магазина, а не как чужая форма. */

/* Шапка прибита к верху экрана (position:fixed в header-cohesion.css),
   поэтому первый экран страницы обязан начинаться ниже неё — иначе
   крошки и заголовок уезжают под логотип. Отступ тот же, что у
   страницы товара (.pdp), чтобы разделы начинались на одной высоте. */
.cartp {
  max-width: 1080px;
  margin: 0 auto;
  padding: 122px 20px 72px;
}

.cart-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: #8fb0d8;
  font-size: 13px;
}
.cart-crumbs a { color: #8fb0d8; text-decoration: none; }
.cart-crumbs a:hover { color: #45bbff; }

.cartp h1 {
  margin: 0 0 4px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -.02em;
}
.cart-lead {
  margin: 0 0 26px;
  max-width: 62ch;
  color: #a9c3e2;
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- пустая корзина ---------- */
.cart-empty {
  padding: 46px 24px;
  border: 1px dashed #2a5b8f;
  border-radius: 16px;
  background: #081f43;
  text-align: center;
}
.cart-empty b { display: block; margin-bottom: 6px; font-size: 19px; }
.cart-empty p { margin: 0 0 20px; color: #a9c3e2; }

/* ---------- список ---------- */
.cart-list { margin: 0; padding: 0; list-style: none; }

.cart-head,
.cart-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 132px 128px 118px 34px;
  align-items: center;
  gap: 14px;
}

.cart-head {
  padding: 0 12px 10px;
  color: #7f97b8;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
/* Первая ячейка шапки пустая — она стоит над снимком. */
.cart-head span:nth-child(3),
.cart-head span:nth-child(4),
.cart-head span:nth-child(5) { text-align: right; }

.cart-row {
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #2a5b8f;
  border-radius: 14px;
  background: #081f43;
}

.cart-pic {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  background: #0b2a55;
  overflow: hidden;
}
.cart-pic img { width: 100%; height: 100%; object-fit: contain; }
.cart-nopic { display: block; width: 28px; height: 28px; border-radius: 6px; background: #16406f; }

.cart-name { min-width: 0; }
.cart-name a,
.cart-name span { color: #eaf3ff; font-size: 15.5px; font-weight: 700; text-decoration: none; }
.cart-name a:hover { color: #45bbff; }
.cart-name i { font-style: normal; color: #a9c3e2; font-weight: 600; }
.cart-name small { display: block; margin-top: 3px; color: #7f97b8; font-size: 12px; }
.cart-gone { display: block; margin-top: 4px; color: #ffb347; font-size: 12px; font-style: normal; }

.cart-price { text-align: right; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-price small { display: block; margin-top: 2px; color: #7f97b8; font-size: 11.5px; font-weight: 600; }
.cart-ask { color: #a9c3e2; font-size: 13px; font-weight: 600; }

/* ---------- количество ---------- */
.cart-qty {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.cart-step {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #2a5b8f;
  border-radius: 9px;
  background: #0b2a55;
  color: #eaf3ff;
  font: 700 17px/1 inherit;
  cursor: pointer;
}
.cart-step:hover { border-color: #45bbff; color: #45bbff; }
.cart-n {
  width: 54px;
  height: 32px;
  padding: 0 4px;
  border: 1px solid #2a5b8f;
  border-radius: 9px;
  background: #0b2a55;
  color: #eaf3ff;
  font: 700 14px/1 inherit;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.cart-n::-webkit-outer-spin-button,
.cart-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-n:focus { outline: 2px solid #45bbff; outline-offset: 1px; }

.cart-sum { text-align: right; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }

.cart-del {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: transparent;
  color: #8fb0d8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.cart-del:hover { border-color: #ff6b6b; color: #ff6b6b; }

/* ---------- итог ---------- */
.cart-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #2a5b8f;
  border-radius: 16px;
  background: linear-gradient(160deg, #0b2a55, #081f43);
}
.cart-nums { display: flex; flex-direction: column; gap: 4px; color: #a9c3e2; font-size: 13.5px; }
.cart-nums b { color: #eaf3ff; }
.cart-total-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
  color: #eaf3ff;
  font-size: 15px;
}
.cart-total-line b { font-size: 26px; font-variant-numeric: tabular-nums; }
.cart-partial { margin: 8px 0 0; color: #ffb347; font-size: 12.5px; }
.cart-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cart-note { flex: 1 1 100%; margin: 4px 0 0; color: #7f97b8; font-size: 12.5px; }

#cart-clear {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: #a9c3e2;
  font: 600 13.5px/1 inherit;
  cursor: pointer;
}
#cart-clear:hover { border-color: #ff6b6b; color: #ff6b6b; }

/* ---------- телефон ----------
   Сетка из шести колонок на 390 px не живёт: снимок и число количества
   ужимаются до нечитаемого. Разворачиваем строку в две: сверху снимок и
   название, снизу цена, счётчик и сумма. */
@media (max-width: 820px) {
  .cart-head { display: none; }
  /* Третья колонка — auto, а не 30 px под крестик: во второй строке в ней
     стоит сумма позиции, и на фиксированной ширине «9 900 ₽» обрезалось
     краем карточки. Крестик в широкой колонке прижимаем вправо. */
  .cart-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas:
      'pic name del'
      'qty qty  sum';
    gap: 10px 12px;
  }
  .cart-del { justify-self: end; }
  .cart-sum { white-space: nowrap; }
  .cart-pic { grid-area: pic; width: 64px; height: 64px; }
  .cart-name { grid-area: name; }
  .cart-del { grid-area: del; }
  .cart-qty { grid-area: qty; justify-content: flex-start; }
  .cart-sum { grid-area: sum; }
  /* Цена за единицу уезжает под название: в узкой строке ей места нет,
     а сумма по позиции важнее. */
  .cart-price {
    grid-area: name;
    align-self: end;
    text-align: left;
    margin-top: 34px;
    font-size: 13px;
    font-weight: 600;
    color: #a9c3e2;
  }
  .cart-price small { display: inline; margin-left: 6px; }
  .cart-name { padding-bottom: 20px; }
}

@media (max-width: 560px) {
  .cartp { padding: 104px 14px 60px; }
  .cart-foot { padding: 14px; }
  .cart-acts { width: 100%; }
  .cart-acts .button { flex: 1 1 auto; text-align: center; }
}


/* Правовой блок в корзине. Это последняя страница перед оплатой —
   именно её банк-эквайер смотрит внимательнее прочих. Стили самого
   блока лежат в styles.css витрины, который корзина подключает;
   здесь только отступ, чтобы он не липнул к итогу. */
.cartp .shop-legal { margin-top: 40px; }
