/* ============================================
          CSS PREGUNTAS FRECUENTES
   ============================================ */

/* Variables CSS para fácil personalización */
:root {
    --faq-primary-color: #4A90E2;
    --faq-secondary-color: #5BA0F2;
    --faq-text-color: #2D3748;
    --faq-text-light: #666;
    --faq-background: #f7fafc;
    --faq-card-background: #ffffff;
    --faq-border-color: rgba(74, 144, 226, 0.1);
    --faq-shadow: 0 10px 30px rgba(74, 144, 226, 0.1);
    --faq-shadow-hover: 0 15px 40px rgba(74, 144, 226, 0.15);
    --faq-border-radius: 16px;
    --faq-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
            CONTENEDOR PRINCIPAL
   ============================================ */

.faq-section {
    padding: 5rem 2rem;
    background: linear-gradient(135deg, var(--faq-background) 0%, #edf2f7 100%);
    position: relative;
    overflow: hidden;
}

.faq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="1" fill="rgba(74,144,226,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(74,144,226,0.05)"/></svg>') repeat;
    background-size: 100px 100px;
    opacity: 0.3;
    z-index: 0;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================
               ENCABEZADO
   ============================================ */

.faq-header {
    text-align: center;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.faq-main-title {
    font-size: 3rem;
    color: var(--faq-primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-shadow: 2px 2px 4px rgba(74, 144, 226, 0.1);
}

.faq-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--faq-primary-color), var(--faq-secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: bounce 2s ease-in-out infinite;
}

.faq-subtitle {
    font-size: 1.2rem;
    color: var(--faq-text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
              ACORDEÓN FAQ
   ============================================ */

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.faq-item {
    background: var(--faq-card-background);
    border-radius: var(--faq-border-radius);
    box-shadow: var(--faq-shadow);
    border: 1px solid var(--faq-border-color);
    overflow: hidden;
    transition: var(--faq-transition);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Animación escalonada para cada item */
.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }
.faq-item:nth-child(6) { animation-delay: 0.6s; }

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--faq-shadow-hover);
}

.faq-item.active {
    border-color: var(--faq-primary-color);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.2);
}

/* ============================================
               PREGUNTA
   ============================================ */

.faq-question {
    width: 100%;
    padding: 1.8rem 2rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--faq-transition);
    position: relative;
    overflow: hidden;
}

.faq-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.05), transparent);
    transition: left 0.5s ease;
}

.faq-question:hover::before {
    left: 100%;
}

.faq-question:focus {
    outline: 2px solid var(--faq-primary-color);
    outline-offset: 2px;
}

.faq-question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--faq-text-color);
    line-height: 1.4;
    padding-right: 2rem;
}

.faq-toggle-icon {
    font-size: 1.8rem;
    color: var(--faq-primary-color);
    font-weight: 300;
    transition: var(--faq-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.1);
    flex-shrink: 0;
}

.faq-item.active .faq-toggle-icon {
    transform: rotate(45deg);
    background: var(--faq-primary-color);
    color: white;
}

/* ============================================
               RESPUESTA
   ============================================ */

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 250, 252, 0.5) 100%);
}

.faq-answer-content {
    padding: 0 2rem 2rem 2rem;
    border-top: 1px solid rgba(74, 144, 226, 0.1);
    margin-top: 0;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer-content {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.1s;
}

.faq-answer-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--faq-text-light);
    margin: 0;
    padding-top: 1.5rem;
}


/* ============================================
               ANIMACIONES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes float {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    33% {
        transform: translateX(20px) translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateX(-15px) translateY(15px) rotate(240deg);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(360deg);
    }
}

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

@media (max-width: 768px) {
    .faq-section {
        padding: 3rem 1rem;
    }

    .faq-main-title {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .faq-icon {
        font-size: 2.5rem;
    }

    .faq-subtitle {
        font-size: 1rem;
    }

    .faq-question {
        padding: 1.5rem 1.5rem;
    }

    .faq-question-text {
        font-size: 1.1rem;
        padding-right: 1rem;
    }

    .faq-toggle-icon {
        font-size: 1.5rem;
        width: 28px;
        height: 28px;
    }

    .faq-answer-content {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }

    .faq-contact-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .faq-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .faq-main-title {
        font-size: 1.8rem;
    }

    .faq-question {
        padding: 1.2rem 1rem;
    }

    .faq-question-text {
        font-size: 1rem;
    }

    .faq-answer-content {
        padding: 0 1rem 1.2rem 1rem;
    }

    .faq-answer-content p {
        font-size: 0.95rem;
    }
}

/* ============================================
             OPTIMIZACIONES
   ============================================ */

/* Para dispositivos con animaciones reducidas */
@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-header{
        animation: none;
        opacity: 1;
        transform: none;
    }

    .faq-question::before {
        transition: none;
    }

    .faq-icon {
        animation: none;
    }

}

/* Optimización de rendimiento */
.faq-section {
    contain: layout style paint;
}

.faq-item {
    will-change: transform;
}

.faq-answer {
    will-change: max-height;
}