/* ========================================
   FAQ BLOCK - ESTILOS CSS
   Basado en diseño Figma
   ======================================== */

/* ========================================
   MAIN BLOCK
   ======================================== */

.faq-block {
    margin: 60px 0;
    padding: 0;
    width: 100%;
}

.faq-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ========================================
   BLOCK HEADER
   ======================================== */

.faq-header {
    text-align: center;
    margin-bottom: 3rem;
}

.faq-title {
    font-family: 'Nunito', sans-serif;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    color: #000000;
    margin: 0 0 1rem 0;
    letter-spacing: -0.8px;
}

.faq-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #6B7280;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   FILTERS
   ======================================== */

.faq-filters {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    align-items: center;
}

.faq-search {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.faq-search-input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    color: #1e1e1e;
    background: #FFFFFF;
    transition: all 0.3s ease;
}

.faq-search-input:focus {
    outline: none;
    border-color: #228800;
    box-shadow: 0 0 0 3px rgba(34, 136, 0, 0.1);
}

.faq-search-input::placeholder {
    color: #9CA3AF;
}

.faq-search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #228800;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.faq-search-button:hover {
    background: #1a6b00;
    transform: translateY(-50%) scale(1.05);
}

.faq-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.faq-category-btn {
    padding: 8px 16px;
    border: 2px solid #E5E5E5;
    border-radius: 25px;
    background: #FFFFFF;
    color: #6B7280;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.faq-category-btn:hover {
    border-color: #228800;
    color: #228800;
    transform: translateY(-1px);
}

.faq-category-btn.active {
    background: #228800;
    border-color: #228800;
    color: #FFFFFF;
}

/* ========================================
   FAQ LIST
   ======================================== */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========================================
   DEFAULT STATE CONTROL
   ======================================== */

/* Estado por defecto: Plegado (collapsed) */
.faq-default-collapsed .faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
}

.faq-default-collapsed .faq-item .faq-icon {
    transform: rotate(0deg);
}


.faq-item {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    outline: none;
}

.faq-item:focus {
    outline: none;
}

.faq-item:focus-visible {
    outline: none;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FFFFFF;
    outline: none;
    border: none;
}

.faq-question:focus {
    outline: none;
    background: #FFFFFF;
}

.faq-question:focus-visible {
    outline: none;
    background: #FFFFFF;
}

.faq-question:active {
    background: #FFFFFF;
    outline: none;
}

.faq-question:focus:not(:focus-visible) {
    background: #FFFFFF;
    outline: none;
}

/* Eliminar cualquier resaltado de foco del navegador */
.faq-question * {
    outline: none !important;
}

.faq-question *:focus {
    outline: none !important;
    background: inherit !important;
}

.faq-question *:focus-visible {
    outline: none !important;
    background: inherit !important;
}

.faq-question:hover {
    /*background: #F8F9FA;*/
}

.faq-question-title {
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1e1e1e;
    margin: 0;
    line-height: 1.4;
    flex: 1;
    padding-right: 16px;
    margin-top: 0 !important;
}

.faq-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color:#000000;
    flex-shrink: 0;
    box-shadow: none;
}

.faq-toggle:hover {
  /*  background: #F0F9F0;
    transform: scale(1.1);*/
    background: none;
    color:#000000;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

/* ========================================
   DEFAULT STATE OVERRIDES
   ======================================== */

/* Estado por defecto: Desplegado (expanded) - Usar la clase active directamente */
.faq-default-expanded .faq-item.active .faq-answer {
    max-height: 500px !important;
    overflow: visible !important;
}

.faq-default-expanded .faq-item.active .faq-icon {
    transform: rotate(180deg) !important;
}

/* Asegurar que funcione con data attribute también */
[data-default-state="expanded"] .faq-item.active .faq-answer {
    max-height: 500px !important;
    overflow: visible !important;
}

[data-default-state="expanded"] .faq-item.active .faq-icon {
    transform: rotate(180deg) !important;
}

.faq-answer-content {
    padding: 0 24px 24px 24px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
}

.faq-answer-content p {
    margin: 0 0 1rem 0;
}

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

.faq-answer-content ul,
.faq-answer-content ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.faq-answer-content li {
    margin-bottom: 0.5rem;
}

/* ========================================
   NO RESULTS
   ======================================== */

.faq-no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: #F8F9FA;
    border-radius: 12px;
    border: 2px dashed #E5E5E5;
}

.faq-no-results p {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

/* ========================================
   LAYOUT VARIATIONS
   ======================================== */

/* List Layout */
.faq-layout-list .faq-item {
    border-radius: 8px;
}

.faq-layout-list .faq-question {
    padding: 20px;
}

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

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

/* Tablet */
@media (max-width: 1200px) {
    .faq-container {
        padding: 0;
    }
    
    .faq-title {
        font-size: 36px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .faq-container {
        padding: 0;
    }
    
    .faq-header {
        margin-bottom: 2rem;
    }
    
    .faq-title {
        font-size: 28px;
    }
    
    .faq-subtitle {
        font-size: 16px;
    }
    
    .faq-filters {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .faq-search {
        max-width: 100%;
    }
    
    .faq-categories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .faq-category-btn {
        flex-shrink: 0;
    }
    
    .faq-question {
        padding: 20px;
    }
    
    .faq-question-title {
        font-size: 16px;
        padding-right: 12px;
        margin-top: 0 !important;
    }
    
    .faq-answer-content {
        padding: 0 20px 20px 20px;
        font-size: 15px;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .faq-container {
        padding: 0;
    }
    
    .faq-title {
        font-size: 24px;
    }
    
    .faq-question {
        padding: 16px;
    }
    
    .faq-question-title {
        font-size: 15px;
        margin-top: 0 !important;
    }
    
    .faq-answer-content {
        padding: 0 16px 16px 16px;
        font-size: 14px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

.faq-item {
    animation: fadeInUp 0.6s ease-out;
}

.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:nth-child(7) { animation-delay: 0.7s; }
.faq-item:nth-child(8) { animation-delay: 0.8s; }
.faq-item:nth-child(9) { animation-delay: 0.9s; }
.faq-item:nth-child(10) { animation-delay: 1.0s; }

/* ========================================
   SEARCH HIGHLIGHTING
   ======================================== */

.faq-highlight {
    background: #FEF3C7;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.faq-toggle:focus {
   /* outline: 2px solid #228800;
    outline-offset: 2px;*/
    background: none;
    color:#000000;
}

.faq-search-input:focus {
    outline: none;
}

.faq-category-btn:focus {
    outline: 2px solid #228800;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
