/* === ОБЩИЙ CSS ДЛЯ ВСЕХ БЛОКОВ === */
/* Цветовая схема: ЧЁРНЫЙ + БЕЛЫЙ + КРАСНЫЙ */

:root {
  --bg-dark: #0D0D0D;
  --text-white: #FFFFFF;
  --text-gray: #B0B0B0;
  --accent-red: #E02424;
  --accent-red-dark: #B71C1C;
  --card-bg: #1A1A1A;
  --border-color: #2A2A2A;
  --glow: 0 0 20px rgba(224, 36, 36, 0.4);
}

body {
  background-color: var(--bg-dark) !important;
  color: var(--text-white) !important;
  font-family: 'Inter', 'Tilda Sans', sans-serif;
  margin: 0;
  overflow-x: hidden;
}

.tilda-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Анимация при скролле (Fade-In) */
.anim-fade {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.anim-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* КРАСНАЯ КНОПКА */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%) !important;
  border: none !important;
  color: #FFFFFF !important;
  padding: 16px 32px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.4s ease;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  text-shadow: none !important;
  text-align: center;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow);
  color: #FFFFFF !important;
}

/* Калькулятор */
.calculator select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100% !important;
  max-width: 100% !important;
  font-size: 14px !important;
  background-color: #0D0D0D;
  color: #FFFFFF;
  border: 1px solid #333;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E02424' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  padding-right: 40px;
}

@media (max-width: 480px) {
  .calculator select {
    font-size: 13px !important;
    padding: 12px 35px 12px 12px !important;
  }
}

/* Калькулятор — сетка */
@media (max-width: 768px) {
  .calc-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 480px) {
  .calc-grid {
    grid-template-columns: 1fr !important;
  }
}

/* FAQ анимация */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, margin-top 0.3s ease;
}
.faq-answer.faq-open {
  max-height: 1000px !important;
  margin-top: 15px !important;
  overflow-y: auto !important;
}

/* Ховер-эффекты для карточек */
.hover-card {
  transition: all 0.4s ease;
}
.hover-card:hover {
  border-color: var(--accent-red) !important;
  transform: translateY(-5px);
}

/* Метрики Hero */
@media (max-width: 768px) {
  .hero-metrics {
    flex-direction: column !important;
    gap: 15px !important;
  }
  .hero-metrics > div {
    flex: none !important;
    width: 100% !important;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
}

/* Лид-форма на мобильном */
@media (max-width: 480px) {
  #form input,
  #form select,
  #form .btn-primary {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Общие отступы на мобильных */
@media (max-width: 768px) {
  .tilda-container {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
}

/* Цвета для выделения текста */
.text-red {
  color: var(--accent-red) !important;
}

/* Красная линия слева (используется в карточках) */
.red-border-left {
  border-left: 3px solid var(--accent-red) !important;
}

/* Красный кружок иконок */
.icon-circle-red {
  background: rgba(224, 36, 36, 0.15) !important;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .tilda-container { padding: 0 20px; }
  h1 { font-size: 36px !important; }
  h2 { font-size: 28px !important; }
}

@media (max-width: 768px) {
  .tilda-container { padding: 0 15px; }
  h1 { font-size: 28px !important; line-height: 1.2 !important; }
  h2 { font-size: 24px !important; }
  .grid-responsive { grid-template-columns: 1fr !important; }
  .hero-block { min-height: auto !important; padding: 80px 0; }
  .btn-primary { width: 100%; text-align: center; box-sizing: border-box; }
}

@media (max-width: 480px) {
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
}

/* Стиль скролл-галереи */
.scroll-gallery {
  -webkit-overflow-scrolling: touch;
}
.scroll-gallery::-webkit-scrollbar {
  height: 4px;
}
.scroll-gallery::-webkit-scrollbar-thumb {
  background: #E02424;
  border-radius: 2px;
}


/* Стилизация стандартной формы Tilda под наш дизайн */
.t-form {
  background: #1A1A1A !important;
  border: 1px solid #2A2A2A !important;
  border-radius: 16px !important;
  padding: 40px !important;
  max-width: 460px !important;
  margin: 0 auto !important;
}

.t-form .t-input {
  background: #0D0D0D !important;
  border: 1px solid #333 !important;
  color: #FFFFFF !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  padding: 15px !important;
  margin-bottom: 15px !important;
}

.t-form .t-input::placeholder {
  color: #888888 !important;
}

.t-form .t-input:focus {
  border-color: #E02424 !important;
  outline: none !important;
}

.t-form .t-select {
  background: #0D0D0D !important;
  border: 1px solid #333 !important;
  color: #FFFFFF !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  padding: 15px !important;
  margin-bottom: 15px !important;
}

.t-form .t-submit {
  background: linear-gradient(135deg, #E02424, #B71C1C) !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 2px !important;
  font-size: 16px !important;
  padding: 16px !important;
  width: 100% !important;
  cursor: pointer !important;
  transition: all 0.3s !important;
}

.t-form .t-submit:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 0 20px rgba(224,36,36,0.4) !important;
}

/* Все текстовые элементы — белые */
.t-form .t-form-title,
.t-form .t-form-descr,
.t-form .t-form-label,
.t-form .t-form__title,
.t-form .t-form__descr,
.t-form label,
.t-form .t-text,
.t-form .t-name,
.t-form .t-descr,
.t-form [class*="title"],
.t-form [class*="descr"],
.t-form [class*="label"],
.t-form [class*="text"] {
  color: #FFFFFF !important;
}

/* Текст в выпадающем списке */
.t-form .t-select option {
  background: #0D0D0D !important;
  color: #FFFFFF !important;
}

/* Текст политики конфиденциальности */
.t-form .t-form__bottom-text,
.t-form .t-form__bottom-text a {
  color: #888888 !important;
}

.t-form .t-form__bottom-text a:hover {
  color: #E02424 !important;
}

/* Адаптация */
@media (max-width: 480px) {
  .t-form {
    padding: 20px !important;
  }
}


/* ==================== ИСПРАВЛЕНИЯ ДЛЯ МОБИЛЬНЫХ ==================== */

/* Таймер в Блоке 4 — не вылезает за экран */
@media (max-width: 480px) {
  #countdown-timer {
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  
  #countdown-timer > div {
    min-width: 45px !important;
    padding: 8px 4px !important;
  }
  
  #countdown-timer span[style*="font-size: 26px"] {
    font-size: 20px !important;
  }
  
  #countdown-timer span[style*="font-size: 10px"] {
    font-size: 8px !important;
  }
}

