/**
 * =============================================================================
 * GALLERY.CSS — Галерея с главным фото и миниатюрами (car-service)
 * =============================================================================
 */

/* Контейнер всей галереи */
.car-gallery {
  width: 100%;
  max-width: 900px;
  margin: 30px auto;
}

/* Главное изображение */
.car-gallery-main {
  position: relative;
  width: 100%;
  height: 450px;
  overflow: hidden;
  border-radius: 10px;
  background-color: #ddd;
  margin-bottom: 12px;
}

.car-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

/* Контейнер с миниатюрами */
.car-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.car-gallery-thumbs::-webkit-scrollbar {
  display: none;
}

/* Миниатюра */
.car-gallery-thumb {
  flex: 0 0 auto;
  width: 100px;
  height: 70px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.car-gallery-thumb:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.car-gallery-thumb.active {
  border-color: var(--primary-color, #1a7a3e);
  opacity: 1;
}

.car-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Стрелки на главном изображении */
.car-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.car-gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}

.car-gallery-arrow.prev {
  left: 12px;
}

.car-gallery-arrow.next {
  right: 12px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .car-gallery-main {
    height: 300px;
  }

  .car-gallery-thumb {
    width: 80px;
    height: 56px;
  }

  .car-gallery-arrow {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .car-gallery-main {
    height: 220px;
  }

  .car-gallery-thumb {
    width: 70px;
    height: 50px;
  }

  .car-gallery-arrow {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .car-gallery-arrow.prev {
    left: 8px;
  }

  .car-gallery-arrow.next {
    right: 8px;
  }
}
