/* ==================================================================
   BeOrganic.sk – Filter redesign v4 (15. 5. 2026)

   FINÁLNÍ verze dle wireframu:
   - DESKTOP: levý sidebar transparentní, horní toolbar s breadcrumbem
   - MOBIL: filtry VEDLE produktů (split layout 42% / 58%)
            + sticky bar dole se „Zrušiť" + zelený „Zobraziť X produktov"

   ✅ OTESTOVÁNO LIVE — desktop i mobil emulace

   KAM VLOŽIT:
   1) Admin → Úložisko súborov → smaž staré `filter-redesign_*.css`
      a nahraj tento (`filter-redesign_v4.css`)
   2) Admin → Globálny HTML Kód → Hlavička stránky →
      pokud máš link na starou verzi, aktualizuj na `_v4.css`
   ================================================================== */


/* ╔════════════════════════════════════════════════════════════════╗
   ║ 1. SCHOVAT horní filter toolbar (kromě sortování) — DESKTOP    ║
   ╚════════════════════════════════════════════════════════════════╝ */

.c-toolbar .c-title,
.c-toolbar .c-filter-items,
.c-toolbar .c-categories-link {
    display: none !important;
}

.c-toolbar {
    justify-content: flex-end !important;
    border-bottom: none !important;
    padding: 0 !important;
}
.c-toolbar .sorting-navigator {
    margin-left: auto !important;
}

/* Sortovací dropdown jako pill */
.sorting-navigator .s-title {
    display: none !important;
}
.sorting-navigator select.s-items {
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
    padding: 6px 28px 6px 14px !important;
    border-radius: 100px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 13px !important;
    color: rgb(52, 49, 45) !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23647761" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
}


/* ╔════════════════════════════════════════════════════════════════╗
   ║ 2. HORNÍ TOOLBAR (vytváří JS — desktop)                        ║
   ╚════════════════════════════════════════════════════════════════╝ */

.bo-product-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 0 14px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 24px !important;
    font-family: 'Montserrat', sans-serif !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.bo-product-toolbar .bo-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bo-product-toolbar .bo-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bo-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(52, 49, 45, 0.7);
    flex-wrap: wrap;
}
.bo-breadcrumb span:not(.bo-bc-sep) {
    padding: 4px 10px;
    background: rgba(100, 119, 93, 0.08);
    color: rgb(100, 119, 93);
    border-radius: 100px;
    font-weight: 500;
}
.bo-breadcrumb .bo-bc-sep {
    color: rgba(52, 49, 45, 0.3);
    font-size: 13px;
}

.bo-results-count {
    font-size: 13px;
    color: rgba(52, 49, 45, 0.7);
}
.bo-results-count .bo-info-icon {
    display: inline-block;
    margin-left: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: rgba(52, 49, 45, 0.6);
    text-align: center;
    line-height: 14px;
    font-size: 10px;
    cursor: help;
}

.bo-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(52, 49, 45, 0.7);
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: none;
    font-family: 'Montserrat', sans-serif;
    padding: 0;
}
.bo-clear-filters:hover {
    color: rgb(100, 119, 93);
}
.bo-clear-filters::before {
    content: '×';
    font-size: 18px;
    line-height: 1;
}

.bo-view-modes {
    display: inline-flex;
    gap: 4px;
}
.bo-view-mode {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    color: rgba(52, 49, 45, 0.6);
    transition: all 0.15s ease;
    font-size: 14px;
}
.bo-view-mode:hover,
.bo-view-mode.active {
    border-color: rgb(100, 119, 93);
    color: rgb(100, 119, 93);
    background: rgba(100, 119, 93, 0.05);
}


/* ╔════════════════════════════════════════════════════════════════╗
   ║ 3. LEVÝ SIDEBAR (desktop) — transparentní, ladí s pozadím      ║
   ╚════════════════════════════════════════════════════════════════╝ */

#page_panel.panel-filter {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    box-sizing: border-box;
    z-index: 1;
}

#page_panel.panel-filter::-webkit-scrollbar {
    width: 4px;
}
#page_panel.panel-filter::-webkit-scrollbar-thumb {
    background: rgba(100, 119, 93, 0.2);
    border-radius: 2px;
}

#categoryPanel::before {
    content: 'Filtrovať podľa';
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgb(52, 49, 45);
    margin-bottom: 16px;
}

#categoryPanel > a:first-of-type {
    display: none !important;
}

#panel-filter-list::before {
    display: none !important;
    content: '' !important;
}

#categoryPanel ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

#categoryPanel ul li {
    margin: 0 !important;
    padding: 0 !important;
}

#categoryPanel ul li a {
    display: block !important;
    padding: 7px 0 !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: rgb(52, 49, 45) !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

#categoryPanel ul li a:hover {
    color: rgb(100, 119, 93) !important;
}


/* ╔════════════════════════════════════════════════════════════════╗
   ║ 4. JEDNOTLIVÉ FILTRY (desktop)                                 ║
   ╚════════════════════════════════════════════════════════════════╝ */

#categoryFilters.categoryFilters-moved {
    display: block !important;
}

.categoryFiltersRow {
    margin: 0 !important;
    padding: 14px 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-bottom: none !important;
}

.categoryFiltersRow:first-child {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    margin-top: 18px !important;
}

