:root{
  --bg:#0b1020;
  --card:#0f1733;
  --prod-bg: linear-gradient(180deg, rgba(15,23,51,.95), rgba(12,20,45,.86));
  --logo-size: 120px;

  --text:#e9eefc;
  --muted:#a8b3d6;
  --line:rgba(255,255,255,.10);
  --brand:#3b82f6;   /* blue */
  --brand2:#22d3ee;  /* cyan */
  --ok:#10b981;
  --bad:#ef4444;
  --shadow:0 18px 55px rgba(0,0,0,.35);
  --tag-bg: rgba(255,255,255,.08);
  --shadow-card: 0 12px 36px rgba(0,0,0,.22);
  --img-bg: rgba(0,0,0,.18);
  --img-border: rgba(255,255,255,.10);
  --r:18px;
  --max:1360px;
  --font:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,"Noto Sans",sans-serif;

  /* Hero background controls (0..10) */
  --hero-bg-opacity10: 4;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}


/* ============================
   Theme: White (toggle)
   ============================ */
body.theme-white{
  --bg:#f6f8fc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --line:rgba(15,23,42,.10);
  --brand:#2563eb;
  --brand2:#06b6d4;
  --shadow:0 18px 55px rgba(15,23,42,.10);
  background:
    radial-gradient(900px 480px at 12% 6%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(900px 520px at 92% 10%, rgba(6,182,212,.14), transparent 60%),
    radial-gradient(1000px 650px at 50% 110%, rgba(99,102,241,.10), transparent 62%),
    var(--bg);

  --prod-bg: #ffffff;
  --tag-bg: rgba(15,23,42,.06);
  --shadow-card: 0 12px 36px rgba(15,23,42,.10);
  --img-bg: rgba(2,6,23,.04);
  --img-border: rgba(2,6,23,.08);
}

body{
  margin:0;font-family:var(--font);color:var(--text);line-height:1.55;
  background:
    radial-gradient(1100px 650px at 15% 10%, rgba(59,130,246,.22), transparent 60%),
    radial-gradient(950px 600px at 95% 12%, rgba(34,211,238,.18), transparent 55%),
    radial-gradient(1100px 650px at 50% 120%, rgba(34,211,238,.08), transparent 60%),
    var(--bg);
}
a{color:inherit;text-decoration:none}a:hover{opacity:.95}
.container{max-width:var(--max);margin:0 auto;padding:0 18px}
.muted{color:var(--muted)}
.small{font-size:13px}
.section{padding:56px 0}.tight{padding:34px 0}
.hr{border-top:1px solid var(--line);margin:22px 0}
.badge{display:inline-flex;gap:8px;align-items:center;padding:8px 12px;border:1px solid var(--line);
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02));border-radius:999px;color:var(--muted);font-size:13px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:12px 16px;border-radius:14px;
  border:1px solid var(--line);background:rgba(255,255,255,.04);cursor:pointer;transition:.15s}
.btn:hover{transform:translateY(-1px);background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.16)}
.btn.primary{background:linear-gradient(135deg,rgba(139,92,246,.96),rgba(34,211,238,.92));border-color:rgba(255,255,255,.12)}
.btn.sm{padding:10px 12px;border-radius:12px;font-size:14px}
.header{position:sticky;top:0;z-index:50;backdrop-filter:blur(14px);background:rgba(10,14,30,.70);border-bottom:1px solid var(--line)}
.header-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:14px 0;gap:14px}
.brand{display:flex;align-items:center;gap:12px;min-width:180px}
.logo{width:60px;height:60px;border-radius:14px;background:linear-gradient(135deg,rgba(139,92,246,.95),rgba(34,211,238,.92));
  box-shadow:0 10px 30px rgba(59,130,246,.20);display:grid;place-items:center}
.brand strong{font-size:16px;letter-spacing:.2px}.brand span{display:block;font-size:12px;color:var(--muted);margin-top:1px}
.nav{display:flex;gap:10px;align-items:center;min-width:0;flex:1;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none;padding:6px 2px}
.nav::-webkit-scrollbar{display:none}
.nav a{flex:0 0 auto;white-space:nowrap;min-width:0}
.nav a{color:var(--muted);font-size:16px;padding:10px 10px;border-radius:12px;border:1px solid transparent}
.nav a.active,.nav a:hover{color:var(--text);border-color:rgba(255,255,255,.12);background:rgba(255,255,255,.04)}
.mobile-toggle{display:none}
.card{background:var(--card);border:1px solid var(--line);border-radius:22px;padding:20px;box-shadow:var(--shadow)}
.pad{padding:18px}
.h1{margin:10px 0 10px;font-size:44px;line-height:1.1;letter-spacing:-.6px}
.h2{font-size:28px;margin:0 0 10px;letter-spacing:-.4px}
.lead{color:var(--muted);max-width:78ch;margin:0 0 18px}
.hero{padding:44px 0 10px}
.hero-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:20px}
.hero-main{padding:28px}
.hero-actions{display:flex;gap:12px;margin-top:18px;flex-wrap:wrap}
.fact{padding:10px 12px;border-radius:14px;border:1px solid var(--line);background:rgba(0,0,0,.12);color:var(--muted);font-size:13px}
.fact b{color:var(--text)}
.products{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.product{border:1px solid var(--line);border-radius:var(--r);overflow:hidden;background:var(--prod-bg);
  box-shadow:var(--shadow-card);display:flex;flex-direction:column}
.pimg{aspect-ratio:16/10;background:var(--img-bg);display:grid;place-items:center;border-bottom:1px solid var(--line)}
.pimg img{width:100%;height:100%;object-fit:cover;display:block}
/* Product card: выравнивание текста и кнопок */
.pbody{
  padding:14px 14px 16px;
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0;
}

/* Заголовок карточки (поддержка старого .title и нового .ptitle) */
.ptitle,
.title{
  font-size:16px;
  margin:0 0 10px;
  line-height:1.25;
  font-weight:700;
}
.ptitle a,
.title a{color:var(--text);text-decoration:none;}
.ptitle a:hover,
.title a:hover{opacity:.9;}

/* Контейнер тегов (если в HTML есть .meta) */
.meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 10px;
}

