/* =====================
   GALLERY CAROUSEL
   ===================== */
.gallery-carousel {
  position: relative;
  overflow: hidden;
  padding: 0 0 3rem;
  margin: 0 auto;
  max-width: 100%;
}
.gallery-carousel__track {
  display: flex;
  gap: 1.25rem;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 1rem 3.5rem;
  cursor: grab;
}
.gallery-carousel__track:active { cursor: grabbing; }
.gallery-carousel__slide {
  flex: 0 0 calc(25% - 1rem);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 20px rgba(27,42,92,0.1);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.gallery-carousel__slide:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 40px rgba(27,42,92,0.18);
}
.gallery-carousel__slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(27,42,92,0.4) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.gallery-carousel__slide:hover::after { opacity: 1; }
.gallery-carousel__slide img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-carousel__slide:hover img { transform: scale(1.08); }

.gallery-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - 1rem));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(27,42,92,0.15);
  z-index: 10;
  transition: all 0.3s ease;
  color: #1B2A5C;
}
.gallery-carousel__arrow:hover {
  background: #1B2A5C;
  color: #fff;
  transform: translateY(calc(-50% - 1rem)) scale(1.1);
}
.gallery-carousel__arrow--prev { left: 0.5rem; }
.gallery-carousel__arrow--next { right: 0.5rem; }

.gallery-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1.5rem;
}
.gallery-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #CBD5E1;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}
.gallery-carousel__dot.active {
  background: #00B4D8;
  width: 28px;
  border-radius: 5px;
}

/* Gallery Popup */
.gallery-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
.gallery-popup.active { display: flex; }
.gallery-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,17,40,0.92);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.gallery-popup__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}
.gallery-popup__close:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}
.gallery-popup__content {
  position: relative;
  z-index: 5;
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-popup__content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: popupZoomIn 0.3s ease;
}
@keyframes popupZoomIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.gallery-popup__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}
.gallery-popup__nav:hover {
  background: rgba(0,180,216,0.4);
  border-color: rgba(0,180,216,0.6);
}
.gallery-popup__nav--prev { left: 1.5rem; }
.gallery-popup__nav--next { right: 1.5rem; }
.gallery-popup__counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10;
  background: rgba(0,0,0,0.3);
  padding: 0.4rem 1rem;
  border-radius: 20px;
}

@media (max-width: 1024px) {
  .gallery-carousel__slide { flex: 0 0 calc(33.333% - 1rem); }
  .gallery-carousel__slide img { height: 240px; }
}
@media (max-width: 768px) {
  .gallery-carousel__slide { flex: 0 0 calc(50% - 0.75rem); }
  .gallery-carousel__slide img { height: 220px; }
  .gallery-carousel__track { padding: 1rem 2.5rem; gap: 0.75rem; }
  .gallery-carousel__arrow { width: 40px; height: 40px; }
  .gallery-popup__nav--prev { left: 0.5rem; }
  .gallery-popup__nav--next { right: 0.5rem; }
}
@media (max-width: 480px) {
  .gallery-carousel__slide { flex: 0 0 calc(100% - 1rem); }
  .gallery-carousel__slide img { height: 250px; }
}

/* --- Mobile: reduce carousel track padding --- */
@media (max-width: 480px) {
  .gallery-carousel__track {
    padding: 1rem 1rem;
  }
}
