/* ============================================
           IMAGE STYLES
        ============================================ */
img {
  transition: none !important;
}

img:hover,
img:focus {
  transform: none !important;
  zoom: 1 !important;
}

/* ============================================
           GALLERY SECTION - 4 IMAGES ROTATING
        ============================================ */
.gallery-section {
  padding: 60px 0;
  background: var(--bg-secondary);
}

.gallery-header {
  text-align: center;
  margin-bottom: 2rem;
}

.gallery-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-family: var(--font-secondary);
  text-transform: uppercase;
}

.gallery-rotating {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  margin: 0 auto;
  overflow: hidden;
}

.gallery-card {
  position: absolute;
  width: 300px;
  height: 380px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.8s cubic-bezier(0.22, 0.9, 0.35, 1), opacity 0.8s ease;
  cursor: pointer;
  background: var(--bg-primary);
  padding: 4px;
}

.gallery-card img {
  /* width: calc(100% - 6px);
        height: calc(100% - 6px); */
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: none;
  border-radius: 2px;
}

.gallery-card.front {
  /* transform: translateX(0) scale(1.1); */
  z-index: 3;
  opacity: 1;
}

.gallery-card.left {
  transform: translateX(-320px) scale(0.8);
  z-index: 2;
  opacity: 0.8;
}

.gallery-card.right {
  transform: translateX(320px) scale(0.8);
  z-index: 2;
  opacity: 0.8;
}

.gallery-card.back {
  transform: translateX(0) scale(0.6);
  z-index: 1;
  opacity: 0;
}

/* ============================================
           ADVANCED LIGHTBOX - MOBILE FIRST
        ============================================ */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lightbox.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}
.lightbox-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  z-index: 2002;
}
.lightbox-counter {
  color: white;
  font-size: 12px;
  font-weight: 500;
  width: auto;
}
.lightbox-close {
  background: none;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 18px;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 20px;
  z-index: 2001;
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-prev {
  left: 20px;
}
.lightbox-next {
  right: 20px;
}
.lightbox-content {
  position: relative;
  width: 100%;
  height: calc(100% - 90px);
  margin-top: 50px;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  touch-action: none;
}
.lightbox-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: none;
  transform-origin: center center;
  cursor: zoom-in;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}
.lightbox-image-container.no-transition {
  transition: none;
}
.lightbox-image-container.zoomed {
  cursor: grab;
}
.lightbox-image-container.dragging {
  cursor: grabbing;
}
.lightbox-image {
  width: auto;
  height: auto;
  max-width: calc(100% - 6px);
  max-height: calc(100% - 6px);
  object-fit: contain;
  border-radius: 2px;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: none;
}
.lightbox-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2002;
  border-top: 1px solid #333;
}
.zoom-instruction {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-align: center;
}

/* ============================================
           RESPONSIVE STYLES
        ============================================ */
@media (max-width: 768px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .gallery-card {
    width: 220px;
    height: 280px;
  }

  .gallery-card.front {
    transform: translateX(0) scale(1.1);
  }

  .gallery-card.left {
    transform: translateX(-240px) scale(0.8);
  }

  .gallery-card.right {
    transform: translateX(240px) scale(0.8);
  }
}

@media (min-width: 1024px) {
  .lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .lightbox.active {
    display: flex;
    opacity: 1;
  }
  .lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    overflow: hidden;
    margin: 0;
    touch-action: none;
  }
  .lightbox-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: none;
    transform-origin: center center;
    cursor: zoom-in;
  }
  .lightbox-nav {
    display: flex;
  }
  .lightbox-top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    height: auto;
    background: none;
    border-radius: 5px;
    padding: var(--spacing-sm) var(--spacing-md);
    z-index: 2002 !important;
  }
  .lightbox-counter {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: 500;
    width: auto;
    padding: var(--spacing-md);
    border-radius: 4px;
  }
  .lightbox-close {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    z-index: 2001;
    position: absolute;
    top: 20px;
    right: 20px;
  }
  .lightbox-bottom-bar {
    display: none;
  }
}

/* helpful utility to force stable heights */
.tours-carousel-track > * {
  display: block;
}

html,
body {
  overflow-x: hidden;
}