/* Сами “пилюли” тегов */
.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--img-border);
  color:var(--muted);
  background:var(--tag-bg);
  white-space:nowrap;
}

/* Кнопки всегда на одном уровне (внизу карточки) */
.actions{
  display:flex;
  gap:10px;
  margin-top:auto; /* ключевое */
}
.actions a{
  flex:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  white-space:nowrap;
}

.input,select,textarea{width:100%;padding:12px 12px;border-radius:14px;border:1px solid var(--line);background:rgba(0,0,0,.16);color:var(--text);outline:none}
textarea{min-height:110px;resize:vertical}
label{font-size:13px;color:var(--muted)}
.form-grid{display:grid;gap:12px}.two{grid-template-columns:1fr 1fr}
.breadcrumbs{display:flex;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:13px}
.footer{border-top:1px solid var(--line);background:rgba(0,0,0,.10);padding:30px 0}
.footer-grid{display:grid;grid-template-columns:1.1fr .9fr .9fr;gap:14px}
.footer h4{margin:0 0 10px;font-size:14px}.footer a{color:var(--muted);font-size:14px}.footer a:hover{color:var(--text)}
.copy{margin-top:16px;color:var(--muted);font-size:13px}
.sticky{position:fixed;right:16px;bottom:16px;z-index:60;display:flex;flex-direction:column;gap:10px}
.pill{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.14);
  background:rgba(10,14,30,.70);backdrop-filter:blur(12px);box-shadow:0 16px 55px rgba(0,0,0,.35)}
.pill svg{width:18px;height:18px}
.notice{border:1px dashed rgba(255,255,255,.22);border-radius:var(--r);padding:14px 16px;color:var(--muted);background:rgba(255,255,255,.03)}
.toast{margin-top:8px;font-size:14px;color:var(--muted)}
.toast.ok{color:rgba(16,185,129,.95)}.toast.bad{color:rgba(239,68,68,.95)}
@media (max-width:980px){
  .hero-grid{grid-template-columns:1fr}.h1{font-size:38px}.products{grid-template-columns:repeat(2,1fr)}
  .nav{display:none}.mobile-toggle{display:inline-flex}
  .footer-grid{grid-template-columns:1fr}
}
@media (max-width:560px){
  .h1{font-size:32px}.products{grid-template-columns:1fr}.two{grid-template-columns:1fr}
  .sticky{left:16px;right:16px}.pill{justify-content:center}
}

/* Catalog filters */
.catalog-filters { margin-bottom: 14px; }
.filters-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}
.filters-search { grid-column: 1 / -1; }
.filters-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
}
@media (max-width: 980px) {
  .filters-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .filters-search { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .filters-grid { grid-template-columns: 1fr; }
}

/* Select readability */
select, select.input {
  background: rgba(255,255,255,.94) !important;
  color: #111 !important;
  border-color: rgba(0,0,0,.10);
}
select option {
  background: #fff;
  color: #111;
}
select:focus { box-shadow: 0 0 0 3px rgba(59,130,246,.22); }

/* Simple grids used on content pages */
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
@media (max-width:980px){.grid3{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.grid3{grid-template-columns:1fr}}
.steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.step{padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.04)}
@media (max-width:980px){.steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.steps{grid-template-columns:1fr}}

/* Footer alias (HTML uses .site-footer) */
.site-footer{
  border-top:1px solid var(--line);
  background:rgba(0,0,0,.10);
  padding:30px 0;
}
.site-footer a{color:var(--muted);font-size:14px}
.site-footer a:hover{color:var(--text)}

.header-cta{display:flex;gap:10px;align-items:center}
@media (max-width:1180px){
  .header-inner{flex-wrap:wrap;align-items:center}
  .brand{min-width:0}
  .nav{flex-wrap:wrap}
}
@media (max-width:560px){
  .header-cta{width:100%;justify-content:space-between}
  .actions{flex-direction:column}
  .actions a{flex:auto}
}


/* Theme switch (slider) */
/* Theme switch (minimal) */
.theme-switch{display:flex;align-items:center;gap:8px;padding:4px 8px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.06);backdrop-filter:saturate(120%) blur(6px);flex:0 0 auto}
body.theme-white .theme-switch{ background:rgba(255,255,255,.70); }
.ts-label{display:none}
.switch{ position:relative; display:inline-block; width:38px; height:20px; flex:0 0 auto; }
.switch input{ opacity:0; width:0; height:0; }
.slider{ position:absolute; cursor:pointer; inset:0; background:rgba(255,255,255,.14); border:1px solid var(--line); transition:.2s; border-radius:999px; }
.slider:before{ position:absolute; content:""; height:14px; width:14px; left:3px; top:2px; background:linear-gradient(135deg, var(--brand), var(--brand2)); border-radius:999px; transition:.2s; box-shadow:0 8px 18px rgba(0,0,0,.20); }
.switch input:checked + .slider{ background:rgba(255,255,255,.22); }
.switch input:checked + .slider:before{ transform:translateX(16px); }

