/* Estilos para efectos atractivos con Anime.js */
/* NOTA: Estos estilos se superponen a los existentes sin interferir */

/* Clases específicas para diferentes tipos de animaciones */
.anime-carta {
    transform-origin: center bottom;
}

.anime-gomoso {
    transform-origin: center center;
}

.anime-notificacion {
    transform-origin: top right;
}

/* ====================================
   ESTILOS CUSTOM-BOX
   ==================================== */

.custom-box {
    background-color: #f5f5f7 !important;
    height: 240px;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
    /* Optimizaciones para el efecto sticky scroll */
    position: relative;
    will-change: transform;
    transform-origin: center top;
    backface-visibility: hidden;
}

.number-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f69ac3;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.custom-box h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: #0066cc;
}

.custom-box p {
    color: #444;
    margin: 0;
}

/* ====================================
   EFECTO STICKY SCROLL PARA CUSTOM-BOX
   ==================================== */
.align-items-start.order-2.order-md-2 {
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    /* Ocultar scrollbar */
    -ms-overflow-style: none; /* IE 10+ */
}
.align-items-start.order-2.order-md-2::-webkit-scrollbar {
    width: 0; /* Chrome/Safari/Webkit: esconder scrollbar sin quitar funcionalidad */
    height: 0;
}
.align-items-start.order-2.order-md-2 .custom-box {
    position: sticky;
    /* Each card sticks with its own offset */
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}
/* Stacking effect with offset and fade */
.align-items-start.order-2.order-md-2 .custom-box:nth-child(1) {
    top: 0px;
    z-index: 1;
}
.align-items-start.order-2.order-md-2 .custom-box:nth-child(2) {
    top: 10px;
    z-index: 2;
}
.align-items-start.order-2.order-md-2 .custom-box:nth-child(3) {
    top: 20px;
    z-index: 3;
}
.align-items-start.order-2.order-md-2 .custom-box:nth-child(4) {
    top: 30px;
    z-index: 4;
}
.align-items-start.order-2.order-md-2 .custom-box:nth-child(5) {
    top: 40px;
    z-index: 5;
}

/* Indicador de scroll */
.scroll-indicator {
    display: block;
    text-align: center;
    font-size: 2rem;
    color: #174c3c;
    margin: -20px auto 10px;
    opacity: 0.7;
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ====================================
   EFECTOS FLOTACIÓN SERVICIOS
   ==================================== */

/* Efecto de flotación suave y constante para las tarjetas de servicios */
.floating-card {
    animation: float 6s ease-in-out infinite;
    transform-origin: center center;
    will-change: transform;
}

/* Diferentes delays para cada tarjeta para crear un efecto orgánico */
.floating-card:nth-child(1) {
    animation-delay: 0s;
    animation-duration: 6s;
}

.floating-card:nth-child(2) {
    animation-delay: 1.2s;
    animation-duration: 5.5s;
}

.floating-card:nth-child(3) {
    animation-delay: 2.4s;
    animation-duration: 6.5s;
}

.floating-card:nth-child(4) {
    animation-delay: 3.6s;
    animation-duration: 5.8s;
}

.floating-card:nth-child(5) {
    animation-delay: 4.8s;
    animation-duration: 6.2s;
}

/* Keyframes para el efecto de flotación muy sutil */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(0.5deg);
    }
    50% {
        transform: translateY(-12px) rotate(0deg);
    }
    75% {
        transform: translateY(-6px) rotate(-0.5deg);
    }
}

/* Efecto hover más pronunciado que mantiene la flotación */
.floating-card:hover {
    animation-play-state: paused;
    transform: translateY(-15px) scale(1.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

/* Efecto de respiración para el ícono */
.floating-card .card-icon {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Pausar la respiración del ícono en hover */
.floating-card:hover .card-icon {
    animation-play-state: paused;
    transform: scale(1.15);
}

/* Reducir movimiento para usuarios que prefieren menos animación */
@media (prefers-reduced-motion: reduce) {
    .floating-card {
        animation: gentle-float 8s ease-in-out infinite;
    }
    
    @keyframes gentle-float {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-3px);
        }
    }
    
    .floating-card .card-icon {
        animation: none;
    }
}

/* ====================================
   EFECTOS ADICIONALES PARA SERVICIOS
   ==================================== */

/* Efecto de entrada y flotación para tarjetas superpuestas */
.floating-card {
    opacity: 0;
    animation: floatIn 0.8s ease-out forwards, floatCollage 7s ease-in-out infinite;
}

/* Delays específicos para cada tarjeta por color */
.card-orange {
    animation-delay: 0.1s, 0.8s;
    animation-duration: 0.8s, 6.5s;
}

.card-green {
    animation-delay: 0.3s, 1.0s;
    animation-duration: 0.8s, 7.2s;
}

.card-pink {
    animation-delay: 0.5s, 1.2s;
    animation-duration: 0.8s, 6.8s;
}

.card-blue {
    animation-delay: 0.7s, 1.4s;
    animation-duration: 0.8s, 7.5s;
}

.card-purple {
    animation-delay: 0.9s, 1.6s;
    animation-duration: 0.8s, 6.2s;
}

/* Flotación sutil específica para collage */
@keyframes floatCollage {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    20% {
        transform: translateY(-3px) rotate(0.5deg);
    }
    40% {
        transform: translateY(-6px) rotate(-0.2deg);
    }
    60% {
        transform: translateY(-4px) rotate(0.3deg);
    }
    80% {
        transform: translateY(-8px) rotate(-0.1deg);
    }
}

@keyframes floatCollageCenter {
    0%, 100% {
        transform: translateX(-50%) translateY(0px) rotate(0deg);
    }
    20% {
        transform: translateX(-50%) translateY(-3px) rotate(0.3deg);
    }
    40% {
        transform: translateX(-50%) translateY(-6px) rotate(-0.2deg);
    }
    60% {
        transform: translateX(-50%) translateY(-4px) rotate(0.4deg);
    }
    80% {
        transform: translateX(-50%) translateY(-8px) rotate(-0.1deg);
    }
}

@keyframes floatIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reducir movimiento para usuarios que prefieren menos animación */
@media (prefers-reduced-motion: reduce) {
    .floating-card {
        animation: floatIn 0.8s ease-out forwards, floatGentle 8s ease-in-out infinite;
    }
    
    @keyframes floatGentle {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-2px);
        }
    }
    
    .card-purple {
        animation-name: floatIn, floatGentleCenter;
    }
    
    @keyframes floatGentleCenter {
        0%, 100% {
            transform: translateX(-50%) translateY(0px);
        }
        50% {
            transform: translateX(-50%) translateY(-2px);
        }
    }
}

