/* ============================================================
   4smoke — minimal tech дизайн
   Две темы: светлая (по умолчанию) и тёмная (синевато-серая).
   Ноль скруглений. Unbounded + Inter.
   ============================================================ */

/* ---------- Шрифты ---------- */
@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/unbounded-cyrillic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/unbounded-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-cyrillic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   ТЕМА: светлая (по умолчанию)
   ============================================================ */
:root,
[data-theme='light'] {
  --bg: #f0f2f6;
  --paper: #ffffff;
  --solid: #ffffff;
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --placeholder: #eaecf0;
  --accent: #2f6bff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 107, 255, 0.12);
  --danger: #d92d20;
  --ok: #12b76a;
  --header-bg: #ffffff;
  --footer-bg: #ffffff;
  --glow: none;
  --radius: 0px;
  --font-display: 'Unbounded', -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  --header-h: 72px;
}

/* ============================================================
   ТЕМА: тёмная — тёмно-серый с синим оттенком (референс: баннер НОВИНКИ)
   ============================================================ */
[data-theme='dark'] {
  --bg: #121820;
  --paper: #1a2230;
  --solid: #0d131c;
  --ink: #e7edf6;
  --ink-soft: #c3ccdb;
  --muted: #8b96a8;
  --line: #283242;
  --line-strong: #3a4658;
  --placeholder: #1e2836;
  --accent: #4d8aff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(77, 138, 255, 0.16);
  --danger: #ff6b5e;
  --ok: #3ddc97;
  --header-bg: #0d131c;
  --footer-bg: #0d131c;
  --glow: 0 0 18px rgba(77, 138, 255, 0.45);
  color-scheme: dark;
}

/* ---------- База ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

p {
  margin: 0 0 12px;
}

button {
  font: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- Утилиты ---------- */
.container {
  max-width: none;
  margin: 0;
  padding: 0 clamp(16px, 2.5vw, 36px);
}

.section {
  padding-top: 36px;
  padding-bottom: 36px;
}

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* Обязательное подтверждение возраста */
.age-gate-page {
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  background: var(--bg);
  overflow: hidden;
}

.age-gate-site-preview { min-height: 100vh; filter: blur(5px); transform: scale(1.02); opacity: .8; pointer-events: none; }
.age-gate-backdrop { position: fixed; inset: 0; z-index: 1; background: rgba(10, 10, 10, .58); backdrop-filter: blur(7px); }
.age-gate-preview-content { padding-top: 52px; }
.age-gate-preview-banner { height: min(32vw, 300px); border-radius: 18px; background: linear-gradient(120deg, var(--accent-soft), var(--paper)); }
.age-gate-preview-title { width: 38%; height: 28px; margin: 44px 0 24px; border-radius: 8px; background: var(--line-strong); }
.age-gate-preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.age-gate-preview-grid i { display: block; height: 240px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }

.age-gate {
  position: fixed;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(100%, 460px);
  box-sizing: border-box;
  padding: 34px 28px 28px;
  text-align: center;
  color: #111;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}

.age-gate-logo {
  min-height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}

.age-gate-logo img { max-width: min(280px, 90%); max-height: 72px; object-fit: contain; }
.age-gate-logo .logo-mark { justify-content: center; }
.age-gate h1 { margin: 0 0 18px; font-size: clamp(24px, 5vw, 32px); }
.age-gate p { margin: 8px auto; max-width: 370px; line-height: 1.45; }
.age-gate-denied { color: #a40000; font-weight: 700; }
.age-gate-actions { display: flex; justify-content: center; gap: 16px; margin-top: 26px; }
.age-gate-actions button { min-width: 92px; }
.age-gate-no, .age-gate-yes { color: inherit; background: transparent; }

.page-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 24px;
}

/* ============================================================
   ШАПКА
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-strong);
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
  min-height: var(--header-h);
}

/* Логотип как на неоновой вывеске */
.logo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  line-height: 1;
}

.logo-mark {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
}

.logo-4 {
  font-size: 26px;
  color: var(--accent);
  margin-right: 2px;
  filter: drop-shadow(0 0 10px var(--accent-soft));
}

.logo-pill {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--ink);
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px 5px;
}

.logo-by {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  align-self: flex-start;
  margin: -2px 0 0 3px;
}

