.pl-page { padding-bottom: 60px; }

/* topbar */
.pl-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.pl-topbar-right { display: flex; align-items: center; gap: 14px; }
.pl-heading {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--t-text-base);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pl-heading-icon { color: var(--t-primary); font-size: 1rem; }
.pl-count {
    background: var(--t-primary-light);
    color: var(--t-primary-dark);
    font-size: .76rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.pl-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.pl-filter-chip:hover { background: #fecaca; color: #b91c1c; }

/* layout */
.pl-body { display: flex; gap: 24px; align-items: flex-start; }
.pl-sidebar { width: 220px; flex-shrink: 0; position: sticky; top: 88px; }
.pl-content { flex: 1; min-width: 0; }

/* ── Mobile drawer ────────────────────────────────────────────────────── */
.pl-filter-fab { display: none; }
.pl-drawer-overlay { display: none; }

@keyframes pl-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0);    }
}
@keyframes pl-slide-down {
    from { transform: translateY(0);    }
    to   { transform: translateY(100%); }
}

@media (max-width: 767px) {
    /* Sidebar hidden by default on mobile */
    .pl-sidebar {
        display: none;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 1050;
        width: 100%;
        max-height: 88vh;
        overflow-y: auto;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -6px 32px rgba(0,0,0,.18);
        padding: 0 16px 32px;
        scrollbar-width: thin;
    }
    .pl-sidebar.is-open {
        display: block;
        animation: pl-slide-up .3s cubic-bezier(.4,0,.2,1) forwards;
    }
    .pl-sidebar.is-closing {
        display: block;
        animation: pl-slide-down .25s cubic-bezier(.4,0,.2,1) forwards;
    }

    /* Drag handle */
    .pl-drawer-handle {
        width: 40px;
        height: 4px;
        background: #e5e7eb;
        border-radius: 4px;
        margin: 12px auto 4px;
    }

    /* Drawer header row */
    .pl-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0 14px;
        border-bottom: 1px solid #f3f4f6;
        margin-bottom: 14px;
    }
    .pl-drawer-title {
        font-size: .95rem;
        font-weight: 700;
        color: #111827;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .pl-drawer-close {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 6px 14px;
        border-radius: 8px;
        background: #f3f4f6;
        border: none;
        font-size: .8rem;
        font-weight: 600;
        color: #6b7280;
        cursor: pointer;
        font-family: inherit;
        transition: background .14s;
    }
    .pl-drawer-close:hover { background: #e5e7eb; }

    /* Bottom action bar — full-width clickable button */
    .pl-filter-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        background: var(--t-primary, #6366f1);
        color: #fff;
        border: none;
        padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
        font-size: .95rem;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        box-shadow: 0 -4px 20px rgba(99,102,241,.3);
        transition: background .15s;
    }
    .pl-filter-fab:active { background: #4f46e5; }
    .pl-filter-fab__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        border-radius: 11px;
        background: rgba(255,255,255,.25);
        color: #fff;
        font-size: .75rem;
        font-weight: 800;
        border: 1.5px solid rgba(255,255,255,.5);
    }

    /* Overlay */
    .pl-drawer-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1045;
        opacity: 0;
        pointer-events: none;
        transition: opacity .28s;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    .pl-drawer-overlay.is-visible {
        opacity: 1;
        pointer-events: all;
    }

    /* Extra padding so content stays above action bar */
    .pl-page { padding-bottom: 80px; }
}

