/* =============================================================================
   Витрина каталога
   ========================================================================== */

body.catalog {
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
}
@media (min-width: 900px) {
  body.catalog { padding-bottom: 40px; }
}

/* -----------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--fast), box-shadow var(--fast);
  padding-top: env(safe-area-inset-top);
}
.app-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--sh-xs); }

.header-inner {
  display: flex; align-items: center; gap: 10px;
  height: var(--header-h);
  padding: 0 var(--page-pad);
  max-width: 1320px; margin: 0 auto;
}

.header-back {
  width: 38px; height: 38px; flex: none;
  display: none; place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  transition: all var(--fast);
}
.header-back:hover { background: var(--surface-3); }
.header-back.visible { display: grid; }

.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
/* Когда видна кнопка «назад», логотип прячем — не показываем оба сразу */
.header-back.visible ~ .header-brand > :first-child { display: none; }
.header-logo {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  object-fit: cover; background: var(--accent-soft);
}
.header-logo-fallback {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-contrast);
  font-weight: 800; font-size: 15px; letter-spacing: -.5px;
}
.header-titles { min-width: 0; }
.header-title {
  font-size: 16.5px; font-weight: 720; letter-spacing: -.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-subtitle {
  font-size: 12px; color: var(--text-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.header-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--text-2); background: transparent;
  transition: all var(--fast);
}
.header-btn:hover { background: var(--surface-2); color: var(--text); }
.header-btn.active { background: var(--accent-soft); color: var(--accent); }
.header-btn .badge { position: absolute; top: 2px; right: 1px; }

/* Поиск */
.search-bar {
  max-width: 1320px; margin: 0 auto;
  padding: 0 var(--page-pad) 10px;
  display: none;
}
.search-bar.open { display: block; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field .input { padding-left: 40px; padding-right: 40px; min-height: 44px; border-radius: var(--r-md); }
.search-field .search-icon { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; }
.search-field .search-clear {
  position: absolute; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-3); background: var(--surface-2);
}

/* Хлебные крошки */
.breadcrumbs {
  max-width: 1320px; margin: 0 auto;
  padding: 2px var(--page-pad) 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3);
  overflow-x: auto; scrollbar-width: none;
}
.breadcrumbs::-webkit-scrollbar { display: none; }
.breadcrumbs button { color: var(--text-3); white-space: nowrap; transition: color var(--fast); }
.breadcrumbs button:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs .current { color: var(--text); font-weight: 600; white-space: nowrap; }

/* -----------------------------------------------------------------------------
   Основная сетка
   -------------------------------------------------------------------------- */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 6px var(--page-pad) 32px;
}

.section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 12px;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title:first-child { margin-top: 6px; }

/* --- Категории --- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
@media (min-width: 640px) { .categories-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; } }

/* Фото занимает всю плитку, название лежит поверх него в нижней части —
   как в прежней версии каталога. Градиент поверх фото делает текст читаемым
   на любой картинке, а цвет берётся из темы, поэтому в тёмной теме подложка
   тоже тёмная. */
.category-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3.5;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
  -webkit-tap-highlight-color: transparent;
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line-strong); }
.category-card:active { transform: scale(.985); }

.category-media {
  position: absolute; inset: 0;
  background: var(--surface-2);
  overflow: hidden;
}
.category-media img {
  position: relative; z-index: 1;   /* поверх иконки-заглушки */
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity var(--normal), filter .45s var(--ease);
}
.category-media img.loaded { opacity: 1; }
.category-media .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-3); font-size: 26px;
}

.category-body {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 26px 10px 9px;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--surface) 96%, transparent) 0%,
    color-mix(in srgb, var(--surface) 78%, transparent) 45%,
    transparent 100%);
  pointer-events: none;
}
.category-texts { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.category-name {
  font-size: 14.5px; font-weight: 700; line-height: 1.25; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.category-count { font-size: 11.5px; color: var(--text-3); font-weight: 550; }
.category-chevron { flex: none; color: var(--text-2); display: flex; align-items: center; padding-bottom: 2px; }

/* --- Товары --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
@media (min-width: 640px) { .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .products-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); } }

/* Карточка товара — целиком фото в формате 3:4 (кадр выбирает админ), а
   название, цена и кнопка «в корзину» лежат поверх фото снизу. */
.product-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
  -webkit-tap-highlight-color: transparent;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--line-strong); }
.product-card:active { transform: scale(.985); }
/* Товара нет в наличии — фото остаётся обычным (без обесцвечивания и
   притушивания): покупатель видит вещь как есть, а о наличии сообщает лента
   «Нет в наличии» поверх фото (.stock-ribbon ниже). */

/* Точечное обновление каталога: новая карточка мягко появляется, удалённая —
   так же мягко уходит. Остальные карточки при этом не перерисовываются. */
