/* Общие стили */
body {
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.6;
}

h1 {
  text-align: center;
  color: #333;
}

h2 {
  text-align: center;
  color: #8c9c34;
  font-size: 26px;
}

.container {
  width: 80%;
  margin: auto;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #007bff;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
}

/* Навигация */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-bottom: 0;
}

.logo a {
  font-size: 1.5rem;
  font-weight: bold;
}

.logo img {
  width: 270px;
  height: 110px;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 20px;
}

.navbar .nav-links a {
  color: #8c9c34;
  text-decoration: none;
}

/* Стили для бургера */
.burger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 3px 0;
  transition: all 0.3s ease;
}

/* Секция Hero */
/* Общие стили для секции */
#hero {
  display: flex; /* Используем flexbox для управления позиционированием */
  align-items: center; /* Выравнивание по вертикали */
  min-height: 200px; /* Минимальная высота */
  max-height: 250px;
  background-image: url(img/hero/фон.jpg);
  background-size: cover;
  background-position: left; /* Фиксируем фон слева */
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  margin: 0 auto; /* Центрируем по горизонтали */
  max-width: 100%; /* Занимает всю доступную ширину */
}

.hero-content {
  max-width: 50%; /* Занимает половину ширины контейнера */
  padding: 20px;
  text-align: center; /* Выравниваем текст справа */
  margin-left: auto;
}

#hero h1 {
  color: #000000;
  font-size: 2.5em;
  margin-bottom: 10px;
}

#hero h2 {
  font-size: 1.5em;
}

#hero p {
  color: black;
  font-size: 1.2em;
  margin-bottom: 30px;
}

.hero-content a {
  color: black;
  background-color: white;
  border-color: #8c9c34;
  border-style: solid;
  font-size: small;
}

.hero-content a:hover {
  background-color: #bac675;
  border-color: #8c9c34;
}

/* Медиа-запрос для экранов больше 1635px */
@media (max-width: 1635px) {
  #hero {
    flex-direction: column; /* Текст вниз, фон сверху */
    background-image: url(img/hero/фон2.1.jpg); /* Новый фон */
    background-position: center;
    text-align: center;
    min-height: 450px;
  }

  .hero-content {
    max-width: 80%; /* Увеличиваем ширину текста */
    text-align: center; /* Центрируем текст */
    margin: auto;
    margin-top: 150px;
  }
}

/* Медиа-запрос для мобильных устройств */

@media (min-width: 471px) and (max-width: 768px) {
  #hero {
    flex-direction: column; /* Текст вниз, фон сверху */
    background-image: url(img/hero/фон3.2.jpg); /* Мобильный фон */
    background-position: center;
    text-align: center;
    max-height: 350px;
  }

  .hero-content {
    max-width: 90%; /* Увеличиваем ширину текста */
    text-align: center; /* Центрируем текст */
    margin: auto;
    margin-top: 200px;
  }
}
@media (max-width: 470px) {
  #hero {
    flex-direction: column; /* Текст вниз, фон сверху */
    background-image: url(img/hero/фон3.1.jpg); /* Мобильный фон */
    background-position: 45% center;
    text-align: center;
    height: 400px;
  }

  .hero-content {
    max-width: 90%; /* Увеличиваем ширину текста */
    text-align: center; /* Центрируем текст */
    margin: auto;
    margin-top: 160px;
  }
}

/*#hero {*/
/* background: linear-gradient(to bottom, #8c9c34, #eeecec); */
/* background: #c9d47f88;
  color: #fff;
  text-align: center;
  padding-top: 20px;
  padding-bottom: 20px;
  border-radius: 20px;
}

#hero h1 {
  color: #000000;
  font-size: 2.5em;
  margin-bottom: 10px;
}

#hero p {
  color: black;
  font-size: 1.2em;
  margin-bottom: 30px;
}

.hero-content a {
  color: black;
  background-color: white;
  border-color: #8c9c34;
  border-style: solid;
  font-size: small;
}

.hero-content a:hover {
  background-color: #bac675;
  border-color: #8c9c34;
}*/

