/* ==========================================================
   SHOP.CSS — полноценный интернет-магазин
   Зависит от site.css (переменные CSS уже определены там)
   ========================================================== */


/* ── Breadcrumbs ─────────────────────────────────────────── */
.shop-bc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 0.8rem;
  line-height: 1;
}

.shop-bc a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.shop-bc a:hover { color: var(--accent); }

.shop-bc__sep { color: #cbd5e1; font-size: 0.75rem; }

.shop-bc__cur { color: var(--text); font-weight: 500; }

/* Dark variant (на тёмном фоне) */
.shop-bc--dark a,
.shop-bc--dark .shop-bc__cur { color: rgba(255,255,255,0.55); }
.shop-bc--dark a:hover       { color: #fff; }
.shop-bc--dark .shop-bc__sep { color: rgba(255,255,255,0.2); }

/* ── Лёгкий заголовок категории / каталога ───────────────── */
.shop-cat-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 24px 14px 14px 14px;
}

.shop-cat-head__title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 6px 0 0;
}

.shop-cat-head__search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Строка поиска и саджест (.shop-catalog-search*, .shop-catalog-suggest*)
   перенесены в site.css: компонент используется и глобальным оверлеем
   поиска в шапке (partials/_global_search.html). */

/* ── Страница-шапка (узкая, не fullscreen) ───────────────── */
.shop-page-head {
  background: var(--dark);
  padding: 40px 0 36px;
  position: relative;
  overflow: hidden;
}

.shop-page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, var(--accent-veil-soft) 0%, transparent 60%);
  pointer-events: none;
}

.shop-page-head__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-page-head__title {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0;
}

.shop-page-head__sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  margin: 0;
}

/* ── Поиск встроен в page-head ───────────────────────────── */
.shop-search-bar { display: none; } /* больше не используется */

.shop-page-head__search {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin-top: 4px;
}

.shop-page-head__search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.shop-page-head__search-input::placeholder { color: rgba(255,255,255,0.3); }
.shop-page-head__search-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.11);
}

/* ── Основной layout: sidebar + контент ──────────────────── */
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.shop-sidebar {
  position: sticky;
  top: 72px;
  padding: 28px 0 28px 0;
  background: var(--surface);
  align-self: start;
}

.shop-sidebar__inner {
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Sidebar section */
.shop-sf {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.shop-sf:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.shop-sf__title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 10px 8px;
}

/* Categories tree — классическое меню каталога.
   Строка: название + счётчик в скобках сразу после текста, стрелка справа.
   Корневые категории разделены волосяными линиями; текущая — серая плашка
   с чёрной полоской слева; подкатегории — просто с отступом, без линий. */
.shop-cat-nav {
  display: flex;
  flex-direction: column;
}

.shop-cat-nav__item {
  display: block;
  min-width: 0;
  padding: 11px 10px;
  text-decoration: none;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}

.shop-cat-nav__item:hover {
  color: var(--text);
}

/* «Toate categoriile» — строка-«назад» в стиле остального меню,
   стрелка рисуется CSS-шевроном как у кнопок раскрытия */
.shop-cat-nav__item--all {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 4px;
}

.shop-cat-nav__item--all::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-left: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);   /* ‹ влево */
  transition: border-color 0.15s;
}

.shop-cat-nav__item--all:hover {
  background: #f4f6f8;
  color: var(--text);
}

.shop-cat-nav__item--all:hover::before {
  border-color: var(--text);
}

/* Строка дерева */
.shop-cat-nav__row {
  position: relative;
  display: flex;
  align-items: stretch;
  transition: background 0.16s;
}

/* Волосяные разделители между корневыми категориями.
   В category.html первая строка идёт после «← Toate categoriile» и её
   верхняя линия служит разделителем; в catalog.html она first-child — без линии. */
.shop-cat-nav > .shop-cat-nav__row {
  border-top: 1px solid #eef2f6;
}

.shop-cat-nav > .shop-cat-nav__row:first-child {
  border-top: none;
}

.shop-cat-nav__row:hover {
  background: #f4f6f8;
}

