/* ===== ESTILOS CARRUSEL 3D COVERFLOW (formato vertical) ===== */
.carousel-section {
  padding: 60px 0;
  background: #f8f9fa;
}

.carousel-section:nth-child(even) {
  background: #ffffff;
}

.carousel-header {
  text-align: center;
  margin-bottom: 40px;
}

.carousel-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #003153;
  position: relative;
  display: inline-block;
}

.carousel-header h2 span {
  color: #c9a84c;
}

.carousel-header h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: #c9a84c;
  margin: 10px auto 0;
  border-radius: 2px;
}

.carousel-header p {
  color: #666;
  font-size: 1.1rem;
  margin-top: 10px;
}

/* ===== CARRUSEL 3D ===== */
.carousel-3d-wrapper {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 0;
  perspective: 1200px;
  overflow: hidden;
}

/* El track es ahora el punto de referencia para centrar los ítems */
.carousel-3d-track {
  position: relative;
  height: 420px; /* alto del item .center */
  display: block;
}

/* ===== ITEM BASE: vertical, anclado al centro del track ===== */
.carousel-3d-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 380px;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  background: #fff;
  border: 3px solid rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
}

.carousel-3d-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.carousel-3d-item:hover img {
  transform: scale(1.05);
}

/* ===== POSICIONES (translate(-50%,-50%) siempre primero) ===== */
.carousel-3d-item.center {
  transform: translate(-50%, -50%) scale(1) translateZ(80px) rotateY(0deg);
  z-index: 5;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border-color: #c9a84c;
  width: 320px;
  height: 420px;
}

.carousel-3d-item.left {
  transform: translate(-50%, -50%) scale(0.85) translateX(-220px)
    translateZ(-40px) rotateY(15deg);
  z-index: 3;
  opacity: 0.7;
}

.carousel-3d-item.right {
  transform: translate(-50%, -50%) scale(0.85) translateX(220px)
    translateZ(-40px) rotateY(-15deg);
  z-index: 3;
  opacity: 0.7;
}

.carousel-3d-item.far-left {
  transform: translate(-50%, -50%) scale(0.7) translateX(-400px)
    translateZ(-80px) rotateY(25deg);
  z-index: 1;
  opacity: 0.4;
}

.carousel-3d-item.far-right {
  transform: translate(-50%, -50%) scale(0.7) translateX(400px)
    translateZ(-80px) rotateY(-25deg);
  z-index: 1;
  opacity: 0.4;
}

.carousel-3d-item.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5) translateZ(-150px);
  pointer-events: none;
}

/* ===== INFO SUPERPUESTA ===== */
.carousel-3d-item .slide-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 49, 83, 0.9));
  padding: 30px 20px 20px;
  color: white;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.carousel-3d-item.center .slide-info {
  opacity: 1;
}

.carousel-3d-item .slide-info h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.carousel-3d-item .slide-info p {
  font-size: 0.85rem;
  margin: 5px 0 0;
  opacity: 0.8;
  color: #c9a84c;
}

/* ===== BOTONES ===== */
.carousel-3d-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 49, 83, 0.85);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(201, 168, 76, 0.3);
  color: white;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.carousel-3d-btn:hover {
  background: #c9a84c;
  transform: translateY(-50%) scale(1.1);
  border-color: #c9a84c;
  color: #003153;
}

.carousel-3d-btn.prev {
  left: 10px;
}

.carousel-3d-btn.next {
  right: 10px;
}

/* ===== INDICADORES ===== */
.carousel-3d-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 25px 0 5px;
  margin-top: 10px;
}

.carousel-3d-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 49, 83, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  padding: 0;
}

.carousel-3d-dots .dot.active {
  background: #c9a84c;
  transform: scale(1.2);
  border-color: #c9a84c;
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.carousel-3d-dots .dot:hover {
  background: rgba(0, 49, 83, 0.4);
  transform: scale(1.1);
}

/* ===== CONTADOR ===== */
.carousel-3d-counter {
  position: absolute;
  bottom: 10px;
  right: 20px;
  background: rgba(0, 49, 83, 0.8);
  backdrop-filter: blur(5px);
  color: white;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 15;
  border: 1px solid rgba(201, 168, 76, 0.3);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.94);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 90vh;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 25px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  background: none;
  border: none;
  transition: transform 0.3s ease;
  z-index: 10;
}