/* Compact labels on small screens */
@media (max-width: 720px){
  .ts-label{ display:none; }
  .theme-switch{ padding:6px 8px; }
}

body.theme-white .header{
  background:rgba(246,248,252,.78);
  border-bottom:1px solid var(--line);
}
body.theme-white .nav a{ color: rgba(15,23,42,.72); }
body.theme-white .nav a.active, body.theme-white .nav a:hover{
  color: rgba(15,23,42,.96);
  background:rgba(255,255,255,.80);
}


/* HERO BACKGROUND (from admin settings) */
.hero{ position:relative; }
.hero::before{
  content:"";
  position:absolute; inset:-1px;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  opacity: calc(var(--hero-bg-opacity10, 6) / 10);
  filter: saturate(1.05) contrast(1.05);
  pointer-events:none;
}
.hero::after{
  content:"";
  position:absolute; inset:-1px;
  background: radial-gradient(900px 360px at 15% 25%, rgba(139,92,246,.18), transparent 60%),
              radial-gradient(800px 320px at 80% 10%, rgba(34,211,238,.16), transparent 55%),
              linear-gradient(180deg, rgba(10,14,30,.55), rgba(10,14,30,.90));
  pointer-events:none;
}
.hero .container{ position:relative; z-index:1; }

/* THEME WHITE OVERRIDES */
body.theme-white .header{
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid rgba(15,23,42,.08);
}
body.theme-white .nav a.active,
body.theme-white .nav a:hover{
  border-color: rgba(15,23,42,.10);
  background: rgba(15,23,42,.04);
}
body.theme-white .btn{
  background: rgba(15,23,42,.03);
  border-color: rgba(15,23,42,.12);
}
body.theme-white .btn:hover{
  background: rgba(15,23,42,.05);
  border-color: rgba(15,23,42,.16);
}
body.theme-white .card{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,247,255,.92));
  box-shadow: 0 12px 40px rgba(15,23,42,.10);
}
body.theme-white .fact{ background: rgba(15,23,42,.05); }
body.theme-white .notice{ background: rgba(15,23,42,.03); border-color: rgba(15,23,42,.16); }

body.theme-white .product{
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(245,247,255,.92));
  box-shadow: 0 14px 40px rgba(15,23,42,.12);
}
body.theme-white .pimg{ background: rgba(15,23,42,.04); }
body.theme-white .tag{ background: rgba(15,23,42,.04); color: rgba(15,23,42,.72); }

body.theme-white .input, 
body.theme-white select,
body.theme-white textarea{
  background: rgba(255,255,255,.92);
  color: rgba(15,23,42,.95);
}
body.theme-white .footer{
  background: rgba(255,255,255,.78);
  border-top: 1px solid rgba(15,23,42,.08);
}
body.theme-white .pill{
  background: rgba(255,255,255,.88);
  border-color: rgba(15,23,42,.12);
  box-shadow: 0 18px 60px rgba(15,23,42,.14);
}
body.theme-white .slider{
  background: rgba(15,23,42,.08);
}
body.theme-white .switch input:checked + .slider{ background: rgba(15,23,42,.10); }


body.theme-white .hero::after{
  background: radial-gradient(900px 360px at 15% 25%, rgba(139,92,246,.14), transparent 60%),
              radial-gradient(800px 320px at 80% 10%, rgba(34,211,238,.12), transparent 55%),
              linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.85));
}

/* Theme switch in header */
.header .theme-switch{
  padding: 8px 10px;
  border-radius: 999px;
  height: 36px;
}
.header .theme-switch .ts-label{ font-size: 12px; }
.header .theme-switch{ margin-left: 6px; }

@media (max-width: 860px){
  .header .theme-switch{
    padding: 6px 8px;
    height: 32px;
  }
  .header .theme-switch .ts-label{ font-size: 11px; }
}