.scroll-tren {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* IE/Edge */
  /* Añadir espacio adicional para completar el scroll de todas las cajas */
  padding-bottom: 500px;
}

.scroll-tren::-webkit-scrollbar {
  display: none;                 /* Chrome/Safari */
}

/* ====================================
   ACORDEÓN FAQ - DISEÑO HERMOSO
   ==================================== */

/* Selectores para tipos específicos de bloques */
#faq-back {
    height: 640px; /* Altura personalizada para el bloque de faq */
}

.faq-accordion {
    position: fixed;
    bottom: 15px;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    transform: translateY(calc(100% - 80px)); /* Solo muestra el título */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    max-height: 80vh;
    overflow: hidden;
    /* Solo mostrar en el .back activo */
    display: none;
}

/* Mostrar solo cuando el bloque esté en .back */
.bloque.active .faq-accordion {
    display: block;
}

/* Título del cajón */
.faq-floating-title {
    padding: 20px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.9), rgba(0, 95, 206, 0.9));
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border-radius: 20px 20px 0 0;
    position: relative;
    z-index: 10;
}

.faq-floating-title:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 1), rgba(0, 95, 206, 1));
}

.faq-floating-title .faq-title {
    margin: 0;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.faq-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.faq-indicator i {
    color: white;
    font-size: 20px;
    transition: transform 0.3s ease;
}

/* Contenido del acordeón */
.faq-content {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
}

/* Estado expandido - cajón completamente arriba */
.faq-accordion.expanded {
    transform: translateY(0);
}

.faq-accordion.expanded .faq-indicator i {
    transform: rotate(180deg);
}

.faq-accordion.expanded .faq-floating-title {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.9), rgba(48, 161, 78, 0.9));
}

.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.accordion-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.accordion-item.active {
    border-color: #007AFF;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.15);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
}

.accordion-header:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05), rgba(0, 122, 255, 0.02));
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    padding-right: 20px;
    line-height: 1.4;
}

.accordion-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007AFF, #0056D6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.accordion-icon i {
    color: white;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
    background: linear-gradient(135deg, #34C759, #30A14E);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-content {
    max-height: 300px;
}

.accordion-body {
    padding: 0 24px 24px 24px;
    background: rgba(255, 255, 255, 0.5);
}

.accordion-body p {
    margin: 0;
    padding: 20px 24px;
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividad */
@media (max-width: 768px) {
    .faq-accordion {
        transform: translateY(calc(100% - 70px));
        max-height: 85vh;
    }
    
    .faq-floating-title {
        padding: 16px;
    }
    
    .faq-floating-title .faq-title {
        font-size: 1.1rem;
    }
    
    .faq-indicator {
        width: 28px;
        height: 28px;
    }
    
    .faq-indicator i {
        font-size: 16px;
    }
    
    .faq-content {
        padding: 16px;
        max-height: calc(85vh - 70px);
    }
    
    .accordion-header {
        padding: 16px 20px;
    }
    
    .accordion-header h3 {
        font-size: 1rem;
        padding-right: 16px;
    }
    
    .accordion-icon {
        width: 28px;
        height: 28px;
    }
    
    .accordion-icon i {
        font-size: 14px;
    }
    
    .accordion-body {
        padding: 0 20px 20px 20px;
    }
    
    .accordion-body p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .faq-accordion {
        transform: translateY(calc(100% - 60px));
        max-height: 90vh;
    }
    
    .faq-floating-title {
        padding: 12px;
    }
    
    .faq-floating-title .faq-title {
        font-size: 1rem;
    }
    
    .faq-content {
        padding: 12px;
        max-height: calc(90vh - 60px);
    }
    
    .accordion-header {
        padding: 14px 16px;
    }
    
    .accordion-header h3 {
        font-size: 0.95rem;
    }
    
    .accordion-body {
        padding: 0 16px 16px 16px;
    }
}