/* Секция About */

.about {
  background-color: #fff7ee;
  padding: 20px;
}

.about h2 {
  text-align: center; /* заголовок по центру */
  margin-bottom: 20px;
}

.about p {
  max-width: 930px; /* Максимальная ширина для удобочитаемости */
  margin: 0 auto; /* Горизонтальные отступы автоматически равны, центрирует элемент */
  padding: 0 15px; /* Отступы слева и справа для адаптации на маленьких экранах */
  text-align: center; /* Центрируем текст внутри параграфа */
  box-sizing: border-box; /* Чтобы паддинги учитывались в ширине */
  text-indent: 5%;
  text-align: justify;
}

/* Кнопка остается с центровкой в div */
#about a {
  background-color: #ffffff;
  border: 2.5px solid #bac675;
  color: black;
  font-size: small;
  padding: 10px 20px;
  margin-top: 25px;
  text-decoration: none;
  border-radius: 5px;
  display: inline-block;
  transition: background-color 0.3s ease;
}

#about a:hover {
  background-color: #bac675;
  border-color: #8c9c34;
  color: black;
}

/* Адаптивность */

@media (max-width: 600px) {
  .about p {
    text-indent: 5%;
    text-align: justify;
  }
  .about h2 {
    font-size: 1.5rem;
  }
}

/* .about {
  background-color: #fff7ee;
}

.about .container {
  display: flex;
  align-items: center;
}
.about-content p {
  text-indent: 7%;
  text-align: justify;
}

.about-image {
  flex: 1;
  padding: 20px;
}

.about-image img {
  width: 300px;
  border-radius: 10px;
}

.about-content {
  flex: 1;
  padding: 20px;
}

#about a {
  background-color: #ffffff;
  border-style: solid;
  border-color: #8c9c34;
  color: black;
  font-size: small;
}

#about a:hover {
  background-color: #bac675;
  border-style: solid;
  border-color: #8c9c34;
  color: black;
} */

/* Секция Hero2 */

#hero2 {
  background: #c9d47f88;
  color: #000000;
  text-align: center;
  padding-top: 10px;
  padding-bottom: 10px;
  border-radius: 20px;
}

.hero-content2 {
  margin-bottom: 0px;
}

.hero-content2 h2 {
  font-size: 1.3em;
}

/* Секция Галерея */

.gallery-container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  display: flex;
  gap: 16px;
  padding-bottom: 16px;

  /* Добавляем паддинг, чтобы первый и последний элемент не прилипали к краям */
  padding-left: 16px;
  padding-right: 16px;
}

.gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  border-radius: 5%;
  overflow: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  background: white;
  transition: transform 0.5s ease;
}

.gallery-item img {
  display: block;
  width: 100%;
  /* height: auto; */
  max-height: 373.33px;
}

/* На больших экранах показываем 2 фото */
@media (min-width: 1200px) {
  .gallery-item {
    width: calc(
      (1000px - 16px * 3) / 2
    ); /* 2 фото и 3 gap (слева, между, справа) по 16px */
  }
}

/* На мобильных 1 фото */
@media (max-width: 767px) {
  .gallery-container {
    padding-left: 0px;
    padding-right: 0;
  }

  .gallery-item {
    width: 95vw; /* или чуть меньше, чтобы не было скролла */
    /* width: 95%; */
    margin-left: 8px;
  }
}

/*МОДАЛЬНОЕ ОКНО*/
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  display: block;
  margin: 0 auto;
  cursor: auto;
}

#gallery p {
  max-width: 930px;
}

#gallery p {
  /* Максимальная ширина для удобочитаемости */
  margin: 0 auto; /* Горизонтальные отступы автоматически равны, центрирует элемент */
  padding: 0 30px; /* Отступы слева и справа для адаптации на маленьких экранах */
  text-align: center; /* Центрируем текст внутри параграфа */
  box-sizing: border-box; /* Чтобы паддинги учитывались в ширине */
  text-indent: 5%;
  text-align: justify;
}