.lightbox-close:hover {
  transform: rotate(90deg);
}

.lightbox-counter {
  position: fixed;
  bottom: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 22px;
  border-radius: 20px;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 45px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 20px;
  transition: color 0.3s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  color: white;
}

.lightbox-nav.prev {
  left: 20px;
}
.lightbox-nav.next {
  right: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .carousel-3d-track {
    height: 340px;
  }

  .carousel-3d-item {
    width: 220px;
    height: 300px;
  }

  .carousel-3d-item.center {
    width: 260px;
    height: 340px;
  }

  .carousel-3d-item.left {
    transform: translate(-50%, -50%) scale(0.8) translateX(-160px)
      translateZ(-30px) rotateY(12deg);
  }

  .carousel-3d-item.right {
    transform: translate(-50%, -50%) scale(0.8) translateX(160px)
      translateZ(-30px) rotateY(-12deg);
  }

  .carousel-3d-item.far-left {
    transform: translate(-50%, -50%) scale(0.65) translateX(-280px)
      translateZ(-60px) rotateY(20deg);
  }

  .carousel-3d-item.far-right {
    transform: translate(-50%, -50%) scale(0.65) translateX(280px)
      translateZ(-60px) rotateY(-20deg);
  }
}

@media (max-width: 768px) {
  .carousel-section {
    padding: 40px 0;
  }

  .carousel-header h2 {
    font-size: 1.6rem;
  }

  .carousel-3d-track {
    height: 250px;
  }

  .carousel-3d-item {
    width: 160px;
    height: 220px;
    border-radius: 14px;
  }

  .carousel-3d-item.center {
    width: 190px;
    height: 250px;
  }

  .carousel-3d-item .slide-info h4 {
    font-size: 0.85rem;
  }

  .carousel-3d-item .slide-info p {
    font-size: 0.7rem;
  }

  .carousel-3d-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .carousel-3d-btn.prev {
    left: 5px;
  }
  .carousel-3d-btn.next {
    right: 5px;
  }

  .carousel-3d-item.left {
    transform: translate(-50%, -50%) scale(0.75) translateX(-110px)
      translateZ(-20px) rotateY(10deg);
  }

  .carousel-3d-item.right {
    transform: translate(-50%, -50%) scale(0.75) translateX(110px)
      translateZ(-20px) rotateY(-10deg);
  }

  .carousel-3d-item.far-left {
    transform: translate(-50%, -50%) scale(0.6) translateX(-190px)
      translateZ(-40px) rotateY(15deg);
  }

  .carousel-3d-item.far-right {
    transform: translate(-50%, -50%) scale(0.6) translateX(190px)
      translateZ(-40px) rotateY(-15deg);
  }
}

@media (max-width: 480px) {
  .carousel-3d-track {
    height: 200px;
  }

  .carousel-3d-item {
    width: 120px;
    height: 170px;
    border-radius: 10px;
  }

  .carousel-3d-item.center {
    width: 150px;
    height: 200px;
  }

  .carousel-3d-item .slide-info {
    padding: 15px 12px 12px;
  }

  .carousel-3d-item .slide-info h4 {
    font-size: 0.7rem;
  }

  .carousel-3d-item .slide-info p {
    font-size: 0.6rem;
  }

  .carousel-3d-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .carousel-3d-counter {
    font-size: 0.65rem;
    padding: 3px 10px;
    bottom: 5px;
    right: 10px;
  }

  .carousel-3d-item.left {
    transform: translate(-50%, -50%) scale(0.7) translateX(-80px)
      translateZ(-15px) rotateY(10deg);
  }

  .carousel-3d-item.right {
    transform: translate(-50%, -50%) scale(0.7) translateX(80px)
      translateZ(-15px) rotateY(-10deg);
  }

  .carousel-3d-item.far-left {
    transform: translate(-50%, -50%) scale(0.55) translateX(-140px)
      translateZ(-30px) rotateY(15deg);
  }

  .carousel-3d-item.far-right {
    transform: translate(-50%, -50%) scale(0.55) translateX(140px)
      translateZ(-30px) rotateY(-15deg);
  }
}
