/**
 * Forter — редизайн страницы корзины (2026-04-26)
 * Все стили namespace .forter-cart, чтобы не конфликтовать с базовой темой.
 * Источник дизайна: Forter new/cart-design.html
 */

/* Серый фон на всю ширину окна (вне контейнера темы) */
.forter-cart-page {
  background: #eef2f6;
  margin: 0;
  padding: 28px 0 56px;
  /* full-bleed: вырвемся из любого родителя темы */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.forter-cart {
  --fc-bg: #eef2f6;
  --fc-surface: #fff;
  --fc-surface-muted: #f7f9fc;
  --fc-text: #1a1f2b;
  --fc-muted: #697386;
  --fc-line: #d8dee8;
  --fc-line-strong: #b9c3d2;
  --fc-brand: #d8232a;
  --fc-accent: #ff6c20;
  --fc-ok: #1f8f58;
  --fc-warn: #e09a26;
  --fc-bad: #c22832;
  --fc-shadow: 0 10px 24px rgba(22, 34, 52, 0.08);
  --fc-radius-lg: 16px;
  --fc-radius-md: 12px;
  --fc-radius-sm: 10px;

  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--fc-text);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.forter-cart *,
.forter-cart *::before,
.forter-cart *::after { box-sizing: border-box; }

/* ---------- Breadcrumb ---------- */
.forter-cart .fc-breadcrumb {
  background: transparent;
  padding: 0 0 12px;
  margin: 0;
  list-style: none;
  font-size: 13px;
  color: var(--fc-muted);
}
.forter-cart .fc-breadcrumb li { display: inline; }
.forter-cart .fc-breadcrumb a { color: var(--fc-muted); text-decoration: none; }
.forter-cart .fc-breadcrumb a:hover { color: var(--fc-accent); }
.forter-cart .fc-breadcrumb .sep { color: var(--fc-line-strong); padding: 0 4px; }

/* ---------- Шапка страницы ---------- */
.forter-cart .page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.forter-cart .page-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--fc-text);
  font-weight: 800;
}

.forter-cart .page-weight {
  color: var(--fc-muted);
  font-size: 0.55em;
  font-weight: 600;
  margin-left: 6px;
}

