/* ============================================ */
/* STACKED CARDS - ESTRUCTURA BASE               */
/* ============================================ */

.home #main {
  padding-left: 10px!important;
  padding-right: 10px!important;
}

#hero {
  transition: opacity 0.1s ease-out;
}

.stacked-cards-section {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
}

.stacked-cards-sticky {
  position: sticky;
  top: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  box-sizing: border-box;
}

.stacked-cards-wrapper {
  position: relative;
  width: 100%;
  height: 90vh;
  margin: 0 auto;
}

#stackedCardsSection .card-stack {
  position: relative;
  width: 100%;
  height: 100%;
  margin-left: 30px;
  bottom: -10px;
}

/* ============================================ */
/* CARDS CLONADAS - ESTILOS BASE                 */
/* ============================================ */

.stack-card-cloned {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  will-change: transform;
  transform-origin: top center;
  box-shadow: none;
}

.stack-card-cloned .stack-card-inner-wrap  {
  width: 100%;
}

.stack-card-cloned .stack-card-inner-wrap > .fusion-row {
  height: 100%;
}

.stack-card-cloned .fusion-builder-row,
.stack-card-cloned .fusion-row {
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.stack-card-cloned .fusion-fullwidth {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ============================================ */
/* COLORES DE FONDO POR CARD                     */
/* ============================================ */

/* Colores de fondo: descomenta y ajusta según necesites
.stack-card-cloned:nth-child(1) { background: #C4C9A4; }
.stack-card-cloned:nth-child(2) { background: #E8C4C4; }
.stack-card-cloned:nth-child(3) { background: #E8D5A5; }
.stack-card-cloned:nth-child(4) { background: #A8D8EA; }
*/

/* ============================================ */
/* ÍNDICE LATERAL - POSICIÓN FIJA                */
/* ============================================ */

.stack-card > .fusion-builder-row  {
  align-content: flex-start;
}

.stacked-cards-nav {
  position: fixed;
  /* ✅ Ajustado para max-width 1500px: 88vw de 1500px = 1320px, min(1320, 1500) = 1320 */
  /* (100vw - 1320px) / 2 + 44px */
  right: max(calc((100vw - min(94vw, 1500px)) / 2 + 0px), 15px);
  top: 50%;
  transform: translateY(-18%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 100;
}

/* ✅ Ajuste adicional para pantallas muy grandes (≥ 1500px) */
@media (min-width: 1500px) {
  .stacked-cards-nav {
    right: max(calc((100vw - 1500px) / 2 + 15px), 15px);
  }
}

.stacked-cards-nav-btn {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid #413b47;
  background: transparent;
  color: #413b47;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.stacked-cards-nav-btn:not(:first-child) {
  padding-left: 7px;
}

.stacked-cards-nav-btn:hover {
  border-color: rgba(0, 0, 0, 0.5);
  color: rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.03);
}

.stacked-cards-nav-btn.active {
  background: #413b47;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Botón ir arriba */
.stacked-cards-nav-top .top-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.3s ease;
}

.stacked-cards-nav-top:hover .top-dot {
  transform: scale(1.4);
}

.stacked-cards-nav-separator {
  width: 20px;
  height: 1px;
  background: rgba(0, 0, 0, 0.15);
  margin: 4px 0;
}

.stacked-cards-nav-top.visible {
  opacity: 1;
}

.stacked-cards-nav-top.active {
  background: #413b47;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.card_back_text {opacity: 0; transition: all 0.2s;}
.card_back:hover .card_back_text {opacity: 1;}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

/* Tablets grandes (800px - 1024px) */
@media (max-width: 1024px) {
  .stacked-cards-wrapper {
    width: 100%!important;
    height: 85vh;
  }

  /* El índice desaparece */
  .stacked-cards-nav {
    display: none;
  }
}

/* Móviles y tablets (800px hacia abajo) */
@media (max-width: 800px) {
  .stacked-cards-sticky {
    padding-top: 4vh;
  }

  .stacked-cards-wrapper {
    height: 88vh;
  }
}

/* Móviles (480px - 768px) */
@media (max-width: 768px) {
  .stacked-cards-sticky {
    padding-top: 3vh;
  }

  .stacked-cards-wrapper {
    height: 90vh;
  }
}

/* Móviles pequeños (< 480px) */
@media (max-width: 480px) {
  .stacked-cards-wrapper {
    height: 92vh;
  }
}
