/* =================== БАЗОВЫЕ СТИЛИ =================== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f7f7f7;
}

/* Обгортка контенту під меню */
.content-wrapper {
  padding-top: 120px; /* top-header + main-nav */
}
@media (max-width: 768px) {
  .content-wrapper {
    padding-top: 160px; /* top-header + main-nav на мобільних */
  }
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}

section {
  padding: 40px 20px; /* базовий padding, верх контролює .content-wrapper */
  max-width: 1200px;
  margin: auto;
}

/* =================== ШАПКА И МЕНЮ =================== */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #222;
  z-index: 101;
  display: flex;
  justify-content: center; /* логотип по центру */
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 40px;
  width: auto;
}

.site-title {
  color: white;
  font-size: 22px;
  font-weight: bold;
  margin-left: 10px;
}

/* Меню отдельным фиксированным блоком под шапкой */
.main-nav {
  position: fixed;
  top: 60px; /* под шапкой */
  left: 0;
  width: 100%;
  background: #333;
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 10px 0;
  z-index: 100;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.main-nav a:hover {
  background: #4CAF50;
}

/* =================== АДАПТИВ =================== */
@media (max-width: 768px) {
  .logo-container {
    flex-direction: column;
    gap: 5px;
  }

  .site-title {
    font-size: 18px;
    margin-left: 0;
    text-align: center;
  }

  .main-nav {
    top: 100px; /* под вертикальной шапкой */
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
  }
}

/* =================== БЛОК "ПОЧЕМУ ВЫБИРАЮТ NEEDCAR" =================== */
.about-us {
  background: #ffffff;
  padding: 10px 20px;
  max-width: 1100px;
  margin: 10px auto 10px; /* уменьшен верхний и нижний margin */
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.about-us h2 {
  text-align: center;
  font-size: 28px;
  margin-bottom: 25px;
  color: #222;
}

.about-us p {
  font-size: 16px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 20px;
}

.about-us ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 20px;
}

.about-us ul li {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 10px;
  color: #444;
}

.about-us strong {
  color: #4CAF50;
}
/* Адаптивность */
@media (max-width: 768px) {
  .about-us {
    padding: 20px 15px;
  }

  .about-us h2 {
    font-size: 24px;
  }

  .about-us p,
  .about-us ul li {
    font-size: 15px;
  }
}


/* =================== КАТАЛОГ =================== */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.car-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 15px;
}

.main-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}

.gallery img:hover {
  transform: scale(1.05);
}

.details {
  margin-top: 10px;
}

.details p {
  margin: 5px 0;
}

/* Каталог готових авто */
#readyCatalogContent {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 авто в ряд */
  gap: 20px;
}

#readyCatalogContent .car-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  padding: 10px;
  text-align: left;
}

/* Картинка авто */
#readyCatalogContent .main-img {
  width: 100%;
  height: 220px; /* фиксированная высота */
  object-fit: cover; /* обрезаем без искажений */
  border-radius: 8px;
}

/* Мобильная версия */
@media (max-width: 768px) {
  #readyCatalogContent {
    grid-template-columns: 1fr; /* только 1 авто */
  }
}

/* =================== КАЛЬКУЛЯТОР =================== */
.calc-container {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  max-width: 500px;
  margin: auto;
}

label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}

select, input {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

button {
  margin-top: 15px;
  padding: 10px 20px;
  border: none;
  background: #4CAF50;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  background: #45a049;
}

.result {
  margin-top: 20px;
}

/* =================== КОНТАКТЫ =================== */
.contacts {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: auto;
}

.contacts p {
  margin: 8px 0;
}

/* =================== МОДАЛЬНОЕ ОКНО =================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 32px;
  color: white;
  cursor: pointer;
  font-weight: bold;
}

/* Стрелки для галереи */
.modal-prev, .modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-prev:hover, .modal-next:hover {
  background: rgba(0,0,0,0.6);
}

.modal-prev { left: 30px; }
.modal-next { right: 30px; }

/* =================== ПРОДАНІ АВТО =================== */
.sold-cars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.sold-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  padding: 8px;
  text-align: center;
}

.sold-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 5px;
  transition: transform 0.2s;
}

.sold-img:hover {
  transform: scale(1.05);
}

.sold-details p {
  margin: 2px 0;
  font-size: 13px;
}
/* Адаптив для мобільних */
@media (max-width: 768px) {
  .sold-cars {
    grid-template-columns: repeat(2, 1fr);
  }
}

.about-content {
  overflow: hidden;
  max-height: 300px; /* изначально показываем только часть */
  transition: max-height 0.6s ease;
}

.about-content.expanded {
  max-height: 2000px; /* при клике плавно разворачиваем */
}

.toggle-about {
  margin-top: 10px;
  background: none;
  border: none;
  color: #4CAF50;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
}

.toggle-about:hover {
  text-decoration: underline;
}
.details-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 15px;
  background: #4CAF50;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}

.details-btn:hover {
  background: #45a049;
}

