/**
 * TW FAQ Widget Styles
 */

.tw-faq {
    width: 100%;
}

/* Item */
.tw-faq-item {
    overflow: hidden;
}

/* Question button */
.tw-faq-question {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    gap: 15px;
    margin: 0;
    font-family: inherit;
}

.tw-faq-question:focus {
    outline: none;
}

.tw-faq-question:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.tw-faq-question-text {
    flex: 1;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.4;
}

/* Icon position */
.tw-faq--icon-right .tw-faq-question {
    flex-direction: row;
}

.tw-faq--icon-left .tw-faq-question {
    flex-direction: row;
}

/* Icon */
.tw-faq-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, color 0.2s ease;
}

.tw-faq-icon svg {
    display: block;
    transition: transform 0.3s ease;
}

/* Plus/Minus icon */
.tw-faq-icon-plus {
    position: relative;
    width: 1em;
    height: 1em;
}

.tw-faq-icon-plus::before,
.tw-faq-icon-plus::after {
    content: '';
    position: absolute;
    background-color: currentColor;
    transition: transform 0.3s ease;
}

.tw-faq-icon-plus::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.tw-faq-icon-plus::after {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.tw-faq-item.is-open .tw-faq-icon-plus::after {
    transform: translateX(-50%) rotate(90deg);
    opacity: 0;
}

/* Arrow icon rotation */
.tw-faq-item.is-open .tw-faq-icon--arrow svg {
    transform: rotate(180deg);
}

/* Chevron icon rotation */
.tw-faq-item.is-open .tw-faq-icon--chevron svg {
    transform: rotate(180deg);
}

/* Answer */
.tw-faq-answer {
    overflow: hidden;
    transition: height 0.3s ease;
}

.tw-faq-answer[hidden] {
    display: block;
    height: 0;
    visibility: hidden;
}

.tw-faq-answer-inner {
    line-height: 1.6;
}

.tw-faq-answer-inner p:first-child {
    margin-top: 0;
}

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

/* Border variant */
.tw-faq--border .tw-faq-answer {
    border-top: 1px solid #e5e7eb;
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
    .tw-faq-answer {
        transition: height 0.3s ease, visibility 0.3s ease;
    }
}

/* Responsive */
@media (max-width: 767px) {
    .tw-faq-question {
        padding: 15px !important;
    }

    .tw-faq-answer-inner {
        padding: 15px !important;
    }
}
