/* ==========================================================
   Product Filter Bar & Popup — Tekcom
   ========================================================== */

/* ── Filter bar ──────────────────────────────────────────── */
.pf-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 0;
    margin-bottom: 24px;
}

.pf-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    letter-spacing: 0.02em;
    line-height: 1;
}

.pf-bar__btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: block;
}

.pf-bar__btn:hover {
    color: #111827;
}

.pf-bar__count {
    display: inline-block;
}

/* ── Overlay backdrop ────────────────────────────────────── */
.pf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.pf-overlay.is-open {
    display: flex;
    align-items: center;
}

/* ── Panel (bottom sheet) ────────────────────────────────── */
.pf-panel {
    background: #fff;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pf-overlay.is-open .pf-panel {
    transform: translateY(0);
}

/* ── Panel header ────────────────────────────────────────── */
.pf-header {
    display: flex;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    position: relative;
}

.pf-header__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    flex: 1;
}

.pf-header__clear {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 4px;
}

.pf-header__clear:hover {
    color: #374151;
}

.pf-header__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.pf-header__close:hover {
    background: #f3f4f6;
}

/* ── Panel body (scrollable) ─────────────────────────────── */
.pf-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

/* ── Filter section (accordion) ──────────────────────────── */
.pf-section {
    border-bottom: 1px solid #f0f0f0;
    padding: 4px 0;
}

.pf-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e3a8a;
    text-align: left;
    gap: 8px;
}

.pf-section-toggle svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.pf-section.is-collapsed .pf-section-toggle svg {
    transform: rotate(180deg);
}

.pf-section-body {
    overflow: hidden;
    transition: max-height 0.25s ease;
    max-height: 600px;
}

.pf-section.is-collapsed .pf-section-body {
    max-height: 0;
}

/* ── Checkbox items ──────────────────────────────────────── */
.pf-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
}

.pf-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pf-checkbox__box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid #1e3a8a;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pf-checkbox input[type="checkbox"]:checked+.pf-checkbox__box {
    background: #1e3a8a;
    border-color: #1e3a8a;
}

.pf-checkbox__box svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    display: none;
}

.pf-checkbox input[type="checkbox"]:checked+.pf-checkbox__box svg {
    display: block;
}

.pf-checkbox__label {
    font-size: 0.875rem;
    color: #1e3a8a;
    line-height: 1.4;
}

/* ── Panel footer ────────────────────────────────────────── */
.pf-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 24px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.pf-footer__apply {
    flex: 1;
    padding: 14px 24px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pf-footer__apply:hover {
    background: #0f172a;
}

.pf-footer__cancel {
    padding: 14px 24px;
    background: none;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #374151;
    cursor: pointer;
}

.pf-footer__cancel:hover {
    color: #111827;
}

/* ── Sort dropdown ───────────────────────────────────────── */
.pf-sort-dropdown {
    position: relative;
}

.pf-sort-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.pf-sort-dropdown.is-open .pf-sort-list {
    display: block;
}

.pf-sort-list__item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: #374151;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.pf-sort-list__item:hover,
.pf-sort-list__item.is-active {
    background: #f3f4f6;
    color: #111827;
}

.pf-sort-list__item.is-active {
    font-weight: 600;
}