/* ==================================================================
   ePlanery - SEO kategorii produktów
   Kolory, fonty i zaokrąglenia pobierane ze zmiennych motywu
   (--color-sage-*, --font-sans, --font-display-long, --radius-cta),
   z wartościami zapasowymi na wypadek braku zmiennej.
   ================================================================== */

/* ---------- Krótki opis nad listą produktów ----------
   Lekki blok w ramce z paskiem akcentu po lewej. Pełna szerokość
   kontenera treści (sidebar + siatka), wszystkie wartości z tokenów motywu. */
.woocommerce-products-header .term-description,
.term-description {
    max-width: none;
    margin: 16px 0 28px;
    padding: 22px 26px;
    background: var(--color-sage-50, #F4F8F5);
    border-left: 4px solid var(--color-sage-700, #315744);
    border-radius: var(--radius-cta, 7px);
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-primary, #262626);
}

.term-description p {
    margin: 0 0 12px;
}

.term-description p:last-child {
    margin-bottom: 0;
}

@media screen and (max-width: 1000px) {
    .term-description {
        margin: 12px 0 24px;
        padding: 16px;
        font-size: 15px;
    }
}

/* ---------- Sekcja SEO pod produktami ---------- */
.ep-cat-seo {
    margin: 56px 0 0;
    padding: 44px 0 40px;
    border-top: 1px solid var(--color-border-subtle, #DDDCD8);
    background: var(--color-sage-50, #F4F8F5);
    font-family: var(--font-sans, system-ui, sans-serif);
}

.ep-cat-seo__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.ep-cat-seo__text {
    position: relative;
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-primary, #262626);
    overflow: hidden;
}

/* zwinięcie jest wyłącznie wizualne - cała treść siedzi w HTML */
.ep-cat-seo__text[data-collapsed="true"].is-collapsible {
    max-height: 280px;
}

.ep-cat-seo__text[data-collapsed="true"].is-collapsible::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(244, 248, 245, 0), var(--color-sage-50, #F4F8F5));
    pointer-events: none;
}

.ep-cat-seo__text h2 {
    margin: 32px 0 12px;
    font-family: var(--font-display-long, Georgia, serif);
    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--color-sage-900, #234738);
}

.ep-cat-seo__text h3 {
    margin: 24px 0 10px;
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--color-text-primary, #262626);
}

.ep-cat-seo__text > *:first-child {
    margin-top: 0;
}

.ep-cat-seo__text p {
    margin: 0 0 16px;
}

.ep-cat-seo__text ul,
.ep-cat-seo__text ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.ep-cat-seo__text li {
    margin-bottom: 6px;
}

.ep-cat-seo__text a {
    color: var(--color-sage-700, #315744);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 160ms ease, color 160ms ease;
}

.ep-cat-seo__text a:hover {
    color: var(--color-sage-900, #234738);
    border-bottom-color: currentColor;
}

.ep-cat-seo__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px 20px;
    border: 1px solid var(--color-sage-700, #315744);
    border-radius: var(--radius-cta, 7px);
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-sage-700, #315744);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.ep-cat-seo__toggle:hover {
    background: var(--color-sage-100, #E7F1E9);
}

.ep-cat-seo__toggle:focus-visible {
    outline: 2px solid var(--color-sage-900, #234738);
    outline-offset: 2px;
}

.ep-cat-seo__toggle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 200ms ease;
}

.ep-cat-seo__toggle[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(-135deg);
}

.ep-cat-seo__toggle .ep-cat-seo__toggle-less,
.ep-cat-seo__toggle[aria-expanded="true"] .ep-cat-seo__toggle-more {
    display: none;
}

.ep-cat-seo__toggle[aria-expanded="true"] .ep-cat-seo__toggle-less {
    display: inline;
}

/* ---------- FAQ ---------- */
.ep-cat-faq {
    margin-top: 44px;
}

.ep-cat-faq__title {
    margin: 0 0 18px;
    font-family: var(--font-display-long, Georgia, serif);
    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--color-sage-900, #234738);
}

.ep-cat-faq__item {
    margin-bottom: 10px;
    border: 1px solid var(--color-sage-300, #BFDCCB);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.ep-cat-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 18px;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--color-text-primary, #262626);
    cursor: pointer;
    list-style: none;
}

/* strzałka zamiast domyślnego trójkąta */
.ep-cat-faq__question::-webkit-details-marker {
    display: none;
}

.ep-cat-faq__question::after {
    content: '';
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--color-sage-700, #315744);
    border-bottom: 2px solid var(--color-sage-700, #315744);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 200ms ease;
}

.ep-cat-faq__item[open] .ep-cat-faq__question::after {
    transform: translateY(2px) rotate(-135deg);
}

.ep-cat-faq__question:hover {
    color: var(--color-sage-900, #234738);
}

.ep-cat-faq__question:focus-visible {
    outline: 2px solid var(--color-sage-700, #315744);
    outline-offset: -2px;
}

.ep-cat-faq__answer {
    padding: 0 18px 16px;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--color-text-primary, #262626);
}

.ep-cat-faq__answer p:last-child {
    margin-bottom: 0;
}

.ep-cat-faq__answer a {
    color: var(--color-sage-700, #315744);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* płynne rozwijanie tam, gdzie przeglądarka to obsługuje */
@media (prefers-reduced-motion: no-preference) {
    .ep-cat-faq__item::details-content {
        transition: block-size 240ms ease, content-visibility 240ms allow-discrete;
        block-size: 0;
        overflow: hidden;
    }

    .ep-cat-faq__item[open]::details-content {
        block-size: auto;
    }
}

/* ---------- Telefon ---------- */
@media screen and (max-width: 1000px) {
    .ep-cat-seo {
        margin-top: 40px;
        padding: 32px 0 30px;
    }

    .ep-cat-seo__inner {
        padding: 0 16px;
    }

    .ep-cat-seo__text {
        font-size: 15.5px;
    }

    .ep-cat-seo__text h2,
    .ep-cat-faq__title {
        font-size: 22px;
    }

    .ep-cat-seo__text h3 {
        font-size: 17px;
    }

    .ep-cat-faq__question {
        padding: 14px;
        font-size: 15.5px;
    }

    .ep-cat-faq__answer {
        padding: 0 14px 14px;
        font-size: 15px;
    }
}
