/* Container principal */
.preguntas-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.preguntas-header {
    margin-bottom: 3rem;
    text-align: center;
}

.preguntas-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.preguntas-descripcion {
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.preguntas-descripcion p {
    margin: 0;
}

/* Buscador */
.preguntas-busqueda {
    margin-bottom: 2rem;
    position: relative;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.search-box input {
    flex: 1;
    padding: 1rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-box button {
    padding: 1rem 1.5rem;
    border: none;
    background: #6b747c;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #17773f;
}

#resultadosBusquedaFaq {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 1rem;
    display: none;
    z-index: 1000;
}

#resultadosBusquedaFaq.visible {
    display: block;
}

.resultados-info {
    padding: 0.75rem;
    background: #bed4c8;
    color: #1e6e39;
    border-radius: 4px;
    font-size: 0.95rem;
    text-align: center;
}

.sin-resultados {
    padding: 1rem;
    text-align: center;
    color: #666;
}

/* Resumen */
.preguntas-resumen {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.preguntas-resumen p {
    margin: 0;
    color: #666;
}

/* Lista de preguntas (Accordion) */
.preguntas-lista {
    margin-bottom: 2rem;
}

.pregunta-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.pregunta-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pregunta-item.abierta {
    border-color: #6b747c;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.pregunta-item.highlight {
    animation: highlight 2s ease-in-out;
}

@keyframes highlight {
    0%, 100% { background: white; }
    25%, 75% { background: #fff3cd; }
}

/* Cabecera de pregunta (clickeable) */
.pregunta-cabecera {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.pregunta-cabecera:hover {
    background: #f8f9fa;
}

.pregunta-item.abierta .pregunta-cabecera {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.pregunta-cabecera:focus {
    outline: 2px solid #6b747c;
    outline-offset: -2px;
}

.pregunta-numero {
    font-weight: bold;
    color: #6b747c;
    font-size: 1.1rem;
    min-width: 2rem;
}

.pregunta-titulo {
    flex: 1;
    margin: 0;
    font-size: 1.15rem;
    color: #333;
    font-weight: 600;
}

.pregunta-icono {
    flex-shrink: 0;
    color: #6b747c;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Respuesta (collapsible) */
.pregunta-respuesta {
    padding: 1.5rem;
    color: #444;
    line-height: 1.7;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

.pregunta-respuesta-contenido {
    margin-bottom: 1rem;
}

.pregunta-respuesta-contenido p {
    margin-bottom: 1rem;
}

.pregunta-respuesta-contenido p:last-child {
    margin-bottom: 0;
}

.pregunta-respuesta-contenido ul,
.pregunta-respuesta-contenido ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.pregunta-link {
    display: inline-block;
    color: #6b747c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    margin-top: 0.5rem;
}

.pregunta-link:hover {
    color: #407a53;
    text-decoration: underline;
}

/* Acciones (Expandir/Colapsar todo) */
.preguntas-acciones {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-accion {
    padding: 0.75rem 1.5rem;
    background: #6b747c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-weight: 500;
}

.btn-accion:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-accion:active {
    transform: translateY(0);
}

/* Botón volver arriba */
.btn-volver-arriba {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #6b747c;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-volver-arriba.visible {
    opacity: 1;
    visibility: visible;
}

.btn-volver-arriba:hover {
    background: #0056b3;
}

/* Estado vacío */
.preguntas-vacio {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.preguntas-vacio p {
    margin: 0;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .preguntas-container {
        padding: 1rem;
    }

    .preguntas-header h1 {
        font-size: 2rem;
    }

    .preguntas-descripcion {
        font-size: 1rem;
    }

    .pregunta-cabecera {
        padding: 1rem;
        gap: 0.75rem;
    }

    .pregunta-numero {
        font-size: 1rem;
        min-width: 1.5rem;
    }

    .pregunta-titulo {
        font-size: 1rem;
    }

    .pregunta-respuesta {
        padding: 1rem;
    }

    .preguntas-acciones {
        flex-direction: column;
    }

    .btn-accion {
        width: 100%;
    }

    .btn-volver-arriba {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    .search-box {
        max-width: 100%;
    }

    #resultadosBusquedaFaq {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .preguntas-header h1 {
        font-size: 1.75rem;
    }

    .pregunta-cabecera {
        gap: 0.5rem;
    }

    .pregunta-titulo {
        font-size: 0.95rem;
    }
}

a {
    color: #6b747c;
    text-decoration: none;
    transition: color 0.3s;
}