.logo-sub {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  color: var(--muted);
  padding-left: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.main-nav a {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 8px 12px;
  transition: color .12s ease, background .12s ease;
}

.main-nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.main-nav a.active {
  color: var(--accent);
}

.header-phone {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: color .12s ease;
}

.header-phone:hover {
  color: var(--accent);
}

.telegram-header-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 6px 11px 6px 7px;
  border: 1px solid #229ed9;
  background: #229ed9;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.telegram-header-button:hover {
  color: #fff;
  filter: brightness(1.08);
}

.telegram-header-button .telegram-button-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  font-size: 14px;
}

/* Переключатель темы */
.theme-toggle {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}

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

.theme-toggle::before {
  content: '\263E\FE0E';
}

[data-theme='dark'] .theme-toggle::before {
  content: '\2600\FE0E';
}

/* Бургер */
.burger {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 10px 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.burger span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform .18s ease, opacity .18s ease;
}

.burger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ============================================================
   СЛАЙДЕР (на всю ширину)
   ============================================================ */
.slider-wrap {
  margin-top: 0;
}

.slider {
  position: relative;
  background: var(--solid);
  aspect-ratio: 3 / 1;
  height: auto;
  overflow: hidden;
}

.slide {
  display: none;
}

.slide.active {
  display: block;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--solid);
}

.slide-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 32px 36px;
  color: #fff;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 30%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

.home-featured-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr);
  align-items: stretch;
  gap: 24px;
}

.home-featured-products {
  min-width: 0;
}

.home-featured-products .card-img img {
  object-fit: cover;
}

.home-catalog-cta {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  min-height: 250px;
  margin-top: 60px;
  padding: clamp(24px, 4vw, 48px);
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  transition: background .15s ease, transform .15s ease;
}

.home-catalog-cta::before,
.home-catalog-cta::after {
  content: '';
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .35s ease;
}

.home-catalog-cta::before {
  right: -8%;
  bottom: -34%;
  width: 72%;
  height: 86%;
  background: radial-gradient(ellipse, rgba(255,255,255,.28) 0%, rgba(255,255,255,.12) 34%, transparent 72%);
  filter: blur(18px);
  transform: rotate(-12deg);
}

.home-catalog-cta::after {
  left: 4%;
  bottom: -20%;
  width: 56%;
  height: 58%;
  background: radial-gradient(ellipse, rgba(255,255,255,.22) 0%, transparent 70%);
  filter: blur(22px);
  transform: rotate(18deg);
}

.home-catalog-cta > *:not(.home-catalog-smoke) {
  position: relative;
  z-index: 2;
}

.home-catalog-smoke {
  position: absolute;
  z-index: 1;
  left: 18%;
  bottom: -20px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 65%, rgba(255,255,255,.42) 0 15%, transparent 42%),
    radial-gradient(circle at 68% 38%, rgba(255,255,255,.30) 0 18%, transparent 48%),
    radial-gradient(circle, rgba(255,255,255,.16), transparent 70%);
  filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 20px, 0) scale(.55);
}

.home-catalog-smoke-one {
  animation: catalogue-smoke-one 5s ease-in-out infinite;
}

.home-catalog-smoke-two {
  left: 42%;
  width: 138px;
  height: 138px;
  animation: catalogue-smoke-two 5.8s ease-in-out .5s infinite;
}

.home-catalog-smoke-three {
  left: 70%;
  width: 86px;
  height: 86px;
  animation: catalogue-smoke-three 4.8s ease-in-out 1s infinite;
}

.home-catalog-cta:hover .home-catalog-smoke {
  opacity: .85;
}

.home-catalog-cta:hover::before,
.home-catalog-cta:hover::after {
  opacity: 1;
}

.home-catalog-cta:hover {
  box-shadow: inset 0 -28px 55px rgba(255,255,255,.08), 0 12px 28px rgba(0,0,0,.12);
}

@keyframes catalogue-smoke-one {
  0%, 100% { transform: translate3d(-10px, 18px, 0) scale(.45); opacity: 0; }
  35% { transform: translate3d(6px, -38px, 0) scale(1); opacity: .7; }
  70% { transform: translate3d(-12px, -105px, 0) scale(1.45); opacity: 0; }
}

