/* =========================================================
   Corele Filter v3.0 — sidebar filter
   Design: theo mẫu — radio checkbox, size button, color swatch
   ========================================================= */

/* ── Variables ────────────────────────────────────────────── */
.jpf-wrap {
    --jpf-bg:           #f2f2f2;
    --jpf-border:       #e8e8e8;
    --jpf-text:         #1a1a1a;
    --jpf-text-muted:   #888;
    --jpf-accent:       #111111;
    --jpf-radius:       4px;
    --jpf-transition:   0.18s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
.jpf-wrap *,
.jpf-wrap *::before,
.jpf-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.jpf-wrap {
    font-size: 13.5px;
    color: var(--jpf-text);
    background: var(--jpf-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
	padding:12px;
}
.jpf-section:hover {
    border-color: green;
}
span.jpf-cb-name:hover {
    color: green;
}

/* ── Header row: "Bộ lọc" + "19 kết quả" ─────────────────── */
.jpf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 14px;
    margin-bottom: 0;
}

.jpf-header__label {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--jpf-text);
}

.jpf-header__close {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--jpf-transition);
}
.jpf-header__close:hover { color: #000; }

.jpf-brand-title {
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    color: #000;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.jpf-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.jpf-summary-count {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.jpf-clear-all {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    text-decoration: none;
}
.jpf-clear-all:hover {
    text-decoration: underline;
}

/* ── Active tag pills ─────────────────────────────────────── */
.jpf-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 0 20px 0;
}

.jpf-tag {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 28px;
    padding: 0 4px 0 10px;
    background: transparent;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #000;
    white-space: nowrap;
    line-height: 1;
}

.jpf-tag__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 2px;
    color: #888;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
    border-radius: 50%;
    transition: background var(--jpf-transition), color var(--jpf-transition);
    flex-shrink: 0;
}
.jpf-tag__remove:hover { background: #e0e0e0; color: #111; }

/* ── Sections wrapper ─────────────────────────────────────── */
.jpf-sections {
    /* không có border-top vì sections tự có border-bottom */
}

/* ── Individual section ───────────────────────────────────── */
.jpf-section {
    border-bottom: 1px solid #000;
}
.jpf-section:first-child {
    border-top: 1px solid #000;
}

/* ── Section header button ────────────────────────────────── */
.jpf-section-hd {
    appearance: none;
    background: none;
    border: none;
    margin: 0;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    cursor: pointer;
    gap: 8px;
    transition: opacity var(--jpf-transition);
}
.jpf-section-hd:hover { opacity: 0.75; }
.jpf-section-hd:focus-visible {
    outline: 2px solid #bbb;
    outline-offset: 2px;
}

/* Section title */
.jpf-section-hd__title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #000;
}

/* Green check indicator */
.jpf-active-indicator {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.jpf-active-indicator svg { display: block; }

/* Chevron icon */
.jpf-chevron {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #000;
    transition: transform var(--jpf-transition), color var(--jpf-transition);
}
.jpf-section--open .jpf-chevron {
    transform: rotate(180deg);
}

/* ── Section body ─────────────────────────────────────────── */
.jpf-body {
    padding: 0 0 16px;
    overflow: hidden;
}
.jpf-body.hidden { display: none; }

/* ============================================================
   CHECKBOX LIST (mặc định — dạng radio tròn theo mẫu)
   ============================================================ */
.jpf-checkbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jpf-cb-item {
    margin-left: 0 !important;
}

.jpf-cb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 13.5px;
    font-weight: 400;
    padding: 7px 0;
    transition: color var(--jpf-transition);
    cursor: pointer;
}
.jpf-cb-link:hover { color: #000; }
.jpf-cb-link.is-checked { color: #111; }

/* Checkbox box — dạng tròn như radio trong mẫu */
.jpf-cb-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #000;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--jpf-transition), background var(--jpf-transition);
}
.jpf-cb-link:hover .jpf-cb-box {
    border-color: #000;
}
.jpf-cb-link.is-checked .jpf-cb-box {
    border-color: #000;
    background: #000;
}

/* SVG checkmark */
.jpf-cb-check {
    display: block;
    flex-shrink: 0;
    color: #fff;
}
.jpf-cb-check path { stroke: currentColor; }

.jpf-cb-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: #000;
}

.jpf-cb-count {
    display: inline-block;
    color: #000;
}

/* ============================================================
   SIZE BUTTON GRID (thuộc tính kích thước)
   ============================================================ */
.jpf-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    list-style: none;
    margin: 0;
}

.jpf-size-item { 
    margin-left: 0 !important;
}

.jpf-size-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
    transition: border-color var(--jpf-transition), background var(--jpf-transition), color var(--jpf-transition);
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.jpf-size-link:hover {
    border-color: #888;
    color: #111;
}
.jpf-size-link.is-checked {
    border-color: #111;
    background: #111;
    color: #fff;
}

/* ============================================================
   COLOR SWATCHES (thuộc tính màu sắc)
   ============================================================ */
.jpf-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 0;
    list-style: none;
    margin: 0;
}

.jpf-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.jpf-color-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
}

/* Vòng tròn màu */
.jpf-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px rgba(0,0,0,.12);
    background: #ccc;
    transition: box-shadow var(--jpf-transition), transform var(--jpf-transition);
    flex-shrink: 0;
    position: relative;
}
.jpf-color-link:hover .jpf-color-swatch {
    box-shadow: 0 0 0 2px #888;
    transform: scale(1.05);
}
.jpf-color-link.is-checked .jpf-color-swatch {
    box-shadow: 0 0 0 2px #111;
}

/* Nhãn tên màu */
.jpf-color-name {
    font-size: 11px;
    color: #555;
    text-align: center;
    white-space: nowrap;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.jpf-color-link.is-checked .jpf-color-name {
    color: #111;
    font-weight: 600;
}

/* ============================================================
   PRICE CHECKBOXES (dạng vuông theo mẫu)
   ============================================================ */
.jpf-price-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jpf-price-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 13.5px;
    font-weight: 400;
    padding: 7px 0;
    transition: color var(--jpf-transition);
    cursor: pointer;
}
.jpf-price-link:hover { color: #000; }
.jpf-price-link.is-checked { color: #111; }

/* Checkbox vuông cho giá */
.jpf-price-box {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid #c0c0c0;
    border-radius: 3px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--jpf-transition), background var(--jpf-transition);
}
.jpf-price-link:hover .jpf-price-box { border-color: #888; }
.jpf-price-link.is-checked .jpf-price-box {
    border-color: #111;
    background: #111;
}

.jpf-price-check {
    display: block;
    color: #fff;
}
.jpf-price-check path { stroke: currentColor; }

.jpf-price-label {
    flex: 1;
}

/* ── Empty state ──────────────────────────────────────────── */
.jpf-empty {
    padding: 12px 0;
    font-size: 13px;
    color: #888;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 767px) {
    .jpf-wrap {
        border: 1px solid var(--jpf-border);
        border-radius: 8px;
        padding: 0 16px;
        overflow: hidden;
    }
}
