/**
 * Estilos para la parte pÃºblica del plugin de Preguntas Frecuentes Flotantes
 */

/* BotÃ³n flotante */
.pf-trigger-button {
	position: relative;
	display: inline-flex;
    cursor: pointer!important;
}

.pf-trigger-button:focus-visible .pf-whatsapp-icon-button {
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.35), 0 6px 12px rgba(0, 0, 0, 0.16);
}

.pf-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.pf-icon {
    font-weight: bold;
    pointer-events: none;
}

/* Contenedor principal */
.pf-container {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: min(350px, calc(100vw - 40px));
    min-height: 0;
    max-height: 80vh;
    background-color: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.pf-container[aria-hidden="false"] {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Cabecera */
.pf-header {
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pf-title {
    flex: 1;
    margin: 0;
    margin-left: 8px;
    font-size: 18px !important;
    text-align: left;
}

.pf-back-button, 
.pf-close-button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    color: #555;
    transition: background-color 0.2s ease;
}

.pf-back-button:hover, 
.pf-close-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.pf-back-button {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.pf-container.show-respuesta .pf-back-button {
    visibility: visible;
    opacity: 1;
}

/* Contenido */
.pf-content {
    flex: 1;
    overflow: visible;
    position: relative;
    height: auto;
}

.pf-preguntas-list,
.pf-respuesta {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    overflow-y: visible;
    transition: transform 0.3s ease;
}

.pf-respuesta {
    position: absolute;
    overflow-y: auto;
    height: 100%;
    transform: translateX(100%);
    padding: 20px;
    padding-bottom: 30px; /* MÃ¡s espacio en la parte inferior de las respuestas */
}

.pf-container.show-respuesta .pf-preguntas-list {
    transform: translateX(-100%);
    position: absolute;
    visibility: hidden;
}

.pf-container.show-respuesta .pf-respuesta {
    transform: translateX(0);
    position: relative;
    height: auto;
    visibility: visible;
}

/* Lista de preguntas */
.pf-preguntas {
    padding-top: 10px;
    margin: 0 20px;
    padding-bottom: 10px; /* AÃ±adir padding inferior para mejor espaciado */
}

.pf-pregunta {
    display: flex;
    margin: 4px 0;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 24px !important;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.pf-pregunta:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.pf-pregunta-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.pf-pregunta-icon {
    float: right;
    font-size: 18px;
    opacity: 0.8;
}

/* Respuesta */
.pf-pregunta-title {
    font-size: 18px !important;
    margin-top: 0;
    margin-bottom: 16px;
}

.pf-respuesta-content {
    line-height: 1.6;
    color: #333;
}

.pf-respuesta-content p, .pf-respuesta-content ul, .pf-respuesta-content ol {
    font-size: 14px;
    margin-bottom: 16px !important;
}

.pf-respuesta-content a {
    color: #0073aa;
    text-decoration: underline;
}

/* BotÃ³n de WhatsApp */
.pf-whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: #25d366 !important;
    color: #ffffff !important;
    font-size: 14px !important;
    border: none;
    border-radius: 24px;
    padding: 12px 20px;
    margin: 32px 20px 16px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.pf-whatsapp-button:hover {
    opacity: 0.9;
}

/* Icono dentro del botÃ³n de WhatsApp */
.pf-whatsapp-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="white"><path d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}


/* Icono de WhatsApp para el botÃ³n flotante */
.pf-whatsapp-icon-button {
	width: 64px;
    height: 64px;
    display: inline-block;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="white"><path d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
    pointer-events: none;
	border-radius: 50%;
    background-color: #25d366 !important; 
    color: #ffffff !important; 
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16);
    z-index: 99999;
    transition: all 0.3s ease;
    outline: none;
}



.pf-trigger-button:hover .pf-whatsapp-icon-button {
 	transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.16);
}


/* Loading */
.pf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

.pf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: pf-spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes pf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos responsive */
@media (max-width: 480px) {
    .pf-container {
        left: 0!important;
        right: 0!important;
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
        min-height: 0; /* Permitir que se ajuste al contenido */
        height: auto;
        max-height: 80vh;
        border-radius: 16px;
        transform:scale(0.9);
    }

    .pf-container[aria-hidden="false"] {
        transform: translateX(-40%) scale(1);
    }
}