@keyframes catalogue-smoke-two {
  0%, 100% { transform: translate3d(8px, 20px, 0) scale(.4); opacity: 0; }
  40% { transform: translate3d(-10px, -48px, 0) scale(1.05); opacity: .55; }
  75% { transform: translate3d(12px, -125px, 0) scale(1.5); opacity: 0; }
}

@keyframes catalogue-smoke-three {
  0%, 100% { transform: translate3d(0, 18px, 0) scale(.4); opacity: 0; }
  38% { transform: translate3d(14px, -42px, 0) scale(1); opacity: .65; }
  72% { transform: translate3d(-4px, -108px, 0) scale(1.4); opacity: 0; }
}

.home-catalog-cta:hover .home-catalog-smoke-one {
  animation-duration: 3.8s;
}

.home-catalog-cta:hover .home-catalog-smoke-two {
  animation-duration: 4.6s;
}

.home-catalog-cta:hover .home-catalog-smoke-three {
  animation-duration: 3.4s;
}

@media (prefers-reduced-motion: reduce) {
  .home-catalog-smoke { animation: none; }
}

.home-catalog-cta:hover {
  background: #2455c7;
  color: #fff;
  transform: translateY(-2px);
}

.home-catalog-cta-label {
  max-width: 220px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .82);
}

.home-catalog-cta strong {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
  text-transform: uppercase;
}

.home-catalog-cta-arrow {
  font-size: 36px;
  line-height: 1;
}

.telegram-button {
  --telegram-bg: #229ed9;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--telegram-bg);
  background: var(--telegram-bg);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.telegram-button:hover {
  color: #fff;
  filter: brightness(1.08);
  box-shadow: 0 8px 20px rgba(34, 158, 217, .25);
  transform: translateY(-1px);
}

.telegram-button-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  font-size: 17px;
}

.telegram-button-arrow {
  margin-left: auto;
  font-size: 22px;
}

.telegram-product-button {
  position: relative;
  z-index: 3;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 12px;
}

.telegram-product-page-button,
.telegram-about-button {
  width: auto;
  margin: 18px 0 6px;
  padding: 12px 18px;
}

.telegram-product-page-button {
  margin: 8px 0 18px;
  min-height: 44px;
}

.slide-text h2 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: #fff;
}

.slide-text p {
  font-size: 14px;
  color: #e5e5e5;
  max-width: 560px;
  margin: 0 0 14px;
}

.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  background: var(--solid);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.slide-arrow:hover {
  background: var(--accent);
  color: #fff;
}

.slide-prev { left: 0; }
.slide-next { right: 0; }

.dots {
  position: absolute;
  bottom: 14px;
  right: 18px;
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid #fff;
  background: transparent;
  cursor: pointer;
}

.dot.active {
  background: #fff;
}

/* ============================================================
   СЕКЦИИ И СЕТКА КАРТОЧЕК
   ============================================================ */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.link-more {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
  transition: color .12s ease;
}

.link-more:hover {
  color: var(--accent);
}

/* Сетка без «фона-ловушки»: обычный gap + бордер у карточки */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* ---------- Карточка (клик по всей площади) ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color .15s ease;
}

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

.card-img {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  height: auto;
  background: var(--placeholder);
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .3s ease;
}

.card:hover .card-img img {
  transform: scale(1.03);
}

.no-img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  flex: 1;
}

.card-cat {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.card-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  transition: color .12s ease;
}

.catalog-product .card-body { min-height: 0; }
.card-meta-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 16px; margin-top: 6px; }
.card-meta-bottom .availability { flex: 0 0 auto; margin: 0; }
.catalog-product .telegram-product-button { margin-top: 0; }
.availability,
.telegram-product-button,
.btn,
.btn-primary,
.btn-ghost,
.btn-danger { font-family: var(--font-body); }

.product-name-cell { min-width: 260px; max-width: 440px; white-space: normal; overflow-wrap: anywhere; }
.product-name-cell > a { display: block; font-weight: 700; line-height: 1.35; }

.wysiwyg { border: 1px solid var(--line-strong); background: var(--paper); }
.wysiwyg-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--placeholder); }
.wysiwyg-toolbar button { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); padding: 5px 9px; cursor: pointer; font-size: 12px; }
.wysiwyg-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.wysiwyg-input { min-height: 180px; padding: 12px; outline: none; line-height: 1.6; }
.wysiwyg-input:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.wysiwyg-input p { margin: 0 0 10px; }
.wysiwyg-input h2 { font-size: 20px; }
.rich-content ul, .rich-content ol { padding-left: 24px; }
.rich-content h2, .rich-content h3 { margin-top: 20px; }
.rich-content,
.rich-content * {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit;
  max-width: 100%;
}
.rich-content h2 { font-size: 20px !important; line-height: 1.25; }
.rich-content h3 { font-size: 17px !important; line-height: 1.3; }
.rich-content p { margin: 0 0 12px; }

