/* --- Переменные --- */
:root {
  --primary-color: #245e1d; /* Основной зеленый */
  --secondary-color: #4CAF50; /* Светлый зеленый (hover, акценты) */
  --dark-color: #333; /* Темный для текста и фона */
  --light-color: #f5f5f5; /* Светлый фон */
  --white-color: #ffffff;
  --grey-color: #ddd; /* Светло-серый для границ */
  --light-grey-bg: #f9f9f9; /* Фон для секций и таблицы */
  --overlay-color: rgba(55, 99, 71, 0.8);
  --overlay-hover-color: rgba(55, 99, 71, 1);
  --header-overlay-color: rgba(0, 0, 0, 0.55);
  --font-family: Arial, sans-serif;
  --nav-height: 70px;
  --border-radius: 8px;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* --- Сброс стилей --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--light-color);
  line-height: 1.6;
  color: var(--dark-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Утилиты --- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.section {
  padding: 60px 0;
  flex-grow: 1;
}

.section-bg-grey {
    background-color: var(--light-grey-bg);
}

.section h1, .section h2 {
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-color);
}
.section h1 { font-size: clamp(2em, 5vw, 2.5em); }
.section h2 { font-size: clamp(1.8em, 4vw, 2.2em); }
.section h3 { font-size: clamp(1.3em, 3vw, 1.5em); margin-bottom: 15px; color: var(--primary-color); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--secondary-color); text-decoration: none; }
ul { list-style: none; }

/* --- Якорь для прокрутки --- */
:target {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}


/* ============================================= */
/* ---            НАВИГАЦИЯ (DESKTOP)        --- */
/* ============================================= */
nav {
  background-color: var(--white-color);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px var(--shadow-light);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 20px;
}

/* Логотип */
.logo-link { display: inline-block; text-decoration: none; flex-shrink: 0; order: 1; /* Порядок для мобильных */ }
#logo-img { max-height: 55px; width: auto; vertical-align: middle; display: block; }

/* Переключатель языка (Desktop) */
.language-switcher {
  font-size: 0.9em;
  white-space: nowrap;
  margin-left: auto; /* Прижимаем к меню */
  margin-right: 20px; /* Отступ от меню */
  order: 2; /* Порядок для мобильных */
}
.language-switcher a { margin: 0 5px; color: var(--dark-color); font-weight: normal; padding: 5px; }
.language-switcher a.active-lang { font-weight: bold; color: var(--primary-color); border-bottom: 2px solid var(--secondary-color); }

/* Основное меню (Desktop) */
nav ul#main-menu { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; order: 3; /* Порядок для мобильных */ }
nav ul#main-menu > li:not(.language-switcher-li) { /* Стили для обычных пунктов меню */ display: inline-block; margin: 0 15px; position: relative; }
nav ul#main-menu > li > a { color: var(--primary-color); font-weight: bold; padding: 10px 0; display: block; }
nav ul#main-menu > li > a:hover { color: var(--secondary-color); }

/* Выпадающее подменю */
nav ul li ul { display: none; position: absolute; top: 100%; left: 0; background-color: var(--white-color); min-width: 180px; padding: 10px 0; margin: 0; list-style: none; box-shadow: 0 4px 8px var(--shadow-light); border-radius: 0 0 var(--border-radius) var(--border-radius); z-index: 1001; border: 1px solid var(--grey-color); border-top: none; }
nav ul li ul li { display: block; margin: 0; }
nav ul li ul li a { display: block; padding: 10px 15px; text-align: left; font-weight: normal; white-space: nowrap; color: var(--dark-color); }
nav ul li ul li a:hover { background-color: var(--light-color); color: var(--primary-color); }
nav ul li:hover > ul { display: block; }


/* ============================================= */
/* ---             ШАПКА СТРАНИЦЫ            --- */
/* ============================================= */
header { position: relative; width: 100%; background-repeat: no-repeat; background-position: center center; background-size: cover; color: var(--white-color); text-align: center; padding: 90px 20px; min-height: 380px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
header.header-home { background-image: url('images/header-background.jpg'); }
header.header-prices { background-image: url('images/price-header-background.jpg'); }
header.header-contacts { background-image: url('images/contacts-background.jpg'); }
header.header-about { background-image: url('images/header-background.jpg'); }

.header-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--header-overlay-color); z-index: 1; }
.header-content { position: relative; z-index: 2; }
header h1 { margin-bottom: 20px; font-size: clamp(2.5em, 6vw, 3.8em); text-shadow: 2px 2px 4px rgba(0,0,0,0.4); color: var(--white-color); }
header p { font-size: clamp(1em, 2.5vw, 1.2em); margin-bottom: 10px; }
header .subtitle { font-size: clamp(1.2em, 3vw, 1.6em); margin-bottom: 35px; max-width: 750px; margin-left: auto; margin-right: auto; line-height: 1.5; }
header p:has(a[href^="tel:"]) { font-size: clamp(1.1em, 2.8vw, 1.2em); margin-bottom: 30px; }
header a[href^="tel:"], header a[href^="mailto:"] { color: var(--white-color); font-weight: bold; }
header a[href^="tel:"]:hover, header a[href^="mailto:"]:hover { text-decoration: underline; }

