/* FAQ Widget Styles v1.0.0 */

/* Reset básico para el widget */
.faq-main-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.faq-main-container {
    font-family: 'Roboto', sans-serif;
    color: #333;
    margin-top: 40px;
    margin-bottom: 60px;
}

/* === ESTILOS COMPARTIDOS === */

.faq-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.faq-widget-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #333;
}

.faq-category-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === MODO EXPANDIDO === */

.header-placeholder {
    display: none;
    height: 80px;
}

.header-placeholder.active {
    display: block;
}

.faq-header-sticky {
    background: white;
    z-index: 100;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.faq-header-sticky.fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

.faq-tabs-wrapper {
    position: relative;
    overflow: hidden;
    background: white;
    padding: 10px 0;
}

.faq-tabs-container {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.faq-tabs-container::-webkit-scrollbar {
    display: none;
}

.faq-tabs {
    display: flex;
    gap: 12px;
    white-space: nowrap;
    padding: 0 20px;
    min-width: min-content;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: fit-content;
    user-select: none;
}

.faq-tab:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.faq-tab.active {
    background: #333 !important;
    border-color: #333 !important;
    color: white !important;
}

.faq-tab .count,
.faq-tab-simple .count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    display: inline-block;
}

.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.scroll-indicator.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-indicator:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.1);
}

.scroll-left {
    left: 10px;
}

.scroll-right {
    right: 10px;
}

.fade-left, .fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-left {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.9), transparent);
}

.fade-right {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
}

.fade-left.visible, .fade-right.visible {
    opacity: 1;
}

/* Preguntas expandidas */
.faq-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.faq-question {
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    line-height: 1.4;
}

.faq-answer {
    padding: 20px;
    background: white;
}

.faq-answer p {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

/* === MODO ACORDEÓN === */

.faq-tabs-simple {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: #f8f9fa;
    border-radius: 10px;
}

.faq-tabs-simple .faq-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 0;
}

.faq-tab-simple {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
    outline: none;
}

.faq-tab-simple:hover {
    background: #f0f0f0;
    border-color: #333;
}

.faq-tab-simple.active {
    background: #333;
    border-color: #333;
    color: white;
}

.faq-tab-simple.active .count {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Items del acordeón */
.faq-accordion-mode .faq-category-section {
    display: none;
}

.faq-accordion-mode .faq-category-section:first-child {
    display: block;
}

.faq-item-accordion {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
}

.faq-item-accordion:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.faq-item-accordion.active {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.faq-question-accordion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.faq-question-accordion:hover {
    background: #e9ecef;
}

.faq-item-accordion.active .faq-question-accordion {
    background: #333;
    color: white;
}

.faq-question-accordion h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
    padding-right: 20px;
}

.faq-toggle-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.faq-item-accordion.active .faq-toggle-icon {
    background: rgba(255,255,255,0.2);
    transform: rotate(180deg);
}

.faq-toggle-icon i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.faq-item-accordion.active .faq-toggle-icon i {
    color: white;
}

.faq-answer-accordion {
    display: none;
    border-top: 1px solid #e9ecef;
}

.faq-answer-content {
    padding: 20px;
}

.faq-answer-content p {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
    margin: 0;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .faq-container {
        padding: 0 10px;
    }
    
    .faq-widget-title {
        font-size: 24px;
    }
    
    .faq-category-title {
        font-size: 20px;
    }
    
    .faq-tab,
    .faq-tab-simple {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .faq-question,
    .faq-question-accordion h3 {
        font-size: 15px;
        padding: 15px;
    }
    
    .faq-answer,
    .faq-answer-content {
        padding: 15px;
    }
    
    .scroll-indicator {
        width: 35px;
        height: 35px;
    }
    
    .header-placeholder.active {
        height: 70px;
    }
    
    /* Tabs simples en móvil */
    .faq-tabs-simple .faq-tabs {
        flex-direction: column;
        align-items: stretch;
        padding: 0 20px;
    }
    
    .faq-tab-simple {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .faq-main-container {
        margin-top: 20px;
        margin-bottom: 40px;
    }
    
    .faq-widget-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* === ANIMACIONES === */

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

.faq-category-section {
    animation: fadeIn 0.5s ease;
}

/* === MODO PRINT === */

@media print {
    .faq-header-sticky,
    .faq-tabs-simple,
    .scroll-indicator,
    .fade-left,
    .fade-right {
        display: none !important;
    }
    
    .faq-item-accordion .faq-answer-accordion {
        display: block !important;
    }
    
    .faq-toggle-icon {
        display: none !important;
    }
}

/* === FORMATO DE CONTENIDO === */

.faq-answer p,
.faq-answer-content p {
    color: #555;
    line-height: 1.8;
    font-size: 15px;
    margin: 0 0 15px 0;
}

.faq-answer p:last-child,
.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.faq-answer strong,
.faq-answer-content strong {
    color: #333;
    font-weight: 600;
}

.faq-answer ul,
.faq-answer ol,
.faq-answer-content ul,
.faq-answer-content ol {
    margin: 15px 0;
    padding-left: 25px;
    color: #555;
}

.faq-answer li,
.faq-answer-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.faq-answer ul li,
.faq-answer-content ul li {
    list-style-type: disc;
}

.faq-answer ol li,
.faq-answer-content ol li {
    list-style-type: decimal;
}

/* Bullets personalizados */
.faq-answer ul li::marker,
.faq-answer-content ul li::marker {
    color: #0073aa;
}

/* Espaciado entre elementos */
.faq-answer > *:first-child,
.faq-answer-content > *:first-child {
    margin-top: 0;
}

.faq-answer > *:last-child,
.faq-answer-content > *:last-child {
    margin-bottom: 0;
}

/* Mejoras para listas anidadas */
.faq-answer ul ul,
.faq-answer ol ol,
.faq-answer ul ol,
.faq-answer ol ul,
.faq-answer-content ul ul,
.faq-answer-content ol ol,
.faq-answer-content ul ol,
.faq-answer-content ol ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Estilo para c��digo inline si lo usas */
.faq-answer code,
.faq-answer-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Mejorar legibilidad en m��viles */
@media (max-width: 768px) {
    .faq-answer p,
    .faq-answer-content p {
        font-size: 14px;
        line-height: 1.7;
    }
    
    .faq-answer ul,
    .faq-answer ol,
    .faq-answer-content ul,
    .faq-answer-content ol {
        padding-left: 20px;
    }
}

/* === ESTILOS PARA IMÁGENES FAQ === */
.faq-image-container {
    margin: 15px 0;
    text-align: center;
}

.faq-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.faq-image:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .faq-image-container {
        margin: 10px 0;
    }
    
    .faq-image {
        border-radius: 6px;
    }
}