/* Markdown-редактор в админке */
.md-editor { border: 1px solid var(--line-strong); background: var(--paper); }
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--placeholder); }
.md-toolbar button { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); padding: 5px 9px; cursor: pointer; font-size: 12px; font-family: var(--font-body); }
.md-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.md-toolbar button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.md-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.md-spacer { flex: 1 1 auto; }
.md-panes { display: grid; grid-template-columns: 1fr 1fr; }
.md-input { width: 100%; min-height: 360px; padding: 12px 14px; border: 0; outline: none; resize: vertical; background: var(--paper); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.65; tab-size: 2; }
.md-input:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.md-preview { min-height: 360px; padding: 12px 16px; border-left: 1px solid var(--line); overflow: auto; background: var(--paper); }
.md-preview:empty::before { content: 'Предпросмотр появится здесь'; color: var(--muted); font-size: 13px; }
.md-preview-hidden .md-panes { grid-template-columns: 1fr; }
.md-preview-hidden .md-preview { display: none; }
.md-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--placeholder); }
.md-footer .small { margin: 0; }
.md-counter { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.md-counter.over { color: #c0392b; font-weight: 700; }
@media (max-width: 900px) {
  .md-panes { grid-template-columns: 1fr; }
  .md-preview { border-left: 0; border-top: 1px solid var(--line); }
}

/* Markdown в описаниях: таблицы, цитаты, код */
.rich-content ul, .rich-content ol { margin: 0 0 14px; }
.rich-content li { margin: 4px 0; }
.rich-content h2 { margin: 22px 0 10px; }
.rich-content h3 { margin: 18px 0 8px; }
.rich-content a { color: var(--accent); text-decoration: underline; }
.rich-content blockquote { margin: 14px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--placeholder); color: var(--ink-soft); }
.rich-content hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.rich-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em !important; background: var(--placeholder); padding: 1px 5px; }
.rich-content pre { margin: 14px 0; padding: 12px 14px; overflow-x: auto; background: var(--placeholder); border: 1px solid var(--line); }
.rich-content pre code { padding: 0; background: transparent; }
.rich-content .table-scroll { width: 100%; overflow-x: auto; margin: 14px 0; }
.rich-content table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line-strong); font-size: 13px !important; }
.rich-content .table-scroll table { margin: 0; min-width: 480px; }
.rich-content th, .rich-content td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rich-content th { background: var(--placeholder); font-family: var(--font-display); font-size: 11px !important; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.rich-content tr:last-child td { border-bottom: 0; }

.card:hover .card-title {
  color: var(--accent);
}

/* Растянутая ссылка: кликабельна вся карточка */
.card-title::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.card-props {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
}

.card-props li {
  padding: 2px 0;
}

.card-props span {
  color: var(--ink-soft);
}

.card-price {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sale-price del {
  color: var(--muted);
  font-size: .85em;
  font-weight: 400;
}

.sale-price strong {
  color: var(--danger);
}

.availability {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 6px;
  border: 0;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.availability-in {
  color: #fff;
  background: #087443;
}

.availability-out {
  color: #fff;
  background: #a51d2d;
}

/* ---------- Бейджи ---------- */
.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  color: #fff;
  line-height: 1.2;
  pointer-events: none;
}

.badge-hot {
  background: var(--accent);
}

.badge-new {
  background: var(--ink);
  color: var(--paper);
}

.badge-sale {
  background: var(--danger);
}

/* Абсолютное позиционирование — только поверх фото карточки товара */
.card-img .badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.card-img .badge-new {
  top: 28px;
}

/* ============================================================
   КАТАЛОГ
   ============================================================ */
.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}

.catalog-side {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  padding: 18px;
}

.side-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cat-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--ink-soft);
  transition: background .12s ease, color .12s ease;
}

.cat-link:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.cat-link.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.cat-link .count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cat-link.active .count {
  color: rgba(255, 255, 255, 0.75);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
}

