/*
 * Шаблон сайта клиента TheMoosy — оформление каркаса (шапка, подвал, разделы).
 * Блоки страниц CMS оформляет css/cms-blocks.css (тот же файл, что на сайте
 * Mittivoy) — он читает те же переменные. Фирменный цвет и шрифт сайт
 * берёт из «Инструменты → Оформление» (js/site.js задаёт переменные в :root).
 */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eaf1ff;
  --text-color: #1f2937;
  --text-light: #64748b;
  --bg-color: #ffffff;
  --bg-light: #f5f7fa;
  --border-color: #e5e7eb;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, .06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, .10);
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-family); color: var(--text-color); background: var(--bg-color); line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--primary-color); }
.st-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.st-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--text-color); color: #fff; }
.st-skip:focus { top: 12px; }

/* ── Шапка ── */
.st-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-color); }
.st-header-in { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.st-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-color); font-weight: 800; font-size: 1.15rem; flex: 0 0 auto; min-width: 0; }
.st-logo img { display: block; max-height: 44px; width: auto; max-width: 180px; }
.st-logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.st-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.st-nav-item { position: relative; }
.st-nav a { display: inline-flex; align-items: center; gap: 4px; padding: 9px 13px; border-radius: 999px; color: var(--text-color); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.st-nav a:hover, .st-nav a[aria-current="page"] { background: var(--primary-light); color: var(--primary-color); }
.st-nav-sub { position: absolute; top: 100%; left: 0; min-width: 200px; padding: 8px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); display: none; }
.st-nav-sub a { display: flex; border-radius: 10px; }
.st-nav-item:hover > .st-nav-sub, .st-nav-item:focus-within > .st-nav-sub { display: block; }
.st-lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-light); flex: 0 0 auto; }
.st-lang a { padding: 6px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--text-light); text-decoration: none; text-transform: uppercase; }
.st-lang a[aria-current="true"] { background: #fff; color: var(--text-color); box-shadow: var(--shadow-sm); }
.st-burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg-light); cursor: pointer; align-items: center; justify-content: center; }
.st-burger span, .st-burger span::before, .st-burger span::after { display: block; width: 20px; height: 2px; background: var(--text-color); border-radius: 2px; position: relative; content: ""; }
.st-burger span::before { position: absolute; top: -6px; }
.st-burger span::after { position: absolute; top: 6px; }
.st-drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.st-drawer.is-open { display: block; }
.st-drawer-bg { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.st-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); background: #fff; padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; box-shadow: var(--shadow-md); }
.st-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-drawer-close { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--bg-light); font-size: 22px; line-height: 1; cursor: pointer; }
.st-drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.st-drawer-nav a { padding: 12px 14px; border-radius: 12px; color: var(--text-color); text-decoration: none; font-weight: 600; }
.st-drawer-nav a.is-sub { padding-left: 28px; font-weight: 500; color: var(--text-light); }
.st-drawer-nav a:hover { background: var(--primary-light); color: var(--primary-color); }

