/**
 * plp-filter-widget.css
 * Theme override for the roomvo-plp filter widget.
 *
 * Two visual variants are derived from the rendered markup:
 *   - "image" rows (li.plp-item that contains <img>): pill-shaped, custom
 *     close mark when the checkbox is checked. Used for pa_product-family,
 *     pa_color, pa_shade, pa_color-family.
 *   - "checkbox" rows (li.plp-item with no <img>): square brand-style
 *     checkbox + label. Used for pa_brand and any other text-only taxonomy.
 */

/* -----------------------------------------------
   Widget shell
   ----------------------------------------------- */
.kt-inside-inner-col>p {
    margin: 0 !important;
}
.widget_block .kt-row-column-wrap {
    padding-top: 0 !important;
}
.widget_block .kb-row-layout-wrap {
    border: none;
    border-right: 1px solid rgba(225, 225, 225, 1);
    padding-right: 20px;
    border-radius: 0;
}
.plp-filter-widget {
    font-family: 'Montserrat', 'DM Sans', 'Segoe UI', sans-serif;
    color: #1a1a1a;
    background: #ffffff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    max-width: 320px;
}

.plp-filter-widget * {
    box-sizing: border-box;
}

/* Hide the breadcrumb badge bar — selection state is shown inline as pills. */
.plp-filter-widget .plp-active-filters {
    display: none;
}

/* -----------------------------------------------
   Group / section
   ----------------------------------------------- */
.plp-filter-widget .plp-attribute-group {
    padding: 19px 0;
    border-bottom: 1px solid rgba(225, 225, 225, 1);
}

.plp-filter-widget .plp-attribute-group:last-child {
    border-bottom: 0;
}

.plp-filter-widget .plp-attribute-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
    cursor: pointer;
    user-select: none;
    color: #000;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 17px;
    text-transform: uppercase;
    min-height: 24px;
}

.plp-filter-widget .plp-group-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: transform .18s ease;
}

.plp-filter-widget .plp-group-chevron svg {
    display: block;
}

.plp-filter-widget .plp-attribute-label[aria-expanded="false"] .plp-group-chevron {
    transform: rotate(180deg);
}

/* -----------------------------------------------
   Term list
   ----------------------------------------------- */
.plp-filter-widget .plp-term-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plp-filter-widget .plp-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.plp-filter-widget .plp-item-label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a1a;
}

.plp-filter-widget .plp-name {
    flex: 1;
    line-height: 1.2;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* -----------------------------------------------
   Variant A — items WITH a thumbnail (image-bearing taxonomies)
   Pill row with round thumb, native checkbox hidden.
   ----------------------------------------------- */
.plp-filter-widget .plp-item:has(img) {
    padding: 8px;
    border-radius: 48px;
    transition: background-color .15s ease;
}

.plp-filter-widget .plp-item:has(img):hover {
    background-color: #f6f6f6;
}

.plp-filter-widget .plp-item:has(img) > img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    margin: 0 10px 0 0;
}

/* The whole row reorders to: [thumb] [label] — image is outside the label. */
.plp-filter-widget .plp-item:has(img) .plp-item-label {
    gap: 10px;
    padding: 4px 0;
}

/* Hide native checkbox in image rows — selection is shown via pill background + ×. */
.plp-filter-widget .plp-item:has(img) .plp-filter-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Selected state: light pill + × glyph after the name. */
.plp-filter-widget .plp-item:has(img):has(.plp-filter-checkbox:checked) {
    background-color: #efefef;
}

.plp-filter-widget .plp-item:has(img):has(.plp-filter-checkbox:checked) .plp-name::after {
    content: '';
    display: block;
    background-image: url('data:image/svg+xml,<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.75 0.75L5.75 5.75M10.75 10.75L5.75 5.75M5.75 5.75L10.75 0.75M5.75 5.75L0.75 10.75" stroke="black" stroke-width="1.5" stroke-linecap="round"/></svg>');
    width: 16px;
    height: 16px;
    margin-left: 8px;
    background-repeat: no-repeat;
    background-position: center;
}