.view-toggle a {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  margin-left: -1px;
  transition: background .12s ease, color .12s ease;
}

.view-toggle a:first-child {
  margin-left: 0;
}

.view-toggle a:hover {
  color: var(--ink);
}

.view-toggle a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Списочный вид ---------- */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-row {
  position: relative;
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 18px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 14px;
  transition: border-color .15s ease;
}

.list-row:hover {
  border-color: var(--accent);
}

.list-row .card-title::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.list-img {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  height: auto;
  background: var(--placeholder);
  overflow: hidden;
}

.list-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.list-body .card-title {
  font-size: 15px;
}

.list-row:hover .card-title {
  color: var(--accent);
}

.list-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-right: 8px;
}

/* ============================================================
   СТРАНИЦА ТОВАРА
   ============================================================ */
.breadcrumbs {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 20px;
}

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

.breadcrumbs span {
  margin: 0 8px;
  color: var(--line-strong);
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.gallery-main {
  position: relative;
  background: var(--placeholder);
  aspect-ratio: 3 / 2;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  aspect-ratio: 3 / 2;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--placeholder);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .12s ease;
}

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

.thumb:hover {
  border-color: var(--ink);
}

.thumb.active {
  border-color: var(--accent);
}

.product-info .card-cat {
  margin-bottom: 8px;
}

.product-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

.product-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.product-price {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 20px;
  color: var(--accent);
}

.product-contact-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: -8px 0 22px;
}

.product-contact-stack .availability {
  display: block;
  width: fit-content;
  margin: 0 0 2px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.45;
}

.product-contact-stack .telegram-product-page-button {
  display: inline-flex;
  align-self: flex-start;
  width: auto;
  min-width: 220px;
  margin: 10px 0 0;
  padding: 12px 18px;
}

.product-desc {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.product-desc p {
  margin: 0 0 10px;
}

.props-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 10px;
}

.props-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line-strong);
}

.props-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.props-table tr:last-child td {
  border-bottom: 0;
}

.props-table td:first-child {
  color: var(--muted);
  width: 45%;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   БЛОГ / О НАС / 404
   ============================================================ */
.post-full {
  max-width: 780px;
}

.post-meta {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
}

.post-hero {
  margin: 0 0 22px;
  background: var(--placeholder);
  overflow: hidden;
}

.post-hero img {
  width: 100%;
}

.post-content {
  font-size: 15px;
  color: var(--ink-soft);
}

.post-content p {
  margin: 0 0 14px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}

.contact-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.contact-block:first-child {
  padding-top: 0;
}

.contact-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

.about-map iframe {
  width: 100%;
  height: 380px;
  border: 1px solid var(--line-strong);
}

/* ============================================================
   ФУТЕР
   ============================================================ */
.site-footer {
  margin-top: 48px;
  background: var(--footer-bg);
  color: var(--muted);
  padding: 28px 0;
  border-top: 1px solid var(--line-strong);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}

.footer-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a:hover {
  color: var(--accent);
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn,
.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 11px 20px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.3;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  text-align: center;
}

.btn,
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn:hover,
.btn-primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 10px;
}

/* ============================================================
   ФОРМЫ
   ============================================================ */
.form-card {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  padding: 24px;
  margin-bottom: 20px;
}

/* Настройки: каждая секция — отдельный бокс с заголовком */
fieldset.form-card {
  margin: 0 0 20px;
  min-width: 0;
  display: block;
}

.form-card h2 {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 18px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span,
.field-label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .12s ease;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
}

.field-row .field {
  margin-bottom: 0;
}

.field-row + .field-row,
.field-row + .field,
.field + .field-row {
  margin-top: 16px;
}