.logo img{width:100%;height:100%;object-fit:contain;border-radius:14px;display:block}

/* Prevent wrapping in header nav */
.nav a{white-space:nowrap;min-width:0}

.hint.ok{color:rgba(34,197,94,.95)}
.hint.bad{color:rgba(239,68,68,.95)}

.header-actions{display:flex;align-items:center;gap:12px;flex-wrap:nowrap}


/* Brand text wrapping */
.brand{min-width:0}
.brand > span{min-width:0}
.brand strong{line-height:1.2}
.brand span span{line-height:1.2}
@media (max-width:560px){
  .brand span span{display:none}
}


/* ============================
   Header polish (no overlaps)
   ============================ */
.header-inner{gap:12px}
.nav{flex:1 1 420px;justify-content:center}
.header-cta{flex:0 0 auto}
.brand > span:last-child{min-width:0}
.brand strong{display:block;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brand > span:last-child > span{line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:560px){
  .brand > span:last-child > span{display:none}
}

/* ============================
   Theme switch — minimal
   ============================ */
.theme-switch{padding:4px 8px;gap:8px}
.theme-switch .ts-label{display:none}
.switch{width:38px;height:20px}
.slider:before{height:14px;width:14px;left:3px;top:2px;box-shadow:0 6px 14px rgba(0,0,0,.28)}
.switch input:checked + .slider:before{transform:translateX(18px)}

/* ============================
   Carousel (multi-photo)
   ============================ */
.carousel{position:relative;width:100%;height:100%;overflow:hidden;border-radius:inherit}
.carousel-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;height:100%;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.carousel-track::-webkit-scrollbar{display:none}
.carousel-track > img{flex:0 0 100%;width:100%;height:100%;object-fit:cover;scroll-snap-align:start;display:block}
.carousel-btn{position:absolute;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:999px;border:1px solid var(--img-border);background:rgba(0,0,0,.38);color:var(--text);display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .15s, transform .15s;z-index:3}
.carousel-btn:hover{transform:translateY(-50%) scale(1.03)}
.carousel-btn[data-prev]{left:8px}
.carousel-btn[data-next]{right:8px}
.product:hover .carousel-btn,.carousel:focus-within .carousel-btn{opacity:1}
.carousel-dots{position:absolute;left:50%;bottom:8px;transform:translateX(-50%);display:flex;gap:6px;z-index:3}
.carousel-dot{width:7px;height:7px;border-radius:999px;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.45);cursor:pointer;padding:0}
.carousel-dot[aria-current="true"]{background:var(--brand);border-color:rgba(255,255,255,.16)}
body.theme-white .carousel-btn{background:rgba(255,255,255,.72);color:var(--text)}
body.theme-white .carousel-dot{border-color:rgba(15,23,42,.16);background:rgba(15,23,42,.20)}

/* Card image link overlay (keeps buttons clickable) */
.pimg{position:relative}
.pimg-link{position:absolute;inset:0;z-index:2}
.carousel-btn,.carousel-dots{z-index:3}

/* Product page gallery */
.product-gallery{aspect-ratio:16/10;background:var(--img-bg);border:1px solid var(--img-border);border-radius:14px;overflow:hidden}