@keyframes card-appear { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.product-card.card-appear,
.category-card.card-appear { animation: card-appear .26s var(--ease) both; }
.product-card.card-leave,
.category-card.card-leave {
  opacity: 0; transform: scale(.94);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  pointer-events: none;
}


.product-media { position: absolute; inset: 0; background: var(--surface-2); overflow: hidden; }
.product-media img {
  position: relative; z-index: 1;   /* поверх иконки-заглушки */
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity var(--normal), transform var(--slow), filter .45s var(--ease);
}
.product-media img.loaded { opacity: 1; }
.product-card:hover .product-media img.loaded { transform: scale(1.04); }
.product-media .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-3); font-size: 28px;
}

.product-flags { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 5px; z-index: 2; }
.flag {
  height: 22px; padding: 0 8px; border-radius: 7px;
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 750; letter-spacing: .02em;
  background: var(--accent); color: var(--accent-contrast);
  box-shadow: var(--sh-xs);
}
.flag-discount { background: var(--danger); color: #fff; }
.flag-new { background: var(--success); color: #fff; }
.flag-custom { background: var(--info); color: #fff; }

.product-gallery-count {
  height: 22px; padding: 0 8px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  background: rgba(10, 14, 24, .62); color: #fff;
  font-size: 11px; font-weight: 700;
  backdrop-filter: blur(4px);
}

/* «Нет в наличии» — полосой по центру фото: снизу теперь название и цена,
   там ленте места нет, а по центру надпись видно сразу. */
.stock-ribbon {
  position: absolute; top: 50%; left: 0; right: 0; z-index: 3;
  transform: translateY(-50%);
  padding: 7px 10px; text-align: center;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(7px);
  font-size: 12.5px; font-weight: 800; color: var(--danger);
  letter-spacing: .02em; text-transform: uppercase;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent) inset;
}

/* Тёмная подложка и белый текст поверх фото — как было в прежней версии
   каталога: читается на любой фотографии и одинаково выглядит в обеих темах. */
.product-body {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 34px 9px 9px;
  background: linear-gradient(to top,
    rgba(8, 12, 20, .84) 0%,
    rgba(8, 12, 20, .58) 45%,
    rgba(8, 12, 20, 0) 100%);
}
.product-texts { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.product-name {
  font-size: 13.5px; font-weight: 640; line-height: 1.26; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-prices { display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; flex-wrap: wrap; margin-left: auto; text-align: right; }
.price {
  font-size: 16px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.price-old { font-size: 13px; color: var(--text-3); text-decoration: line-through; font-weight: 500; }
.price-discount { color: var(--danger); }
.price-unit { font-size: 12px; color: var(--text-3); font-weight: 550; }
.price-none { font-size: 13px; color: var(--text-3); font-weight: 550; }

/* Цены на карточке лежат поверх фото, поэтому там они белые (в карточке
   товара и корзине остаются обычными). */
.product-card .price { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.product-card .price-old { color: rgba(255, 255, 255, .72); }
.product-card .price-discount { color: #ff8080; }
.product-card .price-unit,
.product-card .price-none { color: rgba(255, 255, 255, .82); }
.product-card .price-wholesale { background: rgba(255, 255, 255, .16); color: #ffe27a; }
.price-wholesale {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--info);
  background: var(--info-soft); padding: 2px 7px; border-radius: 6px;
}

/* Розничная цена рядом с оптовой (режим опта). */
.product-prices-retail { margin-top: 1px; gap: 5px; }
.price-retail {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.price-retail-label {
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
}
.product-card .price-retail { color: rgba(255, 255, 255, .92); text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.product-card .price-retail-label { color: rgba(255, 255, 255, .7); }

/* Компактная кнопка «в корзину» в правом нижнем углу карточки: цена остаётся
   у правого края текстового блока, а кнопка не отнимает высоту у фото. */
.product-add {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-sm);
  transition: transform var(--fast), background var(--fast), color var(--fast);
}
.product-add:hover { transform: scale(1.07); }
.product-add:active { transform: scale(.94); }
.product-add.in-cart { background: var(--success); color: #fff; }

/* Скелетон карточки */
.skeleton-card {
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); overflow: hidden;
}
.skeleton-card .sk-media { aspect-ratio: 3 / 4; }
.categories-grid .skeleton-card .sk-media { aspect-ratio: 4 / 3.5; }
.skeleton-card .sk-body { display: none; }

/* -----------------------------------------------------------------------------
   Карточка товара (модалка)
   -------------------------------------------------------------------------- */
.product-modal .modal-panel { width: min(960px, 100%); }
.product-view { display: grid; gap: 0; }
@media (min-width: 860px) { .product-view { grid-template-columns: 1.05fr .95fr; } }

.pv-gallery { position: relative; background: var(--surface-2); overflow: hidden; touch-action: pan-y; }
.pv-slides { display: flex; transition: transform var(--normal); height: 100%; }
/* Покупателю всегда показываем формат 3:4 — как на карточке. Полный
   (необрезанный) оригинал доступен только по кнопке «Скачать оригинал». */
.pv-slide { min-width: 100%; position: relative; aspect-ratio: 3 / 4; }
@media (min-width: 860px) { .pv-slide { max-height: 640px; } }
.pv-slide img { width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }

.pv-download {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  height: 32px; padding: 0 12px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(10, 14, 24, .62); color: #fff;
  font-size: 12px; font-weight: 650;
  backdrop-filter: blur(4px);
  transition: background var(--fast);
}
.pv-download:hover { background: rgba(10, 14, 24, .8); }

.pv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text); box-shadow: var(--sh-sm);
  backdrop-filter: blur(6px);
  transition: all var(--fast); z-index: 3;
}
.pv-nav:hover { background: var(--surface); transform: translateY(-50%) scale(1.06); }
.pv-nav.prev { left: 10px; }
.pv-nav.next { right: 10px; }

.pv-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 3; }
.pv-dot { width: 6px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 30%, transparent); transition: all var(--fast); }
.pv-dot.active { width: 18px; background: var(--accent); }

.pv-thumbs { display: flex; gap: 7px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; background: var(--surface); }
.pv-thumbs::-webkit-scrollbar { display: none; }
.pv-thumb {
  position: relative;
  width: 54px; height: 54px; flex: none; border-radius: var(--r-xs);
  overflow: hidden; border: 2px solid transparent; opacity: .6;
  transition: all var(--fast); cursor: pointer;
}
.pv-thumb.active { border-color: var(--accent); opacity: 1; }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pv-info { padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overflow-x: hidden; max-width: 100%; }
.pv-title { font-size: 21px; font-weight: 720; line-height: 1.25; }
.pv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.pv-price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pv-price { font-size: 27px; font-weight: 780; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pv-price.discount { color: var(--danger); }
.pv-price-old { font-size: 17px; color: var(--text-3); text-decoration: line-through; }

/* Режим опта: под крупной оптовой ценой — розничная, чтобы обе были видны. */
.pv-price-retail {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 2px;
}
.pv-price-retail-label {
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
}
.pv-price-retail-value {
  font-size: 16px; font-weight: 700; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.pv-unit { font-size: 14px; color: var(--text-3); font-weight: 550; }

.pv-desc { font-size: 14.5px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.pv-desc a { color: var(--accent); text-decoration: underline; }

.pv-actions { display: flex; flex-direction: column; gap: 9px; margin-top: auto; padding-top: 6px; min-width: 0; }
.pv-actions-row { display: flex; gap: 9px; flex-wrap: wrap; min-width: 0; }
.pv-actions-row > * { flex: 1 1 auto; }
.pv-actions-row .qty-control { flex: none; }

/* Параметры товара */
.option-group { display: flex; flex-direction: column; gap: 8px; }
.option-label {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 12.5px; font-weight: 680; color: var(--text-2);
}
.option-label .req { color: var(--danger); }
.option-label .picked { color: var(--text-3); font-weight: 500; }
.option-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.option-chip {
  min-height: 36px; padding: 0 14px; border-radius: var(--r-xs);
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--fast);
}
.option-chip:hover { border-color: var(--line-strong); }
.option-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.option-chip.disabled { opacity: .4; pointer-events: none; text-decoration: line-through; }
.option-chip .delta { font-size: 11.5px; opacity: .8; font-variant-numeric: tabular-nums; }

/* Количество */
.qty-control {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); overflow: hidden; flex: none;
}
.qty-control button {
  width: 40px; height: 42px; display: grid; place-items: center;
  color: var(--text-2); font-size: 17px; font-weight: 600;
  transition: background var(--fast);
}
.qty-control button:hover { background: var(--surface-2); color: var(--accent); }
.qty-control button:disabled { opacity: .35; pointer-events: none; }
.qty-control input {
  width: 62px; height: 42px; border: 0; text-align: center;
  background: transparent; font-weight: 700; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-unit { padding: 0 12px 0 2px; font-size: 13px; font-weight: 650; color: var(--text-3); }

/* -----------------------------------------------------------------------------
   Корзина
   -------------------------------------------------------------------------- */
.cart-drawer {
  position: fixed; inset: 0; z-index: 420;
  display: none;
}
.cart-drawer.is-open { display: block; }
.cart-backdrop {
  position: absolute; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(5px);
  opacity: 0; transition: opacity var(--normal);
}
.cart-drawer.is-visible .cart-backdrop { opacity: 1; }
.cart-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(460px, 100%);
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-xl);
  transform: translateX(100%);
  transition: transform var(--slow);
}
.cart-drawer.is-visible .cart-panel { transform: none; }
@media (max-width: 720px) {
  .cart-panel {
    top: auto; left: 0; height: 92dvh;
    width: 100%;
    border-left: 0; border-top: 1px solid var(--line);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%);
  }
}

.cart-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); flex: none;
  padding-top: max(16px, env(safe-area-inset-top));
}
.cart-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 18px; overscroll-behavior: contain; }
.cart-footer {
  flex: none; padding: 16px 18px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; gap: 12px;
}