.field-narrow {
  max-width: 240px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 10px;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.check.danger {
  color: var(--danger);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

fieldset.form-card + .form-actions {
  margin-top: 0;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  margin-bottom: 16px;
  font-size: 13px;
  background: var(--paper);
}

.notice-ok {
  border-color: var(--ok);
  color: var(--ok);
}

.notice-error {
  border-color: var(--danger);
  color: var(--danger);
}

.notice-info {
  border-color: var(--accent);
  color: var(--ink-soft);
}

.log-status {
  font-weight: 600;
}

.log-status-success {
  color: var(--ok);
}

.log-status-failed {
  color: var(--danger);
}

.inline-category-form {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 220px;
}

.inline-category-form select {
  min-width: 0;
  max-width: 220px;
  padding: 5px 7px;
  font-size: 12px;
}

.inline-photo-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 150px;
}

.inline-photo-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.inline-photo-form .upload-ready {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.bulk-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.admin-product-filters {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.admin-product-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-product-search {
  flex: 1;
  min-width: min(100%, 280px);
}

.admin-product-search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.admin-category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
}

.admin-category-chip span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-category-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.admin-category-chip.active span {
  color: rgba(255,255,255,.78);
}

.admin-category-child {
  background: color-mix(in srgb, var(--paper) 88%, var(--line));
}

.admin-category-uncategorized.has-uncategorized {
  border-color: var(--danger);
  animation: uncategorized-attention 1.5s ease-in-out infinite;
}

.admin-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.admin-products-table {
  min-width: 1180px;
  margin: 0;
  border: 0;
}

.admin-products-table .select-col {
  width: 48px;
  text-align: center;
}

.admin-products-table input[type="checkbox"] {
  width: 21px;
  height: 21px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

.admin-products-table .select-col input[type="checkbox"] {
  width: 24px;
  height: 24px;
}

.admin-products-table .numeric-col,
.admin-products-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.admin-product-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-product-identity > div {
  min-width: 0;
}

.admin-product-identity a {
  display: block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.35;
  font-weight: 600;
}

.admin-product-info {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 420px;
}

.admin-no-photo {
  display: grid;
  width: 64px;
  height: 48px;
  place-items: center;
  background: var(--placeholder);
  color: var(--muted);
  font-size: 10px;
}

.admin-products-table .row-actions {
  min-width: 170px;
}

.admin-price-cell {
  min-width: 140px;
  text-align: right;
  white-space: nowrap;
}

.admin-price-cell .btn-xs {
  display: block;
  margin: 6px 0 0 auto;
}

.admin-sale-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  padding: 24px;
}

.admin-sale-dialog::backdrop {
  background: rgba(0,0,0,.55);
}

.admin-sale-dialog h2 {
  margin-top: 0;
}

.admin-sale-dialog .form-actions {
  flex-wrap: wrap;
}

.sale-dialog-error {
  margin: 8px 0;
}

.admin-products-table .visibility-status {
  display: block;
  margin-bottom: 6px;
}

.admin-filter-clear {
  min-height: 34px;
}

.admin-filter-result {
  margin-left: auto;
  padding-bottom: 8px;
}

.admin-product-filter-hidden {
  display: none !important;
}

.uncategorized-notice {
  margin: 0;
  padding: 8px 10px;
  animation: uncategorized-attention 1.5s ease-in-out infinite;
}

@keyframes uncategorized-attention {
  0%, 100% { box-shadow: 0 0 0 rgba(190, 65, 65, 0); }
  50% { box-shadow: 0 0 0 4px rgba(190, 65, 65, .16); }
}

.catalog-filters {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.catalog-filter-primary,
.catalog-property-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.catalog-property-filters {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.catalog-filter-hidden {
  display: none !important;
}

.catalog-filters label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.catalog-search {
  flex: 1 1 240px;
}

.catalog-search input,
.catalog-filters select {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.availability-buttons {
  display: flex;
  gap: 4px;
}

.filter-chip {
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
}

.filter-chip.active,
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.catalog-category-children {
  margin-left: 13px;
  border-left: 1px solid var(--line);
  display: none;
}

.catalog-category-link-row {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.catalog-category-link-row .cat-link {
  flex: 1;
}

.catalog-category-node.expanded > .catalog-category-children {
  display: block;
}

.catalog-category-marker {
  display: inline-block;
  width: 12px;
  color: var(--accent);
}

.catalog-category-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 18px;
  height: 22px;
  margin: 0 4px 0 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.catalog-category-toggle:hover,
.catalog-category-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.catalog-property-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.category-root-drop {
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 12px;
}

.category-root-drop.drag-over,
.category-node-row.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.category-tree,
.category-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-children {
  display: none;
  margin-left: 27px;
}

.category-node.expanded > .category-children {
  display: block;
}

.category-node-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.category-toggle,
.category-toggle-spacer {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.category-toggle {
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
}

.category-drag-handle {
  color: var(--muted);
  cursor: grab;
  letter-spacing: -2px;
}

.category-node.dragging {
  opacity: .45;
}

.category-node-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

/* ============================================================
   ТАБЛИЦЫ / МИНИАТЮРЫ
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  font-size: 13px;
}

.table th {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  text-align: right;
  white-space: nowrap;
}

.row-actions a,
.row-actions button,
.row-actions form {
  display: inline-block;
  margin-left: 6px;
}

.thumb-sm {
  width: 64px;
  height: 44px;
  object-fit: cover;
  background: var(--placeholder);
}

.photo-count {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.site-logo-image {
  display: block;
  width: min(180px, 24vw);
  height: 42px;
  max-width: 180px;
  max-height: 42px;
  object-fit: contain;
}

.settings-logo-preview {
  display: block;
  max-width: 260px;
  max-height: 90px;
  margin: 8px 0;
  object-fit: contain;
  background: var(--placeholder);
}

.settings-favicon-preview {
  display: block;
  width: 48px;
  height: 48px;
  margin: 8px 0;
  object-fit: contain;
  background: var(--placeholder);
}

.table-check {
  display: inline-flex;
  margin: 5px 8px 0 0;
  font-size: 11px;
}

.thumb-lg {
  max-width: 100%;
  max-height: 160px;
  background: var(--placeholder);
}

/* ============================================================
   АДМИНКА
   ============================================================ */
.admin-topbar {
  background: var(--header-bg);
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
}

.admin-topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  flex-wrap: wrap;
}

.admin-topbar .logo-mark .logo-4 {
  font-size: 20px;
}

.admin-topbar .logo-pill {
  font-size: 12px;
  padding: 3px 9px 4px;
}

.admin-topbar .logo-by {
  font-size: 9px;
}

.admin-topbar .logo-sub {
  font-size: 7px;
  letter-spacing: 0.3em;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}

.admin-nav a {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 7px 11px;
  transition: color .12s ease, background .12s ease;
}

.admin-nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.admin-nav a.active {
  color: var(--accent);
}

.admin-actions {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.admin-actions a {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color .12s ease;
}

.admin-actions a:hover {
  color: var(--accent);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

.admin-grid > * {
  min-width: 0;
  overflow-x: auto;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 20px;
  transition: border-color .12s ease;
}

.stat-card:hover {
  border-color: var(--accent);
}

.stat-card b {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-card span {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.prop-row {
  display: grid;
  grid-template-columns: 1fr 150px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.prop-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.img-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.img-item {
  width: 110px;
}

.img-item img {
  width: 110px;
  height: 82px;
  object-fit: cover;
  background: var(--placeholder);
  margin-bottom: 6px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head .page-title {
  margin: 0;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  margin: 0;
}

.login-card .btn-primary {
  width: 100%;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.muted-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.muted-link:hover {
  color: var(--accent);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 860px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .burger {
    display: flex;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .burger {
    margin-left: 0;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line-strong);
    padding: 8px 16px 16px;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
  }

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .header-phone {
    display: none;
  }

  .telegram-header-button {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 5px;
  }

  .telegram-header-button > span:last-child {
    display: none;
  }

  .telegram-header-button .telegram-button-icon {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .header-inner {
    position: relative;
    gap: 12px;
  }

  .slider {
    aspect-ratio: 3 / 1;
    height: auto;
  }

  .slider-wrap + .section {
    padding-top: 34px;
  }

  .slide-text {
    padding: 20px;
  }

  .slide-text h2 {
    display: none;
  }

  .slide-text p {
    display: none;
  }

  .slide-arrow {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

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

  .home-featured-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-catalog-cta {
    min-height: 140px;
    margin-top: 0;
    padding: 22px;
    gap: 8px;
  }

  .home-catalog-cta strong {
    font-size: 26px;
  }

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-price {
    font-size: 14px;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .catalog-side {
    padding: 14px;
  }

  .list-row {
    grid-template-columns: 100px 1fr;
    gap: 12px;
  }

  .list-side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-right: 0;
  }

  .list-body .card-desc {
    display: none;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gallery-main img {
    height: 100%;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .about-map iframe {
    height: 280px;
  }

  .field-row,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .field-narrow {
    max-width: none;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .prop-row {
    grid-template-columns: 1fr 110px auto;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .view-toggle a {
    padding: 7px 10px;
  }
}