.forter-cart .cart-meta-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.forter-cart .cart-icon-btn {
  position: relative;
  --cart-offset-y: 48px;
  width: 112px;
  height: 68px;
  border: 0;
  border-radius: 16px;
  background: var(--fc-accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(255, 108, 32, 0.28);
  transform: translateY(var(--cart-offset-y));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.forter-cart .cart-icon-btn:hover {
  transform: translateY(calc(var(--cart-offset-y) - 1px));
  box-shadow: 0 12px 24px rgba(255, 108, 32, 0.34);
}

.forter-cart .cart-icon-svg {
  width: 34px;
  height: 34px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.forter-cart .cart-icon-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #1b3566;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border: 2px solid #fff;
  outline: 2px solid var(--fc-accent);
  box-shadow: 0 6px 14px rgba(16, 42, 89, 0.35);
  line-height: 1;
}

/* ---------- Тулбар (кнопки массовых действий) ---------- */
.forter-cart .cart-tools {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.forter-cart .tool-btn,
.forter-cart .main-btn,
.forter-cart .light-btn {
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.18s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.forter-cart [hidden] { display: none !important; }

.forter-cart .tool-btn {
  background: #fff;
  border-color: var(--fc-line);
  color: #2b3750;
}

.forter-cart .tool-btn:hover { border-color: var(--fc-line-strong); }

.forter-cart .main-btn { background: var(--fc-accent); color: #fff; }
.forter-cart .main-btn:hover { background: #e45f19; color: #fff; }

.forter-cart .light-btn {
  background: #fff;
  color: var(--fc-text);
  border-color: var(--fc-line);
}
.forter-cart .light-btn:hover { color: var(--fc-text); border-color: var(--fc-line-strong); }

/* ---------- Layout 2 колонки ---------- */
.forter-cart .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.forter-cart .card {
  background: var(--fc-surface);
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-lg);
  box-shadow: var(--fc-shadow);
}

/* ---------- Таблица товаров ---------- */
.forter-cart .cart-table-wrap {
  overflow: auto;
  border-radius: var(--fc-radius-lg);
}

.forter-cart table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.forter-cart thead th {
  text-align: left;
  font-size: 12px;
  color: #5f7192;
  font-weight: 800;
  background: var(--fc-surface-muted);
  border-bottom: 1px solid var(--fc-line);
  padding: 12px 10px;
  white-space: nowrap;
  text-transform: uppercase;
}

.forter-cart tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #ebeff5;
  vertical-align: top;
  font-size: 14px;
  color: #27344a;
  word-break: break-word;
}

.forter-cart tbody tr:last-child td { border-bottom: 0; }

.forter-cart .col-check { width: 40px; text-align: center; }
.forter-cart .col-product { width: 30%; }
.forter-cart .col-actions { width: 48px; text-align: center; }

.forter-cart .col-check input[type="checkbox"],
.forter-cart .fc-row-check {
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
}

/* Подвал таблицы (кнопка обновить) */
.forter-cart .cart-table-foot {
  padding: 14px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #ebeff5;
}
.forter-cart .cart-table-foot .fa { margin-right: 6px; }

/* Товар (картинка + название) */
.forter-cart .prod {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
}

.forter-cart .prod-img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 1px solid var(--fc-line);
  background: linear-gradient(145deg, #fff, #f2f5fa);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.forter-cart .prod-img img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.forter-cart .prod-name {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 800;
  color: #1b2a42;
  line-height: 1.25;
}

.forter-cart .prod-name a {
  color: inherit;
  text-decoration: none;
}

.forter-cart .prod-name a:hover { color: var(--fc-accent); }

.forter-cart .prod-desc {
  margin: 0;
  color: #6f7f96;
  font-size: 12px;
  line-height: 1.25;
}

.forter-cart .prod-options {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: #6f7f96;
  line-height: 1.4;
}

/* Бейджи наличия */
.forter-cart .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  margin-top: 6px;
}

.forter-cart .badge.ok { background: #eaf7f0; color: var(--fc-ok); }
.forter-cart .badge.warn { background: #fff6e8; color: var(--fc-warn); }
.forter-cart .badge.bad { background: #ffeef0; color: var(--fc-bad); }

/* qty input */
.forter-cart .qty {
  display: inline-grid;
  grid-template-columns: 28px 42px 28px;
  border: 1px solid var(--fc-line);
  border-radius: 10px;
  overflow: hidden;
}

.forter-cart .qty button {
  border: 0;
  background: var(--fc-surface-muted);
  color: #33435d;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.forter-cart .qty input {
  border: 0;
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: #21304a;
  width: 100%;
  min-height: 34px;
  padding: 0;
  background: #fff;
  -moz-appearance: textfield;
}

.forter-cart .qty input::-webkit-outer-spin-button,
.forter-cart .qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.forter-cart .price {
  white-space: nowrap;
  font-weight: 700;
}

.forter-cart .muted {
  color: #6f7f96;
  font-size: 12px;
  margin-top: 4px;
}

.forter-cart .delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--fc-line);
  background: #fff;
  color: #8a98ad;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.forter-cart .delete-btn:hover {
  color: var(--fc-bad);
  border-color: #efc7cd;
  background: #fff8f9;
}

/* ---------- Сводка ---------- */
.forter-cart .summary {
  position: sticky;
  top: 84px;
  padding: 16px;
}

.forter-cart .summary h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--fc-text);
}

.forter-cart .sum-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 0;
  font-size: 14px;
  color: #4f607a;
}

.forter-cart .sum-row.total {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--fc-line-strong);
  font-size: 18px;
  color: #1a2b46;
  font-weight: 800;
}

.forter-cart .summary-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.forter-cart .summary-actions .main-btn,
.forter-cart .summary-actions .light-btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
}

/* ---------- Empty state ---------- */
.forter-cart .empty-state {
  text-align: center;
  padding: 40px 18px;
}