.shop-cat-nav__row .shop-cat-nav__item {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

/* Предок текущей категории на раскрытом пути */
.shop-cat-nav__row.is-active > .shop-cat-nav__item {
  color: var(--text);
  font-weight: 600;
}

/* Текущая категория: серая плашка + чёрная полоска слева + жирный текст */
.shop-cat-nav__row.is-current {
  background: #f1f5f9;
}

.shop-cat-nav__row.is-current:hover {
  background: #e9eef4;
}

.shop-cat-nav__row.is-current::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.shop-cat-nav__row.is-current > .shop-cat-nav__item {
  color: var(--text);
  font-weight: 700;
}

/* Счётчик товаров — в скобках сразу после названия */
.shop-cat-nav__count {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.shop-cat-nav__count::before { content: "("; }
.shop-cat-nav__count::after  { content: ")"; }

/* Кнопка свернуть/развернуть */
.shop-cat-nav__toggle {
  flex-shrink: 0;
  align-self: center;
  width: 28px;
  height: 28px;
  margin-right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 7px;
  font-size: 0;
  transition: background 0.15s;
}

.shop-cat-nav__toggle::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(-45deg);   /* → вправо (свёрнуто) */
  transition: transform 0.22s ease, border-color 0.15s;
  margin-top: 1px;
}

.shop-cat-nav__toggle:hover { background: #e2e8f0; }
.shop-cat-nav__toggle:hover::after { border-color: var(--text); }

.shop-cat-nav__toggle.is-open::after {
  transform: rotate(45deg);    /* ↓ вниз (открыто) */
  border-color: #475569;
  margin-top: -2px;
}

/* Подкатегории: плавное раскрытие через grid-rows */
.shop-cat-nav__sub {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.24s ease, visibility 0.24s;
}

.shop-cat-nav__sub.is-open {
  grid-template-rows: 1fr;
  visibility: visible;
  padding-bottom: 6px;
}

.shop-cat-nav__sub-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.shop-cat-nav__sub .shop-cat-nav__item {
  font-size: 0.84rem;
  font-weight: 400;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 26px;
  color: var(--muted);
}

.shop-cat-nav__sub .shop-cat-nav__item:hover {
  color: var(--text);
}

/* Третий уровень вложенности — отступ глубже */
.shop-cat-nav__sub .shop-cat-nav__sub .shop-cat-nav__item {
  padding-left: 42px;
}

/* Checkbox filter */
.shop-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 0.87rem;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.15s;
  user-select: none;
}

.shop-checkbox:hover {
  background: var(--surface-soft);
}

.shop-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* Sidebar apply button */
.shop-sf__apply {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.shop-sf__apply:hover { background: var(--accent-hover); }

/* Mobile filter toggle */
.shop-sidebar-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s;
}

.shop-sidebar-toggle:hover { border-color: var(--accent); }

.shop-sidebar-toggle__arrow {
  transition: transform 0.2s;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
}

.shop-sidebar-toggle.is-open .shop-sidebar-toggle__arrow {
  transform: rotate(180deg);
}

.shop-sidebar-toggle__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.shop-sidebar-toggle__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--muted);
}

.shop-sidebar-toggle__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Мобильная рельса категорий ─────────────────────────────
   Desktop: категории живут в сайдбаре, рельса скрыта. Mobile (<=900px):
   категории уезжают в горизонтальную рельсу чипсов над листингом, сайдбарный
   блок категорий прячется, кнопка сайдбара остаётся только для фильтров.
   Визуальный язык чипов = .shop-category-chip лендинга (999px, белый, --line). */
.shop-chip-rail-wrap { display: none; }

.shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.shop-chip:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.shop-chip.is-current {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  font-weight: 700;
}

.shop-chip__count {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.shop-chip.is-current .shop-chip__count { color: rgba(255, 255, 255, 0.72); }

.shop-chip--back {
  gap: 9px;
  color: var(--muted);
  font-weight: 500;
}

.shop-chip--back::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-left: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
}

@media (max-width: 900px) {
  .shop-chip-rail-wrap { display: block; padding-top: 2px; }

  .shop-chip-rail {
    display: flex;
    gap: 8px;
    padding: 2px 2px 12px;
    overflow-x: auto;
    overscroll-behavior-x: none;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* правый край мягко гаснет — подсказка, что рельса скроллится */
    -webkit-mask-image: linear-gradient(to right, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, black 92%, transparent 100%);
  }

  .shop-chip-rail::-webkit-scrollbar { display: none; }

  .shop-chip-rail > * {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  /* Категории на мобиле — в рельсе; сайдбарный блок и showcase-сайдбар прячем */
  .shop-sf--categories { display: none; }
  .shop-sidebar--showcase { display: none; }
}

/* ── Main content area ───────────────────────────────────── */
.shop-main {
  padding: 28px 0 28px 28px;
  min-width: 0;
  border-left: 1px solid var(--line);
}

/* ── Toolbar ─────────────────────────────────────────────── */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.shop-toolbar__info {
  font-size: 0.85rem;
  color: var(--muted);
}

.shop-toolbar__info strong {
  color: var(--text);
  font-weight: 600;
}

.shop-toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.shop-sort-label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.shop-sort-select {
  padding: 8px 32px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--text);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s;
}

.shop-sort-select:focus { border-color: var(--accent); }

/* Active filter badges */
.shop-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.shop-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.shop-filter-badge--reset {
  background: transparent;
  border: 1.5px solid var(--text, #111);
  color: var(--text, #111);
  font-weight: 700;
}

.shop-filter-badge__x {
  font-size: 0.7rem;
  opacity: 0.7;
  line-height: 1;
}

/* ── Product grid ────────────────────────────────────────── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

/* ── Product card ────────────────────────────────────────── */
.shop-card {
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #e8ecf0;
  box-shadow: none;
  transition: box-shadow 0.22s, border-color 0.22s;
  text-decoration: none;
}

.shop-card:hover {
  border-color: var(--accent);
  z-index: 1;
  position: relative;
}

.shop-card.is-promo {
  box-shadow: 0 4px 14px rgba(15,23,42,0.11);
  transform: translateY(-2px);
  position: relative;
  z-index: 1;
}

/* Image */
.shop-card__img-wrap {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
  text-decoration: none;
}


.shop-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.38s ease;
  box-sizing: border-box;
}

.shop-card:hover .shop-card__img-wrap img {
  transform: scale(1.04);
}

.shop-card__no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
}

.shop-card__no-img svg {
  width: 40px;
  height: 40px;
}

/* RAL-плейсхолдер: заливка цветом варианта вместо серой заглушки */
.shop-card__no-img--ral {
  flex-direction: column;
  gap: 6px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .14)),
    var(--ph, #f8fafc);
  color: rgba(15, 23, 42, .6);
}

.shop-card__no-img--ral.is-dark {
  color: rgba(255, 255, 255, .82);
}

.shop-card__no-img--ral svg {
  width: 34px;
  height: 34px;
  opacity: .9;
}

