/**
 * plp-toolbar.css
 * Above-the-grid toolbar with active filter pills, reset, item count and sort.
 *
 * The toolbar is rendered inside <main> by PHP, then promoted to a sibling of
 * <main> by plp-toolbar.js so it spans both the sidebar and the product grid.
 * Both grid-column and flex-basis are set so it behaves as a full-row child
 * regardless of whether the Kadence container is using grid or flex.
 */

/*
 * Two-level structure:
 *   .plp-toolbar          — full-page-width band (background + bottom border)
 *   .plp-toolbar__inner   — Kadence container, max-width like the rest of the
 *                           site, holds the actual flex layout of pills + sort.
 *
 * The outer is rendered inside <main> by PHP and moved by plp-toolbar.js to
 * be a sibling immediately BEFORE .content-container so the band can span
 * the whole viewport width above the sidebar+grid layout.
 */
.plp-toolbar {
    width: 100%;
    margin: 0 0 24px;
    background: #ffffff;
    border-bottom: 1px solid #ececec;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: #000;
}

.plp-toolbar__inner {
    box-sizing: border-box;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.plp-toolbar__left,
.plp-toolbar__right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.plp-toolbar__right {
    margin-left: auto;
    gap: 10px;
}

/* -----------------------------------------------
   Active filter pills
   ----------------------------------------------- */
.plp-toolbar__pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    color: #000;
    text-decoration: none;
    transition: background-color .15s ease;
    border-radius: 4px;
    background: rgba(242, 241, 240, 1);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}
.plp-toolbar__sort-label {
    color: rgba(0, 0, 0, 0.35);
    font-size: 14px;
    font-weight: 500;
    line-height: 17px;
}
.plp-toolbar__pill:hover,
.plp-toolbar__pill:focus {
    background: #f5f5f5;
    text-decoration: none;
    color: #000;
}

.plp-toolbar__pill-x {
    font-size: 16px;
    line-height: 1;
    color: #6b6b6b;
}

.plp-toolbar__reset {
    margin-left: 6px;
    color: #000;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.plp-toolbar__reset:hover,
.plp-toolbar__reset:focus {
    text-decoration: underline;
    color: #000;
}

/* -----------------------------------------------
   Right side: item count + sort
   ----------------------------------------------- */
.plp-toolbar__count {
    color: rgba(0, 0, 0, 0.35);
    font-size: 14px;
    font-weight: 500;
    line-height: 17px;
}

.plp-toolbar__sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(225, 225, 225, 1);
}

.plp-toolbar__sort .woocommerce-ordering,
.plp-toolbar__sort form {
    margin: 0;
    padding: 0;
}

.plp-toolbar__sort label {
    color: #6b6b6b;
    font-size: 13px;
}

.plp-toolbar__sort select {
    border: 0;
    background: transparent;
    font-family: inherit;
    color: #000;
    cursor: pointer;
    padding: 4px 24px 4px 4px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%231a1a1a' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 4px center;
    font-size: 14px;
    font-weight: 500;
    line-height: 17px;
}

.plp-toolbar__sort select:focus {
    outline: 2px solid rgba(0, 0, 0, .12);
    outline-offset: 2px;
}

/* -----------------------------------------------
   Empty state — no active filters yet
   ----------------------------------------------- */
.plp-toolbar.is-empty .plp-toolbar__left:empty {
    display: none;
}

/* -----------------------------------------------
   Filter button (mobile only) + count badge
   ----------------------------------------------- */
.plp-toolbar__filter-btn {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: rgba(242, 241, 240, 1);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 17px;
    color: #000;
}

.plp-toolbar__filter-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.plp-toolbar__filter-btn-icon svg {
    display: block;
}

.plp-toolbar__filter-btn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(250, 83, 2, 1);
    color: rgba(255, 255, 255, 1);
    font-family: "Montserrat";
    font-size: 14px;
    font-weight: 500;
    line-height: 17px;
    text-align: center;
}

/* -----------------------------------------------
   Mobile layout: collapse pills/count, show Filter btn
   ----------------------------------------------- */
@media (max-width: 1024px) {
    .plp-toolbar__filter-btn {
        display: inline-flex;
        width: 100%;
        justify-content: center;
    }

    .plp-toolbar__pill,
    .plp-toolbar__reset,
    .plp-toolbar__count {
        display: none;
    }

    .plp-toolbar.is-empty .plp-toolbar__left:empty {
        display: flex;
    }

    .plp-toolbar__left {
        display: flex;
    }

    .plp-toolbar__sort {
        border-left: 0;
        padding-left: 0;
    }

    .plp-toolbar__inner {
        gap: 0;
        flex-wrap: nowrap;
    }

    .plp-toolbar__left,
    .plp-toolbar__right {
        flex: 0 0 50%;
        max-width: 50%;
        min-width: 0;
        flex-wrap: nowrap;
    }

    .plp-toolbar__right {
        margin-left: 0;
        justify-content: flex-end;
        overflow: hidden;
    }

    .plp-toolbar__sort {
        flex-wrap: nowrap;
        min-width: 0;
        max-width: 100%;
    }

    .plp-toolbar__sort-label {
        white-space: nowrap;
    }

    .plp-toolbar__sort select {
        max-width: 100%;
        text-overflow: ellipsis;
    }
}