/* ── Основная часть ── */
.st-main { min-height: 60vh; }
.st-loading { padding: 64px 0; }
.st-skel { display: block; border-radius: 10px; background: linear-gradient(90deg, #eef2f6 25%, #f6f8fb 50%, #eef2f6 75%); background-size: 200% 100%; animation: stShimmer 1.4s ease infinite; }
@keyframes stShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Шапка раздела (магазины, акции, блог, статья) */
.st-hero { background: var(--primary-light); padding: 40px 0 32px; }
.st-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .92rem; color: var(--text-light); margin-bottom: 8px; }
.st-crumbs a { color: var(--primary-color); text-decoration: none; }
.st-hero h1 { margin: 0; font-size: clamp(1.8rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.2; font-weight: 800; overflow-wrap: anywhere; }
.st-hero p { margin: 10px 0 0; color: var(--text-light); max-width: 760px; }
.st-section { padding: 40px 0 72px; }

/* Карточки акций и статей: картинка не сжимается во флекс-колонке (иначе высота
   картинки зависит от пропорций фото). В cms-blocks.css не правлю — файл общий с сайтом Mittivoy. */
.cmsu-card-img { flex: 0 0 auto; position: relative; overflow: hidden; }
.cmsu-card-img img { position: absolute; inset: 0; }

/* Блоки CMS внутри шаблона: шапка сайта не фиксированная, отступ под неё не нужен */
.st-main .cmsu-b.cmsu-phead { padding: 40px 0 32px; }
.st-stores-all { max-height: none; overflow: visible; padding: 0; }
.st-stores-all .cmsu-store[hidden] { display: none; }

/* Фильтр-чипы */
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.st-chip { padding: 8px 15px; border-radius: 999px; border: 1.5px solid var(--border-color); background: #fff; color: var(--text-color); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; }
.st-chip[aria-pressed="true"] { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.st-more-wrap { display: flex; justify-content: center; margin-top: 28px; }

/* Статья / акция / магазин */
.st-article { max-width: 860px; margin: 0 auto; }
.st-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-light); font-size: .92rem; margin-top: 12px; }
.st-meta--top { margin: 0 0 20px; }
.st-badge { display: inline-flex; padding: 4px 12px; border-radius: 999px; background: #fff; color: var(--primary-color); font-weight: 700; font-size: .8rem; }
.st-cover { margin: 0 0 28px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: var(--bg-light); }
.st-cover img { display: block; width: 100%; max-height: 520px; object-fit: cover; }
.st-content { font-size: 1.06rem; line-height: 1.8; overflow-wrap: anywhere; }
.st-content img { height: auto; border-radius: var(--radius-md); }
.st-content h2, .st-content h3 { line-height: 1.3; margin: 28px 0 12px; }
.st-content p, .st-content ul, .st-content ol { margin: 0 0 16px; }
.st-content ul { list-style: disc; padding-left: 1.3em; }
.st-content ol { list-style: decimal; padding-left: 1.3em; }
.st-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.st-content td, .st-content th { border: 1px solid var(--border-color); padding: 8px 12px; }
.st-content blockquote { margin: 0 0 16px; padding: 12px 18px; border-left: 4px solid var(--primary-color); background: var(--bg-light); border-radius: 0 12px 12px 0; }
.st-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 32px; font-weight: 700; text-decoration: none; }
.st-store { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.st-store-info { display: grid; gap: 12px; }
.st-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.st-store-row { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-light); }
.st-store-row > .st-ico { width: 20px; height: 20px; margin-top: 2px; color: var(--primary-color); }
.st-store-row b { display: block; font-size: .8rem; color: var(--text-light); font-weight: 600; }
.st-store-map { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: var(--bg-light); }
.st-store-map iframe { display: block; width: 100%; height: 420px; border: 0; }
.st-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 24px; }
.st-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.st-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.st-tag { padding: 5px 12px; border-radius: 999px; background: var(--primary-light); color: var(--primary-color); font-weight: 600; font-size: .85rem; }
.st-related { margin-top: 48px; }
.st-related h2 { font-size: 1.4rem; margin: 0 0 16px; }

/* Не найдено */
.st-404 { text-align: center; padding: 96px 0 120px; }
.st-404-code { font-size: clamp(4rem, 3rem + 6vw, 8rem); font-weight: 900; line-height: 1; color: var(--primary-color); }
.st-404 h1 { margin: 16px 0 12px; font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem); }
.st-404 p { margin: 0 auto 28px; max-width: 560px; color: var(--text-light); }

/* ── Подвал ── */
.st-footer { background: var(--bg-light); border-top: 1px solid var(--border-color); padding: 48px 0 24px; margin-top: 0; }
.st-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.st-footer h4 { margin: 0 0 12px; font-size: .95rem; }
.st-footer p { margin: 8px 0 0; color: var(--text-light); font-size: .94rem; }
.st-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-footer a { color: var(--text-color); text-decoration: none; font-size: .94rem; }
.st-footer a:hover { color: var(--primary-color); }
.st-footer-contact li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-light); font-size: .94rem; }
.st-footer-contact svg, .st-socials svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; color: var(--primary-color); }
.st-socials { display: flex; flex-wrap: wrap; gap: 10px; }
.st-socials a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--border-color); }
.st-socials a svg { margin: 0; }
.st-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-color); color: var(--text-light); font-size: .88rem; }

@media (max-width: 991px) {
  .st-nav, .st-header .st-lang { display: none; }
  .st-burger { display: inline-flex; }
  .st-footer-grid { grid-template-columns: 1fr 1fr; }
  .st-store { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .st-wrap { padding: 0 16px; }
  .st-logo img { max-height: 38px; max-width: 150px; }
  .st-logo-text { max-width: 180px; }
  .st-hero { padding: 28px 0 24px; }
  .st-section { padding: 28px 0 56px; }
  .st-footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .st-store-map iframe { height: 300px; }
  .st-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 20px; padding: 2px 16px 6px; scrollbar-width: none; }
  .st-chips::-webkit-scrollbar { display: none; }
  .st-chip { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .st-skel { animation: none; } }
