/* Homepage vehicle gallery slider  -  4-up strip */
.gallery-slider {
  margin-top: 12px;
}

.gallery-slider-viewport {
  overflow: hidden;
  width: 100%;
  margin-bottom: 20px;
  border-radius: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}

.gallery-slider-viewport:active {
  cursor: grabbing;
}

.gallery-slider .gallery-slider-prev,
.gallery-slider .gallery-slider-next,
.gallery-slider .hero-slider-arrow {
  display: none !important;
}

.gallery-slider-track {
  display: flex;
  gap: 10px;
  will-change: transform;
  backface-visibility: hidden;
  align-items: flex-start;
}

.gallery-slider-item {
  flex: 0 0 calc((100% - 30px) / 4);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  position: relative;
  aspect-ratio: auto;
  border-radius: 0;
}

/* Override static grid .gallery-item rules from extras.css */
.gallery-slider-item.gallery-item {
  aspect-ratio: auto;
  overflow: visible;
  border: none;
}

.gallery-slider-item.gallery-item figcaption,
.gallery-slider-item .gallery-slider-caption {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  background: transparent;
  padding: 0 2px;
}

.gallery-slider-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(77, 184, 224, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.gallery-slider-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0a1018;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-slider-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 0 2px;
  margin: 0;
  background: transparent;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.3;
}

.gallery-caption-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(232, 240, 248, 0.9);
  line-height: inherit;
  text-align: left;
}

.gallery-make-badge {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 1.65em;
  max-height: 1.65em;
  padding: 0;
  border: none;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

.gallery-make-badge img {
  display: block;
  width: auto;
  height: 100%;
  max-height: 1.65em;
  max-width: 2.4em;
  object-fit: contain;
  background: transparent !important;
  opacity: 0.4;
  filter: brightness(0.85) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.gallery-make-fallback {
  font-family: var(--font-display);
  font-size: 0.85em;
  font-weight: 800;
  line-height: 1;
  color: var(--bright-cyan, #4db8e0);
  background: none !important;
  border: none !important;
}

.gallery-slider-item:hover .gallery-slider-media {
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: 0 8px 24px rgba(8, 146, 212, 0.2);
}

.gallery-slider-item:hover .gallery-slider-media img {
  transform: scale(1.05);
}

.gallery-slider-controls.hero-slider-controls {
  justify-content: center;
  margin-top: 20px;
  gap: 12px;
}

.gallery-slider .hero-slider-arrow {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(77, 184, 224, 0.28);
  color: rgba(232, 240, 248, 0.85);
  width: 36px;
  min-width: 36px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.gallery-slider .hero-slider-arrow:hover,
.gallery-slider .hero-slider-arrow:focus-visible {
  border-color: var(--bright-cyan, #4db8e0);
  color: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.gallery-slider .hero-slider-dots {
  flex: 0 1 auto;
  justify-content: center;
  flex-wrap: wrap;
}

.section-gallery .section-header {
  margin-bottom: var(--section-header-gap, clamp(28px, 4vw, 40px));
}

@media (max-width: 768px) {
  .section.section-gallery {
    padding-top: var(--home-section-gap, 32px);
    padding-bottom: var(--home-section-gap, 32px);
  }

  .section.section-gallery + .section {
    padding-top: var(--home-section-gap, 32px);
  }

  .section-gallery .section-header {
    margin-bottom: var(--section-header-gap, clamp(24px, 5vw, 32px));
  }

  #homeGallery,
  .gallery-slider {
    margin-top: 10px;
    margin-bottom: 0;
  }

  .gallery-slider-viewport {
    -webkit-mask-image: none;
    mask-image: none;
    margin-bottom: 18px;
  }

  .gallery-slider-track {
    gap: 12px;
  }

  .gallery-slider-item {
    flex: 0 0 calc((100% - 12px) / 2);
  }

  .gallery-slider-media {
    aspect-ratio: 16 / 11;
    border-radius: 10px;
  }

  .gallery-slider-caption {
    font-size: clamp(13px, 3.4vw, 15px);
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-slider-track {
    transition: none !important;
  }

  .gallery-slider-item:hover .gallery-slider-media img {
    transform: none;
    transition: none;
  }
}
