/* Корзина — стили из design/cart.html. */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --fg: #111111;
    --muted: #6b6b6b;
    --border: #e0e0e0;
    --accent: #0058a3;
    --accent-hover: #004080;
    --accent-light: #e6f0fa;
    --warning: #f5a623;
    --success: #00843d;
    --danger: #d32f2f;
    --radius: 8px;
    --radius-sm: 4px;
    --font: -apple-system, BlinkMacSystemFont, 'Noto Sans', 'Segoe UI', system-ui, sans-serif;
  }

  html { font-size: 16px; scroll-behavior: smooth; }
  body { font-family: var(--font); background: var(--bg); color: var(--fg); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }

  a { color: inherit; text-decoration: none; }
  button { cursor: pointer; border: none; background: none; font: inherit; }
  input, select { font: inherit; }

  /* ─── HEADER ───────────────────────────────── */
  .header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
  .header-top { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 20px; }
  .logo { display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; }
  .logo-name { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; color: var(--accent); line-height: 1.1; }
  .header-search { flex: 1; max-width: 560px; position: relative; }
  .header-search input { width: 100%; height: 40px; border: 1.5px solid var(--border); border-radius: 20px; padding: 0 44px 0 16px; font-size: 14px; background: var(--bg); color: var(--fg); outline: none; transition: border-color .2s; }
  .header-search input:focus { border-color: var(--accent); background: var(--surface); }
  .header-search-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; align-items: center; }
  .header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .header-icon-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); transition: color .2s, background .2s; position: relative; font-size: 10px; cursor: pointer; }
  .header-icon-btn:hover { color: var(--accent); background: var(--accent-light); }
  .header-icon-btn.active { color: var(--accent); }
  .cart-badge { position: absolute; top: 2px; right: 6px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
  .hamburger { display: none; padding: 8px; }

  /* .main и .breadcrumbs — единый источник в app.css (дубли из дизайна удалены). */

  .page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 24px; }

  /* Cart layout */
  .cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }

  /* ─── CART ITEMS ────────────────────────────── */
  .cart-items { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

  .cart-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; padding: 20px; background: var(--surface); align-items: start; }
  .cart-item-img { width: 120px; height: 120px; background: #e8e8e8; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--border); flex-shrink: 0; }

  .cart-item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .cart-item-name { font-size: 15px; font-weight: 600; }
  .cart-item-name a { transition: color .2s; }
  .cart-item-name a:hover { color: var(--accent); }
  .cart-item-desc { font-size: 13px; color: var(--muted); }
  .cart-item-article { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; }
  .cart-item-stock { font-size: 12px; color: var(--success); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
  .cart-item-stock .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

  .cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
  .cart-item-price { text-align: right; }
  .cart-item-price .price-current { font-size: 18px; font-weight: 700; display: block; }
  .cart-item-price .price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }

  /* Quantity control */
  .qty-control { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .qty-control button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--fg); transition: background .15s; }
  .qty-control button:hover { background: var(--bg); }
  .qty-control button:disabled { color: var(--border); }
  .qty-control .qty-value { width: 40px; text-align: center; font-size: 14px; font-weight: 600; border-left: 1px solid var(--border); border-right: 1px solid var(--border); height: 36px; line-height: 36px; }

  .cart-item-actions { display: flex; gap: 12px; }
  .cart-item-actions button { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; transition: color .2s; }
  .cart-item-actions button:hover { color: var(--accent); }
  .cart-item-actions .btn-remove:hover { color: var(--danger); }

  /* ─── CART SUMMARY ─────────────────────────── */
  .cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: sticky; top: 84px; }
  .cart-summary-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

  .summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
  .summary-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 16px; font-size: 20px; font-weight: 700; }
  .summary-row .label { color: var(--muted); }
  .summary-row.total .label { color: var(--fg); }
  .summary-discount { color: var(--success); }

  /* Promo code */
  .promo-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
  .promo-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
  .promo-input-wrap { display: flex; gap: 8px; }
  .promo-input-wrap input { flex: 1; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; font-size: 14px; outline: none; }
  .promo-input-wrap input:focus { border-color: var(--accent); }
  .promo-input-wrap button { height: 40px; padding: 0 16px; background: var(--fg); color: #fff; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); transition: background .2s; white-space: nowrap; }
  .promo-input-wrap button:hover { background: #333; }
  .promo-applied { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--success); }
  .promo-applied .remove-promo { color: var(--danger); cursor: pointer; margin-left: 4px; }

  /* Checkout button */
  .btn-checkout { width: 100%; height: 48px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; border-radius: var(--radius-sm); margin-top: 20px; transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
  .btn-checkout:hover { background: var(--accent-hover); }

  .cart-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.4; }

  /* Delivery estimate */
  .delivery-estimate { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 12px; background: var(--accent-light); border-radius: var(--radius-sm); font-size: 13px; color: var(--accent); }

  /* Empty cart */
  .cart-empty { text-align: center; padding: 80px 24px; }
  .cart-empty svg { margin-bottom: 16px; color: var(--border); }
  .cart-empty h2 { font-size: 22px; margin-bottom: 8px; }
  .cart-empty p { color: var(--muted); margin-bottom: 24px; }
  .btn-continue { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 24px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); transition: background .2s; }
  .btn-continue:hover { background: var(--accent-hover); }

  /* ─── FOOTER ───────────────────────────────── */
  .footer { background: #1a1a1a; color: #ccc; padding: 48px 24px 24px; margin-top: auto; }
  .footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .footer-col-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
  .footer-col a { display: block; font-size: 13px; color: #999; padding: 3px 0; transition: color .2s; }
  .footer-col a:hover { color: #fff; }
  .footer-bottom { max-width: 1280px; margin: 24px auto 0; padding-top: 20px; border-top: 1px solid #333; font-size: 12px; color: #666; text-align: center; }

  /* ─── RESPONSIVE ───────────────────────────── */
  @media (max-width: 960px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
  }

  @media (max-width: 768px) {
    .header-search { display: none; }
    .hamburger { display: block; }
    .footer-inner { grid-template-columns: repeat(2, 1fr); }
  }

  @media (max-width: 600px) {
    .cart-item { grid-template-columns: 80px 1fr; gap: 12px; padding: 16px; }
    .cart-item-img { width: 80px; height: 80px; }
    .cart-item-right { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
    .cart-item-name { font-size: 14px; }
    .page-title { font-size: 22px; }
    .footer-inner { grid-template-columns: 1fr; }
  }

/* ── Адаптация под наши хуки ── */
.cart-page-title { font-size:26px; font-weight:800; letter-spacing:-.4px; margin:18px 0 20px; }
.cart-item-img { display:block; }
.cart-item-img img { width:100%; height:100%; object-fit:cover; display:block; }
.cart-item-stock.oos { color:#c0392b; }
.qty-value, .qty-val { min-width:28px; text-align:center; }
.btn-remove { color:var(--muted); }
.btn-remove:hover { color:#c0392b; }
.cart-item-price .unit-price { display:block; font-size:12px; color:var(--muted); margin-top:2px; }
.checkout-btn { display:block; width:100%; text-align:center; margin-top:18px; height:46px; line-height:46px; background:var(--accent); color:#fff; border-radius:var(--radius); font-weight:600; font-size:15px; transition:background .15s; }
.checkout-btn:hover { background:var(--accent-hover); }
.cart-empty { text-align:center; padding:70px 20px; }
.cart-empty p { color:var(--muted); margin:14px 0 18px; }

/* Модалка подтверждения удаления */
.cart-modal { position:fixed; inset:0; z-index:300; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; padding:16px; }
.cart-modal-card { background:var(--surface); border-radius:12px; max-width:380px; width:100%; padding:24px; box-shadow:0 20px 60px rgba(0,0,0,.25); }
.cart-modal-card h3 { font-size:17px; font-weight:700; margin-bottom:6px; }
.cart-modal-card p { font-size:14px; color:var(--muted); margin-bottom:18px; }
.cart-modal-card p span { color:var(--fg); }
.cart-modal-actions { display:flex; gap:10px; }
.cart-modal-actions button { flex:1; height:42px; border-radius:var(--radius); font-weight:600; font-size:14px; }
.btn-danger { background:#e53935; color:#fff; }
.btn-danger:hover { background:#c62828; }

/* ── Минимальная сумма заказа ── */
.min-order { margin:14px 0 4px; padding:12px 14px; background:#fff4e5; border:1px solid #f5d9a8; border-radius:var(--radius-sm); }
.min-order.reached { background:var(--accent-light); border-color:transparent; }
.min-order-msg { font-size:13px; color:#9a6a00; margin-bottom:8px; line-height:1.4; }
.min-order-msg b { font-weight:700; }
.min-order.reached .min-order-msg { color:var(--success); }
.min-order-bar { height:6px; background:#fff; border-radius:3px; overflow:hidden; }
.min-order-fill { height:100%; width:0; background:var(--warning); border-radius:3px; transition:width .35s ease; }
.min-order.reached .min-order-fill { background:var(--success); }

/* Кнопка оформления заблокирована, пока не набран минимум */
.checkout-btn.disabled { opacity:.5; pointer-events:none; }

/* ── Кросс-сейл «С этим покупают» ── */
.cross-sell { margin-top:48px; }
.cross-sell-title { font-size:22px; font-weight:800; letter-spacing:-.4px; margin-bottom:18px; }

/* ── Скидки в корзине ── */
.cart-item-price .line-old { display:block; font-size:13px; color:var(--muted); text-decoration:line-through; margin-top:2px; }
.summary-row.discount-row .label { color:var(--success); }
.discount-val { color:var(--success); font-weight:600; }
