/* ═══════════════════════════════════════════
   MOBILE-GLOBAL.CSS — универсальные мобильные правки
   Подключается на ВСЕХ страницах lot-click.ru
   Правила с !important чтобы перебивать inline styles
   v2026-04-05
   ═══════════════════════════════════════════ */

/* ─── ДОСТУПНОСТЬ (a11y, 21.07): видимый фокус клавиатуры + reduce-motion, на всех страницах ─── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, [onclick]:focus-visible {
  outline: 3px solid #D6001C !important;
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ─── Хлебные крошки div.breadcrumbs (21.07, авто-вставка на все страницы) ─── */
.breadcrumbs { font-size: 13px; color: #777; margin: 12px 0 16px; line-height: 1.5; }
.breadcrumbs a { color: #D6001C; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ─── БАЗА: глобальные стили breadcrumbs (для всех экранов) ─── */
ol.breadcrumb {
  list-style: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px !important;
  margin: 0 !important;
  font-size: 13px;
  background: rgba(0,0,0,.03);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
ol.breadcrumb li {
  display: inline-flex;
  align-items: center;
  color: #6B7280;
}
ol.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: #9CA3AF;
  font-weight: 300;
}
ol.breadcrumb li a {
  color: #C8A850 !important;
  text-decoration: none !important;
  font-weight: 500;
}
ol.breadcrumb li a:hover {
  text-decoration: underline !important;
}
ol.breadcrumb li[aria-current="page"] {
  color: #1A1A1A;
  font-weight: 500;
}
/* Тёмная тема */
html[data-theme="dark"] ol.breadcrumb,
body.dark ol.breadcrumb {
  background: rgba(255,255,255,.03);
  border-bottom-color: rgba(255,255,255,.08);
}
html[data-theme="dark"] ol.breadcrumb li[aria-current="page"],
body.dark ol.breadcrumb li[aria-current="page"] {
  color: #F5F3EE;
}

/* ─── БАЗА: убираем кастомный курсор на тач-устройствах ─── */
@media (hover: none) and (pointer: coarse) {
  body, a, button, input, textarea, select, .lots-filter, .faq-q, .nav-links a, .nav-dropdown a {
    cursor: auto !important;
  }
  #cur, #cur-ring { display: none !important; }
}

/* ─── ПЛАНШЕТЫ И МЕНЬШЕ (≤1024px) ─── */
@media (max-width: 1024px) {
  /* Схлопываем широкие сетки */
  [style*="grid-template-columns:repeat(5"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns:repeat(6"],
  [style*="grid-template-columns: repeat(6"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ─── МОБИЛЬНЫЕ ТЕЛЕФОНЫ (≤768px) ─── */
@media (max-width: 768px) {

  /* ── Базовая типографика ── */
  html { font-size: 15px !important; }
  /* C14/Kravets I12: overflow-x:clip вместо hidden + убран * max-width:100vw (перерасчёт на каждом элементе) */
  html, body { overflow-x: clip; }

  /* ── Горизонтальный скролл: убираем вылеты ── */
  img, video, iframe, table, pre { max-width: 100% !important; height: auto; }

  /* ── Схлопываем inline grid-сетки ── */
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(5"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns:repeat(6"],
  [style*="grid-template-columns: repeat(6"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns:1fr 380px"],
  [style*="grid-template-columns:1fr 360px"],
  [style*="grid-template-columns:1fr 320px"],
  [style*="grid-template-columns:1fr 300px"],
  [style*="grid-template-columns:380px 1fr"],
  [style*="grid-template-columns:360px 1fr"],
  [style*="grid-template-columns:280px 1fr"],
  [style*="grid-template-columns:200px 1fr"],
  [style*="grid-template-columns:240px 1fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns:3fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Уменьшаем большие inline padding (только вертикаль, чтобы не ломать секции X 0) ── */
  [style*="padding:80px"], [style*="padding: 80px"] { padding-top: 40px !important; padding-bottom: 40px !important; }
  [style*="padding:60px"], [style*="padding: 60px"] { padding-top: 32px !important; padding-bottom: 32px !important; }
  [style*="padding:48px"], [style*="padding: 48px"] { padding-top: 28px !important; padding-bottom: 28px !important; }
  [style*="padding:40px"], [style*="padding: 40px"] { padding-top: 24px !important; padding-bottom: 24px !important; }
  /* Для карточек (padding: X ) горизонтальный тоже режем, но только если это all-sides */
  div[style*="padding:40px;"], div[style*="padding: 40px;"],
  div[style*="padding:40px\""], div[style*="padding: 40px\""] { padding-left: 20px !important; padding-right: 20px !important; }
  div[style*="padding:48px;"], div[style*="padding: 48px;"],
  div[style*="padding:48px\""], div[style*="padding: 48px\""] { padding-left: 20px !important; padding-right: 20px !important; }

  /* ── Flex-ряды в колонку ── */
  [style*="display:flex"][style*="gap:48px"],
  [style*="display:flex"][style*="gap:40px"],
  [style*="display:flex"][style*="gap:32px"] {
    flex-wrap: wrap !important;
  }

  /* ── Фикс ширины контейнеров ── */
  .container, .invoice, .wrap, .wrapper, main { padding-left: 16px !important; padding-right: 16px !important; }

  /* ── Hero и Section: меньше top/bottom ── */
  .hero, [class*="hero"] { padding-top: 88px !important; padding-bottom: 48px !important; }
  .section { padding-top: 48px !important; padding-bottom: 48px !important; }

  /* ── Навбар на мобилке: безопасная высота ── */
  .nav, nav.nav, header.nav { height: 64px !important; padding-left: 16px !important; padding-right: 16px !important; }

  /* ── Topbar (для кастомных шапок на invoice-страницах) ── */
  .topbar { padding: 12px 16px !important; flex-wrap: wrap; gap: 8px; }
  .topbar-right { font-size: 11px !important; }

  /* ── Поля ввода: не вылезают за экран ── */
  input, textarea, select, .top3-input, .course-input, #exitEmail, #auctionEmail, #payEmail {
    max-width: 100% !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }
  .top3-row { flex-direction: column !important; }
  .top3-input { flex: none !important; }

  /* ── Кнопки: тач-таргет минимум 44px ── */
  button, .btn, .btn-primary, .btn-outline, .btn-secondary, a[class*="btn"], input[type="submit"] {
    min-height: 44px !important;
  }

  /* ── a11y/тач (21.07): чекбоксы/радио и tel крупнее для пальца (input 16px уже ниже, стр.~340) ── */
  input[type="checkbox"], input[type="radio"] { min-width: 20px; min-height: 20px; }
  a[href^="tel:"], a[href^="mailto:"] { display: inline-block; padding: 6px 2px; }

  /* ── Шрифты: h1/h2 не должны вылетать за экран ── */
  h1 { font-size: clamp(26px, 7vw, 38px) !important; line-height: 1.15 !important; }
  h2 { font-size: clamp(22px, 6vw, 32px) !important; line-height: 1.2 !important; }
  h3 { font-size: clamp(18px, 5vw, 24px) !important; }

  /* ── Inline font-size с пикселями > 32 уменьшаем ── */
  [style*="font-size:56px"], [style*="font-size: 56px"] { font-size: 32px !important; }
  [style*="font-size:48px"], [style*="font-size: 48px"] { font-size: 28px !important; }
  [style*="font-size:44px"], [style*="font-size: 44px"] { font-size: 26px !important; }
  [style*="font-size:40px"], [style*="font-size: 40px"] { font-size: 26px !important; }
  [style*="font-size:36px"], [style*="font-size: 36px"] { font-size: 24px !important; }

  /* ── Таблицы: горизонтальный скролл ── */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Модалки/поповеры: на всю ширину с отступом ── */
  [style*="max-width:440px"], [style*="max-width:480px"], [style*="max-width:520px"] {
    max-width: calc(100vw - 32px) !important;
  }

  /* ── Фиксированные кнопки "наверх" и виджеты не должны перекрывать контент ── */
  .owl-trigger, .chat-trigger, [class*="floating"], [class*="fab"] {
    bottom: 16px !important;
    right: 16px !important;
  }

  /* ── Mobile: только Сова + VK, остальные соц-кнопки скрыты ── */
  .social-float { display: none !important; }
}

/* ─── УЗКИЕ ТЕЛЕФОНЫ (≤480px) ─── */
@media (max-width: 480px) {
  html { font-size: 14px !important; }

  /* Схлопываем 2-колонные inline сетки до 1 */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  /* Гэпы уменьшаем */
  [style*="gap:48px"], [style*="gap: 48px"] { gap: 20px !important; }
  [style*="gap:40px"], [style*="gap: 40px"] { gap: 16px !important; }
  [style*="gap:32px"], [style*="gap: 32px"] { gap: 14px !important; }
  [style*="gap:24px"], [style*="gap: 24px"] { gap: 12px !important; }

  /* Контейнеры: ещё уже padding */
  .container, .invoice, .wrap, .wrapper { padding-left: 12px !important; padding-right: 12px !important; }

  /* Любые inline padding: 40-80px режем ещё сильнее */
  [style*="padding:60px"], [style*="padding: 60px"],
  [style*="padding:80px"], [style*="padding: 80px"] { padding: 24px 12px !important; }
}

/* ─── ЛАНДШАФТ МОБИЛКИ (короткая высота) ─── */
@media (max-height: 500px) and (orientation: landscape) {
  .hero, [class*="hero"] { padding-top: 80px !important; padding-bottom: 40px !important; }
}

/* ═══════════════════════════════════════════
   v2026-04-16: финальные фиксы для презентации
   - заголовки не вылазят за экран
   - breadcrumbs нормально стилизованы
   - cookies-баннер не закрывает важные кнопки
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Заголовки H1/H2 с inline clamp() — переносы слов */
  h1, h2 { word-wrap: break-word !important; overflow-wrap: break-word !important; hyphens: auto; }

  /* Все заголовки с inline font-size:clamp(...) или большие — режем максимум */
  h1[style*="clamp"], h1[style*="font-size:60px"], h1[style*="font-size: 60px"],
  h1[style*="font-size:52px"], h1[style*="font-size: 52px"],
  h1[style*="font-size:48px"], h1[style*="font-size: 48px"] {
    font-size: clamp(24px, 7vw, 32px) !important;
    line-height: 1.15 !important;
  }
  h2[style*="clamp"], h2[style*="font-size:42px"], h2[style*="font-size:40px"],
  h2[style*="font-size:36px"], h2[style*="font-size: 36px"] {
    font-size: clamp(20px, 5.5vw, 28px) !important;
    line-height: 1.2 !important;
  }

  /* Breadcrumbs убираем на мобильном — занимают место */
  ol.breadcrumb, nav.breadcrumbs, .breadcrumbs {
    display: none !important;
  }

  /* Cookies-баннер: меньше, не закрывает кнопки */
  #cookieBanner {
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
    max-width: none !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
    z-index: 9999 !important;
  }
  #cookieBanner button {
    padding: 4px 12px !important;
    font-size: 11px !important;
  }

  /* Hero: не выпускать длинные тексты */
  .hero, [class*="hero"], .geo-hero, .gift-hero, .ze-hero {
    overflow-x: hidden;
  }
  .hero h1, .geo-hero h1, .gift-hero h1, .ze-hero h1 {
    max-width: 100%;
    word-wrap: break-word !important;
  }

  /* Container — не разрешаем переполнение */
  .container { overflow-wrap: break-word; max-width: 100%; }

  /* Длинные слова в любых параграфах */
  p, .lot-title, .geo-stat-num { overflow-wrap: break-word; word-wrap: break-word; }

  /* Кнопка установки PWA: над cookies */
  .install-bar { bottom: 70px !important; z-index: 9998 !important; }
}

/* ═══ КОМПАКТНЫЙ МОБИЛЬНЫЙ 2026 ═══ */
/* Убираем пустые пространства, больше контента на экран */

@media (max-width: 768px) {
  /* Секции: меньше вертикальных отступов */
  .section { padding-top: 36px !important; padding-bottom: 36px !important; }

  /* Hero: компактнее */
  .hero, [class*="hero"] { padding-top: 76px !important; padding-bottom: 32px !important; }

  /* Все inline margin/padding: режем */
  [style*="margin-top:40px"], [style*="margin-top: 40px"] { margin-top: 16px !important; }
  [style*="margin-top:32px"], [style*="margin-top: 32px"] { margin-top: 12px !important; }
  [style*="margin-bottom:40px"], [style*="margin-bottom: 40px"] { margin-bottom: 16px !important; }
  [style*="margin-bottom:32px"], [style*="margin-bottom: 32px"] { margin-bottom: 12px !important; }
  [style*="padding:40px"], [style*="padding: 40px"] { padding: 16px !important; }
  [style*="padding:32px"], [style*="padding: 32px"] { padding: 14px !important; }

  /* Gap: компактнее */
  [style*="gap:40px"], [style*="gap: 40px"] { gap: 12px !important; }
  [style*="gap:32px"], [style*="gap: 32px"] { gap: 10px !important; }
  [style*="gap:24px"], [style*="gap: 24px"] { gap: 8px !important; }

  /* Hero stats: в ряд, компактно */
  .hero-stats { gap: 4px !important; }
  .hero-stat { padding: 10px 12px !important; }

  /* Типографика: читаемая но компактная */
  .section-title { margin-bottom: 12px !important; }
  .section-sub { margin-bottom: 16px !important; font-size: 14px !important; }
  .section-label { margin-bottom: 6px !important; }

  /* Маскоты меньше */
  img.mascot { max-width: 200px !important; margin-bottom: 12px !important; }

  /* Кнопки: минимум 48px тач-зона */
  .btn-primary, .btn-outline, .nav-cta { min-height: 48px; font-size: 15px !important; }

  /* Input: 16px предотвращает zoom на iOS */
  input, textarea, select { font-size: 16px !important; }
}

/* На очень узких — ещё агрессивнее */
@media (max-width: 480px) {
  h1, h1[style*="clamp"] { font-size: clamp(22px, 6vw, 28px) !important; }
  h2, h2[style*="clamp"] { font-size: clamp(18px, 5vw, 24px) !important; }
  .ze-hero h1, .gift-hero h1, .geo-hero h1 { font-size: 24px !important; }

  /* Ещё компактнее */
  .section { padding-top: 28px !important; padding-bottom: 28px !important; }
  .hero, [class*="hero"] { padding-top: 68px !important; padding-bottom: 24px !important; }
  [style*="padding:24px"], [style*="padding: 24px"] { padding: 12px !important; }
  [style*="gap:16px"], [style*="gap: 16px"] { gap: 6px !important; }

  /* Все 2-колонные → 1 */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
}