/* Логотип: убрать фон-плашку */
.header .brand .logo{
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* === FORCE: убираем плашку логотипа в футере при любом HTML === */
footer .logo,
.footer .logo,
.site-footer .logo{
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;

  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Картинка логотипа в футере */
footer .logo img,
.footer .logo img,
.site-footer .logo img,
footer img.logo-img,
.footer img.logo-img,
.site-footer img.logo-img{
  width: auto !important;
  height: 80px !important;   /* регулируй размер тут */
  border-radius: 0 !important;
  background: transparent !important;
}


/* === LOGO: единый размер сверху и снизу (1 переменная) === */

/* контейнер лого (убираем плашку и фиксируем размер) */
.logo{
  width: var(--logo-size) !important;
  height: var(--logo-size) !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* сама картинка */
.logo img{
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  background: transparent !important;
  display: block !important;
}







/* =========================================================
   MOBILE PRO LAYER (ONLY phones)
   - ПК не меняем: всё внутри @media
   - делает шапку аккуратной, кнопки в столбик, hero/карточки компактнее
   - меню-выдвижка (burger) работает через #mobileNav[data-open="1"]
   - бургер всегда доступен, меню не перекрывает полоски
   ========================================================= */

@media (max-width: 980px){

  /* Общие микро-настройки для смартфонов */
  :root{
    --mobile-header-h: 72px; /* можно подкрутить */
    --mobile-gap: 10px;
    --mobile-pad: 14px;
    --mobile-radius: 18px;

    /* Лого на мобиле (сверху и снизу одинаково) */
    --logo-size-mobile: 44px;
  }

  /* Контейнер чуть уже и аккуратнее */
  .container{ padding: 0 var(--mobile-pad) !important; }

  /* Текст/заголовки под телефон */
  .h1{ font-size: 30px !important; line-height: 1.08 !important; letter-spacing: -.4px !important; }
  .h2{ font-size: 22px !important; }
  .lead{ font-size: 15px !important; line-height: 1.55 !important; }

  /* Карточки/секции — меньше воздуха и лучше читаемость */
  .section{ padding: 34px 0 !important; }
  .hero{ padding: 18px 0 8px !important; }
  .card{ border-radius: var(--mobile-radius) !important; padding: 16px !important; }
  .hero-main{ padding: 16px !important; }
  .hr{ margin: 16px 0 !important; }

  /* =========================================================
     HEADER: делаем 2 ряда
     - ряд 1: бургер + бренд + переключатель темы/кнопки справа
     - ряд 2: CTA-кнопки (в колонку)
     ========================================================= */

  .header{ z-index: 120 !important; }

  .header-inner{
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-auto-rows: minmax(0, auto) !important;
    align-items: center !important;
    gap: var(--mobile-gap) !important;
    padding: 10px 0 !important;
  }

  /* бренд в центре, чтобы не ломался */
  .brand{
    min-width: 0 !important;
    gap: 10px !important;
  }
  .brand strong{
    font-size: 13px !important;
    max-width: 180px !important;
  }

  /* Лого на мобиле одинаковое сверху/снизу */
  .header .logo,
  .site-footer .logo,
  footer .logo{
    width: var(--logo-size-mobile) !important;
    height: var(--logo-size-mobile) !important;
  }
  .header .logo img,
  .site-footer .logo img,
  footer .logo img{
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  /* =========================================================
     Burger (3 lines) — кнопка должна быть id="mobileToggle"
     ========================================================= */

  #mobileToggle,
  .mobile-toggle#mobileToggle{
    display: inline-flex !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    border: 1px solid var(--line) !important;
    background: rgba(255,255,255,.06) !important;
    backdrop-filter: blur(10px) !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 140 !important; /* выше меню */
    cursor: pointer !important;

    /* если внутри есть текст — скрываем */
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
  }

  #mobileToggle::before{
    content:"";
    width: 20px;
    height: 14px;
    display:block;
    background:
      linear-gradient(var(--text), var(--text)) 0 0 / 100% 2px no-repeat,
      linear-gradient(var(--text), var(--text)) 0 50% / 100% 2px no-repeat,
      linear-gradient(var(--text), var(--text)) 0 100% / 100% 2px no-repeat;
    opacity: .95;
  }

  /* если JS ставит aria-expanded="true" — делаем "X" */
  #mobileToggle[aria-expanded="true"]::before{
    height: 18px;
    background:
      linear-gradient(var(--text), var(--text)) 50% 50% / 100% 2px no-repeat,
      linear-gradient(var(--text), var(--text)) 50% 50% / 100% 2px no-repeat;
    transform: rotate(45deg);
  }

  /* Кнопка "Главная" (только моб), если добавишь <a class="mobile-home" href="/">Главная</a> */
  .mobile-home{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
    border: 1px solid var(--line) !important;
    background: rgba(255,255,255,.06) !important;
    color: var(--text) !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    z-index: 140 !important;
  }

  /* Переключатель темы на мобиле — на всю ширину и аккуратно */
  .header .theme-switch{
    height: 44px !important;
    padding: 6px 10px !important;
    justify-content: space-between !important;
  }

  /* =========================================================
     ВАЖНО: все "ряды модулей" → в колонку на мобиле
     (то, что ты обводил кружками: 2–3+ кнопки рядом)
     ========================================================= */

  .header-cta,
  .header-actions,
  .hero-actions,
  .filters-row,
  .actions{
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--mobile-gap) !important;
  }

  .header-cta > *,
  .header-actions > *,
  .hero-actions > *,
  .filters-row > *,
  .actions > *{
    width: 100% !important;
    max-width: none !important;
  }

  /* Кнопки на телефоне — удобный tap-target */
  .btn,
  .actions a{
    min-height: 48px !important;
    border-radius: 16px !important;
  }

  /* =========================================================
     Mobile drawer menu
     Требования:
     - меню контейнер: id="mobileNav"
     - JS при открытии ставит: data-open="1"
     ========================================================= */

  #mobileNav{
    position: fixed !important;

    /* меню появляется НИЖЕ шапки, бургер не перекрывает */
    top: calc(env(safe-area-inset-top, 0px) + var(--mobile-header-h)) !important;
    left: var(--mobile-pad) !important;
    right: var(--mobile-pad) !important;

    width: auto !important;
    max-width: 520px !important;
    height: calc(100dvh - (env(safe-area-inset-top, 0px) + var(--mobile-header-h)) - 12px) !important;

    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;

    border-radius: 18px !important;
    border: 1px solid var(--line) !important;
    background: rgba(10,14,30,.94) !important;
    backdrop-filter: blur(14px) !important;
    box-shadow: var(--shadow) !important;

    padding: 10px !important;

    z-index: 110 !important;
    display: none !important;
    opacity: 0 !important;
    transform: translateY(-8px) !important;
    pointer-events: none !important;
    transition: opacity .18s ease, transform .18s ease !important;
  }

  #mobileNav[data-open="1"]{
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  #mobileNav a{
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;

    padding: 12px 12px !important;
    border-radius: 14px !important;
    margin: 6px 0 !important;

    color: var(--text) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    background: rgba(255,255,255,.05) !important;
  }
  #mobileNav a:hover{
    background: rgba(255,255,255,.07) !important;
    border-color: rgba(255,255,255,.16) !important;
  }

  /* затемнение фона (если браузер поддерживает :has) */
  body:has(#mobileNav[data-open="1"])::after{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 100; /* ниже шапки */
  }

  /* =========================================================
     Hero / контент: меньше "кирпичей", больше воздуха
     ========================================================= */

  .fact{
    font-size: 13px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
  }

  /* Каталог: на телефоне карточки в 1 колонку (у тебя уже есть на 560,
     но подстрахуем для всех смартфонов) */
  .products{ grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Фильтры — в 1 колонку */
  .filters-grid{ grid-template-columns: 1fr !important; }
  .filters-search{ grid-column: 1 / -1 !important; }

  /* Нижние фикс-кнопки (если используешь .sticky/.pill) — безопасная зона iPhone */
  .sticky{
    left: var(--mobile-pad) !important;
    right: var(--mobile-pad) !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 10px !important;
  }
  .pill{
    width: 100% !important;
    justify-content: center !important;
    min-height: 52px !important;
    border-radius: 18px !important;
  }
}

