/* ==========================================================================
   Витрина: главная, каталог, карточка товара, корзина, оформление, оплата.
   Токены и базовые компоненты — в site.css.
   ВНИМАНИЕ: этот файл подключает и печатная форма счёта (invoice_print.html) —
   здесь нельзя задавать стили для общих тегов (body, table, a …), только классы.
   ========================================================================== */

.text-err { color: var(--c-err); }
.empty { text-align: center; padding: 44px 20px; }
.empty-ico { width: 44px; height: 44px; color: var(--brand-200); margin-bottom: 6px; }
.empty-title { font-size: 18px; font-weight: 700; }
.no-photo { color: var(--c-muted); font-size: 13px; }

/* ---------- Заглушки товаров (по категориям) ---------- */
.ph {
  --ph-bg: #e3eeec; --ph-ink: #3b6a63; --ph-soft: #fff;
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; overflow: hidden; background: var(--ph-bg); color: var(--ph-ink); border-radius: inherit;
}
.ph::before { content: ""; position: absolute; height: 78%; max-width: 78%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.ph::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; opacity: .07; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60V40l28-22 18 14 30-26 26 24 16-10 30 22 22-16 30 20v14z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60V40l28-22 18 14 30-26 26 24 16-10 30 22 22-16 30 20v14z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.ph-icon { position: relative; z-index: 1; width: 46%; height: 46%; max-width: 132px; max-height: 132px; }
.ph-water    { --ph-bg: #e1eff6; --ph-ink: #1f6a8f; }
.ph-lemonade { --ph-bg: #edf3d5; --ph-ink: #5b6c10; --ph-soft: #fbfdf0; }
.ph-juice    { --ph-bg: #fde7d3; --ph-ink: #b0510b; --ph-soft: #fffaf4; }
.ph-energy   { --ph-bg: #ebe5f7; --ph-ink: #5a3ea3; }
.ph-iced     { --ph-bg: #f2e6da; --ph-ink: #774829; --ph-soft: #fffaf5; }
.ph-tea      { --ph-bg: #e1f0e3; --ph-ink: #2a7545; }
.ph-candy    { --ph-bg: #fae2e7; --ph-ink: #a12f4b; --ph-soft: #fff8f9; }
.ph-cereal   { --ph-bg: #f7ecd1; --ph-ink: #866012; --ph-soft: #fffcf3; }
.ph-grain    { --ph-bg: #efe8d9; --ph-ink: #765e3b; --ph-soft: #fffcf5; }
.ph-beer     { --ph-bg: #fbeecb; --ph-ink: #8f5d00; --ph-soft: #fff9e8; }
.ph-pack     { --ph-bg: #e7eaec; --ph-ink: #48535e; }
.ph-box      { --ph-bg: #e3eeec; --ph-ink: #3b6a63; }

/* ---------- Заголовки страниц, крошки, секции ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; color: var(--c-muted); margin-bottom: 10px; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { color: var(--c-border-strong); }
.page-title { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.page-title h1 { margin: 0; }
.page-title .ph { width: 64px; height: 64px; flex: none; border-radius: 16px; }
.page-title .ph::after { display: none; }
.page-title .ph-icon { width: 62%; height: 62%; }
.page-sub { margin-top: 4px; font-size: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 36px 0 14px; }
.section-head h2 { margin: 0; }
.section-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; white-space: nowrap; }
.section-link .i { width: 18px; height: 18px; transition: transform .15s; }
.section-link:hover .i { transform: translateX(3px); }

/* ---------- Главная ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #e6f1ed; isolation: isolate;
  background: radial-gradient(120% 140% at 0% 0%, #136c5f 0%, #0b4a41 45%, #073630 100%);
  padding: clamp(28px, 5vw, 60px) clamp(22px, 5vw, 56px); min-height: 360px; display: flex; align-items: center;
}
.hero-ridges { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-content { max-width: 600px; }
.hero .eyebrow { color: var(--sun); }
.hero h1 { color: #fff; font-size: clamp(28px, 3.2vw + 12px, 48px); line-height: 1.08; letter-spacing: -.025em; margin: 14px 0 16px; }
.hero-lead { font-size: clamp(15px, .5vw + 13px, 18px); color: #cfe3dd; max-width: 540px; margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-on-dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .16); border-color: #fff; color: #fff; }
@media (max-width: 700px) {
  .hero { min-height: 0; padding-bottom: 150px; border-radius: 18px; }
  .hero-ridges { top: auto; height: 170px; }
  .hero-actions .btn { width: 100%; }
}

.benefits { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.benefits li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); font-size: 13px; color: var(--c-muted); line-height: 1.4; }
.benefits b { display: block; color: var(--c-text); font-size: 14.5px; margin-bottom: 2px; }
.benefit-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
@media (max-width: 1000px) { .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .benefits { gap: 8px; } .benefits li { flex-direction: column; gap: 8px; padding: 12px; font-size: 12.5px; } .benefits b { font-size: 14px; } .benefit-ico { width: 34px; height: 34px; border-radius: 10px; } }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.category-tile { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.category-tile:hover { text-decoration: none; color: var(--c-text); border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-2px); }
.category-tile .ph { width: 68px; height: 68px; flex: none; border-radius: 14px; }
.category-tile .ph::after { display: none; }
.category-tile .ph-icon { width: 64%; height: 64%; }
.category-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.category-name { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.category-tile:hover .category-name { color: var(--brand); }
.category-count { color: var(--c-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 520px) { .category-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .category-tile { flex-direction: column; align-items: flex-start; gap: 10px; } .category-tile .ph { width: 52px; height: 52px; } .category-name { font-size: 14.5px; } }

.b2b-band { margin-top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px 32px; border-radius: 20px; background: var(--sun-50); border: 1px solid #f1dfb2; position: relative; overflow: hidden; }
.b2b-band::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(242, 181, 68, .16); pointer-events: none; }
.b2b-text { max-width: 720px; position: relative; z-index: 1; }
.b2b-text h2 { margin: 8px 0 8px; }
.b2b-text p { margin: 0; color: var(--c-text-2); }
.b2b-band .eyebrow { color: #8a5a00; }
.b2b-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
@media (max-width: 600px) { .b2b-band { padding: 22px 18px; } .b2b-actions, .b2b-actions .btn { width: 100%; } }

/* ---------- Список товаров: плитка / список ---------- */
.product-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.home-section .product-list, .product-list-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .home-section .product-list, .product-list-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .home-section .product-list, .product-list-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.pcard { container: pcard / inline-size; position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--brand-200); box-shadow: var(--shadow); }
.pcard-media { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--c-surface-2); }
.home-section .pcard-media, .product-list-4 .pcard-media { aspect-ratio: 4 / 3; }
.pcard-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.pcard-flag { position: absolute; top: 10px; left: 10px; z-index: 2; }
.pcard-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 0; flex: 1; }
.pcard-cat { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-title { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.pcard-name { color: var(--c-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-name:hover { color: var(--brand); }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12.5px; color: var(--c-muted); }
.pcard-meta .avail { font-size: 12.5px; }
.pcard-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; padding: 12px 14px 0; }
.pcard-price-label { flex-basis: 100%; font-size: 12px; color: var(--c-muted); }
.pcard-unit { color: var(--c-muted); font-size: 13px; }
.pcard-min { flex-basis: 100%; font-size: 12px; font-weight: 650; color: var(--c-warn); margin-top: 2px; }
.pcard-actions { padding: 12px 14px 14px; }
.pcard-blocked .pcard-actions { padding-top: 10px; }

.buy-form { display: flex; gap: 8px; align-items: center; }
.btn-cart { flex: 1; white-space: nowrap; }
.btn-cart .i { width: 19px; height: 19px; }
.qty-input { width: 76px; }
.buy-blocked { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--c-warn); background: var(--c-warn-50); border-radius: var(--radius-sm); padding: 9px 11px; }
.buy-blocked .i { width: 17px; height: 17px; margin-top: 1px; }

@container pcard (max-width: 280px) {
  .pcard .btn-cart { flex: 0 0 44px; padding: 0; }
  .pcard .btn-cart span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pcard .qty { flex: 1; }
  .pcard .qty input { flex: 1; width: 100%; }
}
@container pcard (max-width: 200px) {
  .pcard-body, .pcard-price { padding-left: 10px; padding-right: 10px; }
  .pcard-actions { padding: 10px; }
  .pcard .qty button { width: 30px; }
  .pcard .qty input { width: 100%; min-width: 0; }
  .pcard-title { font-size: 13.5px; }
}

/* Вид «списком» — для быстрых оптовых закупок */
.product-list.is-list { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); overflow: hidden; }
.is-list .pcard { container-type: normal; display: grid; grid-template-columns: 64px minmax(0, 1fr) 190px 270px; align-items: center; gap: 0 16px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--c-border); border-radius: 0; box-shadow: none; }
.is-list .pcard:last-child { border-bottom: 0; }
.is-list .pcard:hover { background: #fcfbf8; box-shadow: none; }
.is-list .pcard-media { width: 64px; height: 64px; aspect-ratio: auto; border-radius: 10px; overflow: hidden; }
.is-list .pcard-media .ph::before { width: 72%; }
.is-list .pcard-media .ph::after { display: none; }
.is-list .pcard-media .ph-icon { width: 62%; height: 62%; }
.is-list .pcard-flag { top: auto; bottom: 3px; left: 3px; padding: 1px 5px; font-size: 9px; }
.is-list .pcard-body { padding: 0; gap: 3px; }
.is-list .pcard-cat { display: none; }
.is-list .pcard-name { -webkit-line-clamp: 2; }
.is-list .pcard-price { padding: 0; justify-content: flex-end; text-align: right; }
.is-list .pcard-price-label, .is-list .pcard-min { text-align: right; }
.is-list .pcard-actions { padding: 0; }
.is-list .btn-cart span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
@media (max-width: 1100px) { .is-list .pcard { grid-template-columns: 56px minmax(0, 1fr) 160px 230px; gap: 0 12px; } .is-list .pcard-media { width: 56px; height: 56px; } }
@media (max-width: 760px) {
  .is-list .pcard { grid-template-columns: 56px minmax(0, 1fr); gap: 8px 12px; align-items: start; }
  .is-list .pcard-price { grid-column: 2; justify-content: flex-start; text-align: left; }
  .is-list .pcard-price-label, .is-list .pcard-min { text-align: left; }
  .is-list .pcard-actions { grid-column: 1 / -1; }
}

/* ---------- Степпер количества (добавляется скриптом) ---------- */
.qty { display: inline-flex; align-items: stretch; height: 42px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); background: #fff; overflow: hidden; flex: none; transition: border-color .15s, box-shadow .15s; }
.qty:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 90, 79, .16); }
.qty input.qty-input { width: 46px; min-height: 0; height: auto; padding: 0 2px; border: 0; border-radius: 0; text-align: center; font-weight: 700; box-shadow: none; -moz-appearance: textfield; appearance: textfield; background: transparent; }
.qty input.qty-input:focus-visible { outline: none; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-btn { width: 34px; flex: none; border: 0; padding: 0; background: var(--c-surface-2); color: var(--brand); font: 700 19px/1 var(--font); cursor: pointer; }
.qty-btn:hover { background: var(--brand-50); }
.qty-btn:disabled { color: #b7c2bf; cursor: default; background: var(--c-surface-2); }
.qty-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 0; }

/* ---------- Каталог ---------- */
.cat-chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); padding-right: 40px !important; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.subcategories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-surface); color: var(--c-text-2); font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-count { color: var(--c-muted); font-weight: 500; }

.filters { position: sticky; top: calc(var(--header-h) + 16px); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.filters-head { display: none; }
.filters select, .filters input { width: 100%; }
.filters .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; color: var(--c-text-2); }
.price-range { display: flex; gap: 6px; align-items: center; color: var(--c-muted); }
.price-range input { min-width: 0; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.filter-actions .btn { flex: 1; }
.list-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sort-form { display: flex; gap: 8px; align-items: center; }
.sort-form select { min-height: 40px; }
.view-toggle { display: none; gap: 2px; padding: 3px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.js .view-toggle { display: inline-flex; }
.view-toggle .icon-btn { width: 34px; height: 34px; border-radius: 7px; color: var(--c-muted); }
.view-toggle .icon-btn .i { width: 20px; height: 20px; }
.view-toggle .icon-btn[aria-pressed="true"] { background: var(--brand-50); color: var(--brand); }
.list-toolbar .filters-open { display: none; }

@media (max-width: 900px) {
  .filters { position: static; }
  .js .list-toolbar .filters-open { display: inline-flex; margin-right: auto; }
  .js .filters { position: fixed; z-index: 70; inset: auto 0 0 0; max-height: 88vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 18px 22px; box-shadow: var(--shadow-lg); transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  .js body.filters-visible .filters { transform: none; visibility: visible; transition: transform .22s ease; }
  .js .filters-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 10px; margin-bottom: 10px; border-bottom: 1px solid var(--c-border); position: sticky; top: -8px; background: #fff; z-index: 1; }
  .js .filters-title { font-weight: 800; font-size: 18px; }
  .js body.filters-visible .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(6, 39, 35, .45); }
  body.filters-visible { overflow: hidden; }
}
@media (max-width: 480px) { .sort-form label { display: none; } .sort-form select { max-width: 160px; } .list-toolbar { flex-wrap: nowrap; gap: 8px; } .list-toolbar .filters-open { padding: 0 12px; } }

/* ---------- Страница товара ---------- */
.product-page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: start; }
.product-photo { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 20px; background: var(--c-surface); border: 1px solid var(--c-border); }
.product-photo img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 18px; }
.product-photo-ph { border: 0; }
.product-photo .ph::before { height: 64%; }
.product-photo .ph-icon { width: 44%; height: 44%; max-width: 220px; max-height: 220px; }
.product-photo .no-photo { position: absolute; bottom: 14px; right: 16px; font-size: 12px; font-weight: 600; color: var(--c-text-2); background: rgba(255, 255, 255, .7); padding: 3px 10px; border-radius: 999px; }
.product-flag { position: absolute; top: 16px; left: 16px; font-size: 12px; padding: 5px 11px; }
.product-info h1 { margin: 6px 0 12px; font-size: clamp(22px, 1.6vw + 14px, 32px); }
.product-cat { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.product-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; font-size: 13px; color: var(--c-muted); }
.meta-item { padding: 4px 10px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; }
.meta-item b { color: var(--c-text); font-weight: 650; }
.buy-box { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.buy-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.buy-label { font-size: 13px; color: var(--c-muted); font-weight: 600; }
.price-lg { font-size: clamp(28px, 1.5vw + 20px, 36px); line-height: 1.15; letter-spacing: -.02em; }
.price-unit { font-size: 15px; font-weight: 500; color: var(--c-muted); letter-spacing: 0; }
.buy-top .avail { font-size: 14px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, currentColor 9%, #fff); }
.min-qty { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--c-warn); background: var(--c-warn-50); padding: 9px 12px; border-radius: var(--radius-sm); }
.min-qty .i { width: 18px; height: 18px; }
.buy-form-lg .qty { height: 50px; }
.buy-form-lg .qty input.qty-input { width: 64px; font-size: 17px; }
.buy-form-lg .qty-btn { width: 44px; }
.buy-form-lg > .qty-input { width: 96px; min-height: 50px; }
.buy-hint { margin: -4px 0 0; }
.buy-extra { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--c-border); padding-top: 14px; }
.fav-btn.is-active { background: var(--accent-50); border-color: #f0b9b2; color: var(--accent); }
.fav-btn .i { width: 18px; height: 18px; }
.buy-extra .btn .i { width: 18px; height: 18px; }
.product-facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--c-text-2); }
.product-facts li { display: flex; gap: 10px; align-items: flex-start; }
.product-facts .i { color: var(--brand); width: 20px; height: 20px; }
.product-section { margin-top: 36px; }
.product-section > h2 { margin-top: 0; }
.product-description { max-width: 860px; }
.product-description p:first-child { margin-top: 0; }
.product-description p:last-child { margin-bottom: 0; }
.chars-list { margin: 0; max-width: 860px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.chars-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; padding: 11px 16px; border-bottom: 1px solid var(--c-border); }
.chars-row:nth-child(even) { background: var(--c-surface-2); }
.chars-row:last-child { border-bottom: 0; }
.chars-row dt { color: var(--c-muted); }
.chars-row dd { margin: 0; font-weight: 600; }
@media (max-width: 860px) {
  .product-page { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .product-photo { aspect-ratio: 16 / 10; max-height: 340px; width: 100%; }
  .buy-box { padding: 18px; }
  .buy-form-lg .btn-cart { flex: 1; }
}

/* ---------- Корзина ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cart-errors ul { margin: 6px 0 0; padding-left: 20px; }
.cart-table td { vertical-align: middle; }
.cart-table tbody tr:hover > td { background: transparent; }
.cart-thumb { width: 88px; }
.cart-thumb a { display: flex; width: 64px; height: 64px; align-items: center; justify-content: center; border-radius: 12px; overflow: hidden; background: var(--c-surface-2); }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-thumb .ph::after { display: none; }
.cart-thumb .ph::before { width: 74%; }
.cart-thumb .ph-icon { width: 64%; height: 64%; }
.cart-name { font-weight: 600; color: var(--c-text); }
.cart-name:hover { color: var(--brand); }
.cart-line-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: 13px; color: var(--c-muted); }
.cart-line-meta .avail { font-size: 12.5px; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.cart-sum { font-weight: 800; font-size: 16px; }
.cart-remove { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--radius-sm); color: var(--c-muted); }
.cart-remove:hover { background: var(--c-err-50); color: var(--c-err); text-decoration: none; }
.cart-remove .i { width: 20px; height: 20px; }
.row-warn > td { background: #fffaf0 !important; }
.row-warn .cart-thumb a { box-shadow: 0 0 0 2px #f3d593; }
.cart-summary { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.cart-summary h2 { margin: 0; font-size: 19px; }
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--c-border-strong); border-bottom: 1px dashed var(--c-border-strong); }
.cart-total-row .price { font-size: 26px; }
.cart-count-row { display: flex; justify-content: space-between; color: var(--c-muted); font-size: 14px; }
.cart-recalc { display: flex; }
.cart-form.is-dirty .cart-recalc { background: var(--sun); border-color: var(--sun); color: var(--brand-900); }
.recalc-hint { display: none; font-size: 13px; color: var(--c-warn); font-weight: 600; }
.cart-form.is-dirty .recalc-hint { display: block; }
.cart-continue { text-align: center; font-size: 14px; }
@media (max-width: 960px) { .cart-layout { grid-template-columns: minmax(0, 1fr); } .cart-summary { position: static; } }
@media (max-width: 700px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr { display: block; width: 100%; }
  .cart-table tr { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 12px; padding: 14px 12px; border-bottom: 1px solid var(--c-border); }
  .cart-table tbody tr:last-child { border-bottom: 0; }
  .cart-table td { display: block; border: 0; padding: 0; text-align: left; }
  .cart-table td.cart-thumb { grid-row: span 4; width: auto; }
  .cart-table td.cart-info { padding-right: 40px; }
  .cart-table td.right { text-align: left; }
  .cart-table td[data-label] { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .cart-table td[data-label]::before { content: attr(data-label); color: var(--c-muted); font-size: 13px; }
  .cart-table td.cart-actions { position: absolute; top: 8px; right: 6px; }
  .cart-table td.cart-thumb a { width: 64px; height: 64px; }
}

/* ---------- Оформление заказа ---------- */
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.checkout-main { display: flex; flex-direction: column; gap: 16px; counter-reset: step; }
.checkout-intro { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--brand-50); color: var(--c-text-2); margin-bottom: 16px; }
.checkout-intro .i { color: var(--brand); }
.checkout fieldset { margin: 0; min-width: 0; }
.checkout fieldset.card { padding: 18px 20px 6px; }
.checkout legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; padding: 0; margin-bottom: 16px; counter-increment: step; }
.checkout legend::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 800; }
.checkout legend + * { clear: both; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.choice-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
label.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
label.choice input { margin-top: 2px; width: 18px; flex: none; }
.choice-list label.choice { padding: 13px 14px; border: 1.5px solid var(--c-border-strong); border-radius: var(--radius-sm); background: #fff; font-weight: 600; transition: border-color .15s, background-color .15s; }
.choice-list label.choice:hover { border-color: var(--brand-200); }
.choice-list label.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.choice-list label.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.pickup-info { display: flex; gap: 12px; align-items: flex-start; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.pickup-info > .i { color: var(--brand); margin-top: 2px; }
.pickup-info[hidden] { display: none; }
.pickup-hours { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--c-text-2); }
.pickup-hours .i { width: 16px; height: 16px; color: var(--brand); }
.checkout .agree { padding: 2px 4px; }
.checkout-summary { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.checkout-summary h2 { margin: 0; font-size: 19px; }
.summary-lines { list-style: none; padding: 0; margin: 0; max-height: 340px; overflow: auto; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--c-border); font-size: 14px; }
.summary-lines li > span:last-child { font-weight: 650; font-variant-numeric: tabular-nums; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; padding-top: 4px; }
.summary-total .price { font-size: 26px; }
.checkout-back { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.checkout-back .i { width: 16px; height: 16px; }
@media (max-width: 960px) { .checkout-layout { grid-template-columns: minmax(0, 1fr); } .checkout-summary { position: static; } }
@media (max-width: 560px) { .form-grid-2 { grid-template-columns: 1fr; } .checkout fieldset.card { padding: 16px 14px 4px; } }

/* ---------- Заказ, оплата ---------- */
.success-head { display: flex; gap: 18px; align-items: flex-start; padding: 24px; margin-bottom: 18px; border-radius: 20px; background: linear-gradient(135deg, var(--brand-50), #f6fbf9); border: 1px solid var(--brand-100); }
.success-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 0 0 8px rgba(14, 90, 79, .1); }
.success-ico .i { width: 28px; height: 28px; }
.success-head h1 { margin: 4px 0 8px; }
.success-head p { margin: 0; color: var(--c-text-2); max-width: 760px; }
.order-page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.order-page-head h1 { margin: 0; }
.order-meta { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin-bottom: 16px; }
.order-meta dt { color: var(--c-muted); font-size: 14px; padding-top: 1px; }
.order-meta dd { margin: 0; }
.order-meta .pickup-line { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: 13px; color: var(--c-text-2); }
@media (max-width: 560px) { .order-meta { grid-template-columns: minmax(0, 1fr); gap: 2px; } .order-meta dd { margin-bottom: 8px; } }
.order-items { margin-bottom: 16px; }
.order-items tfoot td { border-bottom: 0; }
.order-items .total-row td { font-size: 17px; font-weight: 800; }
.pay-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; border-left: 4px solid var(--sun); }
.pay-box p { margin: 0; }
.pay-box-col { flex-direction: column; align-items: stretch; }
.pay-sum { font-size: 15px; color: var(--c-text-2); }
.requisites { margin-bottom: 16px; }
.requisites h2 { margin-top: 0; }
.requisites-table th { width: 30%; color: var(--c-muted); font-weight: 600; background: var(--c-surface-2); }
.requisites-table td { font-variant-numeric: tabular-nums; }
.payment-purpose { background: var(--sun-50); border: 1px dashed #e8c77a; padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 12px; }
.status-paid, .pay-paid { background: var(--c-ok-50); color: var(--c-ok); }
.status-cancelled { background: var(--c-err-50); color: var(--c-err); }
.status-awaiting_payment, .pay-unpaid, .pay-pending { background: var(--c-warn-50); color: var(--c-warn); }
.order-history { list-style: none; padding: 0; }
.order-history li { padding: 4px 0; border-bottom: 1px solid var(--c-border); }
.page-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.page-back .i { width: 16px; height: 16px; }

/* Счёт на оплату (печатная форма) */
.invoice-body { background: #fff; color: #000; font: 13px/1.4 Arial, Helvetica, sans-serif; margin: 0; }
.invoice { max-width: 800px; margin: 0 auto; padding: 24px; }
.invoice table { width: 100%; border-collapse: collapse; }
.inv-bank td { border: 1px solid #000; padding: 3px 6px; vertical-align: top; }
.inv-bank .inv-label { width: 60px; }
.inv-bank-name { width: 60%; }
.inv-caption { font-size: 11px; margin-top: 10px; }
.inv-title { font-size: 20px; margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 2px solid #000; }
.inv-parties td { padding: 4px 6px 4px 0; vertical-align: top; }
.inv-parties .inv-label { width: 110px; }
.inv-items { margin-top: 12px; }
.inv-items th, .inv-items td { border: 1px solid #000; padding: 3px 6px; }
.inv-items th { background: #f2f2f2; }
.invoice .c { text-align: center; } .invoice .r { text-align: right; }
.inv-totals { width: auto !important; margin: 8px 0 0 auto; }
.inv-totals td { padding: 2px 0 2px 16px; font-weight: 700; text-align: right; }
.inv-words { border-bottom: 2px solid #000; padding-bottom: 10px; }
.inv-signs { display: flex; justify-content: space-between; gap: 24px; margin-top: 36px; flex-wrap: wrap; }
.sign-line { display: inline-block; width: 140px; border-bottom: 1px solid #000; margin: 0 6px; }
.invoice-toolbar { max-width: 800px; margin: 0 auto; padding: 12px 24px 0; display: flex; gap: 16px; align-items: center; }
.invoice-toolbar button { padding: 6px 16px; cursor: pointer; }
@media print {
  .no-print { display: none !important; }
  .invoice { padding: 0; max-width: none; }
  @page { size: A4; margin: 15mm; }
}

/* ---------- Не хочется выбирать вручную: сборка заказа на сумму ---------- */
.text-warn { color: var(--c-warn); }
.builder { margin-bottom: 20px; border-color: var(--brand-200); background: linear-gradient(180deg, var(--brand-50), var(--c-surface) 70%); }
.builder-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.builder-ico { width: 30px; height: 30px; flex: none; color: var(--brand); margin-top: 2px; }
.builder-head h2 { margin: 0 0 4px; font-size: 19px; }
.builder-lead { margin: 0; color: var(--c-text-2); max-width: 72ch; }
.builder-form { display: flex; flex-direction: column; gap: 10px; }
.builder-row { display: flex; gap: 10px; flex-wrap: wrap; }
.builder-input { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 340px; }
.builder-input input { width: 100%; height: 50px; padding-right: 38px; font-size: 18px; font-weight: 700; }
.builder-cur { position: absolute; right: 14px; color: var(--c-muted); font-weight: 700; pointer-events: none; }
.builder-btn { flex: none; }
.builder-keep { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; margin: 0; }
.builder-keep input { width: 17px; height: 17px; margin: 0; flex: none; }
.builder-hints { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.builder-chip { padding: 5px 12px; border: 1px solid var(--c-border-strong); border-radius: 999px; background: var(--c-surface); font-size: 14px; font-weight: 600; color: var(--c-text-2); cursor: pointer; }
.builder-chip:hover { border-color: var(--brand); color: var(--brand); }
.builder-applied { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--c-ok-50); color: var(--c-text); }
.builder-applied .i { color: var(--c-ok); flex: none; margin-top: 2px; }
.builder-applied span { min-width: 0; }
@media (max-width: 600px) { .builder-input { max-width: none; } .builder-btn { flex: 1 1 auto; justify-content: center; } }
.cart-build-note { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); }
.cart-build-note .i { flex: none; margin-top: 1px; }
.cart-build-note.is-exact { background: var(--c-ok-50); color: var(--c-ok); }
.cart-build-note.is-approx { background: var(--c-warn-50); color: var(--c-warn); }