.cart-item {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-media {
  position: relative;
  width: 64px; height: 64px; border-radius: var(--r-xs);
  overflow: hidden; background: var(--surface-2); flex: none;
}
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 620; line-height: 1.35; }
.cart-item-options { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-item-sum { font-size: 15px; font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-item-remove { color: var(--text-3); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; transition: all var(--fast); }
.cart-item-remove:hover { color: var(--danger); background: var(--danger-soft); }

.cart-totals { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.cart-total-row { display: flex; justify-content: space-between; color: var(--text-2); }
.cart-total-row.grand { font-size: 19px; font-weight: 780; color: var(--text); padding-top: 8px; border-top: 1px solid var(--line); }
.cart-total-row .num { font-variant-numeric: tabular-nums; }

.cart-warning {
  display: flex; gap: 9px; padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--warning-soft); color: var(--warning);
  font-size: 13px; font-weight: 550; line-height: 1.45;
}

/* Форма оформления */
.checkout-form { display: flex; flex-direction: column; gap: 14px; }
.checkout-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.option-cards { display: flex; flex-direction: column; gap: 8px; }
.option-card {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; transition: all var(--fast); text-align: left; width: 100%;
}
.option-card:hover { border-color: var(--line-strong); }
.option-card.active { border-color: var(--accent); background: var(--accent-soft); }
.option-card-radio {
  width: 19px; height: 19px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-strong); position: relative; transition: all var(--fast);
}
.option-card.active .option-card-radio { border-color: var(--accent); }
.option-card.active .option-card-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent);
}
.option-card-body { flex: 1; min-width: 0; }
.option-card-name { font-size: 14px; font-weight: 620; }
.option-card-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.option-card-price { font-size: 13.5px; font-weight: 700; white-space: nowrap; }

