/* style.css */
/* Основные стили */
:root {
  --primary: #333333;
  --accent: #990000;
  --bg: #ffffff;
  --font: 'Inter', 'Helvetica Neue', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--primary);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1rem;
}

/* Контейнеры разной ширины */
.container-wide {
  max-width: 1030px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Заголовок */
header {
  padding: 2rem 0;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 400;
}

/* Меню */
nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
  font-weight: 600;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 0;
  white-space: nowrap;
}

nav a:hover {
  text-decoration: underline;
}

nav a.current {
  color: var(--primary);
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}

/* Двухколоночная сетка */
.two-column {
  display: flex;
  gap: 2rem;
  margin: 2rem 0;
}

.left-column {
  width: 300px;
  box-sizing: border-box;
}

.right-column {
  flex: 1;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .two-column.mobile-reverse {
    flex-direction: column;
  }

  .two-column.mobile-reverse .left-column,
  .two-column.mobile-reverse .right-column {
    width: 100%;
  }

  .two-column.mobile-reverse .right-column {
    order: 1;
  }

  .two-column.mobile-reverse .left-column {
    order: 2;
  }
}

/* Фото */
.photo {
  text-align: left;
  margin: 0 0 1rem 0;
}

.photo img {
  max-width: 300px;
  border-radius: 8px;
  border: 1px solid #ddd;
  vertical-align: top;
  margin-top: 7px;
}

.photo p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  text-align: left;
}

/* Логотипы */
.logos {
  text-align: left;
  margin: 1.5rem 0;
}

.logos h2 {
  margin-bottom: 1rem;
}

.logos img {
  max-width: 300px;
  height: auto;
  border-radius: 8px;
}

/* Отзывы на главной */
.reviews-home {
  text-align: left;
  margin: 1.5rem 0;
}

.reviews-home h2 {
  margin-bottom: 1rem;
}

.reviews-home-container {
  width: 300px;
  margin: 0;
}

.reviews-home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0;
}

/* Отзывы на странице отзывов */
.reviews-page {
  margin: 1.5rem 0;
}

.reviews-page h2 {
  margin-bottom: 1rem;
}

.reviews-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

/* Карточка отзыва */
.review-item {
  aspect-ratio: 1 / 1;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.review-item a {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #f9f9f9;
  text-align: center;
  line-height: 100px;
  color: #999;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.review-item a:hover {
  transform: scale(1.05);
}

.review-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* CTA */
.cta {
  text-align: left;
  margin: 3rem 0;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-weight: 600;
  max-width: 848px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.cta strong {
  font-size: 1.2rem;
}

.cta a {
  color: #0000ff;
  font-weight: 600;
}

.consulting {
  margin-left:20px;
}

/* Футер */
footer {
  text-align: center;
  padding: 1.5rem 0;
  color: var(--primary);
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}

footer .js-warning {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--primary);
}

/* Cookies баннер */
.cookies-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f0f0f0;
  color: var(--primary);
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
  z-index: 1000;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.cookies-banner button {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ ГАЛЕРЕИ ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
  background: transparent;
  border: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Обертка для изображения и полей */
.modal-image-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 90vh;
}

.modal-image-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Левое поле */
.modal-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: -90px;
  width: 90px;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  pointer-events: none;
  border-radius: 8px 0 0 8px;
}

/* Правое поле */
.modal-image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: -90px;
  width: 90px;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  pointer-events: none;
  border-radius: 0 8px 8px 0;
}

/* ===== КНОПКИ НАВИГАЦИИ (СТРЕЛКИ) ===== */
.modal .nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0;
    padding: 0;
    cursor: pointer;
    border-radius: 12px;
    z-index: 1002;
    transition: all 0.25s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.modal .nav-button::before {
    font-size: 60px;
    font-weight: 100;
    line-height: 1;
    color: white;
    margin-top: -4px;
}

.modal .prev-button::before {
    content: "‹";
}

.modal .next-button::before {
    content: "›";
}

.modal .prev-button {
    left: -70px;
}

.modal .next-button {
    right: -70px;
}

.modal .nav-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.modal .nav-button:active {
    transform: translateY(-50%) scale(0.98);
    background-color: rgba(0, 0, 0, 0.8);
}

/* ===== КНОПКА ЗАКРЫТИЯ ===== */
.modal .close {
    position: absolute;
    top: 20px;
    right: -70px;
    color: white;
    font-size: 0;
    cursor: pointer;
    z-index: 1002;
    background-color: rgba(0, 0, 0, 0.4);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.modal .close::before {
    content: "×";
    font-size: 48px;
    font-weight: 200;
    line-height: 1;
    color: white;
    margin-top: -4px;
}

.modal .close:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.modal .close:active {
    transform: rotate(90deg) scale(0.95);
    background-color: rgba(0, 0, 0, 0.8);
}

/* ===== АНИМАЦИЯ ===== */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal[style*="display: flex"] .modal-image-wrapper {
  animation: modalFadeIn 0.2s ease-out;
}

/* ===== АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95vw;
  }

  .modal-image-wrapper img {
    max-height: 85vh;
    border-width: 2px;
  }

  .modal-image-wrapper::before {
    left: -60px;
    width: 60px;
  }

  .modal-image-wrapper::after {
    right: -60px;
    width: 60px;
  }

  .modal .nav-button {
    width: 40px;
    height: 100px;
  }

  .modal .nav-button::before {
    font-size: 50px;
  }

  .modal .prev-button {
    left: -55px;
  }

  .modal .next-button {
    right: -55px;
  }

  .modal .close {
    width: 40px;
    height: 40px;
    right: -55px;
  }

  .modal .close::before {
    font-size: 42px;
  }
}

@media (max-width: 480px) {
  .modal-image-wrapper::before {
    left: -45px;
    width: 45px;
  }

  .modal-image-wrapper::after {
    right: -45px;
    width: 45px;
  }

  .modal .nav-button {
    width: 36px;
    height: 80px;
  }

  .modal .nav-button::before {
    font-size: 44px;
  }

  .modal .prev-button {
    left: -48px;
  }

  .modal .next-button {
    right: -48px;
  }

  .modal .close {
    width: 36px;
    height: 36px;
    right: -48px;
  }

  .modal .close::before {
    font-size: 38px;
  }
}

/* Адаптив для остальных элементов */
@media (max-width: 768px) {
  .two-column {
    flex-direction: column;
  }

  .container-wide,
  .container-narrow {
    padding: 0 1rem;
  }

  .review-item {
    width: 100%;
    max-width: 100%;
  }

  .logos img,
  .reviews-home-container {
    max-width: 100%;
    width: 100%;
  }

  .reviews-home-grid,
  .reviews-page-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