/* Кнопка CTA */
.cta-button { display: inline-flex; align-items: center; gap: 10px; background-color: var(--secondary-color); color: var(--white-color) !important; padding: 15px 35px; font-size: 1.2em; font-weight: bold; border-radius: var(--border-radius); margin-top: 25px; transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; text-transform: uppercase; border: none; cursor: pointer; text-shadow: none; }
.cta-button:hover { background-color: var(--primary-color); color: var(--white-color) !important; transform: translateY(-3px); box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3); text-decoration: none; }
.cta-button i { font-size: 0.9em; }


/* ============================================= */
/* ---          СЕКЦИИ КОНТЕНТА             --- */
/* ============================================= */

/* Секция "Преимущества" */
#benefits .benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; text-align: center; }
#benefits .benefit-item { background-color: var(--white-color); padding: 25px; border-radius: var(--border-radius); box-shadow: 0 2px 10px var(--shadow-light); transition: transform 0.3s ease, box-shadow 0.3s ease; }
#benefits .benefit-item:hover { transform: translateY(-5px); box-shadow: 0 8px 15px var(--shadow-medium); }
#benefits .benefit-item i.benefit-icon { font-size: 2.5em; color: var(--secondary-color); margin-bottom: 15px; display: block; }
#benefits .benefit-item h3 { margin-bottom: 10px; font-size: 1.3em; color: var(--primary-color); }

/* Секция "Продукция" */
#products .product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
#products .product-item { position: relative; overflow: hidden; border-radius: var(--border-radius); box-shadow: 0 4px 10px var(--shadow-light); transition: box-shadow 0.3s ease, transform 0.3s ease; }
#products .product-item:hover { box-shadow: 0 8px 15px var(--shadow-medium); transform: translateY(-3px); }
#products .product-item img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.4s ease; }
#products .product-item:hover img { transform: scale(1.08); }
#products .product-item .overlay { position: absolute; bottom: 0; left: 0; background: var(--overlay-color); color: var(--white-color); width: 100%; text-align: center; padding: 15px 10px; font-size: 1.2em; font-weight: bold; transition: background 0.3s ease; }
#products .product-item:hover .overlay { background: var(--overlay-hover-color); }

