/* Wilsons FAQ Accordion - frontend styles
   Defaults only; Elementor Style tab overrides per widget instance. */

.wfa-wrapper {
    width: 100%;
}

/* ── Tabs ── */

.wfa-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.wfa-tab {
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    padding: 12px 22px;
    border-radius: 30px;
    background: #f4f3ef;
    color: #1a1a1a;
    transform: scale(1);
    transition:
        background-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wfa-tab:hover {
    transform: scale(1.02);
}

.wfa-tab:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.wfa-tab.is-active {
    background: #7c1f2a;
    color: #ffffff;
    transform: scale(1);
    box-shadow: 0 4px 14px rgba(124, 31, 42, 0.22);
}

/* ── Panels ── */

.wfa-panels {
    position: relative;
}

.wfa-panel {
    display: none;
    opacity: 0;
}

.wfa-panel.is-active,
.wfa-panel.is-leaving {
    display: block;
}

.wfa-panel.is-active {
    opacity: 1;
    transform: translateY(0);
}

.wfa-panel.is-entering {
    animation: wfa-panel-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wfa-panel.is-leaving {
    animation: wfa-panel-out 0.26s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

@keyframes wfa-panel-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wfa-panel-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ── Accordion list ── */

.wfa-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wfa-item {
    background: transparent;
    border: none;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.wfa-wrapper.wfa-has-dividers .wfa-item {
    border-bottom-style: solid;
}

.wfa-wrapper.wfa-has-dividers .wfa-item:last-child {
    border-bottom: none !important;
}

.wfa-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: #1a1a2e;
    padding: 20px 24px;
    transition:
        background-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        border-radius 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wfa-item.is-open .wfa-question {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.wfa-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    color: inherit;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.wfa-item.is-open .wfa-icon {
    transform: rotate(180deg);
}

/* ── Answer expand/collapse ── */

.wfa-answer {
    max-height: 0;
    overflow: hidden;
    will-change: max-height;
}

.wfa-answer-inner {
    padding: 24px 24px;
    color: #444444;
    background: #ffffff;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.06s,
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.06s;
}

.wfa-item.is-open .wfa-answer-inner {
    opacity: 1;
    transform: translateY(0);
}

.wfa-item:not(.is-open) .wfa-answer-inner {
    transition-duration: 0.2s;
    transition-delay: 0s;
}

.wfa-item.is-open .wfa-answer-inner {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.wfa-answer-inner p:first-child {
    margin-top: 0;
}

.wfa-answer-inner p:last-child {
    margin-bottom: 0;
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
    .wfa-tab,
    .wfa-question,
    .wfa-icon,
    .wfa-answer,
    .wfa-answer-inner,
    .wfa-item,
    .wfa-panel {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .wfa-panel.is-active {
        opacity: 1;
    }

    .wfa-item.is-open .wfa-answer-inner {
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .wfa-tabs {
        gap: 8px;
    }

    .wfa-tab {
        padding: 10px 16px;
        font-size: 14px;
    }

    .wfa-question {
        font-size: 15px;
        padding: 16px 20px;
    }

    .wfa-answer-inner {
        padding-left: 20px;
        padding-right: 20px;
    }
}
