:root {
  --slider-h: 6px;  /* толщина полоски */
  --handle: 16px;   /* диаметр ручек */
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */
*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

input,
button,
textarea,
select { font: inherit; color: inherit; background: none; border: none; outline: none; }

ul, ol { list-style: none; }

a { text-decoration: none; color: inherit; }

h1,h2,h3,h4,h5,h6 { font-size: inherit; font-weight: inherit; margin: 0; }

body {
  line-height: 1.5;
  font-family: 'Roboto Condensed', sans-serif;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

:focus { outline: none; }

* { font-family: 'Roboto Condensed', sans-serif; }

[hidden] { display: none !important; }

html.modal-open,
body.modal-open { overflow: hidden; }

/* ==========================================================================
   LAYOUT / COMMON
   ========================================================================== */
.container { max-width: 1160px; margin: 0 auto; }

.breadcrumbs {
  font-size: 14px;
  color: #777;
  margin: 20px 0 12px;
}

.breadcrumbs a {
  color: #777;
  transition: color .2s ease;
}
.breadcrumbs a:hover { color: #C2181F; }

.breadcrumbs span {
  font-weight: 400;
  color: #303030;
}

/* ==========================================================================
   SUBCATEGORIES
   ========================================================================== */
.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  margin: 30px 0;
}

.subcategory-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  color: #303030;
  transition: box-shadow .2s ease, background .2s ease;
}

.subcategory-card:hover {
  background: #f9f9f9;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  color: #303030;
}

.subcategory-card img {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.subcategory-text { display: flex; flex-direction: column; gap: 4px; }

.subcategory-title { font-size: 18px; font-weight: 400; }

.subcategory-count { font-size: 14px; color: #888; }

/* ==========================================================================
   CATEGORY LAYOUT
   ========================================================================== */
.category-title {
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 20px;
}

.category-layout {
  display: flex;
  gap: 24px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0;
}

.category-content { flex: 1; }

/* ==========================================================================
   FILTERS (DESKTOP)
   ========================================================================== */
.filters { width: 262px; flex-shrink: 0; }

.filters-title {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filters-toggle { font-size: 18px; }

.icon-sliders { display: inline-block; vertical-align: middle; }

.product-count {
  font-size: 14px;
  color: #303030;
  margin-bottom: 20px;
}

.filter-group { margin-bottom: 28px; }

.filter-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  color: #303030;
}

.price-range {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.price-range input {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.filter-search {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* tags */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-tags.expandable .tag { display: none; }
.filter-tags.expandable.expanded .tag { display: inline-block; }
.filter-tags.expandable .tag:nth-child(-n+6) { display: inline-block; }

.tag {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.tag.active {
  background: #C2181F;
  color: #fff;
  border-color: #C2181F;
}

.tag:hover { opacity: .85; }

.select-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
}

.show-more,
.show-filters {
  font-size: 13px;
  color: #C2181F;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
}

/* toggles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 10px;
  transition: .2s;
}

.toggle-switch .slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}

.toggle-switch input:checked + .slider { background-color: #C2181F; }
.toggle-switch input:checked + .slider::before { transform: translateX(16px); }

/* extra groups */
.extra-filters-wrapper .filter-group { display: none; }
.extra-filters-wrapper.expanded .filter-group { display: block; }
.extra-filters-wrapper .filter-group:nth-child(-n+2) { display: block; }

/* ==========================================================================
   noUiSlider
   ========================================================================== */
.noui-slider { margin-top: 8px; height: 5px; }

.noUi-horizontal { height: var(--slider-h) !important; }

.noUi-target {
  background: #ddd !important;
  border: none;
  height: var(--slider-h) !important;
  border-radius: calc(var(--slider-h) / 2) !important;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.noUi-base,
.noUi-connects,
.noUi-connect { height: 100% !important; }

.noUi-connects {
  border-radius: calc(var(--slider-h) / 2) !important;
  overflow: hidden; /* ключ: убирает «выпуклость» у connect */
}

.noUi-connect {
  background: #C2181F !important;
  border-radius: 0; /* радиус не нужен — уже клипуется сверху */
}

.noUi-base {
  position: relative;
  transform: translateX(-12px);
  left: -1px !important; /* ключевой сдвиг */
}

/* Ползунки по центру трека */
.noUi-handle {
  width: var(--handle) !important;
  height: var(--handle) !important;
  top: calc((var(--slider-h) - var(--handle)) / 2) !important;
  border: none !important;
  border-radius: 50% !important;
  background: #C2181F !important;
  box-shadow: none !important;
}

.noUi-handle::before,
.noUi-handle::after { display: none !important; }

.noUi-horizontal .noUi-handle-lower { transform: translateX(-1px); }

/* ==========================================================================
   SORT / PAGER (CSR helper + styles)
   ========================================================================== */
.sort-options {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
}

.sort-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  padding: 4px 6px;
  transition: color .2s ease;
}

.sort-btn:hover { color: #C2181F; }

.sort-btn.active {
  color: #C2181F;
  font-weight: 400;
}

/* CSR helper */
#catalog-root.is-loading { opacity: .6; pointer-events: none; }

/* сортбар под твой существующий стиль */
.sortbar-select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.sortbar-dir-btn {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 9999px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.sortbar-dir-btn:hover {
  background: #f9f9f9;
  border-color: #ccc;
}

.sortbar-dir-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(194, 24, 31, 0.15);
}

.sortbar-dir-btn.active {
  border-color: #C2181F;
  color: #C2181F;
}

.pager { display: flex; align-items: center; gap: 12px; }

.pager button {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.pager .pages {
  font-size: 14px;
  color: #303030;
}

/* Контейнер пагинации по центру и с отступом от футера */
#pager {
  display: flex;
  justify-content: center;
  margin: 24px 0 56px;
}

#pager .pager {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid #eee;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

#pager .pager-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#pager .pager-btn:hover {
  background: #f8f8f8;
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

#pager .pager-btn:active { transform: translateY(1px); }

#pager .pager-btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

#pager .pages {
  font-size: 14px;
  color: #555;
  white-space: nowrap;
}

#pager #page-size-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 14px;
  padding: 8px 28px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 9999px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  position: relative;

  background-image:
    linear-gradient(45deg, transparent 50%, #777 50%),
    linear-gradient(135deg, #777 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 55%,
    calc(100% - 10px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

#pager #page-size-select:hover { border-color: #cfcfcf; }

#pager #page-size-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(194, 24, 31, 0.15);
}

/* пустое состояние */
.cards-empty {
  padding: 24px;
  border: 1px dashed #ccc;
  border-radius: 8px;
  text-align: center;
  color: #777;
  margin-bottom: 180px;
}

/* ==========================================================================
   PRODUCT GRID / CARD
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  position: relative; /* для loader overlay */
}

.product-card {
  --card-bg: #fff;
  --desc-lines: 5; /* теперь 4 строки (оставляю как было в файле) */
  --desc-lh: 1.3;

  position: relative;
  border: 1px solid #eee;
  padding: 36px 10px 20px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  transition: box-shadow .2s ease;
}

.product-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }

.product-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: inherit;
  gap: 6px;
}

.product-link img {
  height: 120px; /* было max-height — ставим фиксированную высоту */
  width: auto;
  object-fit: contain;
  margin-bottom: 20px;
  display: block;
}

.product-title {
  font-size: 20px;
  font-weight: 400;
}

.product-link .product-title {
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(1.3 * 20px * 2);
}

.product-title:hover { color: #303030; opacity: 0.85; }

.product-rating {
  display: flex;
  gap: 2px;
  color: #C2181F;
  font-size: 24px;
}
.product-rating .star { color: #C2181F; }
.product-rating .star.empty { color: #ccc; }

.product-article {
  font-size: 14px;
  color: #303030;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;

  line-height: 1.2;
  max-width: 100%;
}

.product-desc {
  font-size: 14px;
  line-height: var(--desc-lh);
  color: #303030;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--desc-lines);
  overflow: hidden;

  min-height: calc(var(--desc-lines) * 1em * var(--desc-lh));
  position: relative;
}

.product-meta-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* badges */
.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 40;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-sale { background-color: #C2181F; }
.badge-hit  { background-color: #3A7A63; }

/* icons */
.product-icons {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 18px;
  font-size: 20px;
  color: #999;
  z-index: 50;
}

/* ===== HEART (final, working) ===== */
.icon-heart {
  display: block;
  width: 20px;
  height: 20px;
  cursor: pointer;
  transition: stroke .2s ease, fill .2s ease;
}

.icon-heart .heart-path {
  stroke: #303030 !important;
  stroke-width: 2 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none !important;
  opacity: 1 !important;
  vector-effect: non-scaling-stroke;
  transition: fill .2s ease, stroke .2s ease;
}

.icon-heart:hover .heart-path { stroke: #C2181F !important; }

.icon-heart.active .heart-path {
  stroke: #C2181F !important;
  fill: #C2181F !important;
}

/* лёгкая тряска при ошибке */
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.icon-heart.shake { animation: shakeX .28s ease; }

/* на всякий случай: убираем эффекты, которые иногда ломают stroke */
.product-icons svg,
.product-icons svg * {
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* prices */
.product-prices {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 40px; /* десктоп */
}

.product-price {
  font-size: 24px;
  font-weight: 400;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-price-old {
  font-size: 14px;
  color: #888;
  text-decoration: line-through;
}

.product-price-unit {
  font-size: 12px;
  color: #8A8A8A;
  white-space: nowrap;
}

/* buttons */
.product-button {
  background: #C2181F;
  color: #fff;
  padding: 10px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
}
.product-button:hover { opacity: .85; }

/* Внешний вид кнопки "Под заказ" на карточке */
.product-button.product-button--preorder {
  background: #333;
  color: #fff;
  border: 1px solid #303030;
}

/* Статусы кнопки "В корзину" */
.product-button.btn-cart--pending { opacity: .75; cursor: wait; }

.product-button.btn-cart--error {
  background: #b00020;
  color: #fff;
}

/* добавлено в корзину — как договорились */
.product-button.btn-cart--added {
  background: #3A7A63 !important;
  color: #fff !important;
  cursor: default;
}

.product-button.btn-cart--added:hover,
.product-button.btn-cart--added:focus,
.product-button.btn-cart--added:active {
  background: #3A7A63 !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

.product-button[disabled] {
  cursor: default;
  opacity: .9;
}

/* links hover in card */
.product-card a { transition: color .15s ease, opacity .15s ease; }

.product-card a:hover,
.product-card a:focus,
.product-card a:focus-visible,
.product-card a:active {
  color: #303030;
  opacity: 0.85;
}

.product-card .product-link:hover .product-title { color: #303030 !important; }

/* ====== LOADER OVERLAY для каталога ====== */
.catalog-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(120%) blur(2px);
  z-index: 20;
}

.is-loading .catalog-loader { display: flex; }

.catalog-loader__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #eee;
}

.catalog-loader__spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #e6e6e6;
  border-top-color: #C2181F;
  animation: catalogSpin 0.9s linear infinite;
}

@keyframes catalogSpin { to { transform: rotate(360deg); } }

.catalog-loader__text {
  font-size: 14px;
  color: #303030;
  line-height: 1.2;
  white-space: nowrap;
}

.catalog-loader__sub {
  font-size: 12px;
  color: #777;
  line-height: 1.2;
  white-space: nowrap;
}

/* ===== Наличие "В наличии: Много/Мало" ===== */
.product-reminder {
  font-size: 13px;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f3f3f3;
  color: #303030;
  width: fit-content;
  margin-top: 6px;
}

.product-reminder.is-many {
  background: rgba(58, 122, 99, 0.12);
  color: #3A7A63;
}

.product-reminder.is-low {
  background: rgba(194, 24, 31, 0.12);
  color: #C2181F;
}

/* ==========================================================================
   MOBILE FILTERS MODAL
   ========================================================================== */
.mobile-filters-modal { display: none; }

.mobile-filters-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
}

.mobile-filters-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-filters-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90vh;
  max-height: 90vh;
  background: #fff;
  z-index: 9999;
  display: none;
  flex-direction: column;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 16px 16px 8px;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .mobile-filters-modal { height: 90dvh; max-height: 90dvh; }
}

.mobile-filters-modal.active { display: flex; }

.mobile-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  margin-bottom: 16px;
  flex: 0 0 auto;
}

.mobile-filters-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #000;
  cursor: pointer;
}

.mobile-filters-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Чтоб контент под кнопками не прятался, дадим снизу запас прокрутки */
#mobileFiltersBody { padding-bottom: 72px; }

/* Действия внизу модалки: ряд с двумя кнопками, прилипающий к низу */
#mobileFiltersModal > div:last-child {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 8px 0;
  background: #fff;
  box-shadow: 0 -6px 12px rgba(0, 0, 0, .04);
  min-width: 0;
}

/* Кнопки в ряд */
#mobileFiltersModal > div:last-child .apply-filters-button {
  position: static;
  width: auto;
  flex: 1 1 0;
  margin: 0;
}

.apply-filters-button {
  width: 100%;
  padding: 14px 0;
  background: #C2181F;
  color: #fff;
  font-size: 16px;
  border-radius: 4px;
  border: none;
  margin-top: 12px;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 -6px 12px rgba(0, 0, 0, .04);
}

/* Цвета для "Сбросить" */
#resetMobileFilters.apply-filters-button {
  background: #eee;
  color: #333;
}

/* На очень узких экранах — в колонку */
@media (max-width: 360px) {
  #mobileFiltersModal > div:last-child { flex-direction: column; }
}

/* по умолчанию скрыт */
.mobile-only-filters { display: none !important; }

/* на мобильных показываем */
@media (max-width: 1023px) {
  .mobile-only-filters {
    display: flex !important;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }
}

/* ==========================================================================
   PREORDER MODAL (preorder-*)
   ========================================================================== */
.preorder-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.preorder-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.preorder-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.preorder-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.preorder-modal .preorder-dialog {
  background: #fff;
  width: min(480px, 92vw);
  border-radius: 12px;
  padding: 20px 22px 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  transform: translateY(8px);
  transition: transform .2s ease;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.preorder-modal.active .preorder-dialog { transform: translateY(0); }

.preorder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.preorder-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #303030;
}

.preorder-close {
  font-size: 26px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #8A8A8A;
}

.preorder-close:hover {
  background: #f2f2f2;
  color: #303030;
}

.preorder-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preorder-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preorder-row label {
  font-size: 14px;
  color: #444;
}

.preorder-row input,
.preorder-row textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
}

.preorder-row input:focus,
.preorder-row textarea:focus {
  border-color: #C2181F;
  box-shadow: 0 0 0 1px rgba(194, 24, 31, .25);
}

.preorder-row textarea {
  min-height: 80px;
  resize: vertical;
}

.preorder-consent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preorder-consent label {
  font-size: 14px;
  color: #555;
}

.consent-switch {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
}

.consent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-switch .slider {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 20px;
  transition: .2s;
}

.consent-switch .slider:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.consent-switch input:checked + .slider { background: #C2181F; }
.consent-switch input:checked + .slider:before { transform: translateX(18px); }

/* ==========================================================================
   PREORDER MODAL (po-*)  — отдельная реализация
   ========================================================================== */
/* --- Base --- */
.po {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.po.is-open { display: grid; }

body.po-lock { overflow: hidden; }

/* --- Backdrop --- */
.po__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity .18s ease;
}

.po.is-open .po__backdrop { opacity: 1; }

/* --- Dialog --- */
.po__dialog {
  position: relative;
  margin: auto;
  width: min(560px, 92vw);
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  transform: translateY(8px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
}

.po.is-open .po__dialog {
  transform: translateY(0);
  opacity: 1;
}

/* --- Header --- */
.po__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.po__title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.po__close {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

.po__close:hover { background: #f3f3f3; }

/* --- Form --- */
.po__form { display: grid; gap: 12px; }

.po__row { display: grid; gap: 6px; }

.po__row label { font-size: 14px; color: #333; }

.po__row input[type="text"],
.po__row input[type="tel"],
.po__row input[type="email"],
.po__row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.po__row input:focus,
.po__row textarea:focus { border-color: #999; }

.po__row--consent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.po__consent-text { font-size: 14px; color: #333; }

/* Toggle */
.po-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
}

.po-toggle input { display: none; }

.po-toggle__slider {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 999px;
  transition: .2s;
}

.po-toggle__slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: .2s;
}

.po-toggle input:checked + .po-toggle__slider { background: #C2181F; }
.po-toggle input:checked + .po-toggle__slider::before { transform: translateX(18px); }

.po__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  gap: 8px;
}

.po__submit,
.po__ghost {
  appearance: none;
  border-radius: 10px;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
}

.po__submit {
  background: #C2181F;
  color: #fff;
  border: none;
}

.po__submit:hover { background: #A8141A; }

.po__submit:disabled {
  opacity: .6;
  cursor: default;
}

.po__ghost {
  background: #fff;
  color: #C2181F;
  border: 1px solid #C2181F;
}

.po__ghost:hover { background: #fff5f5; }

/* Success */
.po__success {
  display: grid;
  gap: 10px;
  text-align: center;
  padding: 8px 4px 0;
}

.po__success-title { font-size: 18px; font-weight: 800; }
.po__success-text { color: #555; }

/* ==========================================================================
   CART TOAST
   ========================================================================== */
.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background: #222;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 10000;
}

.cart-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   SEO TEXT
   ========================================================================== */
.ceotext {
  margin: 40px 0 56px;
  padding: 12px 12px 28px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;

  font-size: 15px;
  line-height: 1.6;
  color: #303030;
}

.ceotext p + p { margin-top: 10px; }

.ceotext ul {
  margin-top: 12px;
  padding-left: 0;
  list-style: none;
}

.ceotext li {
  position: relative;
  padding-left: 14px;
  margin: 4px 0;
}

.ceotext li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0.25em;
  font-size: 14px;
  color: #C2181F;
}

.ceotext strong { font-weight: 500; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width:1279px) {
  .container,
  .category-layout { max-width: 944px; margin: 0 auto; }

  .subcategory-grid { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }

  .subcategory-title { font-size: 16px; }

  .filters { width: 212px; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
}

@media (max-width:1023px) {
  .container,
  .category-layout { max-width: 96%; margin: 0 auto; }

  .subcategory-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

  .subcategory-title { font-size: 14px; }

  .filters { display: none; }
  .sort-options { display: none; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width:767px) {
  .container { max-width: 96% !important; }

  .subcategory-grid {
    grid-template-columns: repeat(auto-fill, minmax(216px, 2fr));
    margin: 30px 0;
  }

  .subcategory-card { gap: 8px; }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-items: stretch;
  }

  /* pager mobile */
  #pager .pager { gap: 8px; padding: 6px 10px; }
  #pager .pages { display: none; }
  #pager .pager-btn { width: 34px; height: 34px; }
  #pager #page-size-select { padding: 6px 26px 6px 10px; font-size: 13px; }

  /* SEO mobile */
  .ceotext {
    margin: 32px 0 40px;
    padding: 16px 14px 20px;
    font-size: 14px;
  }
}

@media (max-width:479px) {
  .container { max-width: 96% !important; }

  .subcategory-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 2fr));
    margin: 30px 0;
  }

  .subcategory-card {
    gap: 4px;
    flex-direction: column;
  }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 2fr)); }

  .product-card { padding: 36px 8px 20px; }

  .product-prices { min-height: 80px; }

  .product-price {
    font-size: 18px;
    flex-direction: column; /* было column-reverse */
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 4px;
  }

  .product-price-current { order: 1; }
  .product-price-old     { order: 2; }
  .product-price-unit    { order: 3; } /* unit всегда внизу */

  .product-reminder { font-size: 12px; }

  .product-title { font-size: 14px; }

  .product-article { font-size: 12px; }

  .product-button { padding: 2px 10px !important; }

  .breadcrumbs {
    margin-top: 4px;
    margin-bottom: 4px;
  }

  .catalog-loader__box {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .catalog-loader__spinner {
    width: 30px;
    height: 30px;
  }
}


/* === FIX: /шт всегда под ценой на мобилке === */
@media (max-width: 479px) {
  .product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  /* если есть эти элементы — задаём порядок */
  .product-price .product-price-current { order: 1; }
  .product-price .product-price-old     { order: 2; }

  /* /шт — ВСЕГДА последним */
  .product-price .product-price-unit {
    order: 99;
    font-size: 12px;
    color: #8A8A8A;
    white-space: nowrap;
  }

  /* на случай если “текущая цена” без класса product-price-current */
  .product-price > :not(.product-price-old):not(.product-price-unit) {
    order: 1;
  }
}
