/* ============================================================
   Custom FAQ for WooCommerce — Frontend Styles
   ============================================================ */

/* ── Section wrapper ───────────────────────────────────────── */
.cfw-faq-section {
    max-width: 760px;
    margin: 0 auto;
    font-family: inherit;
}

.cfw-faq-heading {
    font-size: 1.35em;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1.25em;
    padding-bottom: .6em;
    border-bottom: 2px solid #ede9fe;
    position: relative;
}

.cfw-faq-heading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 48px;
    height: 2px;
    background: #7c3aed;
    border-radius: 2px;
}

/* ── Accordion list ────────────────────────────────────────── */
.cfw-faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Individual item ───────────────────────────────────────── */
.cfw-faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}

.cfw-faq-item:hover {
    border-color: #c4b5fd;
}

.cfw-faq-item.is-open {
    border-color: #7c3aed;
    box-shadow: 0 3px 14px rgba(124, 58, 237, .12);
}

/* ── Question button ───────────────────────────────────────── */
.cfw-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    gap: 12px;
    transition: background .15s;
}

.cfw-faq-question:hover {
    background: #faf5ff;
}

.cfw-faq-item.is-open .cfw-faq-question {
    background: #faf5ff;
    border-bottom: 1px solid #ede9fe;
}

.cfw-faq-question-text {
    font-size: .975em;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.45;
    flex: 1;
}

.cfw-faq-item.is-open .cfw-faq-question-text {
    color: #7c3aed;
}

/* ── Toggle icon ───────────────────────────────────────────── */
.cfw-faq-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    color: #94a3b8;
    transition: border-color .2s, color .2s, background .2s, transform .25s;
}

.cfw-faq-item.is-open .cfw-faq-icon {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
    transform: rotate(45deg);
}

/* Show/hide +/- paths */
.cfw-icon-minus {
    display: none;
}

.cfw-faq-item.is-open .cfw-icon-plus {
    display: none;
}

.cfw-faq-item.is-open .cfw-icon-minus {
    display: block;
}

/* ── Answer panel ──────────────────────────────────────────── */
.cfw-faq-answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height .35s cubic-bezier(.4, 0, .2, 1);
}

.cfw-faq-answer:not([hidden]) {
    max-height: 600px; /* large enough for any answer */
}

.cfw-faq-answer[hidden] {
    display: block !important; /* override WC/theme hidden styles so CSS transition works */
    max-height: 0;
    visibility: hidden;
}

.cfw-faq-answer-inner {
    padding: 16px 20px 18px;
    color: #475569;
    font-size: .94em;
    line-height: 1.7;
}

.cfw-faq-answer-inner p:first-child { margin-top: 0; }
.cfw-faq-answer-inner p:last-child  { margin-bottom: 0; }

.cfw-faq-answer-inner a {
    color: #7c3aed;
    text-decoration: underline;
}

.cfw-faq-answer-inner a:hover {
    color: #6d28d9;
}

/* ── Responsive ────────────────────────────────────────────── */
@media ( max-width: 640px ) {
    .cfw-faq-question {
        padding: 14px 16px;
    }
    .cfw-faq-answer-inner {
        padding: 14px 16px;
    }
    .cfw-faq-question-text {
        font-size: .92em;
    }
}