.order-success { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 20px; text-align: center; }
.order-success-icon {
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--success-soft); color: var(--success);
  animation: pop .4s var(--ease);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.order-success-number {
  font-size: 15px; font-weight: 700; padding: 8px 16px; border-radius: var(--r-full);
  background: var(--surface-2); font-variant-numeric: tabular-nums;
}

/* -----------------------------------------------------------------------------
   Нижняя навигация (телефон)
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: flex; align-items: stretch;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .tabbar { display: none; } }

.tab {
  position: relative;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-3);
  font-size: 10.5px; font-weight: 620;
  transition: color var(--fast);
  -webkit-tap-highlight-color: transparent;
}
.tab.active { color: var(--accent-fg); }
.tab:active { transform: scale(.94); }
.tab .badge { position: absolute; top: 6px; left: 50%; margin-left: 4px; }

/* Плавающая кнопка WhatsApp */
.fab-whatsapp {
  position: fixed; right: 16px; z-index: 92;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--whatsapp); color: #06280f;
  box-shadow: 0 10px 28px -6px rgba(37, 211, 102, .6);
  transition: transform var(--fast);
}
.fab-whatsapp:hover { transform: scale(1.07); }
.fab-whatsapp:active { transform: scale(.95); }
@media (min-width: 900px) { .fab-whatsapp { bottom: 24px; } }

/* Индикатор дозагрузки */
.load-more-sentinel { height: 1px; }
.loading-row { display: flex; justify-content: center; padding: 22px 0; }

/* Поисковая выдача */
.search-results-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px 0 14px; font-size: 13.5px; color: var(--text-3);
}

/* Режим опта */
.opt-banner {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 11px 14px;
  border-radius: var(--r-sm);
  background: var(--info-soft); color: var(--info);
  font-size: 13px; font-weight: 620;
}
.opt-banner button { margin-left: auto; color: inherit; font-weight: 700; text-decoration: underline; }

/* Контакты */
.contacts-list { display: flex; flex-direction: column; gap: 4px; }
.contact-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; border-radius: var(--r-sm);
  transition: background var(--fast);
}
.contact-row:hover { background: var(--surface-2); }
.contact-icon {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.contact-label { font-size: 12px; color: var(--text-3); }
.contact-value { font-size: 14.5px; font-weight: 600; }
