/* Корзина, страница заказа и всплывашка витрины «Рыболов» (2в). Палитра «Ясный день».
   Переменные берутся из site.css (--bg, --text, --cta …); здесь — запасные значения,
   чтобы корзина выглядела так же и без него. Классы с префиксами cart-, order-, shopcart-. */
.cart-app, .order-app, .shopcart-toast {
  --c-bg: var(--bg, #f4f5f7);
  --c-card: var(--card, #ffffff);
  --c-text: var(--text, #1b1f24);
  --c-muted: var(--muted, #5d646e);
  --c-line: var(--line, #e4e6ea);
  --c-cline: var(--cline, #e6e8ec);
  --c-acc: var(--acc, #1b1f24);
  --c-cta: var(--cta, #ffc83d);
  --c-ctaink: var(--ctaink, #1b1f24);
  --c-soft: var(--soft, #fff4d1);
  --c-softink: var(--softink, #6b4e00);
  --c-ok: var(--ok, #1d7a46);
  --c-err: #b42318;
  --c-nophoto: var(--nophoto, #eef0f3);
  --c-r: var(--r, 12px);
  --c-rs: var(--rs, 9px);
  --c-shadow: var(--shadow, 0 1px 3px rgba(27, 31, 36, .06));
  --c-font: var(--font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Liberation Sans', Arial, sans-serif);
}

.cart-app, .order-app {
  display: block;
  max-width: 1320px;
  margin: 0 auto;
  padding: 4px 0 44px;
  font: 15px/1.5 var(--c-font);
  color: var(--c-text);
}
.cart-app *, .cart-app *::before, .cart-app *::after,
.order-app *, .order-app *::before, .order-app *::after { box-sizing: border-box; }
.cart-app a:focus-visible, .cart-app button:focus-visible, .cart-app input:focus-visible,
.order-app a:focus-visible { outline: 3px solid var(--c-cta); outline-offset: 2px; }

/* ---------- общий вид блоков ---------- */
.cart-summary, .cart-form, .cart-pickup, .cart-steps, .cart-empty, .order-box {
  background: var(--c-card);
  border: 1px solid var(--c-cline);
  border-radius: var(--c-r);
  box-shadow: var(--c-shadow);
}
.cart-head { display: flex; align-items: baseline; gap: 12px; margin: 20px 0 18px; }
.cart-title { margin: 0; font: 800 34px/1.15 var(--c-font); letter-spacing: -.02em; }

.cart-btn, .cart-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 22px; border: 0; border-radius: var(--c-rs);
  background: var(--c-cta); color: var(--c-ctaink);
  font: 700 16px/1.2 var(--c-font); text-decoration: none; cursor: pointer;
}
.cart-btn:hover, .cart-submit:hover { filter: brightness(.96); }

/* ---------- раскладка корзины ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-areas: "list side" "info side";
  gap: 18px 26px;
  align-items: start;
}
.cart-list { grid-area: list; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cart-side { grid-area: side; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cart-info { grid-area: info; display: grid; gap: 14px; min-width: 0; }

/* ---------- позиция ---------- */
.cart-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto 118px auto;
  grid-template-areas: "img info qty sum del";
  align-items: center;
  gap: 16px;
  padding: 12px 14px 12px 12px;
  background: var(--c-card);
  border: 1px solid var(--c-cline);
  border-radius: var(--c-r);
  box-shadow: var(--c-shadow);
}
.cart-item__img {
  grid-area: img;
  width: 76px; height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px dashed var(--c-line); border-radius: var(--c-rs);
  background: var(--c-nophoto); color: var(--c-muted); text-decoration: none; text-align: center;
}
.cart-item__img small { font-size: 10.5px; line-height: 1.1; }
.cart-item__info { grid-area: info; min-width: 0; }
.cart-item__name {
  display: block; color: var(--c-text); text-decoration: none;
  font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere;
}
.cart-item__name:hover { text-decoration: underline; }
.cart-item__unit { margin-top: 4px; font-size: 13px; color: var(--c-muted); white-space: nowrap; }
.cart-qty {
  grid-area: qty;
  display: inline-flex; align-items: center; justify-self: start;
  border: 1.5px solid var(--c-line); border-radius: var(--c-rs); background: var(--c-card); overflow: hidden;
}
.cart-qty__btn {
  width: 38px; height: 38px; border: 0; background: transparent;
  color: var(--c-text); font: 600 20px/1 var(--c-font); cursor: pointer;
}
.cart-qty__btn:hover:not(:disabled) { background: var(--c-bg); }
.cart-qty__btn:disabled { color: #b6bcc4; cursor: default; }
.cart-qty__val { min-width: 34px; text-align: center; font-size: 15px; font-weight: 700; }
.cart-item__sum { grid-area: sum; text-align: right; font: 800 18px/1.2 var(--c-font); white-space: nowrap; }
.cart-item__del {
  grid-area: del;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 6px; border: 0; border-radius: 6px; background: transparent;
  color: var(--c-muted); font: 500 13px var(--c-font); cursor: pointer;
}
.cart-item__del:hover { color: var(--c-err); }

/* ---------- итог ---------- */
.cart-summary { padding: 18px 20px; }
.cart-summary__row { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0; font-size: 14.5px; color: var(--c-muted); }
.cart-summary__row span:last-child { color: var(--c-text); white-space: nowrap; }
.cart-summary__row .cart-free { color: var(--c-ok); font-weight: 700; }
.cart-summary__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--c-line);
  font-size: 16px; font-weight: 700;
}
.cart-summary__total b { font: 800 28px/1.1 var(--c-font); white-space: nowrap; }
.cart-pay {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 14px 0 0; padding: 12px 14px; border-radius: var(--c-rs);
  background: var(--c-soft); color: var(--c-softink);
  font-size: 14px; font-weight: 600; line-height: 1.4;
}
.cart-pay svg { flex: none; margin-top: 1px; }

/* ---------- форма ---------- */
.cart-form { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; }
.cart-form__title { margin: 0 0 2px; font: 800 19px/1.2 var(--c-font); }
.cart-field { display: flex; flex-direction: column; gap: 6px; }
.cart-field label { font-size: 13.5px; font-weight: 600; }
.cart-field label span { font-weight: 400; color: var(--c-muted); }
.cart-field input, .cart-field textarea {
  width: 100%; padding: 11px 12px;
  border: 1.5px solid var(--c-line); border-radius: var(--c-rs);
  background: #ffffff; color: var(--c-text);
  font: 16px/1.4 var(--c-font); outline: none;
}
.cart-field textarea { min-height: 76px; resize: vertical; }
.cart-field input:focus, .cart-field textarea:focus { border-color: var(--c-acc); box-shadow: 0 0 0 3px rgba(255, 200, 61, .45); }
.cart-field input.is-invalid, .cart-field textarea.is-invalid { border-color: var(--c-err); }
.cart-field__err, .cart-form__err { color: var(--c-err); font-size: 13px; line-height: 1.35; }
.cart-field__err:empty, .cart-form__err:empty { display: none; }
.cart-form__err { padding: 10px 12px; border-radius: var(--c-rs); background: #fdecea; }
.cart-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.cart-consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--c-acc); }
.cart-consent input.is-invalid { outline: 2px solid var(--c-err); outline-offset: 2px; }
.cart-consent a { color: var(--c-text); text-decoration: underline; }
.cart-submit { width: 100%; }
.cart-submit:disabled { opacity: .65; cursor: progress; }
.cart-form__note { margin: 0; font-size: 12.5px; color: var(--c-muted); text-align: center; }

/* ---------- как получить, самовывоз ---------- */
.cart-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 16px 18px; list-style: none; }
.cart-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.cart-steps b {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-soft); color: var(--c-softink); font-size: 14px;
}
.cart-pickup { padding: 16px 18px; font-size: 14px; }
.cart-pickup__title { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 15px; }
.cart-pickup__line { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 0; line-height: 1.45; }
.cart-pickup__line svg { flex: none; margin-top: 2px; color: var(--c-muted); }
.cart-pickup__line small { display: block; font-size: 13px; color: var(--c-muted); }
.cart-pickup a { color: var(--c-text); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* ---------- пусто и отправлено ---------- */
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 560px; padding: 40px 24px; text-align: center; }
.cart-empty__icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-soft); color: var(--c-softink);
}
.cart-empty b { font-size: 20px; }
.cart-empty p { margin: 0 0 6px; color: var(--c-muted); }
.cart-done {
  display: flex; gap: 10px; align-items: center; margin-top: 20px; padding: 24px;
  border-radius: var(--c-r); background: var(--c-card); color: var(--c-ok); font-weight: 700;
}

/* ---------- /order/ ---------- */
.order-box { max-width: 760px; margin: 20px 0; padding: 28px 28px 24px; }
.order-badge {
  width: 52px; height: 52px; margin-bottom: 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #e3f3e9; color: var(--c-ok);
}
.order-title { margin: 0 0 8px; font: 800 30px/1.2 var(--c-font); letter-spacing: -.015em; overflow-wrap: anywhere; }
.order-number { white-space: nowrap; }
.order-status { margin: 0 0 4px; font-size: 15px; color: var(--c-muted); }
.order-status b { color: var(--c-text); }
.order-items { margin-top: 18px; }
.order-items h2 { margin: 0 0 8px; font: 800 18px/1.2 var(--c-font); }
.order-items ul { margin: 0; padding: 0; list-style: none; }
.order-items li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 16px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--c-line); font-size: 14.5px;
}
.order-items__name { font-weight: 600; overflow-wrap: anywhere; }
.order-items__qty { font-size: 13.5px; color: var(--c-muted); white-space: nowrap; }
.order-items__sum { white-space: nowrap; }
.order-items__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; font-weight: 700; }
.order-items__total b { font: 800 24px var(--c-font); white-space: nowrap; }
.order-box .cart-pickup { margin-top: 18px; border-color: transparent; background: var(--c-bg); box-shadow: none; }
.order-note { margin: 14px 0 0; font-size: 14px; color: var(--c-muted); }
.order-actions { margin-top: 20px; }

/* ---------- кнопка «Заказать» и всплывашка ---------- */
.js-add-to-cart.is-added { background: var(--ok, #1d7a46) !important; color: #ffffff !important; }
.shopcart-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 24px); padding: 12px 16px 12px 12px;
  border-radius: var(--c-r); background: var(--c-text); color: #ffffff;
  box-shadow: 0 12px 30px rgba(20, 30, 40, .25);
  font: 600 14.5px/1.3 var(--c-font);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.shopcart-toast.is-shown { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.shopcart-toast__icon {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--c-ok);
}
.shopcart-toast__icon svg { width: 16px; height: 16px; }
.shopcart-toast__link { margin-left: 6px; color: var(--c-cta); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 980px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "list" "side" "info"; }
  .cart-side { position: static; }
  .cart-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cart-app, .order-app { padding: 0 0 28px; }
  .cart-head { margin: 14px 0 12px; }
  .cart-title { font-size: 26px; }
  .cart-item {
    grid-template-columns: 60px 54px minmax(0, 1fr) auto;
    grid-template-areas: "img info info info" "qty qty sum del";
    gap: 10px 12px;
    padding: 12px;
  }
  .cart-item__img { width: 60px; height: 60px; }
  .cart-item__img small { display: none; }
  .cart-item__name { font-size: 14.5px; }
  .cart-qty__btn { width: 40px; height: 40px; }
  .cart-item__sum { font-size: 17px; }
  .cart-item__del { padding: 10px; }
  .cart-item__del span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .cart-summary, .cart-form { padding: 16px; }
  .cart-summary__total b { font-size: 24px; }
  .cart-steps, .cart-pickup { padding: 14px 16px; }
  .order-box { margin: 14px 0; padding: 22px 16px 18px; }
  .order-title { font-size: 24px; }
  .order-items li { grid-template-columns: minmax(0, 1fr) auto; }
  .order-items__name { grid-column: 1 / -1; }
  .shopcart-toast { left: 12px; right: 12px; bottom: 16px; transform: translateY(16px); }
  .shopcart-toast.is-shown { transform: translateY(0); }
}
