/* ✅ ИСПРАВЛЕННЫЙ style.css С ПОДДЕРЖКОЙ iOS */

/* Оптимизированный импорт шрифтов с font-display: swap уже в HTML */

* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

.hero-bg {
  background-image: linear-gradient(rgba(27, 61, 47, 0.9), rgba(27, 61, 47, 0.8)), url('images/главное_фото_1.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.property-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.map-placeholder {
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem;
  border-radius: 1rem;
}

.map-placeholder i {
  font-size: 4rem;
  color: #1B3D2F;
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}

.progress-bar {
  height: 4px;
  background: linear-gradient(90deg, #1B3D2F, #D4A55F);
  width: 0%;
  transition: width 0.3s ease;
}

/* Анимации для Tailwind */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Стили для форм */
.form-input {
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: #D4A55F;
  box-shadow: 0 0 0 3px rgba(212, 165, 95, 0.2);
}

/* Стили для кнопок форм */
.form-button {
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Скрытие элементов */
.hidden {
  display: none !important;
}

/* Специфичные стили для property images */
.property-image-container {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.property-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.property-image-container:hover .property-image {
  transform: scale(1.05);
}

/* Улучшенные стили для мобильных устройств */
@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll;
  }
  
  .cta-button {
    min-height: 48px;
    min-width: 48px;
  }
  
  /* Минимальный размер для касаний */
  .touch-target,
  button,
  a[href] {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  
  /* Увеличение полей ввода для предотвращения зума */
  .form-input {
    font-size: 16px !important;
    padding: 14px !important;
  }
  
  /* Увеличение кнопок форм */
  .form-button {
    padding: 14px !important;
    font-size: 1.05rem !important;
  }
  
  /* Оптимизация хедера */
  .header-container {
    flex-wrap: nowrap;
  }
  
  .nav-link {
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 0.875rem !important;
  }
  
  .phone-text {
    font-size: 0.875rem !important;
  }
  
  /* Уменьшение отступов в карточках */
  .property-card {
    padding: 12px !important;
  }
  
  /* Улучшение читаемости */
  .text-primary {
    color: #1a3a2d !important;
  }
  
  .leading-tight {
    line-height: 1.4 !important;
  }
  
  .property-card {
    margin: 0 8px;
  }
  
  /* Улучшение читаемости текста */
  .text-sm {
    font-size: 0.875rem !important;
  }
  
  .text-base {
    font-size: 1rem !important;
  }
}

/* Анимация появления элементов при скролле */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  /* Без will-change: transform — это вызывало дрожание */
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ✅ ИСПРАВЛЕНО: Улучшенные стили для фокуса (мягче и контрастнее) */
:focus {
  outline: 2px solid #D4A55F;
  outline-offset: 3px;
  /* Добавим полупрозрачность для менее агрессивного вида */
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid #D4A55F;
  outline-offset: 3px;
}

/* Стили для кнопок с увеличенной областью нажатия */
.tap-target {
  position: relative;
}

.tap-target::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

/* Стили для уведомлений */
.notification {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 10000;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Стили для улучшенного калькулятора */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #D4A55F;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #D4A55F;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ✅ ИСПРАВЛЕНО: Стили для мобильного меню (iOS Safari fix) */
.mobile-menu {
  /* ВАЖНО: Используем display вместо только max-height для iOS */
  display: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease-out, opacity 0.3s ease-out;
  /* ✅ Принудительное ускорение GPU для iOS */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mobile-menu.open {
  display: block !important;
  max-height: 1000px;
  opacity: 1;
}

/* ✅ НОВОЕ: Дополнительная фиксация для iOS */
@supports (-webkit-touch-callout: none) {
  /* Стили только для iOS Safari */
  .mobile-menu {
    -webkit-overflow-scrolling: touch;
  }
  
  .mobile-menu.open {
    visibility: visible;
  }
  
  /* Отключаем hover эффекты на iOS */
  @media (hover: none) and (pointer: coarse) {
    .mobile-menu a:hover {
      background-color: transparent;
    }
  }
}

/* Стили для индикатора доступности */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Стили для Яндекс.Карт - см. улучшенную версию в конце файла */

/* Стили для аккордеона FAQ - см. улучшенную версию в конце файла */

/* ✅ НОВОЕ: Стили для плавающих кнопок мессенджеров */
.messenger-button {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.messenger-button:hover {
  transform: scale(1.1);
}

.messenger-button:active {
  transform: scale(0.95);
}

/* ✅ ИСПРАВЛЕНО: will-change только там где реально нужно */
.property-card,
.messenger-button {
  will-change: transform;
}
/* scroll-animate НЕ нужен will-change — он вызывал дрожание страницы */

/* После появления — освобождаем память */
.scroll-animate.visible {
  will-change: auto;
}

/* ✅ iOS Safari: Предотвращение резинового скролла */
body {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

/* ✅ iOS Safari: Фикс для кнопок и ссылок */
button,
a {
  -webkit-tap-highlight-color: rgba(212, 165, 95, 0.3);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ✅ iOS Safari: Убираем синюю рамку при фокусе */
input,
textarea,
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
/* ✅ Стили для чекбокса в форме записи (ИСПРАВЛЕНИЕ) */
#privacy-policy {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  accent-color: #D4A55F; /* Золотой цвет - будет виден на зелёном фоне */
  cursor: pointer;
  flex-shrink: 0; /* Не сжимать */
  /* Добавляем белый фон и рамку для видимости */
  background-color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  /* Убираем стандартный вид */
  appearance: auto;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  /* Увеличиваем область клика */
  position: relative;
  z-index: 10;
}

#privacy-policy:hover {
  border-color: #D4A55F;
  background-color: #ffffff;
}

#privacy-policy:checked {
  background-color: #D4A55F;
  border-color: #D4A55F;
}

/* Увеличиваем чекбокс для мобильных */
@media (max-width: 768px) {
  #privacy-policy {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }
}

/* ✅ Стили для FAQ аккордеона (НОВОЕ) */
.faq-item {
  border-bottom: 1px solid #e5e7eb;
}

.faq-question {
  cursor: pointer;
  padding: 1.25rem;
  background-color: white;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-question:hover {
  background-color: #f9fafb;
}

.faq-question.active {
  background-color: #f3f4f6;
  font-weight: 600;
}

.faq-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 1.25rem;
  background-color: #fafafa;
}

.faq-question.active + .faq-answer {
  padding: 1.25rem;
}

.faq-icon {
  transition: transform 0.3s ease;
  color: #D4A55F;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.faq-question.active .faq-icon {
  transform: rotate(180deg);
}

/* ✅ Улучшение стилей модального окна недвижимости */
#property-modal .bg-white {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Анимация появления модального окна */
#property-modal.flex > div {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ✅ Улучшение быстрой формы */
#quick-form-overlay.flex #quick-form-container {
  animation: quickFormSlideIn 0.3s ease-out;
}

@keyframes quickFormSlideIn {
  from {
    transform: scale(0.9) translateY(30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ✅ Стили для контейнера Яндекс карты */
#yandex-map-container {
  width: 100%;
  height: 450px;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  #yandex-map-container {
    height: 350px;
  }
}

/* ✅ Улучшение карточек недвижимости для кликабельности */
.property-card {
  cursor: pointer;
  user-select: none;
}

.property-card:active {
  transform: translateY(-6px) scale(0.98);
}