/* Секция "Цены" (Таблицы) */
.table-container { margin-bottom: 50px; }
.table-wrapper { border-radius: var(--border-radius); overflow: hidden; box-shadow: 0 4px 15px var(--shadow-light); margin-bottom: 20px; overflow-x: auto; }
.table-container h2 { text-align: left; margin-bottom: 15px; font-size: clamp(1.5em, 3.5vw, 1.8em); border-bottom: 2px solid var(--secondary-color); padding-bottom: 5px; display: inline-block; }
table.price-table { width: 100%; border-collapse: collapse; background-color: var(--white-color); }
table.price-table th, table.price-table td { padding: 12px 15px; text-align: center; border: 1px solid var(--grey-color); vertical-align: middle; }
table.price-table th { background-color: var(--primary-color); color: var(--white-color); font-weight: bold; }
table.price-table tr:nth-child(even) { background-color: var(--light-grey-bg); }
table.price-table tr:hover { background-color: #e8f5e9; }

/* Секция "Контакты" (Блок информации и карта) */
#contact-info { background-color: var(--white-color); padding: 30px; box-shadow: 0 5px 15px var(--shadow-light); border-radius: var(--border-radius); margin-bottom: 40px; }
#contact-info h2 { text-align: left; margin-bottom: 25px; }
#contact-info p { margin-bottom: 15px; font-size: 1.1em; line-height: 1.7; }
#contact-info strong { min-width: 80px; display: inline-block; margin-right: 10px; }
#contact-info a { color: var(--primary-color); font-weight: bold; }
#contact-info a:hover { text-decoration: underline; }
#map-location h2 { text-align: left; margin-bottom: 20px; }
.map-container { position: relative; overflow: hidden; padding-top: 56.25%; border-radius: var(--border-radius); box-shadow: 0 5px 15px var(--shadow-light); }
.map-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Секция "О нас" */
#about-intro p, #about-products p, #about-testimonials p { margin-bottom: 15px; font-size: 1.05em; }
#about-products ul { list-style: disc; margin-left: 25px; margin-bottom: 20px; }
#about-products ul li { margin-bottom: 8px; }
#about-testimonials .testimonial { background-color: var(--white-color); padding: 20px; margin-bottom: 20px; border-left: 5px solid var(--secondary-color); border-radius: 0 var(--border-radius) var(--border-radius) 0; box-shadow: 0 2px 8px var(--shadow-light); }
#about-testimonials .testimonial p { font-style: italic; margin-bottom: 5px; }
#about-testimonials .testimonial cite { display: block; text-align: right; font-weight: bold; color: var(--primary-color); margin-top: 10px; }

/* Форма обратной связи */
.contact-form { max-width: 700px; margin: 40px auto; padding: 30px; background-color: var(--white-color); box-shadow: 0 5px 15px var(--shadow-light); border-radius: var(--border-radius); }
.contact-form h2 { text-align: center; margin-bottom: 25px; font-size: clamp(1.5em, 3.5vw, 1.8em); }
.contact-form .form-group { margin-bottom: 20px; }
.contact-form label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--dark-color); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="tel"], .contact-form textarea { width: 100%; padding: 12px; margin-bottom: 5px; border: 1px solid var(--grey-color); border-radius: 4px; font-size: 1em; transition: border-color 0.3s ease; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 2px rgba(36, 94, 29, 0.2); }
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form button { background-color: var(--secondary-color); color: var(--white-color); padding: 12px 25px; border: none; border-radius: var(--border-radius); cursor: pointer; width: 100%; font-size: 1.1em; font-weight: bold; text-transform: uppercase; transition: background-color 0.3s ease, transform 0.2s ease; }
.contact-form button:hover { background-color: var(--primary-color); transform: translateY(-2px); }


