/* Beelol Product Filters — "Filtrovať" heading, folder tabs (Príchuť / Balenie / Podľa
   príležitosti) and one bordered panel of pill chips above the category product grid.
   Inactive tabs are light yellow, the open tab is white and merges into the panel (no
   bottom border under it). */

.bpf {
    --bpf-line: #e8e8e8;       /* tab + panel outline (owner 2026-11-08: light grey, square corners) */
    --bpf-ink: #3b3b3b;        /* active-chip ring, focus outline, phone dot */
    --bpf-tab: #fff3c2;        /* inactive tab */
    --bpf-tab-hover: #ffe99a;
    --bpf-border: 1px;
    --bpf-radius: 0;
    --bpf-chip-radius: 4px;
    margin: 0 0 28px;
}

/* --- heading */
.bpf .bpf-title {
    margin: 0 0 12px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111;
}

/* --- tab strip: sits on top of the panel; the open tab overlaps the panel's top border */
.bpf-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 0;
    padding: 0 0 0 14px;
}

/* The theme paints every <button> yellow with !important and dims it on hover, so these
   rules need the higher specificity + !important too. The hover tint goes on the button only —
   never on its spans, or the label text gets its own yellow box on the white open tab. */
.bpf .bpf-tabs .bpf-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    min-height: 36px; /* same height with or without the chosen pill */
    margin: 0;
    padding: 9px 18px 8px;
    border: var(--bpf-border) solid var(--bpf-line) !important;
    border-bottom: 0 !important;
    border-radius: var(--bpf-radius) var(--bpf-radius) 0 0;
    background: var(--bpf-tab) !important;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    color: #111 !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease, padding 0.15s ease;
}

.bpf .bpf-tabs .bpf-tab:hover,
.bpf .bpf-tabs .bpf-tab:active {
    opacity: 1 !important;
    background: var(--bpf-tab-hover) !important;
    color: #111 !important;
}

.bpf .bpf-tabs .bpf-tab:hover *,
.bpf .bpf-tabs .bpf-tab:active * {
    opacity: 1 !important;
    background: transparent !important;
    color: #111 !important;
}

/* open tab: white, a little taller, and 1px lower so it covers the panel's top border;
   no hover tint */
.bpf .bpf-tabs .bpf-tab.is-active,
.bpf .bpf-tabs .bpf-tab.is-active:hover,
.bpf .bpf-tabs .bpf-tab.is-active:active {
    min-height: calc(40px + var(--bpf-border));
    padding-top: 12px;
    padding-bottom: calc(8px + var(--bpf-border));
    margin-bottom: calc(-1 * var(--bpf-border));
    background: #fff !important;
    cursor: default;
}

.bpf .bpf-tabs .bpf-tab:focus-visible {
    outline: 2px solid var(--bpf-ink);
    outline-offset: 2px;
}

/* the chosen value shown on the tab: the same yellow + dark ring as the active chip inside the
   panel, so the tab reads as "this filter is set to X". Must survive the tab hover rule above,
   which clears every child's background. */
.bpf .bpf-tabs .bpf-tab__chosen,
.bpf .bpf-tabs .bpf-tab:hover .bpf-tab__chosen,
.bpf .bpf-tabs .bpf-tab:active .bpf-tab__chosen {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 22px;
    margin: -2px 2px -2px 0;
    padding: 2px 8px;
    border-radius: var(--bpf-chip-radius);
    background: #ffd747 !important;
    box-shadow: 0 0 0 1px var(--bpf-ink);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111 !important;
}

/* --- panel: the border around the open filters */
.bpf-panels {
    position: relative;
    border: var(--bpf-border) solid var(--bpf-line);
    border-radius: var(--bpf-radius);
    background: #fff;
    padding: 18px 20px 12px;
}

.bpf-panel[hidden] {
    display: none;
}

/* --- chips: rounded pills — flavours carry a small round image, packaging / occasion are text only */
.bpf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 4px 0 6px;
}

.bpf-chips__item {
    margin: 0;
    padding: 0;
}

.bpf .bpf-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 34px;
    padding: 4px 14px 4px 10px;
    border-radius: var(--bpf-chip-radius);
    background: #f3f3f3;
    box-shadow: 0 0 0 1px #d9d9d9;
    text-decoration: none !important;
    color: #111 !important;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.bpf .bpf-chip:hover,
.bpf .bpf-chip:hover * {
    color: #111 !important; /* theme paints every hovered link orange */
}

.bpf .bpf-chip:hover {
    box-shadow: 0 0 0 1px var(--bpf-ink);
    transform: translateY(-2px);
}

.bpf .bpf-chip.is-active {
    background: #ffd747;
    box-shadow: 0 0 0 1px var(--bpf-ink);
}

.bpf .bpf-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 1px var(--bpf-ink);
}

.bpf-chip__ico {
    display: flex;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-left: -2px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bpf-chip__ico img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bpf-chip__name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bpf .bpf-chip.is-active .bpf-chip__name {
    font-weight: 700;
}

.bpf-chip__count {
    font-size: 11px;
    line-height: 1;
    color: #8a8a8a !important;
}

.bpf .bpf-chip.is-active .bpf-chip__count {
    color: #555 !important;
}

.bpf .bpf-chip.is-empty {
    opacity: 0.35;
    pointer-events: none;
}

/* --- note under a panel that the other tabs' choices left empty */
.bpf .bpf-note {
    margin: 4px 0 6px;
    padding: 0 2px;
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

.bpf .bpf-note__reset {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- footer: count + reset */
.bpf-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 6px 0;
    font-size: 13px;
    color: #555;
}

.bpf .bpf-reset {
    margin-left: auto;
    color: #111 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- loading state: grid dims, bar stays interactive (previous fetch is aborted) */
.bpf-wrap .wp-block-woocommerce-product-collection {
    transition: opacity 0.15s ease;
}

.bpf-wrap.is-loading .wp-block-woocommerce-product-collection {
    opacity: 0.45;
    pointer-events: none;
}

/* --- phones: tabs share the width, pills wrap a little tighter */
@media (max-width: 600px) {
    .bpf .bpf-title {
        font-size: 18px;
    }

    .bpf-tabs {
        gap: 4px;
        padding-left: 8px;
    }

    .bpf .bpf-tabs .bpf-tab {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
        min-height: 0;
        padding: 8px 8px 7px;
        font-size: 11px;
        letter-spacing: 0.04em;
    }

    .bpf .bpf-tabs .bpf-tab.is-active,
    .bpf .bpf-tabs .bpf-tab.is-active:hover {
        min-height: 0;
        padding-top: 11px;
        padding-bottom: calc(7px + var(--bpf-border));
    }

    /* no room for the chosen name: a small yellow dot with the dark ring (same look as the
       active chip) marks a tab with a choice instead */
    .bpf .bpf-tabs .bpf-tab__chosen,
    .bpf .bpf-tabs .bpf-tab:hover .bpf-tab__chosen {
        display: none;
    }

    .bpf .bpf-tabs .bpf-tab.has-choice::after {
        content: '';
        align-self: center;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ffd747 !important;
        box-shadow: 0 0 0 1px var(--bpf-ink);
    }

    .bpf-panels {
        padding: 12px 12px 6px;
    }

    .bpf-foot {
        padding-left: 4px;
        padding-right: 4px;
    }

    .bpf-chips {
        gap: 8px;
    }

    .bpf .bpf-chip {
        min-height: 32px;
        padding: 4px 12px 4px 9px;
    }

    .bpf-chip__ico {
        width: 20px;
        height: 20px;
    }
}