/* На всякий случай: "Главная" скрыта на ПК */
@media (min-width: 981px){
  .mobile-home{ display:none !important; }
}

/* =========================================================
   MOBILE: делаем лого больше, а длинный текст бренда скрываем
   (ПК не трогаем)
   ========================================================= */
@media (max-width: 980px){

  /* 1) Размер логотипа на мобиле (меняешь ОДНО место) */
  :root{
    --logo-size: 52px; /* попробуй 52-64px */
  }

  /* 2) Убираем длинный текст бренда, чтобы не ломал шапку */
  .header .brand strong,
  .header .brand > span,
  .header .brand .muted,
  .header .brand .small{
    display: none !important;
  }

  /* 3) Делаем сам логотип реально большим (на случай разного HTML) */
  .header .brand .logo{
    width: var(--logo-size) !important;
    height: var(--logo-size) !important;
    min-width: var(--logo-size) !important;
    min-height: var(--logo-size) !important;
  }

  .header .brand .logo img,
  .header .brand img.logo-img,
  .header .brand > img{
    width: var(--logo-size) !important;
    height: var(--logo-size) !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* 4) Чтобы слева всё не сжималось в точку */
  .header .brand{
    min-width: 0 !important;
    flex: 0 0 auto !important;
    gap: 10px !important;
  }

  /* 5) Чуть компактнее кнопки в шапке, чтобы всё помещалось */
  .header .btn{
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
  }
  .header .btn.sm{
    padding: 9px 10px !important;
    font-size: 13px !important;
  }
}


/* Страница товара: стрелки карусели всегда видны */
.product-gallery .carousel-btn{
  opacity: 1 !important;     /* всегда показываем */
  width: 46px;               /* удобнее тапать/кликать */
  height: 46px;
  font-size: 26px;           /* крупнее символ */
  background: rgba(0,0,0,.45);
  border: 1px solid var(--img-border);
  backdrop-filter: blur(4px);
}

/* Чуть отодвинем от края */
.product-gallery .carousel-btn[data-prev]{ left: 10px; }
.product-gallery .carousel-btn[data-next]{ right: 10px; }

/* В белой теме — посветлее */
body.theme-white .product-gallery .carousel-btn{
  background: rgba(255,255,255,.88);
}



/* FIX: читаемость текста на кнопках в админке */
.admin-page .btn,
.admin-topbar .btn {
  color: rgba(255,255,255,.92) !important;
  border-color: rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.06) !important;
}

.admin-page .btn:hover,
.admin-topbar .btn:hover {
  background: rgba(255,255,255,.10) !important;
}

/* primary (градиентные/синие) */
.admin-page .btn.primary,
.admin-topbar .btn.primary {
  color: #0b1020 !important;         /* тёмный текст на ярком фоне */
  border-color: rgba(255,255,255,.12) !important;
}

/* если у primary фон не яркий, можно принудительно сделать ярче */
.admin-page .btn.primary,
.admin-topbar .btn.primary {
  background: linear-gradient(135deg, rgba(139,92,246,.95), rgba(34,211,238,.92)) !important;
}

/* ghost кнопки */
.admin-page .btn.ghost,
.admin-topbar .btn.ghost {
  color: rgba(255,255,255,.85) !important;
  background: transparent !important;
  border-color: rgba(255,255,255,.16) !important;
}
.admin-page .btn.ghost:hover,
.admin-topbar .btn.ghost:hover {
  background: rgba(255,255,255,.06) !important;
}