/* ============================================= */
/* ---                 ФУТЕР                 --- */
/* ============================================= */
footer { background-color: var(--dark-color); color: #ccc; padding-top: 40px; margin-top: auto; }

/* Десктопные стили футера */
.footer-content { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 20px; padding-bottom: 40px; align-items: flex-start; }
.footer-column { flex: 1 1 220px; /* Растет, сжимается, база 220px */ }
.footer-column h4 { color: var(--white-color); margin-bottom: 20px; font-size: 1.3em; border-bottom: 1px solid var(--secondary-color); padding-bottom: 8px; display: inline-flex; align-items: center; gap: 8px; }
.footer-column h4 i { color: var(--secondary-color); font-size: 1em; flex-shrink: 0; }
.footer-column p, .footer-column ul li { margin-bottom: 10px; font-size: 0.95em; }
.footer-column ul { padding-left: 0; }
.footer-column a { color: #ccc; }
.footer-column a:hover { color: var(--white-color); text-decoration: underline; }
.social-icons { margin-top: 10px; }
.social-icons a { display: inline-block; margin: 0 7px; font-size: 1.5em; color: #ccc; transition: color 0.3s ease, transform 0.3s ease; }
.social-icons a:hover { color: var(--secondary-color); transform: scale(1.1); text-decoration: none; }
.footer-working-hours p { margin-bottom: 5px; line-height: 1.5; color: #ccc; font-size: 0.95em; }
.footer-working-hours p:last-child { margin-bottom: 0; }
.footer-bottom { text-align: center; padding: 20px 0; border-top: 1px solid #444; font-size: 0.9em; }


/* ============================================= */
/* ---        ГАМБУРГЕР И МОБ. МЕНЮ         --- */
/* ============================================= */

/* Базовый стиль кнопки-гамбургера - СКРЫТ */
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer; padding: 10px; z-index: 1002;
  order: 3; /* Порядок в flex-контейнере nav-container */
  margin-left: 15px; /* Отступ слева от переключателя языка */
}
.hamburger-line { display: block; width: 25px; height: 3px; background-color: var(--primary-color); margin: 5px 0; transition: transform 0.3s ease, opacity 0.3s ease; }


/* ============================================= */
/* ---             АДАПТИВНОСТЬ              --- */
/* ============================================= */

/* --- Планшеты и небольшие ноутбуки --- */
@media (max-width: 992px) {
    .container { padding: 0 15px; }
    #products .product-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Планшеты и мобильные --- */
@media (max-width: 768px) {
  /* --- Общие изменения --- */
  .section { padding: 40px 0; }
  .section h1, .section h2 { margin-bottom: 30px; }

  /* --- Шапка --- */
  header { padding: 70px 15px; min-height: 300px; }
  header h1 { font-size: clamp(2.2em, 7vw, 2.8em); }
  header .subtitle { font-size: clamp(1.1em, 4vw, 1.3em); }
  header p:has(a[href^="tel:"]) { font-size: 1.1em; }
  .cta-button { font-size: 1.1em; padding: 12px 25px; }

  /* --- Навигация --- */
  nav { height: var(--nav-height); }
  .nav-container { flex-direction: row; padding: 0 15px; justify-content: space-between; /* Восстанавливаем space-between для лого слева, остального справа */ gap: 10px; }
  #logo-img { max-height: 45px; }
  .language-switcher { display: none; /* Скрываем в шапке */ }
  nav ul#main-menu { display: none; /* Скрываем десктопное меню */ }

  /* Гамбургер */
  .menu-toggle { display: block; /* Показываем гамбургер */ }

  /* Мобильное меню (открытое) */
  nav.menu-open ul#main-menu { /* Стили для показа */
    display: block; position: absolute; top: var(--nav-height); left: 0; width: 100%; background-color: var(--white-color); box-shadow: 0 4px 8px var(--shadow-light); padding: 0; z-index: 1001; border-top: 1px solid var(--grey-color); list-style: none; margin: 0;
  }
  nav.menu-open ul#main-menu li { display: block; margin: 0; text-align: center; }
  nav.menu-open ul#main-menu li a { padding: 12px 20px; border-bottom: 1px solid var(--light-color); font-size: 1.1em; display: block; font-weight: bold; color: var(--primary-color); }

  /* Язык в мобильном меню */
  nav.menu-open ul#main-menu li.language-switcher-li { padding: 15px 20px; border-bottom: 1px solid var(--light-color); background-color: var(--light-grey-bg); }
  nav.menu-open ul#main-menu li.language-switcher-li .language-switcher { font-size: 1em; text-align: center; white-space: normal; margin: 0; display: block; }
  nav.menu-open ul#main-menu li.language-switcher-li .language-switcher a { display: inline-block; padding: 5px 10px; margin: 0 3px; font-weight: normal; color: var(--dark-color); border-bottom: none; font-size: 1em; }
  nav.menu-open ul#main-menu li.language-switcher-li .language-switcher a.active-lang { font-weight: bold; color: var(--primary-color); background-color: var(--grey-color); border-radius: 4px; }

  /* Последний элемент в меню */
  nav.menu-open ul#main-menu li:not(.language-switcher-li):last-child a { border-bottom: none; }
  /* Если язык последний: */
  /* nav.menu-open ul#main-menu li.language-switcher-li { border-bottom: none; } */

  /* Подменю в мобильном */
  nav.menu-open ul#main-menu li ul { position: static; box-shadow: none; border: none; padding: 5px 0 10px 0; background-color: var(--light-grey-bg); min-width: auto; display: block; }
  nav.menu-open ul#main-menu li ul li a { padding: 8px 20px 8px 40px; font-size: 1em; font-weight: normal; color: var(--dark-color); border-bottom: none; }
  nav.menu-open ul#main-menu li ul li a:hover { background-color: var(--grey-color); }

  /* Анимация гамбургера */
  nav.menu-open .menu-toggle .hamburger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  nav.menu-open .menu-toggle .hamburger-line:nth-child(2) { opacity: 0; }
  nav.menu-open .menu-toggle .hamburger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* --- Стили Контента для мобильных --- */
  #benefits .benefits-grid { grid-template-columns: 1fr; gap: 20px; }
  #products .product-grid { /* Оставляем 2 колонки */ gap: 20px; }
  #products .product-item img { height: 180px; }
  table.price-table th, table.price-table td { padding: 8px 10px; font-size: 0.9em; }
  #contact-info { padding: 20px; }
  #contact-info p { font-size: 1em; }
  .map-container { padding-top: 75%; }

  /* --- Мобильные стили Футера --- */
  .footer-content { flex-direction: column; text-align: center; gap: 25px; align-items: center; }
  .footer-column, .footer-working-hours { min-width: 90%; width: 90%; margin-bottom: 15px; flex-basis: auto; }
  .footer-column h4 { display: inline-flex; /* Оставляем flex */ /* border-bottom: none; */ margin-bottom: 15px; }
  .social-icons a { margin: 0 10px; }

} /* --- КОНЕЦ @media (max-width: 768px) --- */

/* --- Маленькие мобильные --- */
@media (max-width: 576px) {
   #products .product-grid { grid-template-columns: 1fr; } /* 1 колонка */
    #products .product-item img { height: 200px; }
    .contact-form { padding: 20px; }
}

/* --- Стили для :focus-visible (Доступность) --- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: none;
}