/* ============================================================
   design-switcher.css — служебный слой каталога дизайнов
   Префикс классов bc-sw-* — изолирован от стилей концептов.
   Presentation: Top Design CTA — в потоке справа под header:
   ‹ 03 / 30 › Выбрать дизайн. Поверх светлых и тёмных концептов,
   нейтральная подача — не выглядит элементом конкретного дизайна.
   ============================================================ */

:root {
  --bc-sw-surface: #ffffff;
  --bc-sw-ink: #101114;
  --bc-sw-ink-soft: rgba(16, 17, 20, 0.55);
  --bc-sw-accent: #101114;   /* badge: чёрный фон + белый текст */
  --bc-sw-border: #101114;
  --bc-sw-fm: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Overlay: не занимает место в document flow — вертикальное
   положение hero не меняется. top задаёт JS по высоте header. */
.bc-sw {
  position: absolute;
  top: 88px; /* fallback; JS пересчитает по фактическому header */
  right: clamp(16px, 3vw, 40px);
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--bc-sw-ink);
  font-family: var(--bc-sw-fm);
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: normal;
  text-decoration: none;
  background: transparent;
  -webkit-font-smoothing: antialiased;
}

.bc-sw button {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: normal;
  margin: 0;
  padding: 0;
  text-decoration: none;
  text-transform: none;
  box-shadow: none;
}

.bc-sw :focus-visible {
  outline: 2px solid var(--bc-sw-ink);
  outline-offset: 2px;
}

/* Стрелки prev/next — чёрные solid кнопки с белой стрелкой, видны всегда.
   Селектор .bc-sw .bc-sw__arrow перебивает резет .bc-sw button. */
.bc-sw .bc-sw__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 38px;
  flex: none;
  font-size: 18px;
  border: 2px solid var(--bc-sw-border);
  border-radius: 999px;
  background: var(--bc-sw-accent);
  color: #ffffff;
  box-shadow:
    0 4px 12px rgba(10, 12, 18, 0.16);
  transition: background 0.15s ease, color 0.15s ease;
}

.bc-sw .bc-sw__arrow:hover {
  background: var(--bc-sw-surface);
  color: var(--bc-sw-ink);
}

/* Центральная CTA-кнопка (badge + подпись) — solid white, 2px тёмный бордер.
   Селектор .bc-sw .bc-sw__cta — чтобы перебить резет .bc-sw button. */
.bc-sw .bc-sw__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 7px;
  background: var(--bc-sw-surface);
  border: 2px solid var(--bc-sw-border);
  border-radius: 10px;
  box-shadow:
    0 10px 24px rgba(10, 12, 18, 0.18),
    0 2px 7px rgba(10, 12, 18, 0.12);
  transition: background 0.15s ease;
}

.bc-sw .bc-sw__cta:hover { background: #fbfaf4; }

/* Яркий badge с номером 03 / 30 */
.bc-sw__badge {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12.5px;
  color: #ffffff;
  background: var(--bc-sw-accent);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.bc-sw__label {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--bc-sw-ink);
}

.bc-sw__label-short { display: none; }

/* Компактное fixed-состояние после первого экрана */
.bc-sw .bc-sw__cta--mini {
  display: none;
  padding: 5px 12px 5px 5px;
  gap: 8px;
}

.bc-sw.is-scrolled {
  position: fixed;
  top: 10px;
  right: 16px;
  left: auto;
  margin-top: 0 !important; /* снимаем отступ под fixed header (inline style) */
}

.bc-sw.is-scrolled .bc-sw__cta--top { display: none; }
.bc-sw.is-scrolled .bc-sw__cta--mini { display: inline-flex; }

/* ---------- Mobile: компактная строка под header ---------- */

@media (max-width: 640px) {
  .bc-sw {
    right: 12px;
    gap: 4px;
  }

  .bc-sw .bc-sw__arrow {
    width: 30px;
    height: 32px;
    font-size: 16px;
  }

  .bc-sw .bc-sw__cta--top {
    padding: 5px 12px 5px 5px;
    gap: 8px;
  }

  .bc-sw__badge { font-size: 11.5px; padding: 3px 8px; }

  /* MOBILE: ‹ 03 / 30 › Дизайны — только короткая подпись */
  .bc-sw .bc-sw__cta--top .bc-sw__label { display: none; }
  .bc-sw .bc-sw__cta--top .bc-sw__label-short { display: inline; }
  .bc-sw__label { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .bc-sw * { transition: none !important; animation: none !important; }
}

/* ---------- Модальный selector / bottom-sheet ---------- */

.bc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bc-modal[hidden] { display: none; }

.bc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.62);
}

.bc-modal__panel {
  position: relative;
  width: min(880px, 100%);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: #141519;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  color: #fff;
  overflow: hidden;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.bc-modal__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bc-modal__head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  color: #fff;
}

.bc-modal__count {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.6);
}

.bc-modal__close {
  margin-left: auto;
  align-self: center;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.bc-modal__close:hover { background: rgba(255, 255, 255, 0.12); }

.bc-modal__body {
  padding: 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .bc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.bc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bc-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.bc-card.is-current {
  border-color: #fff;
  box-shadow: 0 0 0 1px #fff inset;
}

.bc-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #202127;
}

.bc-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* только для thumbnail */
  object-position: center top;
}

.bc-card__meta { display: flex; flex-direction: column; gap: 2px; }

.bc-card__title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.bc-card__num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.bc-card__sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
}

.bc-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.bc-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.75);
}

.bc-badge--primary {
  background: #fff;
  border-color: #fff;
  color: #141519;
}

.bc-card.is-current .bc-badge--current { background: rgba(255,255,255,0.14); }

.bc-modal__foot {
  padding: 10px 20px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.bc-modal :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* ---------- Mobile: bottom-sheet ---------- */

@media (max-width: 640px) {
  .bc-modal {
    align-items: flex-end;
    padding: 0;
  }
  .bc-modal__panel {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .bc-modal, .bc-card, .bc-modal__close { transition: none !important; }
}