/* Наши услуги  */

#services {
  padding: 40px 20px;
  background-color: #c9d47f88;
  border-radius: 20px;
  text-align: center;
}

#services h2 {
  margin-bottom: 20px;
  margin-top: 5px;
  color: #000000;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 50px;
}

.service-card {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.icon {
  font-size: 25px;
}

.service-card h3 {
  font-size: 1.2em;
  color: #8c9c34;
  margin-top: 3px;
}

.service-card p {
  font-size: 1em;
  color: #555555;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.services-text {
  margin: 0 auto;
  margin-bottom: 30px;
  text-indent: 5%;
  text-align: justify;
}

@media (max-width: 1985px) {
  .services-grid {
    gap: 10px;
  }
}

@media (max-width: 1785px) {
  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 1664px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, auto); /* 4 ряда с высотой по содержимому */
  }
}

/* Стили для карусели на мобильных устройствах */
@media (max-width: 1000px) {
  .services-carousel-container {
    overflow-x: auto; /* Включаем горизонтальную прокрутку */
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    padding-bottom: 10px; /*  Место для индикаторов  */
  }

  .services-grid {
    display: flex; /*  Используем flexbox  */
    flex-wrap: nowrap; /*  Запрещаем перенос на новую строку  */
    width: max-content; /*  Контент определяет ширину  */
  }

  .service-card {
    flex: 0 0 43%; /*  Каждая карточка занимает 50% ширины (две в ряд)  */
    box-sizing: border-box; /*  padding и border не увеличивают ширину  */
    width: 100px;
    min-width: auto;
  }

  .service-grid::-webkit-scrollbar {
    display: none; /* Скрываем полосу прокрутки (необязательно) */
  }
}

/* Адаптивность (существующие стили, можно настроить) */
@media (max-width: 600px) {
  .service-grid {
    grid-template-columns: repeat(
      auto-fill,
      minmax(180px, 1fr)
    ); /* Уменьшаем минимальную ширину до 180px */
  }
}

/* Плоские устройства (например, планшеты) */
@media (min-width: 601px) and (max-width: 900px) {
  .service-grid {
    grid-template-columns: repeat(
      auto-fill,
      minmax(220px, 1fr)
    ); /* Уменьшаем минимальную ширину до 220px */
  }
}

/*Линзы Stellest*/

/* Общие стили */
.section-stellest-info {
  padding: 20px;
  background-color: #fff7ee;
  border-radius: 20px;
}

.stellest-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Текстовая часть */
.stellest-text {
  flex: 1 1 45%;
  padding: 10px;
}

.stellest-title {
  font-size: 24px;
  margin-bottom: 10px;
  color: #000000;
  text-align: left;
}

.stellest-subtitle {
  font-size: 20px;
  margin-bottom: 8px;
}

.stellest-description {
  font-size: 16px;
  line-height: 1.5;
  text-align: justify;
  text-indent: 5%;
}

/* Фото */
.stellest-image-container {
  flex: 1 1 45%;
  padding: 10px;
  text-align: center;
}

.big-img {
  max-width: 70%;
  height: auto;
  display: inline-block;
  border-radius: 7%;
}
.small-img {
  width: 100%;
  height: auto;
  display: inline-block;
  border-radius: 7%;
}

@media (min-width: 1445px) {
  .small-img {
    display: none;
  }
}
@media (max-width: 1444px) {
  .big-img {
    display: none;
  }
}

@media (min-width: 750px) and (max-width: 1444px) {
  .small-img {
    width: 600px;
  }
}

/* Мобильные устройства */
@media (max-width: 1445px) {
  .stellest-container {
    flex-direction: column;
  }
  /* Порядок элементов: h2, h3, фото, p */
  /* .stellest-container .stellest-text h2,
  h3 {
    order: 1;
  }
  .stellest-container .stellest-image-container {
    order: 2;
  }
  .stellest-container .stellest-text p {
    order: 3;
  } */
  /* Остальные элементы внутри текста — по умолчанию */
}