/* -----------------------------------------------
   Variant B — items WITHOUT a thumbnail (Brand etc.)
   Square brand-style checkbox.
   ----------------------------------------------- */
.plp-filter-widget .plp-item:not(:has(img)) .plp-item-label {
    gap: 9px;
    padding: 4px 0;
}

.plp-filter-widget .plp-item:not(:has(img)) .plp-filter-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.65);
    border-radius: 2px;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background-color .12s ease, border-color .12s ease;
}

.plp-filter-widget .plp-item:not(:has(img)) .plp-filter-checkbox:checked {
    background: rgba(250, 83, 2, 1);
    border-color: rgba(250, 83, 2, 1);
}

.plp-filter-widget .plp-item:not(:has(img)) .plp-filter-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.plp-filter-widget .plp-item:not(:has(img)) .plp-filter-checkbox:focus-visible {
    outline: 2px solid rgba(238, 99, 51, .35);
    outline-offset: 2px;
}

/* -----------------------------------------------
   Empty state + reset
   ----------------------------------------------- */
.plp-filter-widget .plp-no-terms {
    margin: 0;
    padding: 4px 0;
    font-size: 13px;
    color: #888;
    font-style: italic;
}

.plp-filter-widget .plp-reset-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    background: #ffffff;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    transition: background-color .12s ease;
}

.plp-filter-widget .plp-reset-btn:hover {
    background: #f5f5f5;
}

/* -----------------------------------------------
   Image-row layout fix: native order is <img>, then <label>.
   The img is a sibling of the label — keep it on the left of the row.
   ----------------------------------------------- */
.plp-filter-widget .plp-item:has(img) {
    display: flex;
    align-items: center;
    gap: 0;
}

/* -----------------------------------------------
   Mobile panel: hide filter widget by default,
   show as fixed full-screen panel when body.plp-filter-open
   ----------------------------------------------- */
.plp-filter-widget__header {
    display: none;
}

@media (max-width: 1024px) {
    .widget_block:has(> .kb-row-layout-wrap .plp-filter-widget),
    .widget_block:has(.plp-filter-widget) {
        display: none;
    }

    body.plp-filter-open {
        overflow: hidden;
    }

    body.plp-filter-open .widget_block:has(.plp-filter-widget) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9999;
        background: #ffffff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        animation: plp-filter-slide-in .3s ease both;
    }

    body.plp-filter-open .widget_block:has(.plp-filter-widget) .kb-row-layout-wrap {
        border: 0;
        padding: 0;
    }

    body.plp-filter-open .plp-filter-widget {
        max-width: none;
        padding: 0;
    }

    body.plp-filter-open .plp-filter-widget__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        position: sticky;
        top: 0;
        background: #ffffff;
        z-index: 1;
        border-bottom: 1px solid rgba(225, 225, 225, 1);
    }

    .plp-filter-widget__title {
        font-family: 'Montserrat', sans-serif;
        font-size: 18px;
        font-weight: 700;
        line-height: 22px;
        color: #000;
    }

    .plp-filter-widget__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .plp-filter-widget__close svg {
        display: block;
    }

    .plp-filter-widget__pills {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 0;
        padding: 20px;
        /*border-bottom: 1px solid rgba(225, 225, 225, 1);*/
    }
    .plp-filter-widget .plp-attribute-group {
        padding: 20px;
        border-bottom: 1px solid rgba(225, 225, 225, 1);
    }
    .plp-filter-widget .plp-toolbar__pill, .plp-filter-widget .plp-toolbar__reset {
        display: inline-flex;
        align-items: center;
    }
    .plp-filter-widget .plp-reset-btn{
        margin-top: 0
    }
    .plp-filter-widget__reset-wrap {
        padding: 20px;
        border-top: 1px solid rgba(225, 225, 225, 1);
    }
}

@keyframes plp-filter-slide-in {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}
