/* --- General Styles --- */
:root {
  --primary-color: #4a7c59; /* Green */
  --secondary-color: #a98e78; /* Brown */
  --dark-color: #333;
  --light-color: #f4f4f4;
  --white-color: #fff;
  --font-family: "Roboto", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--white-color);
}

body.modal-open {
  overflow: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
}

section {
  padding: 4rem 0;
}

/* --- Header & Navigation --- */
.header {
  background-color: var(--white-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo img {
  height: 55px;
  margin-right: 10px;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
}

.nav-menu li {
  margin-left: 25px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--dark-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--primary-color);
}

.header-phone-desktop {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 700;
  padding: 8px 12px;
  border: 1px solid var(--secondary-color);
  border-radius: 5px;
  transition: all 0.3s ease;
  margin-left: 20px;
}

.header-phone-desktop:hover {
  background-color: var(--secondary-color);
  color: var(--white-color);
}

.header-phone-desktop i {
  margin-right: 8px;
}

.nav-menu-phone {
  display: none;
}

.burger-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark-color);
}

/* --- Hero Section --- */
.hero {
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("assets/background.webp") no-repeat center center/cover;
  color: var(--white-color);
  text-align: center;
  padding: 6rem 0;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  color: var(--white-color);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero .subtitle {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.advantage-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition:
    transform 0.3s ease,
    background 0.3s ease;
}

.advantage-item p {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.advantage-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.2);
}

.advantage-item i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--white-color);
}

.hero-description {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 800px;
  margin: 0 auto 2rem auto;
}

.cta-button {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--white-color);
  padding: 12px 30px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background-color: #947a65;
}

/* --- About Section --- */
.about-section {
  background-color: var(--light-color);
}