/* sidebar */
.pl-sidebar-box {
    background: var(--t-card-bg);
    border-radius: 14px;
    border: 1.5px solid var(--t-border);
    overflow: hidden;
}
.pl-sidebar-title {
    padding: 14px 16px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--t-text-base);
    background: color-mix(in srgb, var(--t-card-bg) 80%, var(--t-text-base) 5%);
    border-bottom: 1px solid var(--t-border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pl-cat-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    font-size: .84rem;
    color: var(--t-text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--t-border);
    transition: all .15s;
}
.pl-cat-item:last-child { border-bottom: none; }
.pl-cat-item i:first-child { color: #d1d5db; font-size: .72rem; transition: color .15s; }
.pl-cat-item:hover { background: var(--t-primary-light); color: var(--t-primary); }
.pl-cat-item:hover i:first-child { color: var(--t-primary); }
.pl-cat-item.active { background: var(--t-primary-light); color: var(--t-primary-dark); font-weight: 700; }
.pl-cat-item.active i:first-child { color: var(--t-primary); }
.pl-cat-check { margin-right: auto; color: var(--t-primary); font-size: .72rem; }

/* grid */
.pl-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1100px) { .pl-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .pl-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* empty */
.pl-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--t-card-bg);
    border-radius: 16px;
    border: 1.5px solid var(--t-border);
}
.pl-empty-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #d1d5db;
    margin-bottom: 16px;
}
.pl-empty h5 { font-weight: 700; color: var(--t-text-base); margin-bottom: 6px; }
.pl-empty p { color: #9ca3af; font-size: .88rem; margin-bottom: 20px; }
.pl-empty-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: var(--t-primary);
    color: #fff;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s;
}
.pl-empty-btn:hover { background: var(--t-primary-dark); color: #fff; }

/* pagination */
.pl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
}
.pl-page-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 600;
    color: var(--t-text-base);
    background: var(--t-card-bg);
    border: 1.5px solid var(--t-border);
    text-decoration: none;
    transition: all .15s;
}
.pl-page-btn:hover { border-color: var(--t-primary); color: var(--t-primary); background: var(--t-primary-light); }
.pl-page-btn.active { background: var(--t-primary); color: #fff; border-color: var(--t-primary); }
.pl-page-arrow { font-size: .78rem; }
.pl-page-dots { color: #9ca3af; font-size: .9rem; padding: 0 2px; line-height: 38px; }

/* ── Price filter box ─────────────────────────────────────────────────── */
.pl-price-box {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 14px 12px;
    margin-bottom: 8px;
}
.pl-price-box__head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}
.pl-price-box__head i { color: var(--t-primary,#6366f1); font-size: .8rem; }
.pl-price-reset {
    margin-right: auto;
    color: #9ca3af;
    font-size: .72rem;
    text-decoration: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .14s, color .14s;
}
.pl-price-reset:hover { background: #fee2e2; color: #dc2626; }

.pl-price-values {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    color: #374151;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.pl-price-val { font-weight: 600; color: var(--t-primary,#6366f1); }
.pl-price-sep { color: #9ca3af; }
.pl-price-unit { color: #9ca3af; font-size: .72rem; }

/* ── Dual range slider ───────────────────────────────────────────────── */
.pl-slider-wrap {
    position: relative;
    height: 36px;
    margin-bottom: 12px;
}
.pl-slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0; left: 0;
    height: 4px;
    background: #e5e7eb;
    border-radius: 4px;
    pointer-events: none;
}
.pl-slider-fill {
    position: absolute;
    top: 0; bottom: 0;
    background: var(--t-primary,#6366f1);
    border-radius: 4px;
}
.pl-range {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    pointer-events: none;
    direction: ltr;
}
.pl-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--t-primary,#6366f1);
    box-shadow: 0 1px 6px rgba(99,102,241,.25);
    cursor: pointer;
    pointer-events: all;
    transition: transform .12s, box-shadow .12s;
}
.pl-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 10px rgba(99,102,241,.4);
}
.pl-range::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--t-primary,#6366f1);
    cursor: pointer;
    pointer-events: all;
}

.pl-price-apply {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: var(--t-primary,#6366f1);
    color: #fff;
    border: none;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    font-family: inherit;
}
.pl-price-apply:hover { background: #4f46e5; }
.pl-price-apply:active { transform: scale(.97); }

/* ── Sort bar ─────────────────────────────────────────────────────────── */
.pl-sortbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.pl-sortbar__label {
    font-size: .8rem;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.pl-sort-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.pl-sort-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 500;
    color: #6b7280;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.pl-sort-pill:hover { border-color: var(--t-primary,#6366f1); color: var(--t-primary,#6366f1); background: #f5f3ff; }
.pl-sort-pill.is-active { background: var(--t-primary,#6366f1); color: #fff; border-color: var(--t-primary,#6366f1); font-weight: 600; }

@media (max-width: 575px) {
    .pl-sortbar { padding: 8px 10px; gap: 8px; }
    .pl-sort-pill { padding: 4px 11px; font-size: .76rem; }
}

/* ── Attribute filter chips ───────────────────────────────────────────── */
.pl-filter-chip--attr { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }
.pl-filter-chip--attr:hover { background: #ddd6fe; }
.pl-filter-chip--clear { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.pl-filter-chip--clear:hover { background: #fee2e2; }

/* ── Attribute filter sidebar ─────────────────────────────────────────── */
.pl-attr-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.pl-attr-group {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
}
.pl-attr-group:hover { border-color: #c4b5fd; }
.pl-attr-group.is-open { border-color: var(--t-primary, #6366f1); box-shadow: 0 2px 12px rgba(99,102,241,.08); }

.pl-attr-group__head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 8px;
    text-align: right;
}
.pl-attr-group__label {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
}
.pl-attr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--t-primary, #6366f1);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}
.pl-attr-group__arrow {
    font-size: .7rem;
    color: #9ca3af;
    transition: transform .2s;
    flex-shrink: 0;
}
.pl-attr-group.is-open .pl-attr-group__arrow { transform: rotate(180deg); }

.pl-attr-group__body {
    display: none;
    flex-direction: column;
    padding: 0 10px 10px;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.pl-attr-group.is-open .pl-attr-group__body { display: flex; }

.pl-attr-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background .14s;
}
.pl-attr-opt:hover { background: #f5f3ff; }
.pl-attr-opt.is-checked { background: #ede9fe; }

.pl-attr-opt__box {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1.5px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .6rem;
    color: #fff;
    transition: all .15s;
    background: #fff;
}
.pl-attr-opt.is-checked .pl-attr-opt__box {
    background: var(--t-primary, #6366f1);
    border-color: var(--t-primary, #6366f1);
}

.pl-attr-opt__label {
    font-size: .82rem;
    color: #374151;
    flex: 1;
    font-weight: 500;
}
.pl-attr-opt.is-checked .pl-attr-opt__label { color: #4f46e5; font-weight: 600; }

.pl-attr-opt__count {
    font-size: .72rem;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 1px 7px;
    flex-shrink: 0;
}
.pl-attr-opt.is-checked .pl-attr-opt__count { background: #c4b5fd; color: #4c1d95; }

/* ── Mobile: filter toggle button ────────────────────────────────────── */
@media (max-width: 767px) {
    .pl-attr-filters { margin-top: 4px; }
    .pl-attr-group__body { max-height: 180px; }
}
