/* Хозтрейд — корзина, оформление заказа, формы заявок, статус заказа. */

.small { font-size: 13px; }
.lead { font-size: 18px; color: #3d4650; max-width: 70ch; }
.page--narrow { max-width: 860px; }
.hp-wrap, .hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.topbar__call { background: none; border: 0; color: #e9f4ed; font: inherit; cursor: pointer; padding: 0; }
.topbar__call:hover { color: #fff; text-decoration: underline; }
.hact--cart { position: relative; }
.badge { position: absolute; top: 0; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #2a1d00; font: 700 11px/18px var(--font); font-style: normal; text-align: center; }
.badge[hidden] { display: none; }
.badge.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.35); } }

.toasts { display: grid; gap: 8px; padding-top: 12px; }
.toast { background: var(--surface); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); }
.toast--error { border-left-color: var(--danger); }
.alert { background: var(--accent-tint); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.alert--error { background: #fde8e1; color: #7a2a0b; }
.success { background: var(--brand-tint); border-radius: var(--radius); padding: 16px 20px; display: grid; gap: 4px; margin-bottom: 20px; }
.success[hidden] { display: none; }
.success b { font-size: 18px; color: var(--brand-dark); }
.warn { color: var(--danger); font-size: 13px; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* Корзина и сводка */
.checkout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.checkout__main { display: grid; gap: 16px; }
.cart { background: var(--surface); border-radius: var(--radius); padding: 4px 16px; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto 110px auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line__img { width: 64px; height: 64px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.cart-line__img img { width: 100%; height: 100%; object-fit: contain; }
.cart-line__info { display: grid; gap: 2px; min-width: 0; }
.cart-line__info a { color: var(--text); text-decoration: none; font-weight: 500; }
.cart-line__info a:hover { color: var(--brand-dark); }
.cart-line__sum { text-align: right; white-space: nowrap; }
.stepper--sm { height: 40px; }
.stepper--sm button { width: 34px; }
.stepper--sm input { width: 52px; }

.summary { background: var(--surface); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; position: sticky; top: 140px; box-shadow: var(--shadow); }
.summary h2 { font-size: 20px; margin: 0; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; }
.summary__row[hidden] { display: none; }
.summary__row--total { font-size: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.summary__truck { background: var(--brand-tint); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; font-size: 14px; }
.summary__truck b { color: var(--brand-dark); font-size: 16px; }
.summary__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; max-height: 260px; overflow: auto; }
.summary__lines li { display: flex; justify-content: space-between; gap: 10px; }
.summary__lines span { color: var(--muted); }

/* Формы */
.panel { background: var(--surface); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.panel h2 { font-size: 20px; margin: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields[hidden] { display: none; }
.field { display: grid; gap: 6px; align-content: start; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; }
.field label span { color: var(--danger); }
.field input, .field select, .field textarea, .dialog input:not([type="checkbox"]) {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: 16px var(--font); color: var(--text); background: #fff;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .dialog input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: 13px; }
.field__error[hidden] { display: none; }
.field input[type="file"] { padding: 8px; }
.hint { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--muted); }
.consent { align-items: flex-start; }
.consent input { margin-top: 3px; }

.segmented { display: inline-flex; flex-wrap: wrap; background: var(--bg); border-radius: 10px; padding: 4px; gap: 4px; justify-self: start; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); }

/* Зоны доставки */
.zones { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.zones legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.zone { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.zone:hover { border-color: var(--brand); }
.zone:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.zone input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.zone__name { display: grid; gap: 2px; min-width: 0; }
.zone__name small { color: var(--muted); font-size: 13px; }
.zone__cost { font-weight: 700; white-space: nowrap; }
.zones.field--error .zone { border-color: var(--danger); }
.tariffs th:not(:first-child), .tariffs td:not(:first-child) { text-align: right; white-space: nowrap; }
.tariffs td small { display: block; color: var(--muted); font-size: 12px; }

.calc { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: end; background: var(--bg); border-radius: var(--radius); padding: 16px; }
.calc__result { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.calc__result b { font-size: 26px; color: var(--brand-dark); }
.calc__result span { color: var(--muted); }
@media (max-width: 560px) { .calc { grid-template-columns: 1fr; } }

/* Статус заказа */
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0; margin: 0 0 20px; counter-reset: step; }
.steps li { counter-increment: step; font-size: 13px; color: var(--muted); padding-top: 34px; position: relative; text-align: center; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--line); color: var(--muted);
  display: grid; place-items: center; font-weight: 700;
}
.steps li.done { color: var(--text); font-weight: 600; }
.steps li.done::before { content: "\2713"; background: var(--brand); color: #fff; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table .num { text-align: right; white-space: nowrap; }
.table tfoot td { border-bottom: 0; }
.table tr.discount td { color: var(--brand-dark); font-weight: 600; }

/* Окно «Перезвоним вам» */
.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(15, 36, 25, .5); }
.dialog__form { padding: 24px; display: grid; gap: 12px; position: relative; }
.dialog__form h2, .dialog__form p { margin: 0; }
.dialog__close { position: absolute; top: 10px; right: 10px; }

/* Информационные страницы */
.prose--page { padding: 24px; }
.prose--page h2 { font-size: 22px; margin-top: 1.2em; }
.prose--page ul { padding-left: 20px; }
.prose--page li { margin-bottom: 6px; }
.prose--page .capacity { margin: 12px 0; }
.big { font-size: 22px; font-weight: 700; }

@media (max-width: 860px) {
  .checkout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 48px 1fr auto; grid-template-areas: "img info del" "qty qty sum"; }
  .cart-line__img { width: 48px; height: 48px; grid-area: img; }
  .cart-line__info { grid-area: info; }
  .cart-line__qty { grid-area: qty; }
  .cart-line__sum { grid-area: sum; }
  .cart-line > form:last-child { grid-area: del; }
  .steps li { font-size: 11px; }
}
@media (max-width: 420px) {
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .steps li { text-align: left; font-size: 14px; padding: 4px 0 4px 40px; min-height: 28px; }
  .steps li::before { left: 0; transform: none; }
}

/* Личный кабинет */
.auth { max-width: 480px; margin: 0 auto; }
.auth .panel { gap: 16px; }
.auth__alt { text-align: center; margin-top: 16px; }
.fields--one { grid-template-columns: 1fr; }
.account__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.account { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.account__orders h2 { font-size: 20px; margin: 0 0 12px; }
.account__side { display: grid; gap: 16px; }
.account__side form { display: grid; gap: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.b2b-note { background: #e6eef8; color: #1e4f8a; border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; font-size: 14px; }
.b2b-note b { font-size: 16px; }
.b2b-note--wait { background: var(--accent-tint); color: #5b4300; }
.status { font-weight: 600; }
.status--done { color: var(--brand-dark); }
.status--canceled { color: var(--danger); }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
@media (max-width: 900px) {
  .account { grid-template-columns: 1fr; }
}
