/* Category page intro: SEO description + sub-category chips.
   Descriptions are pasted from editors with mixed inline fonts/sizes, so they are normalised here. */

.cat-intro-wrap .cagtegory-top {
    padding: 14px 0 12px !important;
}

/* ── Description ───────────────────────────── */
.custom-description {
    font-size: 14px;
    line-height: 1.65;
}
.custom-description,
.custom-description * {
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
    color: #4b5563 !important;
    background: transparent !important;
    white-space: normal !important;
    text-align: left !important;
    letter-spacing: normal !important;
}
.custom-description h1,
.custom-description h2,
.custom-description h3,
.custom-description h4 {
    margin: 0 0 4px !important;
    padding: 0 !important;
    font-weight: 400 !important;
}
.custom-description p,
.custom-description ul,
.custom-description ol {
    margin: 0 0 6px !important;
    padding-top: 0 !important;
}
.custom-description ul,
.custom-description ol {
    padding-left: 18px !important;
}
.custom-description b,
.custom-description strong,
.custom-description [style*="font-weight: 700"],
.custom-description [style*="font-weight:700"],
.custom-description [style*="font-weight: bold"] {
    font-weight: 600 !important;
    color: #26336e !important;
}
.custom-description a {
    color: #3849bb !important;
}
.custom-description p:empty,
.custom-description ul:empty,
.custom-description br + br {
    display: none !important;
}

/* Collapsed: two lines, fading out */
.custom-description.is-collapsed {
    max-height: 46px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

.cat-intro-toggle,
.cat-refine-toggle {
    background: none;
    border: 0;
    padding: 0;
    margin: 2px 0 0;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #3849bb;
    cursor: pointer;
}
.cat-intro-toggle:hover,
.cat-refine-toggle:hover {
    color: #26336e;
    text-decoration: underline;
}
.cat-intro-toggle[hidden],
.cat-refine-toggle[hidden] {
    display: none;
}

/* ── Sub-category chips ────────────────────── */
.cat-refine-wrap .refine-categories {
    margin: 0 !important;
    background: transparent !important;
}
.cat-refine-wrap .refine-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 !important;
    /* left offset matches the description: the theme's custom CSS pulls this wrapper 20px further left */
    padding: 0 0 14px 10px;
}
.cat-refine-wrap.cat-refine-solo .refine-items {
    padding-top: 14px;
}
.cat-refine-wrap .refine-item,
.cat-refine-wrap .refine-categories .refine-item:not(.swiper-slide) {
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}
.cat-refine-wrap .refine-item a {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px !important;
    background: #f5f6fd !important;
    border: 1px solid #e1e5f8 !important;
    border-radius: 999px !important;
    transition: background .15s, border-color .15s;
}
.cat-refine-wrap .refine-item a:hover {
    background: #3849bb !important;
    border-color: #3849bb !important;
}
.cat-refine-wrap .refine-item .refine-name {
    padding: 0 !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    color: #26336e !important;
    white-space: nowrap !important;
}
.cat-refine-wrap .refine-item a:hover .refine-name {
    color: #fff !important;
}

/* Mobile: smaller chips that wrap onto the next line (no sideways scrolling) */
@media (max-width: 767px) {
    .cat-intro-wrap .cagtegory-top {
        padding: 12px 15px 10px !important;
    }
    .custom-description,
    .custom-description * {
        font-size: 13px !important;
    }
    .custom-description.is-collapsed {
        max-height: 43px;
    }
    .cat-refine-wrap .refine-items {
        gap: 5px;
        padding: 0 15px 12px 30px;
    }
    .cat-refine-wrap .refine-item a {
        padding: 4px 10px !important;
    }
    .cat-refine-wrap .refine-item .refine-name {
        font-size: 12px !important;
    }
    /* First three rows only, until "Show all" is tapped */
    .cat-refine-wrap .refine-items.is-collapsed {
        max-height: 86px;
        overflow: hidden;
        padding-bottom: 0;
        margin-bottom: 6px !important;
    }
    .cat-refine-toggle {
        display: block;
        margin: 0 0 12px 30px;
    }
}
@media (min-width: 768px) {
    .cat-refine-toggle {
        display: none !important;
    }
}
