#carousel-3d-section {
  position: relative;  
  min-height: calc(100vh - var(--alto-menu));

}

.titulo-carousel {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-light);  
  text-align: center;
}
.carousel-bg-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  height: calc(100vh - var(--alto-menu));
  height: calc(100dvh - var(--alto-menu));
}

.carousel-bg {
  position: absolute;
  inset: 0;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  transition:
    background-image .8s ease,
    transform 8s ease;

  transform: scale(1.02);
}

.carousel-bg::before {
  content: "";
  position: absolute;
  inset: 0;
}


/* El contenido queda encima */
#carousel-3d-section .contenedor {
  position: relative;
  z-index: 2;
}

/* =========================
   CARRUSEL
========================= */

.carousel-3d {
  width: 100%;
  perspective: 1600px;
  padding: 40px 0;
  overflow: visible;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 380px;
  transform-style: preserve-3d;
}

/* =========================
   TARJETAS
========================= */
.carousel-item-3d {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 340px;
  margin-left: -130px;
  margin-top: -170px;
  transition: transform .7s ease, opacity .7s ease;
  cursor: pointer;
  
  backface-visibility: hidden;
}

/* =========================
   CARD
========================= */
.card{
  width: 260px;
  height: 340px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.card-clip {
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.5);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;  
  position: relative;
}

/* =========================
   BLOQUE IMAGEN
========================= */

.card-image-wrapper {
  position: relative;

  width: 100%;
  height: 180px;

  overflow: hidden;

  background: #000;
}

.card-image {
  width: 100%;
  height: 100%;

  object-fit: cover;
  display: block;
}

/* Oscurecido suave para legibilidad */
.card-image-wrapper::after {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      to top,
      rgba(0,0,0,.85) 0%,
      rgba(0,0,0,0) 45%
    );
}

/* =========================
   TITULO SOBRE IMAGEN
========================= */

.card-image-wrapper h3 {
  position: absolute;

  left: 0;
  bottom: 14px;

  width: 100%;

  padding: 0 14px;
  margin: 0;

  box-sizing: border-box;

  color: #fff;

  text-align: center;

  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;

  z-index: 5;

  text-shadow:
    0 2px 8px rgba(0,0,0,.95);
}

/* =========================
   CONTENIDO INFERIOR
========================= */

.card-content {
  flex: 1;
  padding: 14px 16px 34px;
  background: rgba(255,255,255,.08);
  backdrop-filter: none;
  color: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-content h4 {
  margin: 0 0 6px;
  font-size: .9rem;
  line-height: 1.1;
  font-style: italic;
}

.card-content h5 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 100;
  
}

.card-content p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.3;
  color: var(--color-light);
}

/* =========================
   BOTÓN
========================= */

.card-inner .btn-vermas {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  /*z-index: 20;*/
  transform-style: preserve-3d;
}
/* =========================
   ESTADOS 3D
========================= */

/* TARJETA ACTIVA */
.carousel-item-3d.active {
  transform:
    translateX(0)
    translateZ(180px)
    scale(1);
  z-index: 50;
  opacity: 1;
  isolation: isolate;
}

.carousel-item-3d.active .card-clip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55); /* tu translúcido */    
    z-index: 1;  
}
.carousel-item-3d.active .card-content {
    background: rgba(0,0,0,.14);
    backdrop-filter: blur(10px);
}
/*
.carousel-item-3d:not(.active) {
    z-index: 1; 
}

.carousel-item-3d.active {
    z-index: 10;
}
*/
/* IZQUIERDA 1 */
.carousel-item-3d.left-1 {
  transform:
    translateX(-260px)
    translateZ(0)
    scale(.9);
  /*z-index: 8;*/
  opacity: .9;
}

/* DERECHA 1 */
.carousel-item-3d.right-1 {
  transform:
    translateX(260px)
    translateZ(0)
    scale(.9);
  /*z-index: 8;*/
  opacity: .9;
}

/* IZQUIERDA 2 */
.carousel-item-3d.left-2 {
  transform:
    translateX(-480px)
    translateZ(-120px)
    scale(.8);
  /*z-index: 6;*/
  opacity: 0.8;
}

/* DERECHA 2 */
.carousel-item-3d.right-2 {
  transform:
    translateX(480px)
    translateZ(-120px)
    scale(.8);
  /*z-index: 6;*/
  opacity: 0.8;
}

/* OCULTAS */
.carousel-item-3d.hidden {
  transform:
    translateX(0)
    translateZ(-300px)
    scale(.6);
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   TARJETA ACTIVA
========================================= */

.carousel-item-3d.active .card-content {
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
}

/* Mostrar todo */
.carousel-item-3d.active .card-content h5,
.carousel-item-3d.active .card-content p,
.carousel-item-3d.active .btn-vermas,
.carousel-item-3d.active .card-image-wrapper h3 {
  opacity: 1;
  visibility: visible;
  transition: all .35s ease;
}

/* =========================================
   TARJETAS INACTIVAS
========================================= */

.carousel-item-3d:not(.active) .card-image-wrapper h3,
.carousel-item-3d:not(.active) .card-content h5,
.carousel-item-3d:not(.active) .card-content p,
.carousel-item-3d:not(.active) .btn-vermas {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
}

/* Contenido inferior centrado */
.carousel-item-3d:not(.active) .card-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
  min-height: 70px;
}

/* País centrado */
.carousel-item-3d:not(.active) .card-content h4 {
  margin: 0;
  width: 100%;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  font-style: normal;
}
.carousel-item-3d.active .card-image-wrapper,
.carousel-item-3d.active .card-content {
    position: relative;
    z-index: 2;
}