.pl-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.pl-gallery__item { margin: 0; }
.pl-gallery__image { display: block; width: 100%; height: auto; border-radius: 8px; }
.pl-gallery__caption { margin-top: 6px; font-size: 12px; color: #555; }

/* ===== DECK CARRUSEL 3-TARJETAS ===== */
/* Carrusel 3-tarjetas superpuestas (izquierda arriba y más separada, sin sombras) */
#deck1.deck-carousel{
  position:relative;
  width:100%;
  max-width:1100px;
  margin:60px auto;
}

/* Altura del carrusel */
#deck1 .deck{
  position:relative;
  width:100%;
  height:clamp(280px, 50vw, 600px);
}

/* Tarjetas sin sombras ni bordes */
#deck1 .card{
  position:absolute;
  left:50%;
  top:50%;
  width:clamp(240px, 50%, 560px);
  aspect-ratio: 1 / 1;
  transform:translate(-50%,-50%);
  border-radius:20px;
  overflow:hidden;
  transition:transform .6s ease, opacity .6s ease, z-index .6s ease;
  background:#eee;
}
#deck1 .card img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* POSICIONES — izquierda más separada y encima */
#deck1 .card.left{
  transform:translate(-145%,-50%) rotate(-6deg) scale(1.05);
  z-index:4;
  opacity:1;
}
#deck1 .card.center{
  transform:translate(-50%,-58%) rotate(1.5deg) scale(1.0);
  z-index:3;
  opacity:0.98;
}
#deck1 .card.right{
  transform:translate(35%,-50%) rotate(6deg) scale(0.96);
  z-index:2;
  opacity:0.9;
}

/* Estados de salida */
#deck1 .card.off-left{
  transform:translate(-190%,-50%) rotate(-10deg);
  opacity:0;
  z-index:0;
}
#deck1 .card.off-right{
  transform:translate(90%,-50%) rotate(10deg);
  opacity:0;
  z-index:0;
}

/* Controles */
#deck1 .deck-controls{
  position:absolute;
  left:50%;
  bottom:10px;
  transform:translateX(-50%);
  display:flex;
  gap:16px;
  z-index:50;
}
#deck1 .deck-controls button{
  background:none;
  border:none;
  padding:0;
  cursor:pointer;
}
#deck1 .deck-controls img{
  width:44px;
  height:44px;
  display:block;
  transition:transform .2s ease;
}
#deck1 .deck-controls button:hover img{ transform:scale(1.1); }

/* Responsive */
@media (max-width:1024px){
  #deck1 .card{ width:62%; }
  #deck1 .card.left{  transform:translate(-155%,-50%) rotate(-5deg) scale(1.04); }
  #deck1 .card.right{ transform:translate(45%,-50%)  rotate(5deg)  scale(0.95); }
}
@media (max-width:768px){
  #deck1 .card{ width:82%; }
  #deck1 .deck-controls img{ width:34px; height:34px; }
}

/* ===== CARRUSEL CUADRADO APILADO ===== */
/* Base */
#stack1.sc-carousel {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

#stack1 .sc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  top: 30px;
}

#stack1 .sc-slide {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  overflow: hidden;
  transition: transform .45s ease, opacity .45s ease;
}

#stack1 .sc-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}

/* ===== Posiciones apiladas ===== */
#stack1 .is-front { z-index: 30; transform: translate(0,0) scale(1); opacity: 1; }
#stack1 .is-b1    { z-index: 20; transform: translate(-14px, 18px) scale(.965); opacity: 1; }
#stack1 .is-b2    { z-index: 10; transform: translate( 14px, 32px) scale(.93); opacity: 1; }
#stack1 .is-rest  { z-index: 0; opacity: 0; pointer-events: none; transform: scale(.9); }

/* ===== Flechas ===== */
#stack1 .sc-nav {
  position: absolute;
  bottom: -50px; /* un poco más abajo */
  width: 42px; 
  height: 42px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 100;
  display: grid;
  place-items: center;
}

#stack1 .sc-icon {
  width: 36px;
  height: 36px;
  display: block;
}

#stack1 .sc-prev { left: 50%; transform: translateX(calc(-50% - 40px)); }
#stack1 .sc-next { left: 50%; transform: translateX(calc(-50% + 40px)); }

/* ===== Responsive ===== */
@media (max-width: 767px) {
  #stack1.sc-carousel { max-width: 100%; }
  #stack1 .sc-stage { top: 0; }
  #stack1 .is-b1 { transform: translate(-8px, 10px) scale(.97); }
  #stack1 .is-b2 { transform: translate( 8px, 18px) scale(.94); }
  #stack1 .sc-nav { bottom: 20px; width: 36px; height: 36px; }
  #stack1 .sc-icon { width: 30px; height: 30px; }
  #stack1 .sc-prev { transform: translateX(calc(-50% - 34px)); }
  #stack1 .sc-next { transform: translateX(calc(-50% + 34px)); }
}

/* Fallback por si el navegador no soporta aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
  #stack1 .sc-stage { position: relative; height: auto; }
  #stack1 .sc-stage::before {
    content: ""; 
    display: block; 
    padding-top: 100%;
  }
  #stack1 .sc-slide { position: absolute; inset: 0; }
}

/* Fallback por si el navegador no soporta aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
  .sc-stage { position: relative; height: auto; }
  .sc-stage::before {
    content: ""; 
    display: block; 
    padding-top: 100%;
  }
  .sc-slide { position: absolute; inset: 0; }
}