/* на всякий: чтобы текст в кнопках не “приглушался” */
.admin-page .btn, .admin-topbar .btn {
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}



/* алиас для старого класса btn-ghost */
.btn.btn-ghost{
  color: var(--text) !important;
}

/* на всякий случай: в белой теме */
body.theme-white .btn.btn-ghost{
  color: rgba(15,23,42,.95) !important;
}











/* =========================================================
   MOBILE FIX: все такие модули идут друг за другом (в столбик)
   + перебиваем inline grid-template-columns: 1fr 1fr ...
   ========================================================= */
@media (max-width: 980px){

  /* 1) Твои стандартные гриды */
  .grid2, .grid3, .grid4, .products, .steps{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;

    /* на случай если где-то делали "ленту" */
    overflow-x: hidden !important;
    scroll-snap-type: none !important;
  }

  .grid2 > *, .grid3 > *, .grid4 > *, .products > *, .steps > *{
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    scroll-snap-align: none !important;
  }

  /* 2) Inline-сетки: 2/3/4 колонки заданные прямо в HTML */
  div[style*="display:grid"][style*="grid-template-columns:1fr 1fr"],
  div[style*="display: grid"][style*="grid-template-columns:1fr 1fr"],
  div[style*="display:grid"][style*="grid-template-columns: 1fr 1fr"],
  div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr"],

  div[style*="display:grid"][style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="display: grid"][style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="display:grid"][style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr 1fr"],

  div[style*="display:grid"][style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  div[style*="display: grid"][style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  div[style*="display:grid"][style*="grid-template-columns: 1fr 1fr 1fr 1fr"],
  div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr 1fr 1fr"],

  /* старый вариант repeat(2/3/4) тоже оставим */
  div[style*="display:grid"][style*="grid-template-columns:repeat(2"],
  div[style*="display: grid"][style*="grid-template-columns:repeat(2"],
  div[style*="display:grid"][style*="grid-template-columns: repeat(2"],
  div[style*="display: grid"][style*="grid-template-columns: repeat(2"],
  div[style*="display:grid"][style*="grid-template-columns:repeat(3"],
  div[style*="display: grid"][style*="grid-template-columns:repeat(3"],
  div[style*="display:grid"][style*="grid-template-columns: repeat(3"],
  div[style*="display: grid"][style*="grid-template-columns: repeat(3"],
  div[style*="display:grid"][style*="grid-template-columns:repeat(4"],
  div[style*="display: grid"][style*="grid-template-columns:repeat(4"],
  div[style*="display:grid"][style*="grid-template-columns: repeat(4"],
  div[style*="display: grid"][style*="grid-template-columns: repeat(4"]{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* 3) Внутри формы (Имя/Контакт) — тоже в одну колонку */
  .form-grid.two{
    grid-template-columns: 1fr !important;
  }
}






/* =========================================================
   MOBILE: круглые кнопки-ссылки (тел/тг/wa) в одну линию
   Работает для твоих .sticky + .pill
   ========================================================= */
@media (max-width: 980px){

  /* контейнер кнопок — в ряд */
  .sticky{
    position: fixed;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;

    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    flex-direction: row !important;
    gap: 12px !important;
    z-index: 200 !important;
  }

  /* каждая кнопка — круглая */
  .sticky .pill{
    width: 56px !important;
    height: 56px !important;
    padding: 0 !important;

    border-radius: 999px !important;
    justify-content: center !important;
    gap: 0 !important;

    /* прячем текст даже если он не обёрнут в span */
    font-size: 0 !important;
    line-height: 0 !important;
  }

  /* если текст внутри всё-таки в span — тоже прячем */
  .sticky .pill span,
  .sticky .pill .pill-text,
  .sticky .pill .text{
    display: none !important;
  }

  /* иконка — чуть крупнее */
  .sticky .pill svg{
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 auto !important;
  }
}


/* =========================================================
   MOBILE NAV: кнопки-плитки (одинаковый размер)
   ========================================================= */
@media (max-width: 980px){

  /* Контейнер кнопок в #mobileNav (у тебя он сейчас inline flex-wrap) */
  #mobileNav .card > div[style*="flex-wrap:wrap"]{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;

    /* одинаковая высота плиток */
    grid-auto-rows: 62px !important;
    align-items: stretch !important;
  }

  /* Сами плитки */
  #mobileNav .card > div[style*="flex-wrap:wrap"] .btn{
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 10px 12px !important;
    border-radius: 18px !important;

    text-align: center !important;
    line-height: 1.15 !important;
    font-weight: 650 !important;

    white-space: normal !important;     /* разрешаем 2 строки */
    word-break: keep-all !important;    /* не рвём слова */
    hyphens: auto !important;

    /* визуал: плитка */
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)) !important;
    border-color: rgba(255,255,255,.14) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.22) !important;
    backdrop-filter: blur(10px) !important;

    transform: translateY(0);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
  }

  #mobileNav .card > div[style*="flex-wrap:wrap"] .btn:hover{
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04)) !important;
    border-color: rgba(255,255,255,.20) !important;
  }

  /* На очень узких экранах — 1 колонка (плитки остаются одинаковые) */
  @media (max-width: 420px){
    #mobileNav .card > div[style*="flex-wrap:wrap"]{
      grid-template-columns: 1fr !important;
      grid-auto-rows: 58px !important;
    }
  }

  /* Белая тема — чуть светлее */
  body.theme-white #mobileNav .card > div[style*="flex-wrap:wrap"] .btn{
    background: linear-gradient(180deg, rgba(15,23,42,.05), rgba(15,23,42,.03)) !important;
    border-color: rgba(15,23,42,.14) !important;
    box-shadow: 0 10px 26px rgba(15,23,42,.12) !important;
  }
  body.theme-white #mobileNav .card > div[style*="flex-wrap:wrap"] .btn:hover{
    background: linear-gradient(180deg, rgba(15,23,42,.07), rgba(15,23,42,.04)) !important;
    border-color: rgba(15,23,42,.18) !important;
  }
}


