/* Изолированные стили для компонента */
.expert-why-component {
  width: 100%;
  background-color: #f8f9fa;
  padding: 40px 0;
  box-sizing: border-box;
}

.expert-why-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.expert-why-heading {
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 40px;
  line-height: 1.3;
}

.expert-why-cards {
  display: flex;
  gap: 25px;
  margin-bottom: 40px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0;
  scrollbar-width: none;
  max-width: 100%;
}

.expert-why-cards::-webkit-scrollbar {
  display: none;
}

.expert-why-card {
  background: white;
  border-radius: 12px;
  padding: 20px 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  text-align: center;
  min-width: 280px;
}

.expert-why-card:hover {
  transform: translateY(-5px);
}

.expert-why-icon {
  display: block;
  margin: 0 auto 20px;
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.expert-why-description {
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  padding: 0 10px;
}

.expert-why-button {
  display: block;
  width: 100%;
  padding: 16px;
  background: #0D96F7;
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.expert-why-button:hover {
  background: #1976d2;
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* Индикатор прокрутки (скрыт на больших экранах) */
.expert-why-scroll-indicator {
  display: none;
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

.expert-why-progress-bar {
  height: 100%;
  background: #0D96F7;
  width: 30%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* === Модальное окно === */
.expert-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
}

.expert-modal {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: expertModalFadeIn 0.3s ease;
}

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

.expert-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f1f1;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 10;
}

.expert-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

.expert-modal-content {
  padding: 40px 30px 30px;
}

/* Стили для контейнера формы Bitrix24 */
#b24-form-container {
  width: 100%;
}

#b24-form-container .b24-form-container,
#b24-form-container iframe {
  width: 100% !important;
  min-height: 400px;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
  .expert-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 12px;
  }
  
  .expert-modal-content {
    padding: 50px 20px 20px;
  }
  
  .expert-modal-close {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .expert-modal-overlay {
    padding: 10px;
  }
  
  .expert-modal-content {
    padding: 45px 15px 15px;
  }
}

/* Адаптивность для планшетов */
@media (min-width: 577px) and (max-width: 992px) {
  .expert-why-heading {
    font-size: 24px;
  }
  
  .expert-why-cards {
    gap: 15px;
    padding: 5px 0;
    scroll-snap-type: x mandatory;
  }
  
  .expert-why-card {
    min-width: 300px;
    padding: 25px 20px;
    scroll-snap-align: start;
  }
  
  .expert-why-description {
    font-size: 15px;
  }
  
  /* Показываем индикатор на планшетах */
  .expert-why-scroll-indicator {
    display: block;
  }
  
  .expert-why-progress-bar {
    width: 50%;
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 576px) {
  .expert-why-heading {
    font-size: 22px;
  }
  
  .expert-why-cards {
    gap: 15px;
    padding: 5px 0;
    scroll-snap-type: x mandatory;
  }
  
  .expert-why-card {
    min-width: calc(100% - 40px);
    width: calc(100% - 40px);
    padding: 25px 20px;
    scroll-snap-align: start;
  }
  
  .expert-why-description {
    font-size: 15px;
  }
  
  /* Показываем индикатор на мобильных */
  .expert-why-scroll-indicator {
    display: block;
  }
  
  .expert-why-progress-bar {
    width: 30%;
  }
}

/* Для больших экранов - гарантируем, что контейнер не выходит за пределы */
@media (min-width: 993px) {
  .expert-why-cards {
    overflow-x: auto;
    scroll-behavior: auto;
    max-width: 100%;
    padding: 10px 0;
  }
  
  .expert-why-scroll-indicator {
    display: none;
  }
}