/* Блок 4 — правая колонка не уходит за экран */
@media (max-width: 480px) {
  /* Весь блок УТП — меньше внутренние отступы */
  div[style*="border: 1px solid #E02424"] {
    padding: 30px 15px !important;
  }
  
  /* Правая часть с таймером */
  div[style*="flex: 0 0 340px"] {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    padding: 25px 15px !important;
  }
  
  /* Кнопка на всю ширину */
  div[style*="flex: 0 0 340px"] .btn-primary {
    font-size: 14px !important;
    padding: 14px !important;
  }
  
  /* Счётчик "2 места" */
  div[style*="width: 50px; height: 50px"] {
    width: 42px !important;
    height: 42px !important;
    font-size: 24px !important;
  }
}

/* Блок 10 (Контакты) — адрес и кнопка не вылезают */
@media (max-width: 480px) {
  /* Адрес — перенос строки */
  p[style*="font-size: 20px; font-weight: 600; color: #FFFFFF"] {
    font-size: 16px !important;
    word-break: break-word !important;
  }
  
  /* Кнопка VK в контактах */
  a[style*="display: inline-flex; align-items: center; gap: 10px; background: #1A1A1A"] {
    font-size: 14px !important;
    padding: 10px 16px !important;
    white-space: nowrap !important;
  }
}

/* Общее: все якорные ссылки плавно скроллятся */
html {
  scroll-behavior: smooth;
}


/* Блок 10 — отступ для контактов на мобильных */
@media (max-width: 768px) {
  /* Левая колонка контактов */
  .tilda-container div[style*="grid-template-columns: 1fr 1fr"] > div:first-child {
    padding-left: 15px !important;
  }
  
  /* Сам блок с контактами */
  #form + .tilda-container div[style*="display: grid"] > div:first-child,
  div.tilda-container div.grid-responsive > div:first-child {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

@media (max-width: 480px) {
  /* Адрес, режим работы, связь — отступ слева */
  div.tilda-container div[style*="margin-bottom: 30px"] {
    padding-left: 10px !important;
  }
  
  /* Заголовки "Адрес", "Режим работы", "Связь" */
  p[style*="color: #888; font-size: 13px; text-transform: uppercase"] {
    padding-left: 5px !important;
  }
  
  /* Сами данные */
  p[style*="font-size: 20px; font-weight: 600"],
  p[style*="font-size: 18px; font-weight: 600"] {
    padding-left: 5px !important;
  }
  
  /* Кнопка VK */
  a[style*="display: inline-flex; align-items: center; gap: 10px; background: #1A1A1A"] {
    margin-left: 5px !important;
  }
}

/* Переключение фона Hero: десктоп / мобильный */
@media (max-width: 768px) {
  .hero-bg-desktop {
    display: none !important;
  }
  .hero-bg-mobile {
    display: block !important;
  }
}

@media (min-width: 769px) {
  .hero-bg-desktop {
    display: block !important;
  }
  .hero-bg-mobile {
    display: none !important;
  }
}