.forter-cart .empty-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #f0f3f8;
  border: 1px solid var(--fc-line);
  display: grid;
  place-items: center;
  color: #8a98ad;
}

.forter-cart .empty-icon svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.forter-cart .empty-title {
  margin: 0 0 8px;
  font-size: 20px;
  color: #203251;
  font-weight: 800;
}

.forter-cart .empty-text {
  margin: 0 0 14px;
  color: #6f7f96;
}

/* ---------- Алёрты OpenCart внутри корзины ---------- */
.forter-cart .alert {
  border-radius: var(--fc-radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}

.forter-cart .alert-success { background: #eff9f3; border: 1px solid #bce4cc; color: #17794a; }
.forter-cart .alert-info { background: #eef5fb; border: 1px solid #b5d0e8; color: #1d4f7a; }
.forter-cart .alert-danger { background: #fbeef0; border: 1px solid #efc7cd; color: var(--fc-bad); }

/* ---------- Адаптив ---------- */
@media (max-width: 1199px) {
  .forter-cart .layout { grid-template-columns: 1fr; }
  .forter-cart .summary { position: static; }
  .forter-cart .cart-icon-btn { --cart-offset-y: 0px; }
}

@media (max-width: 991px) {
  .forter-cart table { min-width: 0; }
}

@media (max-width: 767px) {
    .forter-cart .card {
      padding: 16px;
    }
  
  .forter-cart-page { padding: 14px 0 32px; }
  .forter-cart {
    padding: 0 16px;
  }

  .forter-cart .page-head {
    flex-direction: row;
    align-items: center;
    margin-bottom: 10px;
  }

  .forter-cart .cart-meta-stack { justify-items: end; }
  .forter-cart .page-title { font-size: 24px; }

  .forter-cart .cart-icon-btn {
    width: 64px;
    height: 44px;
    border-radius: 12px;
    --cart-offset-y: 0px;
  }

  .forter-cart .cart-icon-svg {
    width: 22px;
    height: 22px;
  }

  .forter-cart .cart-icon-badge {
    min-width: 22px;
    height: 22px;
    font-size: 12px;
    top: -8px;
    right: -8px;
  }

  .forter-cart .cart-tools { gap: 8px; }
  .forter-cart .cart-tools .tool-btn { width: 100%; }

  /* Таблиця перетворюється на картки (mobile-friendly, без горизонтального скролу) */
  .forter-cart .cart-table-wrap { overflow: visible; }
  .forter-cart table,
  .forter-cart thead,
  .forter-cart tbody,
  .forter-cart tr,
  .forter-cart td,
  .forter-cart th {
    display: block;
    width: 100%;
  }

  .forter-cart thead { display: none; }

  .forter-cart tbody tr {
    border-bottom: 1px solid #e8edf4;
    padding: 12px 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px 10px;
    align-items: start;
  }

  .forter-cart tbody td {
    border: 0;
    padding: 4px 0;
  }

  .forter-cart tbody td.col-check {
    grid-row: 1;
    grid-column: 1;
    width: auto;
  }
  .forter-cart tbody td.col-product {
    grid-row: 1;
    grid-column: 2;
    width: auto;
  }
  .forter-cart tbody td.col-actions {
    grid-row: 1;
    grid-column: 3;
    width: auto;
    text-align: right;
  }

  .forter-cart tbody td:not(.col-check):not(.col-product):not(.col-actions) {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px dashed #ebeff5;
  }

  .forter-cart tbody td[data-label]:not(.col-check):not(.col-product):not(.col-actions)::before {
    content: attr(data-label);
    font-size: 12px;
    color: #6f7f96;
    font-weight: 700;
    text-transform: uppercase;
  }

  .forter-cart tbody td.col-check::before,
  .forter-cart tbody td.col-product::before,
  .forter-cart tbody td.col-actions::before { content: none; }

  .forter-cart .summary { padding: 14px; }
  .forter-cart .summary h3 { font-size: 20px; }
}
