/* Shared listing layout: category pages and search results */
:root {
    --cat-lav: #f6f3fb;
    --cat-purple: var(--brand, #692c91);
    --cat-purple-dark: var(--brand-dark, #4f216e);
    --cat-muted: #6b6b7a;
    --cat-border: rgba(105, 44, 145, 0.12);
    --cat-pill: var(--brand-soft, #f1e7f8);
}
.cat-page {
    background: var(--cat-lav);
    padding-block: clamp(24px, 4vw, 40px) var(--section-y, clamp(48px, 7vw, 96px));
}
.cat-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--cat-muted);
    margin-bottom: 12px;
}
.cat-breadcrumb a {
    color: var(--cat-muted);
    text-decoration: none;
}
.cat-breadcrumb a:hover {
    color: var(--cat-purple);
}
.cat-breadcrumb .sep {
    color: #9ca3af;
}
.cat-breadcrumb .current {
    color: var(--cat-purple);
    font-weight: 700;
}
.cat-header h1 {
    font-size: clamp(1.1rem, 2.2vw, 1.25rem);
    font-weight: 800;
    margin: 0 0 6px;
    color: #1b1530;
}
.cat-header p {
    margin: 0;
    color: var(--cat-muted);
    font-size: 13px;
    line-height: 1.7;
}
.cat-divider {
    height: 1px;
    background: rgba(105, 44, 145, 0.16);
    margin: 18px 0 22px;
}
.cat-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 18px;
    align-items: start;
}
.cat-sidebar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(27, 21, 48, 0.06);
    position: sticky;
    top: 20px;
}
.cat-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cat-border);
}
.cat-sidebar-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: #1b1530;
}
.cat-reset {
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}
.cat-reset:hover {
    color: var(--brand-dark);
}
.cat-filter-group {
    padding: 14px;
    border-bottom: 1px solid var(--cat-border);
}
.cat-filter-group:last-child {
    border-bottom: 0;
}
.cat-filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
    color: #1b1530;
    white-space: nowrap;
}
.cat-filter-title > span:first-child {
    flex: none;
}
.cat-filter-title .range {
    color: var(--brand);
    font-weight: 600;
    font-size: 12px;
    margin-left: auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
@media (max-width: 359.98px) {
    .cat-filter-title .range { display: none; }
}
.cat-sidebar label {
    margin-bottom: 0;
}
.cat-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 500;
    color: #1b1530;
    margin-bottom: 0;
}
.cat-check input {
    accent-color: var(--brand);
    width: 16px;
    height: 16px;
}
.cat-sidebar-head-left svg {
    color: var(--brand);
}
.cat-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    border: 1.5px solid #cfc9d8;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    transition: border-color .15s, background-color .15s;
}
.cat-check input:focus,
.cat-check input:focus-visible {
    outline: none;
    box-shadow: none;
}
.cat-check input[type="checkbox"]:checked {
    border-color: var(--brand);
    background-color: var(--brand-soft);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2 4.8-4.9' fill='none' stroke='%23692c91' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-position: center;
    background-repeat: no-repeat;
}
.cat-check input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    border: 1.5px solid #cfc9d8;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    transition: border-color .15s, background-color .15s;
}
.cat-check input[type="radio"]:checked {
    border-color: var(--brand);
    background-color: var(--brand-soft);
    background-image: radial-gradient(circle, var(--brand) 3.5px, transparent 3.6px);
    background-position: center;
    background-repeat: no-repeat;
}
.cat-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    color: #1b1530;
    font-weight: 500;
}
.cat-check.is-active .cat-check-label span {
    color: #1b1530;
    font-weight: 500;
}
.cat-count {
    color: #5f5a70;
    font-size: 12px;
}
.cat-count.pill {
    background: var(--brand-soft);
    color: var(--brand);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.cat-toolbar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(27, 21, 48, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.cat-toolbar-left {
    font-size: 13px;
    color: var(--cat-muted);
}
.cat-toolbar-left strong {
    color: #1b1530;
}
.cat-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cat-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--cat-muted);
}
.cat-sort-select {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    background: transparent;
    font-weight: 600;
    color: #1b1530;
}
.cat-sort-select:focus {
    outline: none;
    box-shadow: none;
}
.cat-divider-v {
    width: 1px;
    height: 26px;
    background: rgba(105, 44, 145, 0.16);
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.cat-pagination {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}
.cat-pagination .pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cat-pagination .page-link {
    border-radius: 10px;
    border: 1px solid rgba(105, 44, 145, 0.18);
    background: #fff;
    color: #1b1530;
    padding: 8px 14px;
    box-shadow: none;
    -webkit-box-shadow: none;
}
.cat-pagination .page-link:focus,
.cat-pagination .page-link:active {
    background: #fff;
    border-color: rgba(105, 44, 145, 0.18);
    color: #1b1530;
    outline: 0;
    box-shadow: none;
    -webkit-box-shadow: none;
}
.cat-pagination .page-link:hover {
    background: #f3e8ff;
    border-color: rgba(105, 44, 145, 0.18);
    color: var(--cat-purple, #692c91);
}
.cat-pagination .page-item.active .page-link,
.cat-pagination .page-item.active .page-link:hover,
.cat-pagination .page-item.active .page-link:focus,
.cat-pagination .page-item.active .page-link:active {
    background: var(--cat-purple, #692c91);
    border-color: var(--cat-purple, #692c91);
    color: #fff;
    box-shadow: none;
    -webkit-box-shadow: none;
}
.cat-pagination .page-link:focus-visible {
    outline: 2px solid var(--cat-purple, #692c91);
    outline-offset: 2px;
    box-shadow: none;
    -webkit-box-shadow: none;
}
@media (max-width: 1100px) {
    .cat-layout { grid-template-columns: 220px 1fr; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
    .cat-layout { grid-template-columns: 1fr; }
    .cat-sidebar { position: static; }

}
@media (max-width: 575px) {
    /* catalog, category and search results keep 2 columns like the home cards */
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ---------------- filter form / sidebar upgrades ---------------- */
.cat-filter-form { display: flex; flex-direction: column; min-height: 0; }
details.cat-filter-group { border-bottom: 1px solid var(--cat-border); }
details.cat-filter-group:last-of-type { border-bottom: 0; }
.cat-filter-group:last-child { border-bottom: 1px solid var(--cat-border); }
summary.cat-filter-title {
    cursor: pointer;
    list-style: none;
    margin-bottom: 0;
    gap: 10px;
}
summary.cat-filter-title::-webkit-details-marker { display: none; }
summary.cat-filter-title::marker { content: ''; }
summary.cat-filter-title::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transform: rotate(45deg);
    transition: transform .2s ease;
    flex: none;
}
details[open] > summary.cat-filter-title { margin-bottom: 8px; }
details[open] > summary.cat-filter-title::after { transform: rotate(-135deg); }
.cat-filter-options { display: flex; flex-direction: column; gap: 0; }
.cat-filter-options > .cat-check:nth-child(n+8) { display: none; }
.cat-filter-options.is-expanded > .cat-check:nth-child(n+8) { display: flex; }
.cat-check.is-disabled { color: #b6b2be; cursor: not-allowed; }
.cat-check.is-disabled .cat-check-label span { color: #b6b2be; }
.cat-check.is-disabled input { accent-color: #d8d5de; cursor: not-allowed; }
.cat-check.is-disabled input[type="checkbox"],
.cat-check.is-disabled input[type="radio"] { border-color: #d8d5de; background-color: #f7f6f9; }
.cat-check.is-disabled .cat-count { color: #c3bfca; background: none; }
.cat-check.is-active .cat-count.pill { background: var(--brand-soft); color: var(--brand); }
.cat-more {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cat-purple);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.cat-more:hover { color: var(--cat-purple-dark); text-decoration: underline; }

/* active filter chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(105, 44, 145, 0.25);
    background: #fff;
    color: var(--cat-purple);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.cat-chip span { color: #9b8fb5; font-size: 11px; }
.cat-chip:hover { border-color: var(--cat-purple); color: var(--cat-purple-dark); }
.cat-chip-clear { align-self: center; font-size: 12px; font-weight: 600; color: var(--cat-muted); text-decoration: underline; }

/* mobile filters button (toolbar) */
.cat-filter-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(105, 44, 145, 0.25);
    border-radius: 8px;
    background: #fff;
    color: var(--brand);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.cat-drawer-foot { display: none; }
.cat-drawer-overlay { display: none; }

@media (max-width: 991px) {
    .cat-filter-toggle { display: inline-flex; }
    .cat-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(340px, 88vw);
        max-height: 100dvh;
        border-radius: 0;
        z-index: 1055;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 0 10px 40px rgba(27, 21, 48, 0.25);
    }
    .cat-sidebar.is-open { transform: none; }
    .cat-sidebar-head { position: sticky; top: 0; background: #fff; z-index: 2; }
    .cat-filter-form { flex: 1; overflow-y: auto; }
    .cat-drawer-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(20, 20, 28, 0.45);
        z-index: 1050;
    }
    body.cat-drawer-open .cat-drawer-overlay { display: block; }
    body.cat-drawer-open { overflow: hidden; }
    .cat-drawer-foot {
        display: flex;
        gap: 8px;
        align-items: center;
        padding: 12px 14px;
        border-top: 1px solid var(--cat-border);
        background: #fff;
        position: sticky;
        bottom: 0;
        margin-top: auto;
    }
    .cat-drawer-reset {
        flex: none;
        padding: 10px 16px;
        border-radius: 8px;
        border: 1px solid rgba(105, 44, 145, 0.2);
        background: #f6f3fb;
        color: var(--brand);
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
    }
    .cat-drawer-apply {
        flex: 1;
        padding: 10px 14px;
        border: 0;
        border-radius: 8px;
        background: var(--cat-purple);
        color: #fff;
        font: inherit;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }
}

/* small robustness tweaks for narrow screens */
.cat-toolbar { flex-wrap: wrap; row-gap: 10px; }
.cat-toolbar-left { flex: 1 1 auto; min-width: 0; }
.cat-header h1 { overflow-wrap: anywhere; }
.cat-filter-title { font-size: 14px; }