/*Оправы Nano Vista*/
.nano-vista {
  padding: 20px;
  background-color: #ffffff;
  border-radius: 20px;
}

.nano-vista__container {
  display: flex;
  flex-direction: column; /* по умолчанию — колонка (текст сверху, фото снизу) */
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  gap: 20px;
}

.nano-img-logo {
  flex: 1 1 100%;
  max-width: 100%;
}

.nano-vista__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px; /* по желанию */
  object-fit: cover;
}

.nano-vista__text-wrapper {
  flex: 1 1 100%;
  max-width: 100%;
  text-align: left;
  text-align: justify;
  text-indent: 5%;
}

.nano-vista__text-wrapper ul li {
  text-align: justify;
  text-indent: 1%;
}

.nano-vista__title {
  font-size: 2rem;
  margin-bottom: 10px;
}

.nano-vista__description {
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  padding: 0 13px;
}

.nano-img-deti img {
  width: 100%; /* изображение занимает всю ширину родителя */
  height: auto; /* сохраняет пропорции */
  max-width: 700px; /* максимум ширины на больших экранах */
  display: block; /* устраняет лишние отступы под изображением */
  border-radius: 8px; /* по желанию — скругление */
}

/* Центрирование контейнера, если нужно */
.nano-img-deti {
  max-width: 600px; /* ограничение ширины блока */
  margin: 0 auto; /* центрирование по горизонтали */
  padding: 10px; /* отступы, если надо */
}

/* Можно добавить адаптивность, чтобы на очень больших экранах ширина чуть больше */
@media screen and (min-width: 1024px) {
  .nano-img-deti {
    max-width: 800px;
  }
}

/* Для широких экранов (>768px) меняем порядок и выравнивание */
@media screen and (min-width: 1450px) {
  .nano-vista__container {
    flex-direction: row;
    align-items: center;
    gap: 40px;
  }

  .nano-img-logo {
    order: 1; /* Левый блок */
    max-width: 50%;
  }

  .nano-vista__text-wrapper {
    order: 2; /* Правый блок */
    max-width: 50%;
    text-align: left;
  }
}

/* Секция Адрес */

#addresses {
  padding: 20px;
  margin: 0 auto;
  width: 98%;
  border-radius: 20px;
  background: #fff7ee;
  margin-top: 30px;
}

.faq {
  width: 80%;
  margin: 0 auto;
}

details {
  background: linear-gradient(200deg, #ffffff 0%, #ffffff 78%);
  border: 1px solid #ddd;
  border-radius: 10px;
  border-color: #8c9c34;
  padding: 0.5em;
  margin-bottom: 1em;
}

details p a {
  color: #000000;
  font-style: italic;
}

summary {
  font-weight: bold;
  cursor: pointer;
  color: #8c9c34;
}

#addresses .fas,
#addresses .far {
  color: #8c9c34;
}

details[open] {
  background-color: #eef;
}

@media (max-width: 1007px) {
  #addresses {
    width: 90%;
  }
  .faq {
    width: 82%;
  }
}

/*Адреса. Две колонки*/
/* Контейнер двух колонок */
/* .address-columns {
  display: flex;
  position: relative;
  padding-top: 10px;
} */

/* Левая и правая колонки */
/* .address-left,
.address-right {
  flex: 1;
  padding: 0 15px;
  box-sizing: border-box;
} */

/* Вертикальная черта между колонками */
/* .vertical-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background-color: #8c9c34;
} */

/* Адаптивность: на мобильных устройствах колонки становятся вертикальными */
/* @media (max-width: 768px) {
  .address-columns {
    flex-direction: column;
  }
  .vertical-line {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
  }
}

.phone {
  text-align: center;
  margin: 0 auto;
} */

/* Секция Отзывы */
/* General Styles */
.reviews-section {
  padding: 20px;
  text-align: center;
}

