/* ==============================================
   RESPONSIVE — адаптивная система
   У конкурента 632 @media (по 3 копии каждого брейкпоинта
   из-за дублирования CSS). Здесь один набор, но плотный:
   от 320px до 1920px, плюс container queries где уместно.
   ============================================== */

/* ---------- контейнер ---------- */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--space-sm, 16px);
}

/* ---------- fluid-типографика ---------- */
.fluid-h1 { font-size: clamp(1.6rem, 1.2rem + 2.2vw, 2.9rem); line-height: 1.14; }
.fluid-h2 { font-size: clamp(1.25rem, 1.05rem + 1.1vw, 1.85rem); line-height: 1.22; }
.fluid-h3 { font-size: clamp(1.05rem, .95rem + .6vw, 1.35rem); line-height: 1.3; }
.fluid-body { font-size: clamp(.88rem, .84rem + .2vw, 1rem); line-height: 1.7; }

/* ---------- адаптивные сетки ---------- */
.auto-grid {
    display: grid;
    gap: var(--space-sm, 16px);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.auto-grid-tight { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.auto-grid-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

/* ---------- 320–479: маленькие телефоны ---------- */
@media (max-width: 479px) {
    .container { padding: 0 12px; }
    .auto-grid, .auto-grid-wide, .auto-grid-tight { grid-template-columns: 1fr; gap: 10px; }
    .hide-xs { display: none !important; }
    .stack-xs > * + * { margin-top: 10px; }
}

/* ---------- 480–639: телефоны ---------- */
@media (min-width: 480px) {
    .show-xs { display: block !important; }
}
@media (max-width: 639px) {
    .hide-sm { display: none !important; }
    .full-sm { width: 100% !important; }
    .center-sm { text-align: center !important; }
}

/* ---------- 640–767: крупные телефоны ---------- */
@media (min-width: 640px) {
    .auto-grid-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .hide-md { display: none !important; }
}

/* ---------- 768–1023: планшеты ---------- */
@media (min-width: 768px) {
    .auto-grid-tight { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .auto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
    .hide-lg { display: none !important; }
}

/* ---------- 1024–1279: ноутбуки ---------- */
@media (min-width: 1024px) {
    .auto-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .auto-grid-tight { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 1280–1599: десктоп ---------- */
@media (min-width: 1280px) {
    .container { max-width: 1240px; }
    .auto-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1279px) {
    .hide-xl { display: none !important; }
}

/* ---------- 1600+: широкие экраны ---------- */
@media (min-width: 1600px) {
    .container { max-width: 1380px; }
}
@media (min-width: 1920px) {
    .container { max-width: 1520px; }
    .fluid-body { font-size: 1.02rem; }
}

/* ---------- ориентация ---------- */
@media (orientation: landscape) and (max-height: 500px) {
    .hide-landscape-short { display: none !important; }
}

/* ---------- hover только там, где есть мышь ---------- */
@media (hover: none) {
    .fx-sheen:hover::after { animation: none; }
    a:hover, button:hover { transform: none !important; }
}

/* ---------- понижение плотности на слабых экранах ---------- */
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
}

/* ---------- высокая контрастность ---------- */
@media (prefers-contrast: more) {
    .glass-card, .wc-result, .site-index-nav {
        border-color: currentColor !important;
        background: #000 !important;
    }
}

/* ---------- тёмная/светлая схема (сайт тёмный, но фиксируем) ---------- */
@media (prefers-color-scheme: light) {
    :root { color-scheme: dark; }
}

/* ---------- печать ---------- */
@media print {
    .header, .mobile-nav, .support-widget, .site-toast, .floating-offer,
    .reality-check, .site-index-nav, .mr-overlay { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    a[href]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
