/* css/cart.css — стили экрана «cart». Классы — с префиксом .cart-… .
 * Файл наполняет таск своего экрана; палитра — только токены styles.css. */

.cart-screen {
  padding: 4px 14px calc(var(--nav-h) + 92px);
}

/* ── шапка: заголовок + «Все» ── */
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 2px 12px;
}
.cart-title { font-size: 22px; }
.cart-count {
  color: var(--muted);
  font-family: var(--font-text); font-weight: 800; font-size: 15px;
  margin-left: 2px;
}
.cart-all {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── чекбокс (общий для «Все» и строк) ── */
.cart-check { display: flex; align-items: center; cursor: pointer; }
.cart-all input, .cart-check input { display: none; }
.cart-cb {
  width: 22px; height: 22px; flex: none;
  border-radius: 7px;
  border: 2px solid rgba(36, 26, 46, 0.2);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.cart-cb::after {
  content: '';
  position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cart-all input:checked + .cart-cb,
.cart-check input:checked + .cart-cb {
  background: var(--pink); border-color: var(--pink);
}
.cart-all input:checked + .cart-cb::after,
.cart-check input:checked + .cart-cb::after { transform: rotate(45deg) scale(1); }

/* ── строка товара ── */
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  padding: 12px 12px 12px 10px;
}
.cart-row .cart-check { padding-top: 26px; }
.cart-ph {
  width: 72px; flex: none;
  border-radius: var(--r-s); overflow: hidden;
  background: var(--pink-soft);
  cursor: pointer;
}
.cart-ph img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cart-prices { display: flex; align-items: baseline; gap: 8px; }
.cart-prices b { color: var(--pink); font-size: 17px; font-weight: 800; }
.cart-prices s { color: var(--muted); font-size: 12px; }
.cart-name {
  font-size: 13px; line-height: 1.35; font-weight: 600; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-row-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}

/* ── степпер ── */
.cart-stepper {
  display: flex; align-items: center; gap: 2px;
  background: var(--bg);
  border-radius: var(--r-s);
  padding: 2px;
}
.cart-step-btn {
  width: 32px; height: 30px;
  font-size: 18px; font-weight: 800; color: var(--text);
  border-radius: 8px;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s;
}
.cart-step-btn:active { transform: scale(0.85); background: var(--pink-soft); }
.cart-step-btn.off { color: rgba(36, 26, 46, 0.2); }
.cart-qty {
  min-width: 26px; text-align: center;
  font-size: 15px; font-weight: 800;
}
.cart-del {
  color: var(--muted); font-size: 12.5px; font-weight: 700;
  padding: 8px 4px;
  transition: color 0.15s;
}
.cart-del:active { color: var(--pink); }

/* ── сводка ── */
.cart-summary {
  margin-top: 14px;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.cart-sum-row {
  display: flex; justify-content: space-between;
  font-size: 13.5px; color: var(--muted); font-weight: 600;
}
.cart-sum-row.sale span:last-child { color: var(--green); font-weight: 800; }
.cart-sum-row.total {
  border-top: 1px dashed rgba(36, 26, 46, 0.12);
  padding-top: 10px; margin-top: 2px;
  color: var(--text); font-size: 15px; font-weight: 800;
}
.cart-sum-row.total b { font-size: 17px; }

/* ── sticky-полоса «К оформлению» ── */
.cart-cta {
  position: fixed; z-index: 45;
  left: 12px; right: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  /* КОНТРАКТ ШИРИН: ширина панели — от токена --app-w (styles.css),
   * минус боковые поля 12px + 12px; фолбэк — мобильные 520px */
  max-width: calc(var(--app-w, 520px) - 24px); margin: 0 auto;
  background: var(--orange); color: #fff;
  border-radius: var(--r-m);
  padding: 15px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(255, 122, 61, 0.4);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cart-cta:active { transform: scale(0.97); }
.cart-cta.off {
  background: var(--surface); color: var(--muted);
  box-shadow: var(--shadow);
  justify-content: center;
}

/* ── пустая корзина (зона «дерзко») ── */
.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 24px 40px; min-height: 55vh;
}
.cart-empty-emoji { font-size: 46px; }
.cart-empty h1 { font-size: 21px; line-height: 1.3; margin: 16px 0 10px; }
.cart-empty p { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 300px; }
.cart-empty-btn {
  margin-top: 22px;
  background: var(--pink); color: #fff;
  font-weight: 800; font-size: 15px;
  padding: 14px 32px; border-radius: var(--r-m);
  box-shadow: 0 8px 24px rgba(255, 77, 136, 0.35);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cart-empty-btn:active { transform: scale(0.95); }