.reviews-carousel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden; /* Crucial for the carousel */
  position: relative;
  max-width: 1000px;
  margin: 20px auto;
}

.carousel-containers {
  display: flex;
  transition: transform 0.3s ease;
  padding: 10px;
  gap: 20px; /* Space between cards */
  overflow-x: auto;
  scroll-snap-type: x mandatory; /* Enable snap scrolling */
  -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
}

/* Review Card Styles */
.review-card {
  background-color: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  text-align: left;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  flex: 0 0 auto; /* Don't grow/shrink, take up auto width */
  width: calc(33.333% - 20px); /* Three cards in a row minus gap */
  scroll-snap-align: start; /* Snap cards to the start */
  box-sizing: border-box;
  width: 320px;
  height: auto;
}
.review-card img {
  width: 100%;
  border-radius: 10%;
}

.more-reviews {
  background-color: #e7efbc;
  color: #8c9c34;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
}

.carousel-containers a {
  text-decoration: none;
  color: #8c9c34;
}

/* Media Queries for Responsiveness */

@media (max-width: 768px) {
  .review-card {
    width: calc(50% - 20px); /* Two cards on medium screens */
  }
}

@media (max-width: 576px) {
  .review-card {
    width: 100%; /* One card per row on small screens */
  }
  .reviews-carousel {
    margin: 10px auto;
  }
}

/* Footer */
/* Секция Контакты */

footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  border-radius: 20px;
}

#contacts {
  padding: 10px 0;
  text-align: center;
  /* background-color: #333; */
}

#contacts ul {
  list-style: none;
  padding: 0;
}

#contacts li {
  margin-bottom: 10px;
}

#contacts li a {
  color: #fff;
  text-decoration: none;
}

.social-links a {
  display: inline-block;
  margin: 0 10px;
  color: #fff;
  font-size: 25px;
}

/* Адаптивность */
/* Навигация */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 80px;
    left: -35px;
    background-color: #fff;
    width: 99%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 50px;
  }

  .nav-links li {
    margin: 0;
    padding: 15px;
    border-bottom: 1px solid #eee;
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links.nav-active {
    display: flex;
  }

  .logo img {
    width: 240px;
    height: 90px;
  }

  .burger {
    display: flex;
  }

  /* Анимация бургера */
  .toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

  .toggle .line2 {
    opacity: 0;
  }

  .toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  /* Секция Hero */

  #hero {
    padding: 50px 0;
  }

  #hero h1 {
    font-size: 2em;
  }

  /* Секция Адрес */

  /* Секцмя Отзывы */
  .review-container {
    flex-direction: column;
  }

  .review {
    width: 90%;
    margin-bottom: 20px;
  }
}

/* Секция About */
/* Раздел "Обо мне" */
@media (max-width: 1170px) {
  .about .container {
    flex-direction: column;
  }
  .about-image,
  .about-content {
    padding: 10px;
  }
}

/*Стрелка вверх*/
/* Стили для кнопки */
#scrollToTop {
  display: none; /* изначально скрыта */
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  font-size: 24px;
  line-height: 50px;
  text-align: center;
  border: none;
  background-color: #afbd6056; /* цвет по желанию */
  color: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s, transform 0.3s;
  z-index: 1000;
}

#scrollToTop:hover {
  background-color: #8c9c3494; /* чуть темнее при наведении */
  transform: scale(1.1);
}

/*Кнопка вотсап*/
.whatsapp-button {
  position: fixed;
  bottom: 30px;
  left: 30px; /* слева снизу */
  width: 50px;
  height: 50px;
  background-color: #afbd6056; /* зелёный whatsapp */
  color: white;
  border-radius: 50%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none; /* убрать подчеркивание */
  transition: background-color 0.3s, transform 0.3s;
  z-index: 1000;
}

.whatsapp-button i {
  font-size: 20px;
}

.whatsapp-button:hover,
.whatsapp-button:focus {
  background-color: #8c9c3494; /* чуть темнее при наведении */
  transform: scale(1.1);
  outline: none;
}