.shop-card__no-img-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Promo badge — elevated, rounded-square */
.shop-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e11d48;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 4px 9px;
  border-radius: 8px;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(225,29,72,0.4);
  z-index: 1;
}

/* Body */
.shop-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
}

.shop-card__name {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}

.shop-card__name:hover { color: var(--accent); }

.shop-card__code {
  font-size: 0.68rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* Color swatches */
.shop-card__swatches {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
}

.shop-card__swatch {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.15s ease;
}

.shop-card__swatch:hover {
  transform: scale(1.25);
}

.shop-card__swatch-more {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding-left: 1px;
}

.shop-card__swatch-more:hover {
  color: var(--text);
}

/* Delivery availability row */
.shop-card__delivery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.shop-card__delivery-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.2;
}

.shop-card__unavail {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Price block */
.shop-price {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.shop-price__old {
  font-size: 0.72rem;
  color: #94a3b8;
  text-decoration: line-through;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.shop-price__main {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1;
}

.shop-price__val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.shop-price__cur {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.shop-price__from {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-right: 1px;
}

.shop-price__client-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1;
}

.shop-price__discount {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f172a;
  background: #e2e8f0;
  padding: 2px 7px;
  border-radius: 20px;
  width: fit-content;
}

.shop-price__list {
  font-size: 0.68rem;
  color: #94a3b8;
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

/* Bottom row: price + cart button */
.shop-card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

/* Cart button — rounded square */
.shop-card__cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.18s, transform 0.15s;
  color: var(--accent);
}

.shop-card__cart-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.06);
}

.shop-card__cart-btn svg {
  width: 18px;
  height: 18px;
}

.shop-card__cart-btn.is-out {
  background: #fff;
  border-color: #e2e8f0;
  color: #cbd5e1;
  cursor: default;
  pointer-events: none;
}

.shop-card__cart-btn.is-in-cart {
  background: #f1f5f9;
  border-color: #0f172a;
  color: #0f172a;
}

.shop-card__cart-btn.is-in-cart:hover {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

/* ── Cart modal ──────────────────────────────────────────── */
.shop-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.shop-modal.is-open { display: flex; }

.shop-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(2px);
}

.shop-modal__box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  width: min(500px, 100%);
  display: flex;
  gap: 20px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(15,23,42,0.2);
  font-family: var(--font-body);
}

.shop-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.shop-modal__close:hover { color: var(--text); background: #f1f5f9; }

.shop-modal__img-wrap {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  background: #f8fafc;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

.shop-modal__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
}

.shop-modal__no-img { color: #cbd5e1; }

.shop-modal__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 20px;
}

.shop-modal__name {
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.45;
  color: var(--text);
}

.shop-modal__price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.shop-modal__price-row .shop-price__val { font-size: 1.35rem; }

.shop-modal__qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-modal__qty-label { font-size: 0.8rem; color: var(--muted); }

.shop-modal__qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-modal__qty-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.shop-modal__qty-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.shop-modal__qty-input {
  width: 52px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 6px 4px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.shop-modal__qty-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.shop-modal__qty-input::-webkit-inner-spin-button,
.shop-modal__qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop-modal__qty-unit { font-size: 0.8rem; color: var(--muted); }

.shop-modal__submit {
  width: 100%;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 0.92rem;
  border-radius: 12px;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .shop-modal__box { flex-direction: column; padding: 18px; gap: 14px; }
  .shop-modal__img-wrap { width: 100%; height: 150px; }
  .shop-modal__content { padding-right: 0; }
}

/* ── Empty state ─────────────────────────────────────────── */
.shop-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: #f8fafc;
  border-radius: 14px;
  border: 1.5px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ── Pagination ──────────────────────────────────────────── */
.shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.shop-pagination__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #475569;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-variant-numeric: tabular-nums;
}

.shop-pagination__item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.shop-pagination__item.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.shop-pagination__item.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.shop-pagination__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Sub-category chips (under breadcrumb on category page) */
.shop-sub-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
}

.shop-sub-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.shop-sub-cat:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.shop-sub-cat__count {
  font-size: 0.7rem;
  color: var(--muted);
}

/* ── Product detail ──────────────────────────────────────── */
/* Три зоны: галерея и инфо (описание+спеки) — левая колонка,
   покупка (тайтл/варианты/цена/CTA) — правая. */
.shop-detail-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  grid-template-areas:
    "gallery buy"
    "info    buy";
  gap: 40px 56px;
  align-items: start;
}