/* =========================================================
   FIX: если элемент одновременно .container и .section/.tight
   (например <main class="container section">),
   возвращаем боковые отступы контейнера
   ========================================================= */

.container.section,
.container.tight,
.container.section.tight{
  padding-left: 18px !important;
  padding-right: 18px !important;
}

/* Мобилка — используем твой mobile-pad */
@media (max-width: 980px){
  .container.section,
  .container.tight,
  .container.section.tight{
    padding-left: var(--mobile-pad, 14px) !important;
    padding-right: var(--mobile-pad, 14px) !important;
  }
}











/* =========================================================
   MOBILE: компактная верхняя подсказка в хедере (2 строки)
   ========================================================= */
@media (max-width: 980px){

  .header-topnote{
    background: rgba(255,255,255,.02) !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
  }

  .header-topnote-inner{
    padding: 6px 0 !important;
  }

  .header-topnote-text{
    font-size: 9px !important;
    line-height: 1.25 !important;
    max-width: 100% !important;
    padding: 0 10px !important;
    opacity: .9 !important;

    /* 2 строки и всё */
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
  }

  /* чтобы жирное не “кричало” */
  .header-topnote-text b{
    font-weight: 700 !important;
  }
}


/* =========================================================
   Брендовые карточки товаров из products.json
   Серверный вывод через сниппет BrandProductsJson
   ========================================================= */

.products.brand-products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
  margin-top: 18px !important;
  align-items: stretch !important;
}

/* Сама карточка */
.products.brand-products .product-card {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 100% !important;
}

/* Обёртка изображения */
.products.brand-products .product-img {
  display: block !important;
  width: 100% !important;
  height: 220px !important;
  max-height: 220px !important;
  overflow: hidden !important;
  background: rgba(15, 23, 42, .06) !important;
  border-radius: 0 !important;
}

/* Само изображение */
.products.brand-products .product-img img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 220px !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform .25s ease !important;
}

/* Лёгкий hover */
.products.brand-products .product-card:hover .product-img img {
  transform: scale(1.035);
}

/* Контент карточки */
.products.brand-products .product-card-body {
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Статус */
.products.brand-products .product-status {
  display: inline-flex !important;
  align-items: center !important;
  width: fit-content !important;
  margin-bottom: 10px !important;
  padding: 5px 9px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  background: rgba(34, 197, 94, .12) !important;
  color: #22c55e !important;
}

/* Название */
.products.brand-products .product-title {
  margin: 0 0 10px !important;
  font-size: 18px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
}

.products.brand-products .product-title a {
  color: inherit !important;
  text-decoration: none !important;
}

.products.brand-products .product-title a:hover {
  text-decoration: underline !important;
}

/* Цена */
.products.brand-products .product-price {
  margin-bottom: 10px !important;
  font-size: 17px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
}

/* Характеристики */
.products.brand-products .product-features {
  display: grid !important;
  gap: 6px !important;
  margin-bottom: 12px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  color: var(--muted, #64748b) !important;
}

.products.brand-products .product-features span {
  display: block !important;
}

/* Короткое описание */
.products.brand-products .product-intro {
  margin: 0 0 14px !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
}

/* Кнопки */
.products.brand-products .product-actions {
  margin-top: auto !important;
  display: flex !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.products.brand-products .product-actions .btn {
  white-space: nowrap !important;
}

/* Планшеты */
@media (max-width: 980px) {
  .products.brand-products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .products.brand-products .product-img {
    height: 210px !important;
    max-height: 210px !important;
  }

  .products.brand-products .product-img img {
    max-height: 210px !important;
  }
}

/* Телефоны */
@media (max-width: 640px) {
  .products.brand-products {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .products.brand-products .product-img {
    height: 210px !important;
    max-height: 210px !important;
  }

  .products.brand-products .product-img img {
    max-height: 210px !important;
  }

  .products.brand-products .product-card-body {
    padding: 15px !important;
  }

  .products.brand-products .product-actions {
    flex-direction: column !important;
  }

  .products.brand-products .product-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}