.about-content {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.about-text {
  flex: 1;
}

.about-text ul {
  list-style: none;
}

.about-text li {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.about-text i {
  color: var(--primary-color);
  margin-right: 1rem;
  font-size: 1.2rem;
}

.about-image {
  flex: 1;
}

.about-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.about-image video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

/* --- Products & Services Section --- */
.products-section {
  background-color: var(--white-color);
}

.services-section {
  background-color: var(--light-color);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.item-card {
  background: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.products-section .item-card {
  background-color: var(--white-color);
}

.services-section .item-card {
  background-color: var(--white-color);
}

.item-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.item-card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.item-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.item-card-content h3 {
  margin-bottom: 0.5rem;
  min-height: 50px; /* Reserve space for 2 lines of title */
}

.item-card-content p {
  flex-grow: 1;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #555;
}

.item-price {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.details-btn {
  background-color: var(--primary-color);
  color: var(--white-color);
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  align-self: flex-start;
  transition: background-color 0.3s ease;
}

.details-btn:hover {
  background-color: #3a6347;
}

/* --- Reviews Section --- */
.reviews-section {
  background-color: var(--light-color);
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.review-card {
  background: var(--white-color);
  padding: 2rem;
  border-radius: 8px;
  border-left: 5px solid var(--primary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
}

.star-rating {
  color: #fdd835; /* Yellow for stars */
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.review-text {
  font-style: italic;
  color: #555;
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.review-author h4 {
  margin-bottom: 0.25rem;
  color: var(--dark-color);
}

.review-author span {
  font-size: 0.9rem;
  color: #777;
}

/* --- How We Work Section --- */
.how-it-works-section {
  background-color: var(--white-color);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.timeline::after {
  content: "";
  position: absolute;
  width: 3px;
  background-color: var(--primary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1.5px;
}
.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
}
.timeline-item:nth-child(odd) {
  left: 0;
}
.timeline-item:nth-child(even) {
  left: 50%;
}
.timeline-icon {
  position: absolute;
  width: 50px;
  height: 50px;
  line-height: 50px;
  font-size: 1.5rem;
  text-align: center;
  background: var(--primary-color);
  color: var(--white-color);
  border-radius: 50%;
  z-index: 1;
}
.timeline-item:nth-child(odd) .timeline-icon {
  right: -25px;
}
.timeline-item:nth-child(even) .timeline-icon {
  left: -25px;
}
.timeline-content {
  padding: 20px 30px;
  background: var(--light-color);
  border-radius: 6px;
  position: relative;
}

/* --- Pricing Section --- */
.pricing-section {
  background-color: var(--light-color);
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.pricing-table th,
.pricing-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.pricing-table th {
  background-color: var(--primary-color);
  color: var(--white-color);
  font-size: 1.1rem;
}

.pricing-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.pricing-table tbody tr:hover {
  background-color: #f1f1f1;
}

.pricing-table td:last-child {
  font-weight: 700;
  color: var(--secondary-color);
}

/* --- Footer --- */
.footer {
  background-color: var(--dark-color);
  color: var(--white-color);
  text-align: center;
  padding: 3rem 0;
}

.footer h2 {
  color: var(--white-color);
}

.footer .contact-info {
  margin-bottom: 1.5rem;
}

.footer .contact-info p {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.footer .phone-number a {
  color: var(--white-color);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  transition: color 0.3s ease;
}

.footer .phone-number a:hover {
  color: var(--secondary-color);
}

.footer .phone-number i {
  margin-right: 0.5rem;
}

.footer .map-title {
  color: var(--white-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

#yandex-map {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 3px solid var(--secondary-color);
}

.footer .copyright {
  font-size: 0.9rem;
  color: #ccc;
}

/* --- Modal Styles --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  position: relative;
  animation: slideIn 0.4s;
}

.modal-content h2 {
  font-size: 1.8rem;
  text-align: left;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  padding-right: 40px; /* Добавляем отступ справа, чтобы избежать наложения крестика */
}

.modal-content h4 {
  color: var(--primary-color);
}

.modal-content ul {
  list-style-position: inside;
  padding-left: 10px;
  margin-bottom: 1rem;
}
.modal-content li {
  margin-bottom: 0.5rem;
}

.modal-close {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--dark-color);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .header-phone-desktop {
    display: none;
  }
}

@media (max-width: 768px) {
  h2 {
    font-size: 2rem;
  }

  .navigation {
    position: relative;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--white-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu li {
    margin: 0;
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid #eee;
  }

  .nav-menu-phone {
    display: block;
    background-color: var(--primary-color);
  }

  .nav-menu-phone a {
    color: var(--white-color);
    font-weight: 700;
  }

  .nav-menu-phone a:hover {
    color: var(--white-color);
  }

  .burger-menu {
    display: block;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .about-content {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline::after {
    left: 31px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
  }
  .timeline-icon {
    left: 7px !important;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 20px;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }
}

/* --- Dropdown Menu Styles --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.drop-btn i {
  margin-left: 5px;
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

/* --- Поворот стрелки при наведении ТОЛЬКО на десктопе --- */
@media (min-width: 769px) {
  .dropdown:hover .drop-btn i {
    transform: rotate(180deg);
  }
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 250px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 5px;
  overflow: hidden; /* чтобы скругление работало */
}

.dropdown-content a {
  color: var(--dark-color);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
  color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* --- Product/Service Detail Page Styles --- */
.detail-page-section {
  padding: 4rem 0;
  background-color: var(--white-color);
}

.detail-page-content {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.detail-image {
  flex: 1;
  max-width: 400px;
}

.detail-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.detail-text {
  flex: 1.5;
}

.detail-text h2 {
  text-align: left;
  margin-bottom: 1.5rem;
}

.detail-text h4 {
  margin-top: 1.5rem;
}

.detail-text ul {
  list-style-position: inside;
  padding-left: 10px;
  margin-bottom: 1rem;
}

.detail-text li {
  margin-bottom: 0.5rem;
}

.detail-text .cta-button {
  margin-top: 1.5rem;
}

/* Адаптивность для страницы товара */
@media (max-width: 768px) {
  .detail-page-content {
    flex-direction: column;
  }
  .detail-image {
    max-width: 100%;
  }
  .detail-text h2 {
    text-align: center;
  }
}

/* --- Стили для <a>, чтобы выглядела как кнопка --- */
/* Этот класс у вас уже есть, но убедитесь, что он стилизует и тег <a> */
.details-btn {
  display: inline-block; /* важно для ссылок */
  background-color: var(--primary-color);
  color: var(--white-color);
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  align-self: flex-start;
  transition: background-color 0.3s ease;
  text-decoration: none; /* убираем подчеркивание у ссылки */
}

.details-btn:hover {
  background-color: #3a6347;
  color: var(--white-color);
}

/* --- Стили для полноэкранного мобильного меню --- */

/* Добавляем класс для body, чтобы запретить прокрутку, когда меню открыто */
body.menu-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  /* --- Основа оверлея --- */
  .nav-menu {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ИЗМЕНЕНО ЗДЕСЬ */
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-color);
    overflow-y: auto;
    padding: 80px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease,
      transform 0.3s ease;
    z-index: 1001;
  }

  /* --- Активное состояние меню --- */
  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* --- Ссылки в меню --- */
  .nav-menu li {
    width: auto;
    /* ИЗМЕНЕНО: Уменьшены отступы */
    margin: 10px 0;
    text-align: center;
  }

  .nav-menu a {
    border-bottom: none;
    color: var(--white-color);
    /* ИЗМЕНЕНО: Уменьшен размер шрифта */
    font-size: 1.5rem;
    font-weight: 500;
    padding: 8px;
  }

  .nav-menu a:hover {
    color: var(--secondary-color);
  }

  /* --- Выпадающие списки в полноэкранном меню --- */
  .dropdown .drop-btn {
    color: var(--secondary-color);
    font-size: 1.6rem; /* Делаем родительские пункты чуть заметнее */
  }

  .dropdown .dropdown-content {
    display: block;
    position: static;
    background-color: transparent;
    box-shadow: none;
    min-width: 0;
    text-align: center;
    padding-top: 8px; /* Чуть меньше отступ */
  }

  .dropdown .dropdown-content a {
    /* ИЗМЕНЕНО: Уменьшен размер и изменена прозрачность для иерархии */
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px;
  }

  .dropdown .dropdown-content a:hover {
    color: var(--white-color);
  }

  /* --- Телефон в меню --- */
  .nav-menu-phone {
    background-color: transparent;
    margin-top: 15px; /* Уменьшен отступ */
  }
  .nav-menu-phone a {
    font-size: 1.3rem; /* Уменьшен размер телефона */
  }

  /* --- Кнопка-бургер --- */
  .burger-menu {
    position: relative;
    z-index: 1002;
  }

  .nav-menu.active ~ .burger-menu i {
    color: var(--white-color);
  }

  /* --- Стили для аккордеона в мобильном меню --- */

  /* Скрываем подменю по умолчанию, подготавливая к анимации */
  .dropdown .dropdown-content {
    /* display: none; ЗАМЕНЯЕМ ЭТО */
    overflow: hidden;
    max-height: 0; /* ИЗМЕНЕНО: Начальная высота 0 */
    transition: max-height 0.4s ease-out; /* ИЗМЕНЕНО: Плавный переход */

    padding-top: 0; /* Убираем верхний паддинг, он будет внутри контейнера */
    padding-bottom: 0; /* Убираем нижний паддинг */
  }

  /* Контейнер для ссылок внутри подменю, чтобы были красивые отступы */
  .dropdown .dropdown-content .submenu-links {
    padding-top: 15px;
    padding-bottom: 5px;
  }

  /* Класс, который будет добавляться через JS для отображения подменю */
  .dropdown .dropdown-content.submenu-active {
    /* display: block; ЗАМЕНЯЕМ ЭТО */
    max-height: 500px; /* ИЗМЕНЕНО: Задаем максимальную высоту, чтобы было куда раскрываться */
  }

  /* Анимация для стрелочки - ИЗМЕНЕНО */
  .dropdown .drop-btn .fa-chevron-down {
    transition: transform 0.3s ease;
    transform: rotate(0deg); /* Явно указываем начальное положение */
  }

  /* Класс для разворота стрелочки, когда меню открыто */
  .dropdown .drop-btn.parent-active > .fa-chevron-down {
    /* Используем дочерний селектор для большей точности */
    transform: rotate(180deg); /* Поворачиваем стрелку при активном классе */
  }
}
