.stack-container {
  position: relative;
  width: 80%;
  max-width: 900px;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stack-container img {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  transition: transform 0.5s ease, opacity 0.5s ease;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
  -webkit-border-radius: 10px;
  -moz-border-radius: 10px;
  -ms-border-radius: 10px;
  -o-border-radius: 10px;
}

/* Carta activa */
.stack-container img.active {
  transform: translateX(0) scale(1);
  opacity: 1;
  z-index: 3;
  animation: pop 0.35s ease;
  max-width: 40vw;
  max-height: 60vh;
  -webkit-transform: translateX(0) scale(1);
  -moz-transform: translateX(0) scale(1);
  -ms-transform: translateX(0) scale(1);
  -o-transform: translateX(0) scale(1);
  -webkit-animation: pop 0.35s ease;
}
#counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  opacity: 0.7;
}


@keyframes pop {
  0% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
/* Carta siguiente */
.stack-container img.next {
  transform: translateX(60px) scale(0.9);
  opacity: 0.3;
  z-index: 2;
    max-width: 40vw;
  max-height: 60vh;
}

/* Carta anterior */
.stack-container img.prev {
  transform: translateX(-60px) scale(0.9);
  opacity: 0;
  z-index: 2;
    max-width: 40vw;
  max-height: 60vh;
  -webkit-transform: translateX(-60px) scale(0.9);
  -moz-transform: translateX(-60px) scale(0.9);
  -ms-transform: translateX(-60px) scale(0.9);
  -o-transform: translateX(-60px) scale(0.9);
}

/* Cartas ocultas */
.stack-container img.hidden {
  opacity: 0;
  transform: scale(0.8);
  z-index: 1;
}
.img-modal img {
  max-width: 60vw;
  max-height: 60vh;
  object-fit: contain;
  cursor: pointer;
   opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.img-modal img.fade-out {
  opacity: 0;
  transform: scale(0.96);
}
.img-modal .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 35px;
  color: white;
  cursor: pointer;
  z-index: 1000000;
}
.img-modal {
  display: none; /* ← CLAVE */
  position: fixed;
  z-index: 999999;
  inset: 0;
  background: rgba(0,0,0,0.85);
 animation: fadeIn 0.3s ease;
 cursor: zoom-out;
  align-items: center;
  justify-content: center;
}
.nav{
width: 20px;
}
#leftarrow{
  position: absolute;
  max-width: 150px;
  filter: brightness(70%);
  padding: 10px 20px;
  border-radius: 50%;
  font-size: 30px;
  top: 50%;
  left: 20%;
  cursor: pointer;
  background-color: #ccc;
  color: black;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
  -webkit-filter: brightness(70%);
}
#leftarrow:hover{
  filter: brightness(100%);
  -webkit-filter: brightness(100%);
}
#rightarrow{
  position: absolute;
  max-width: 150px;
  filter: brightness(70%);
  top: 50%;
  left: 75%;
  padding: 20px;
  border-radius: 50%;
  padding: 10px 20px;
  font-size: 30px;
   cursor: pointer;
  background-color: #ccc;
  color: black;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
  -webkit-filter: brightness(70%);
}
#rightarrow:hover{
  filter: brightness(100%);
  -webkit-filter: brightness(100%);
}
.thumbs-container {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.6);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  -webkit-transform: translateX(-50%) translateY(20px);
  -moz-transform: translateX(-50%) translateY(20px);
  -ms-transform: translateX(-50%) translateY(20px);
  -o-transform: translateX(-50%) translateY(20px);
}

.thumbs-container.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.thumbs-container img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-transition: all 0.25s ease;
  -moz-transition: all 0.25s ease;
  -ms-transition: all 0.25s ease;
  -o-transition: all 0.25s ease;
}

.thumbs-container img:hover {
  opacity: 0.9;
  transform: scale(1.08);
}

.thumbs-container img.active {
  opacity: 1;
  border: 2px solid #ffc126;
  transform: scale(1.15);
}
 @media (max-width: 768px) {

  .stack-container {
    width: 100%;
    height: 65vh;
  }

  .stack-container img {
    max-width: 95%;
    max-height: 65vh;
  }
.stack-container img.active {
 
  max-width: 90vw;
  max-height: 60vh;
 
}
  #leftarrow,
  #rightarrow {
    display: none; /* 👈 ocultamos flechas en móvil */
  }

  .thumbs-container {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .thumbs-container img {
    width: 48px;
    height: 38px;
  }
}