/* Gallery */
.shop-detail-gallery {
  grid-area: gallery;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-detail-main {
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: radial-gradient(120% 90% at 50% 10%, #ffffff 0%, #f1f5f9 100%);
}

.shop-detail-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5%;
  transition: transform 0.35s ease;
}

.shop-detail-main:hover img { transform: scale(1.03); }

.shop-detail-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.shop-detail-thumb {
  width: 74px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: #f1f5f9;
  transition: border-color 0.18s;
  flex-shrink: 0;
}

.shop-detail-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shop-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-detail-thumb.is-active { border-color: var(--accent); }
.shop-detail-thumb:hover:not(.is-active) { border-color: #94a3b8; }

.shop-detail-no-img {
  border-radius: 18px;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.82rem;
}

.shop-detail-no-img--ral {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .14)),
    var(--ph, #f1f5f9);
  color: rgba(15, 23, 42, .6);
}

.shop-detail-no-img--ral.is-dark {
  color: rgba(255, 255, 255, .82);
}

.shop-detail-no-img__label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* Content (buy column) */
.shop-detail-content {
  grid-area: buy;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Липкая колонка покупки — только там, где она заведомо помещается
   в экран целиком, иначе sticky прячет её низ. */
@media (min-width: 901px) and (min-height: 940px) {
  .shop-detail-content {
    position: sticky;
    top: calc(var(--header-height, 102px) + 16px);
  }
}

.shop-detail-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.shop-detail-eyebrow:hover { text-decoration: underline; }

.shop-detail-title {
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
}

/* Артикул под тайтлом: кнопка-строка с копированием */
.shop-detail-subline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: -6px;
}

.shop-detail-code {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
}

.shop-detail-code.is-static { cursor: default; }

.shop-detail-code__val {
  font-weight: 700;
  color: #475569;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.shop-detail-code__ic { flex-shrink: 0; }
.shop-detail-code__ic--copy { opacity: 0.5; transition: opacity 0.16s; }
.shop-detail-code:hover .shop-detail-code__ic--copy { opacity: 1; }
.shop-detail-code.is-static .shop-detail-code__ic--copy { display: none; }

.shop-detail-code__ic--done,
.shop-detail-code__done { display: none; }

.shop-detail-code.is-copied .shop-detail-code__ic--copy { display: none; }

.shop-detail-code.is-copied .shop-detail-code__ic--done,
.shop-detail-code.is-copied .shop-detail-code__done {
  display: inline-flex;
  color: #047857;
}

.shop-detail-code__done {
  font-size: 0.74rem;
  font-weight: 700;
}

.shop-detail-variants {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.shop-detail-variants__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.shop-detail-variants__head span {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shop-detail-variants__head strong {
  color: var(--text);
  font-size: 0.9rem;
}

.shop-detail-variants__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-detail-variant {
  min-width: 72px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d8e0e8;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.shop-detail-variant:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.shop-detail-variant.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.shop-detail-variant.is-readonly {
  cursor: default;
  pointer-events: none;
  background: #f1f5f9;
  border-color: transparent;
  color: #475569;
  font-weight: 600;
}

.shop-detail-variant__swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--variant-color);
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
  flex-shrink: 0;
}

/* Price + CTA box */
.shop-detail-price-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.shop-detail-price-box__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Бейдж наличия: пилюля с точкой-индикатором */
.shop-detail-price-box .shop-stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

.shop-detail-price-box .shop-stock::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.shop-detail-price-box .shop-stock.is-out {
  background: #fef2f2;
  color: #b91c1c;
}

.shop-price--detail .shop-price__val {
  font-size: 2.1rem;
  letter-spacing: -0.03em;
}

.shop-price--detail .shop-price__cur {
  font-size: 0.8rem;
}

/* Нет в наличии: подсказка + каналы связи вместо мёртвой надписи */
.shop-detail-oos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-detail-oos__lead {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #475569;
}

.shop-detail-cta--oos .roof-btn {
  gap: 8px;
}

.shop-detail-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.shop-detail-cta .shop-qty-ctrl {
  flex-shrink: 0;
}

.shop-detail-cta .roof-btn {
  flex: 1;
  min-width: 130px;
  justify-content: center;
  padding: 14px 18px;
  font-size: 0.95rem;
  border-radius: 14px;
}

.shop-cart-direct {
  gap: 8px;
}

.shop-cart-direct svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.shop-cart-direct.is-in-cart {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.shop-cart-direct.is-in-cart:hover {
  background: #334155;
  border-color: #334155;
}

/* Mobile sticky buy bar (≤768px, появляется когда прайс-бокс ушёл из вьюпорта) */
.shop-sticky-buy {
  display: none;
}

@media (max-width: 768px) {
  .shop-sticky-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
    animation: shop-sticky-buy-in .25s ease;
  }

  .shop-sticky-buy[hidden] {
    display: none;
  }

  .shop-sticky-buy__price {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    flex-shrink: 0;
  }

  .shop-sticky-buy__val {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .shop-sticky-buy__cur {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
  }

  .shop-qty-ctrl--sticky {
    flex-shrink: 0;
  }

  .shop-qty-ctrl--sticky .shop-qty-input {
    width: 38px;
  }

  .shop-sticky-buy__btn {
    flex: 1;
    justify-content: center;
    padding: 12px 10px;
    font-size: 0.88rem;
    border-radius: 12px;
    white-space: nowrap;
  }
}

@keyframes shop-sticky-buy-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Info: описание + характеристики (левая колонка под фото) */
.shop-detail-info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.shop-detail-info__head {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.shop-detail-desc {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #475569;
  max-width: 70ch;
}

.shop-detail-desc p { margin: 0 0 10px; }
.shop-detail-desc p:last-child { margin-bottom: 0; }

/* Specifications table */
.shop-detail-specs {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 0.88rem;
  background: #fff;
}

.shop-detail-specs th,
.shop-detail-specs td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.shop-detail-specs tr:last-child th,
.shop-detail-specs tr:last-child td { border-bottom: none; }

.shop-detail-specs th {
  width: 42%;
  font-weight: 600;
  color: var(--muted);
}

.shop-detail-specs td {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Delivery & payment box */
.shop-detail-terms {
  border-radius: 16px;
  padding: 16px 18px;
  background: #f8fafc;
}

.shop-detail-terms__head {
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.shop-detail-terms__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-detail-terms__list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #475569;
}

.shop-detail-terms__list svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
}

/* Category benefits / FAQ on detail page */
.shop-detail-guide {
  padding-top: 0;
}

.shop-detail-guide .shop-category-info-box {
  max-width: 860px;
}

.shop-detail-guide .shop-category-faq {
  max-width: 860px;
}

/* ── Cart + checkout ─────────────────────────────────────── */
.shop-cart-layout,
.shop-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.shop-cart-list,
.shop-checkout-form-card {
  min-width: 0;
}

/* Дефолтный submit формы корзины: невидим, но первый в DOM —
   Enter в поле количества обновляет корзину, а не удаляет позицию */
.shop-cart-default-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shop-cart-item,
.shop-checkout-form-card,
.shop-cart-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.shop-cart-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 140px 120px 88px;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.shop-cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Позиции, снятые с продажи и убранные из корзины, — ч/б-алерт без цвета */
.shop-cart-unavailable {
  border: 2px solid var(--text);
  background: var(--surface);
  padding: 14px 16px;
  margin: 24px 0 0;
  font-size: 0.9rem;
}

.shop-cart-unavailable ul {
  margin: 8px 0;
  padding-left: 18px;
}

.shop-cart-unavailable p {
  margin: 0;
  color: var(--muted);
}

/* Ч/б-плашка аккаунта: flash-сообщения и баннер «подтвердите email» */
.shop-account-notice {
  border: 2px solid var(--text);
  background: var(--surface);
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-account-notice form {
  margin: 0;
}

.shop-cart-item__media {
  display: block;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  border-radius: 10px;
  overflow: hidden;
}

.shop-cart-item__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
}

.shop-cart-item__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.shop-cart-item__title {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.shop-cart-item__title:hover {
  color: var(--accent);
}

.shop-cart-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.shop-cart-item__stock.is-out {
  color: #0f172a;
  font-weight: 700;
}

.shop-cart-header {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 160px 140px 64px;
  gap: 16px;
  padding: 0 16px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.shop-cart-header span:nth-child(3),
.shop-cart-header span:nth-child(4) {
  text-align: center;
}

.shop-cart-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 160px 140px 64px;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.shop-cart-item__price,
.shop-cart-item__total {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.shop-cart-item__qty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-qty-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.shop-qty-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.shop-qty-input {
  width: 52px;
  height: 34px;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0 4px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.shop-qty-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.shop-qty-input::-webkit-inner-spin-button,
.shop-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop-form-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.shop-cart-item__qty input,
.shop-form-field input,
.shop-form-field select,
.shop-form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.shop-cart-item__qty input:focus,
.shop-form-field input:focus,
.shop-form-field select:focus,
.shop-form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.shop-form-field textarea {
  min-height: 124px;
  resize: vertical;
}

.shop-delivery-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shop-delivery-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.shop-delivery-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-veil-soft);
}

.shop-form-field .shop-delivery-option input {
  width: auto;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  accent-color: var(--accent);
  box-shadow: none;
  flex-shrink: 0;
}

.shop-delivery-option__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}

.shop-delivery-option__icon svg {
  width: 20px;
  height: 20px;
}

.shop-delivery-option:has(input:checked) .shop-delivery-option__icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.shop-delivery-option__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.shop-delivery-option__body strong {
  font-size: 0.92rem;
  color: var(--text);
}

.shop-delivery-option__body span {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.shop-delivery-address {
  padding: 16px;
  border: 1px solid #e5edf5;
  border-radius: 16px;
  background: #f8fafc;
}

.shop-saved-addresses {
  margin-bottom: 16px;
}

.shop-saved-addresses__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.shop-saved-addresses__head strong {
  font-size: 0.84rem;
  color: var(--text);
}

.shop-saved-addresses__head span {
  font-size: 0.78rem;
  color: #64748b;
}

.shop-saved-addresses__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shop-saved-address-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.shop-saved-address-card:hover,
.shop-saved-address-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 8px 20px var(--accent-veil-soft);
}

.shop-saved-address-card strong {
  font-size: 0.84rem;
  line-height: 1.35;
}

.shop-saved-address-card span {
  font-size: 0.74rem;
  color: #64748b;
}

.shop-saved-address-card--new {
  border-style: dashed;
}

.shop-delivery-address__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.shop-delivery-address .shop-form-field input,
.shop-delivery-address .shop-form-field select {
  width: 100%;
  box-sizing: border-box;
}

.shop-locality-combobox {
  position: relative;
}

.shop-locality-combobox__clear {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.shop-locality-combobox__clear:hover {
  background: #f1f5f9;
  color: var(--text);
}

.shop-locality-combobox input {
  padding-right: 44px;
}

.shop-locality-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.shop-locality-suggest__hint {
  padding: 11px 14px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.shop-locality-suggest__item {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 14px;
  border: none;
  background: #fff;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.shop-locality-suggest__item:hover,
.shop-locality-suggest__item.is-active {
  background: #f8fafc;
}

.shop-locality-suggest__item strong {
  font-size: 0.92rem;
}

.shop-locality-suggest__item span {
  font-size: 0.82rem;
  color: #64748b;
}

.shop-locality-suggest__empty {
  padding: 14px;
  color: #64748b;
  font-size: 0.86rem;
}

.shop-address-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.shop-address-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #e5edf5;
  border-radius: 14px;
  background: #f8fafc;
}

.shop-address-item > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.shop-address-item strong {
  color: var(--text);
  font-size: 0.92rem;
}

.shop-address-item span {
  color: #64748b;
  font-size: 0.78rem;
}

.shop-cart-item__actions {
  display: flex;
  justify-content: flex-end;
}

.shop-remove-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.shop-remove-btn:hover {
  color: #0f172a;
  background: #fee2e2;
}

.shop-cart-summary,
.shop-checkout-form-card {
  padding: 22px;
  overflow: hidden;
}

.shop-cart-summary {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shop-cart-summary__label,
.shop-checkout-form-card__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}

.shop-checkout-form-card__title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.shop-checkout-form-card__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.shop-cart-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.shop-cart-summary__row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.shop-cart-summary__row.is-total {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.shop-cart-summary__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-cart-summary__actions .roof-btn {
  justify-content: center;
}

.shop-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  min-width: 0;
  width: 100%;
}

.shop-form-field--full,
.shop-form-errors,
.shop-form-actions {
  grid-column: 1 / -1;
}

/* Маркер обязательного поля — по факту required-атрибута, без правки шаблонов */
.shop-form-field:has(input[required], select[required], textarea[required]) > label::after {
  content: " *";
  font-weight: 700;
}

.shop-form-errors ul,
.shop-form-field ul.errorlist {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: #0f172a;
  font-size: 0.82rem;
}

.shop-form-errors {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #94a3b8;
}

.shop-form-success {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 0.9rem;
}

.shop-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.shop-summary-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.shop-summary-item:last-of-type {
  padding-bottom: 0;
}

.shop-summary-item__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.shop-summary-item__meta {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Auth + account ──────────────────────────────────────── */
.shop-auth-shell {
  max-width: 560px;
  margin: 32px auto 0;
}

/* Текстовые ссылки блока авторизации — в тон дизайну, не браузерный синий */
.shop-auth-shell a:not(.roof-btn) {
  color: var(--muted);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s;
}

.shop-auth-shell a:not(.roof-btn):hover {
  color: var(--text);
}

/* Строка «Parola … Ai uitat parola?» над полем пароля */
.shop-form-field__labelrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.shop-form-field__labelrow a {
  font-size: 0.8rem;
}

/* Маркер обязательности для label внутри labelrow (базовое правило требует
   label прямым потомком .shop-form-field) */
.shop-form-field:has(input[required], select[required], textarea[required]) .shop-form-field__labelrow > label::after {
  content: " *";
  font-weight: 700;
}

/* Поле пароля с «глазком» */
.shop-password-wrap {
  position: relative;
}

.shop-form-field .shop-password-wrap input {
  padding-right: 48px;
}

.shop-password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  border: 0;
  border-radius: 0 12px 12px 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s;
}

.shop-password-toggle:hover {
  color: var(--text);
}

.shop-password-toggle__hide {
  display: none;
}

.shop-password-toggle.is-visible .shop-password-toggle__show {
  display: none;
}

.shop-password-toggle.is-visible .shop-password-toggle__hide {
  display: block;
}

/* Кнопка отправки формы авторизации — на всю ширину */
.shop-auth-submit {
  width: 100%;
  margin-top: 6px;
}

/* Подсказки в полях формы */
.shop-form-field__hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.shop-form-field__optional {
  color: #94a3b8;
  font-weight: 500;
}

/* «← Înapoi la catalog» под карточкой */
.shop-auth-back {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.shop-auth-email {
  word-break: break-all;
}

/* «Mai târziu» на экране запроса телефона — сдержанная текстовая кнопка */
.shop-auth-skip {
  margin-top: 14px;
  text-align: center;
}

.shop-auth-skip__button {
  border: 0;
  background: none;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.18s;
}

.shop-auth-skip__button:hover {
  color: var(--text);
}

/* Разделитель «sau» между формой и альтернативными входами */
.shop-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.shop-auth-divider::before,
.shop-auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.shop-auth-google {
  width: 100%;
}

.shop-auth-google__icon {
  flex: none;
}

/* «Нет аккаунта? [Создать]» — текст слева, кнопка справа */
.shop-auth-alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

.shop-auth-card,
.shop-account-layout {
  min-width: 0;
}

.shop-form-grid--single {
  grid-template-columns: 1fr;
}

.shop-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.shop-account-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.shop-account-meta__item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.shop-account-meta__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.shop-inline-btn {
  width: 100%;
}

.shop-account-orders {
  margin-top: 24px;
}

.shop-account-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.shop-orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-history-note {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.5;
}

.shop-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.shop-order-row__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.shop-order-row__ref {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.shop-order-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.shop-order-row__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.shop-order-row__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid #e5edf6;
  border-radius: 12px;
  background: #f8fafc;
}

.shop-order-row__item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
}

.shop-order-row__item span {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.shop-order-row__item-meta {
  min-width: 120px;
  text-align: right;
}

.shop-order-row__item-meta span:last-child {
  font-weight: 700;
  color: var(--text);
}

.shop-order-row__amount {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.shop-order-row__status {
  justify-self: end;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.shop-order-row__status.is-ok {
  background: #e2e8f0;
  color: #0f172a;
}

.shop-order-row__status.is-pending {
  background: #e2e8f0;
  color: #0f172a;
}

.shop-order-row__status.is-progress {
  background: #e2e8f0;
  color: #0f172a;
}

.shop-order-row__status.is-warn {
  background: #e2e8f0;
  color: #0f172a;
}

.shop-order-row__status.is-failed {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Placeholder pages ───────────────────────────────────── */
.shop-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  margin: 80px auto 96px;
  gap: 16px;
}

.shop-placeholder__icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.shop-placeholder__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
}

.shop-placeholder__text {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 380px;
  margin: 0;
}

.shop-placeholder__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ── Storefront category landing ─────────────────────────── */
.shop-category-page {
  padding: 42px 0 72px;
}

.shop-category-page__bc {
  margin-bottom: 22px;
}

.shop-category-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 230px;
  padding: 28px 34px;
  border-radius: 8px;
  background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.78) 0%, rgba(2, 6, 23, 0.56) 48%, rgba(2, 6, 23, 0.18) 100%), var(--shop-category-hero-bg);
  background-size: cover;
  background-position: center;
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.12);
}

.shop-category-hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.shop-category-hero__label {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-category-hero h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.shop-category-hero p {
  max-width: 620px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  line-height: 1.55;
}

.shop-category-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.shop-category-feature-list {
  display: grid;
  gap: 34px;
  padding: 38px 0;
  border-bottom: 1px solid var(--line);
}

.shop-category-feature {
  display: grid;
  /* The gallery is a fixed-width frame on both sides, so every block keeps the
     same narrow "SHAKE" proportions regardless of the photo or which side it
     sits on. The copy takes whatever space is left. */
  --feature-gallery-w: 580px;
  grid-template-columns: minmax(0, 1fr) var(--feature-gallery-w);
  gap: 44px;
  align-items: start;
  padding: 32px 0;
}

.shop-category-feature + .shop-category-feature {
  border-top: 1px solid var(--line);
}

.shop-category-feature:nth-child(even) {
  grid-template-columns: var(--feature-gallery-w) minmax(0, 1fr);
}

.shop-category-feature:nth-child(even) .shop-category-feature__copy {
  order: 2;
}

.shop-category-feature__kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-category-feature h2 {
  max-width: 720px;
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.shop-category-feature__details {
  display: grid;
  /* Single column while the copy sits in the narrow text track next to the
     gallery — keeps spec rows like "…stratului de piatră: 1.7 mm" on one line. */
  grid-template-columns: 1fr;
  gap: 18px 32px;
  margin-top: 24px;
}

.shop-category-feature__details h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0;
}

.shop-category-feature__details ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #64748b;
  line-height: 1.55;
}

.shop-category-feature__details li strong,
.shop-category-feature__details li b {
  color: #475569;
}

.shop-category-feature__benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.shop-category-feature__benefits span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
}

.shop-category-feature__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.shop-category-feature__gallery {
  min-width: 0;
}

.shop-category-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 0;
  border-radius: 8px;
  /* Invisible frame: transparent cutouts sit straight on the page, no card. */
  background: transparent;
  scrollbar-width: none;
}

.shop-category-carousel::-webkit-scrollbar {
  display: none;
}

.shop-category-carousel__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  margin: 0;
  aspect-ratio: 4 / 3;
  background: transparent;
}

.shop-category-carousel__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-category-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
}

.shop-category-carousel__dots a {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.shop-category-carousel__dots a:hover,
.shop-category-carousel__dots a:focus,
.shop-category-carousel__dots a.is-active {
  background: var(--accent);
  transform: scale(1.2);
}

.shop-category-section {
  padding: 38px 0;
  border-bottom: 1px solid var(--line);
}

.shop-category-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.shop-category-section__head h2,
.shop-category-guide h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.shop-category-section__head a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.shop-category-section__head a:hover {
  text-decoration: underline;
}

.shop-category-subnav {
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}

.shop-category-subnav__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.shop-category-chip:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.shop-category-chip strong {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-category-guide {
  padding: 44px 0 0;
}

.shop-category-guide__main {
  max-width: 860px;
}

.shop-category-richtext {
  margin-top: 16px;
  color: #475569;
  font-size: 1rem;
  line-height: 1.8;
}

.shop-category-richtext p {
  margin: 0 0 14px;
}

.shop-category-guide__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.shop-category-info-box,
.shop-category-faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.shop-category-info-box {
  padding: 20px;
}

.shop-category-info-box h3,
.shop-category-faq h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1.1rem;
  letter-spacing: 0;
}

.shop-category-info-box ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #475569;
}

.shop-category-info-box li {
  position: relative;
  padding-left: 18px;
  line-height: 1.6;
}

.shop-category-info-box li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.shop-category-faq {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.shop-category-faq details {
  padding: 16px 18px;
}

.shop-category-faq summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.shop-category-faq p {
  margin: 10px 0 0;
  color: #475569;
  line-height: 1.7;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .shop-layout {
    grid-template-columns: 230px 1fr;
  }

  .shop-detail-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 32px 36px;
  }

  .shop-category-feature,
  .shop-category-feature:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .shop-category-feature:nth-child(even) .shop-category-feature__copy {
    order: 0;
  }

  /* Copy now spans full width — there is room for two spec columns again. */
  .shop-category-feature__details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
    border-bottom: 1px solid var(--line);
    padding: 0 0 16px;
  }

  /* Раскрытый сайдбар на мобиле — отдельная панель-карточка */
  .shop-sidebar__inner {
    padding: 8px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .shop-sidebar.is-collapsed .shop-sidebar__inner {
    display: none;
  }

  .shop-sidebar-toggle {
    display: flex;
    margin-bottom: 12px;
  }

  /* Крупные touch-таргеты дерева категорий */
  .shop-cat-nav__item {
    font-size: 0.95rem;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .shop-cat-nav__sub .shop-cat-nav__item {
    font-size: 0.88rem;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .shop-cat-nav__count {
    font-size: 0.78rem;
  }

  .shop-cat-nav__toggle {
    width: 40px;
    height: 40px;
    margin-right: 0;
  }

  .shop-cat-nav__toggle::after {
    width: 8px;
    height: 8px;
  }

  .shop-main {
    padding: 24px 0 0;
    border-left: none;
  }

  .shop-detail-wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "gallery"
      "buy"
      "info";
    gap: 28px;
  }

  .shop-detail-cta .roof-btn {
    flex: none;
    width: 100%;
  }

  .shop-cart-layout,
  .shop-checkout-layout {
    grid-template-columns: 1fr;
  }

  .shop-account-layout {
    grid-template-columns: 1fr;
  }

  .shop-account-panels {
    grid-template-columns: 1fr;
  }

  .shop-cart-summary {
    position: static;
  }

  .shop-cart-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .shop-cart-item__qty,
  .shop-cart-item__total,
  .shop-cart-item__actions {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .shop-category-page {
    padding-top: 24px;
  }

  .shop-category-hero {
    min-height: 260px;
    padding: 24px;
    /* На мобильном — -sm вариант фона (1200px вместо 2000px). */
    background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.8) 0%, rgba(2, 6, 23, 0.58) 100%), var(--shop-category-hero-bg-sm, var(--shop-category-hero-bg));
  }

  .shop-category-hero h1 {
    font-size: 2.45rem;
  }

  .shop-category-section__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .shop-category-guide__grid,
  .shop-category-feature__details {
    grid-template-columns: 1fr;
  }

  .shop-category-feature {
    gap: 24px;
    padding: 22px 0;
  }

  .shop-category-feature h2 {
    font-size: 2.2rem;
  }

  /* ── Catalog search: мобильные правки переехали в site.css вместе с компонентом ── */

  /* ── Cart header hidden (items stack vertically) ── */
  .shop-cart-header {
    display: none;
  }

  /* ── Cart item price/total left-aligned ── */
  .shop-cart-item__price,
  .shop-cart-item__total {
    text-align: left;
  }

  /* ── Product detail CTA: stack vertically ── */
  .shop-detail-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .shop-detail-cta .shop-qty-ctrl {
    align-self: flex-start;
  }

  .shop-detail-cta .roof-btn {
    width: auto;
    flex: none;
    justify-content: center;
  }

  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .shop-card__body {
    padding: 10px 11px 12px;
  }

  .shop-card__name {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }

  .shop-price__val {
    font-size: 1.1rem;
  }

  .shop-detail-subline {
    flex-wrap: wrap;
    gap: 8px;
  }

  .shop-price--detail .shop-price__val {
    font-size: 1.6rem;
  }

  .shop-pagination__item {
    min-width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .shop-form-grid {
    grid-template-columns: 1fr;
  }

  .shop-delivery-options {
    grid-template-columns: 1fr;
  }

  .shop-saved-addresses__head,
  .shop-address-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .shop-saved-addresses__grid {
    grid-template-columns: 1fr;
  }

  .shop-delivery-address__grid {
    grid-template-columns: 1fr;
  }

  .shop-order-row {
    grid-template-columns: 1fr;
  }

  .shop-order-row__amount,
  .shop-order-row__status {
    text-align: left;
    justify-self: start;
  }

  .shop-order-row__item {
    flex-direction: column;
  }

  .shop-order-row__item-meta {
    min-width: 0;
    text-align: left;
  }

  .shop-cart-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .shop-cart-item__media,
  .shop-cart-item__qty,
  .shop-cart-item__total,
  .shop-cart-item__actions {
    grid-column: auto;
  }

  .shop-cart-item__media {
    max-width: 160px;
  }

  .shop-cart-item__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 400px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Sidebar filters: colors and price ───────────────────── */
.shop-sf__subtitle {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 10px 6px;
}

.shop-color-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 10px 6px;
}

.shop-color-filter__item {
  position: relative;
  cursor: pointer;
}

.shop-color-filter__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.shop-color-filter__dot {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shop-color-filter__item:hover .shop-color-filter__dot {
  transform: scale(1.12);
}

.shop-color-filter__item input:checked + .shop-color-filter__dot {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}

.shop-color-filter__item input:focus-visible + .shop-color-filter__dot {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shop-price-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 6px;
}

.shop-price-filter__input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: inherit;
}

.shop-price-filter__input:focus {
  outline: none;
  border-color: var(--accent);
}

.shop-price-filter__sep {
  color: var(--muted);
}

.shop-price-filter__btn {
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.shop-price-filter__btn:hover {
  border-color: #94a3b8;
}

/* ── HTMX loading state for product results / variant switch ── */
#shop-main,
#product-detail {
  transition: opacity 0.15s ease;
}

#shop-main.htmx-request,
#product-detail.htmx-request {
  opacity: 0.45;
  pointer-events: none;
}

/* ── Catalog showcase (category tiles on /catalog/) ──────── */
.shop-showcase__title {
  margin: 4px 0 18px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.shop-showcase__title--featured {
  margin-top: 44px;
}

.shop-showcase-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px 24px;
}

.shop-showcase-grid .roof-category-card__media {
  background: #f8fafc;
  border: 1.5px solid var(--line);
  min-height: 160px;
}

.shop-showcase-grid .roof-category-card__media img {
  object-fit: contain;
  object-position: center;
  padding: 14px;
}

@media (max-width: 640px) {
  .shop-showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
  }

  .shop-showcase-grid .roof-category-card__media {
    min-height: 0;
  }
}

.shop-showcase-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #cbd5e1;
}

.shop-showcase-no-img svg {
  width: 44px;
  height: 44px;
}

.shop-showcase-count {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
}