.categoryFilterName {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgb(52, 49, 45) !important;
    margin-bottom: 0 !important;
    padding: 4px 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.categoryFilterValues {
    margin-top: 8px !important;
}

.categoryFilterValues label,
.categoryFilterValues > div,
.categoryFilterValues a {
    display: flex !important;
    align-items: center !important;
    padding: 5px 0 !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: rgb(52, 49, 45) !important;
    cursor: pointer !important;
    transition: color 0.12s ease;
}

.categoryFilterValues label:hover {
    color: rgb(100, 119, 93) !important;
}

.categoryFilterValues input[type="checkbox"],
.categoryFilterValues input[type="radio"] {
    margin-right: 10px !important;
    accent-color: rgb(100, 119, 93) !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
    flex-shrink: 0;
}


/* ╔════════════════════════════════════════════════════════════════╗
   ║ 5. CENA – slider                                               ║
   ╚════════════════════════════════════════════════════════════════╝ */

.price-slider .noUi-connect,
.price-slider [class*="connect"] {
    background: rgb(100, 119, 93) !important;
}

.price-slider .noUi-handle,
.price-slider [class*="handle"] {
    background: #ffffff !important;
    border: 2px solid rgb(100, 119, 93) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}


/* ╔════════════════════════════════════════════════════════════════╗
   ║ 6. MOBILNÍ HLAVIČKA (JS vytváří .bo-mobile-header)             ║
   ║    Zobrazená jen na mobilu                                     ║
   ╚════════════════════════════════════════════════════════════════╝ */

.bo-mobile-header,
.bo-mobile-sticky-bar {
    display: none;
}


/* ╔════════════════════════════════════════════════════════════════╗
   ║ 7. MOBIL — SPLIT LAYOUT (filtry vlevo, produkty vpravo)        ║
   ║    Plus sticky dolní bar                                       ║
   ╚════════════════════════════════════════════════════════════════╝ */

@media (max-width: 768px) {

    /* Grid layout: 42% sidebar + 58% produkty */
    .pageContentIn {
        display: grid !important;
        grid-template-columns: 42% 58% !important;
        gap: 12px !important;
        padding-bottom: 80px !important;
    }

    /* Sidebar: bílý box, statický */
    #page_panel.panel-filter {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        transform: none !important;
        margin: 0 !important;
        padding: 14px 12px !important;
        background: rgba(255, 255, 255, 0.6) !important;
        border-radius: 12px !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    /* Hlavní obsah produktů */
    #pan_main {
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
    }

    /* Skrýt H1 v main (je v mobile header) */
    #pan_main h1 {
        display: none !important;
    }

    /* Skrýt desktopový horní toolbar */
    .bo-product-toolbar,
    .c-toolbar {
        display: none !important;
    }

    /* Skrýt panel kategorií na mobilu (mobile má jen filtry) */
    #categoryPanel {
        display: none !important;
    }

    #panel-filter-list {
        display: block !important;
    }

    /* Mobilní titulek "Filtrovať podľa" */
    #panel-filter-list::before {
        display: block !important;
        content: 'Filtrovať podľa' !important;
        font-family: 'Montserrat', sans-serif !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        color: rgb(52, 49, 45) !important;
        margin-bottom: 12px !important;
    }

    /* Menší filtry na mobilu */
    .categoryFiltersRow {
        margin: 0 !important;
        padding: 10px 0 !important;
        border-top: none !important;
        border-bottom: none !important;
    }

    .categoryFilterName {
        font-size: 13px !important;
        font-weight: 600 !important;
        margin-bottom: 6px !important;
        padding: 2px 0 !important;
    }

    .categoryFilterValues label {
        padding: 3px 0 !important;
        font-size: 12px !important;
    }

    .categoryFilterValues input[type="checkbox"] {
        width: 14px !important;
        height: 14px !important;
        margin-right: 6px !important;
        border: 1px solid rgba(0, 0, 0, 0.2) !important;
        border-radius: 3px !important;
    }

    /* Produktové karty - 2 sloupce */
    #pan_main .c-product {
        width: calc(50% - 4px) !important;
        margin: 0 4px 12px 0 !important;
    }

    /* Mobilní hlavička s názvem kategorie + Zrušiť */
    .bo-mobile-header {
        display: block !important;
        grid-column: 1 / -1;
        padding: 12px 0 0;
    }

    .bo-mobile-header h2 {
        font-family: 'Montserrat', sans-serif;
        font-size: 24px;
        font-weight: 400;
        color: rgb(52, 49, 45);
        margin: 0 0 10px;
    }

    .bo-mobile-clear-box {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
        font-size: 13px;
        color: rgb(52, 49, 45);
        margin-bottom: 14px;
        cursor: pointer;
    }
    .bo-mobile-clear-box::before {
        content: '×';
        font-size: 16px;
    }

    /* Sticky dolní bar */
    .bo-mobile-sticky-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        gap: 8px;
        padding: 10px 14px;
        background: #ffffff;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        z-index: 999;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
    }

    .bo-sticky-cancel {
        flex: 0 0 auto;
        padding: 10px 18px;
        background: transparent;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 100px;
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        color: rgb(52, 49, 45);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    .bo-sticky-cancel::before {
        content: '×';
        font-size: 14px;
    }

    .bo-sticky-apply {
        flex: 1;
        padding: 12px 18px;
        background: rgb(100, 119, 93);
        color: #ffffff;
        border: none;
        border-radius: 100px;
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    .bo-sticky-apply::before {
        content: '⚡';
        font-size: 14px;
    }
}
