/**
 * FAQ Accordion Component
 * Reusable across: Homepage, Category, Product Page, FAQ page
 * 
 * @package Digidaad_Theme
 * @since 2.6.0
 */

/* ============================================
 * FAQ SECTION CONTAINER
 * ============================================ */
.sv-faq-section {
    padding: var(--sv-space-16) 0;
    background: var(--sv-color-warm);
}

.sv-faq-section--white {
    background: var(--sv-color-white);
}

.sv-faq-section--gray {
    background: var(--sv-color-gray-50);
}

.sv-faq-section__header {
    text-align: center;
    margin-bottom: var(--sv-space-10);
}

/* ============================================
 * FAQ LIST CONTAINER
 * ============================================ */
.sv-faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--sv-space-4);
}

.sv-faq-list--full {
    max-width: none;
}

/* ============================================
 * FAQ ITEM (Accordion)
 * ============================================ */
.sv-faq-item {
    background: var(--sv-color-white);
    border-radius: var(--sv-radius-xl);
    border: 1px solid var(--sv-color-gray-100);
    overflow: hidden;
    transition: all var(--sv-transition);
}

.sv-faq-item:hover {
    border-color: var(--sv-color-gray-200);
}

.sv-faq-item.is-active{
    border-color: var(--sv-color-accent-light);
    box-shadow: var(--sv-shadow-md);
}

/* Question Header (Clickable) */
.sv-faq-item__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sv-space-4);
    width: 100%;
    padding: var(--sv-space-5) var(--sv-space-6);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--sv-font-family);
}

.sv-faq-item__question-text {
    font-size: var(--sv-font-size-base);
    font-weight: 600;
    color: var(--sv-color-gray-900);
    line-height: 1.4;
}

@media (min-width: 768px) {
    .sv-faq-item__question-text {
        font-size: var(--sv-font-size-lg);
    }
}

.sv-faq-item__icon {
    width: 32px;
    height: 32px;
    background: var(--sv-color-gray-100);
    border-radius: var(--sv-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sv-color-gray-500);
    flex-shrink: 0;
    transition: all var(--sv-transition);
}

.sv-faq-item__icon svg {
    width: 16px;
    height: 16px;
    transition: transform var(--sv-transition);
}

.sv-faq-item:hover .sv-faq-item__icon {
    background: var(--sv-color-accent-light);
    color: var(--sv-color-accent);
}

.sv-faq-item.is-active .sv-faq-item__icon{
    background: var(--sv-color-accent);
    color: var(--sv-color-white);
}

.sv-faq-item.is-active .sv-faq-item__icon svg{
    transform: rotate(180deg);
}

/* Answer Content */
.sv-faq-item__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sv-faq-item.is-active .sv-faq-item__answer{
    max-height: 500px;
}

.sv-faq-item__answer-inner {
    padding: 0 var(--sv-space-6) var(--sv-space-5);
}

.sv-faq-item__answer-text {
    font-size: var(--sv-font-size-base);
    color: var(--sv-color-gray-600);
    line-height: 1.7;
}

.sv-faq-item__answer-text p {
    margin-bottom: var(--sv-space-4);
}

.sv-faq-item__answer-text p:last-child {
    margin-bottom: 0;
}

.sv-faq-item__answer-text a {
    color: var(--sv-color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sv-faq-item__answer-text a:hover {
    color: var(--sv-color-accent-hover);
}

.sv-faq-item__answer-text ul,
.sv-faq-item__answer-text ol {
    margin: var(--sv-space-3) 0;
    padding-left: var(--sv-space-6);
}

.sv-faq-item__answer-text li {
    margin-bottom: var(--sv-space-2);
    list-style: disc;
}

.sv-faq-item__answer-text ol li {
    list-style: decimal;
}

/* ============================================
 * FAQ HELP BLOCK (CTA at bottom)
 * ============================================ */
.sv-faq__help-block {
    margin-top: var(--sv-space-8);
    padding: var(--sv-space-6);
    background: linear-gradient(135deg, var(--sv-color-accent-lighter) 0%, var(--sv-color-white) 100%);
    border: 2px solid var(--sv-color-accent-light);
    border-radius: var(--sv-radius-2xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sv-space-4);
}

@media (min-width: 640px) {
    .sv-faq__help-block {
        flex-direction: row;
        text-align: left;
    }
}

.sv-faq__help-icon {
    width: 56px;
    height: 56px;
    background: var(--sv-color-accent);
    border-radius: var(--sv-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sv-color-white);
    flex-shrink: 0;
}

.sv-faq__help-icon svg {
    width: 28px;
    height: 28px;
}

.sv-faq__help-content {
    flex: 1;
}

.sv-faq__help-title {
    font-size: var(--sv-font-size-lg);
    font-weight: 700;
    color: var(--sv-color-gray-900);
    margin-bottom: var(--sv-space-1);
}

.sv-faq__help-text {
    font-size: var(--sv-font-size-sm);
    color: var(--sv-color-gray-600);
}

.sv-faq__help-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sv-space-2);
    padding: var(--sv-space-3) var(--sv-space-5);
    background: var(--sv-color-accent);
    color: var(--sv-color-white);
    font-size: var(--sv-font-size-sm);
    font-weight: 700;
    border-radius: var(--sv-radius-lg);
    text-decoration: none;
    transition: all var(--sv-transition);
    flex-shrink: 0;
}

.sv-faq__help-link:hover {
    background: var(--sv-color-accent-hover);
}

.sv-faq__help-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
 * FAQ - Dark variant (for dark backgrounds)
 * ============================================ */
.sv-faq-section--dark {
    background: var(--sv-color-gray-900);
}

.sv-faq-section--dark .sv-section-label {
    background: var(--sv-color-white);
    color: var(--sv-color-gray-900);
}

.sv-faq-section--dark .sv-section-title {
    color: var(--sv-color-white);
}

.sv-faq-section--dark .sv-faq-item {
    background: var(--sv-color-gray-800);
    border-color: var(--sv-color-gray-700);
}

.sv-faq-section--dark .sv-faq-item__question-text {
    color: var(--sv-color-white);
}

.sv-faq-section--dark .sv-faq-item__answer-text {
    color: var(--sv-color-gray-300);
}
