/* =======================================================
   AC CUSTOM FILTERS - HLAVNÝ DIZAJN
   Firemné farby: #0d69ba (Modrá), #EFF6FF (Svetlomodrá), 
   #444 (Tmavosivá text), #999 (Svetlosivá), #e53e3e (Červená)
======================================================= */

/* Skrytie natívneho zobrazenia WooCommerce (zoradenie, počet a staré stránkovanie) */
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering,
.woocommerce-pagination,
nav.woocommerce-pagination { 
    display: none !important; 
}

/* --- OBAL A HLAVIČKA FILTRA (BOČNÝ PANEL) --- */
.ac-filter-wrapper {
    background: none;
    padding: 0;
    font-family: inherit;
}

/* --- SKUPINY FILTROV A ROZBALOVANIE --- */
.ac-filter-group {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.ac-filter-title {
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
}
.ac-toggle-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
    color: #999;
}
.ac-filter-group.closed .ac-toggle-icon {
    transform: rotate(-90deg);
}
.ac-filter-group.closed .ac-filter-options {
    display: none;
}

/* --- VLASTNÉ CHECKBOXY A RADIO BUTTONY --- */
.ac-filter-options {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}
.ac-custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    user-select: none;
    margin-bottom: 8px;
}
.ac-custom-checkbox input {
    position: absolute;
    opacity: 0; 
    cursor: pointer;
    height: 0;
    width: 0;
}
.ac-checkmark {
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 1px solid #999;
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
/* Hover a kliknutie na checkbox (Primárna farba) */
.ac-custom-checkbox:hover input ~ .ac-checkmark {
    border-color: #0d69ba;
}
.ac-custom-checkbox input:checked ~ .ac-checkmark {
    background-color: #0d69ba;
    border-color: #0d69ba;
}
.ac-custom-checkbox input:checked ~ .ac-checkmark:after {
    content: "✓";
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* --- ROZBAĽOVACIE ZOZNAMY (DROPDOWNS vo filtri) --- */
.ac-dropdown {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #999;
    border-radius: 6px;
    color: #444;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
    
    /* Vypnutie natívneho dizajnu */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Farba a naša vlastná tmavosivá šípka v JEDNOM riadku */
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center !important;
    background-size: 16px !important;
    padding-right: 35px;
}

.ac-dropdown:focus, .ac-dropdown:hover {
    border-color: #0d69ba;
}

/* --- ZORADENIE (SELECT BOX) --- */
/* --- ZORADENIE (SELECT BOX) --- */
.ac-sort-input {
    padding: 10px 15px !important;
    padding-right: 45px !important; /* Extra miesto len pre šípku napravo */
    box-sizing: border-box !important; /* Zabezpečí, že padding nepraskne box */
    min-width: 220px; /* Zabezpečí, aby nebol boxík príliš úzky pre text */
    
    border-radius: 6px;
    border: 1px solid #0d69ba;
    color: #0d69ba;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-size: 14px;
    
    /* Vypnutie natívneho dizajnu */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Farba a naša vlastná MODRÁ šípka */
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230d69ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 15px center !important;
    background-size: 16px !important;
}

.ac-sort-input:hover, .ac-sort-input:focus {
    background-color: #EFF6FF !important;
}

/* --- FARBY A OBRÁZKY (SQUARE ŠTÍTKY) --- */
.ac-color-checkbox input, .ac-image-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.ac-color-swatch { 
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid transparent; 
    cursor: pointer;
    transition: all 0.2s; 
}
.ac-color-checkbox input:checked + .ac-color-swatch { 
    border-color: #0d69ba;
    transform: scale(1.1);
}
.ac-color-checkbox:hover .ac-color-swatch {
    transform: scale(1.05);
}

.ac-image-swatch { 
    display: block;
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px; 
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.ac-image-checkbox input:checked + .ac-image-swatch { 
    border-color: #0d69ba;
    transform: scale(1.1);
}
.ac-image-checkbox:hover .ac-image-swatch {
    transform: scale(1.05);
}

/* --- POSUVNÍK (SLIDER) --- */
.ac-slider-ui {
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 15px 10px 5px;
}
.ac-slider-ui .ui-slider-range {
    position: absolute;
    height: 100%;
    background: #0d69ba; 
    border-radius: 4px;
}
.ac-slider-ui .ui-slider-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid #0d69ba;
    border-radius: 50%;
    top: -6px; 
    margin-left: -9px;
    cursor: grab;
    outline: none;
    transition: transform 0.1s;
}
.ac-slider-ui .ui-slider-handle:active {
    cursor: grabbing;
    transform: scale(1.2); 
}

/* =======================================================
   HORNÝ PANEL (AKTÍVNE ŠTÍTKY A ZORADENIE)
======================================================= */
.ac-top-bar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

/* --- ZORADENIE (SELECT BOX) --- */
.ac-sorting-wrapper {
    display: flex;
    align-items: center;
}
.ac-sort-input {
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #0d69ba;
    background-color: #fff;
    color: #0d69ba;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-size: 14px;
}
.ac-sort-input:hover, .ac-sort-input:focus {
    background-color: #EFF6FF;
}

/* --- AKTÍVNE ŠTÍTKY (PILLS) --- */
.ac-active-filters-container {
    flex-grow: 1;
}
.ac-active-filters-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.ac-filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: #EFF6FF; 
    border: 1px solid #0d69ba; 
    color: #0d69ba;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s;
}
.ac-filter-tag strong {
    margin-left: 4px;
    color: #0d69ba;
}
.ac-remove-tag {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    color: #0d69ba;
    line-height: 1;
    transition: transform 0.2s;
}
/* Efekt pri prejdení myšou */
.ac-filter-tag:hover {
    background-color: #0d69ba;
    color: #fff;
}
.ac-filter-tag:hover strong, .ac-filter-tag:hover .ac-remove-tag {
    color: #fff;
}
.ac-remove-tag:hover {
    transform: scale(1.2);
}
.ac-clear-all-tags {
    font-size: 13px;
    color: #e53e3e;
    text-decoration: underline;
    margin-left: 8px;
    font-weight: bold;
}
.ac-clear-all-tags:hover {
    opacity: 0.7;
}

/* =======================================================
   RESPONZIVITA A VÝSUVNÝ MOBILNÝ PANEL
======================================================= */
.ac-mobile-toggle, .ac-filter-overlay, .ac-mobile-close {
    display: none;
}

@media (max-width: 992px) {
    /* Zoradenie na celú šírku na mobile */
    .ac-top-bar-wrapper { flex-direction: column; align-items: stretch; }
    .ac-sorting-wrapper { width: 100%; }
    .ac-sort-input { width: 100%; text-align: center; }

    /* Tlačidlo na mobile */
    .ac-mobile-toggle { 
        display: block; width: 100%; padding: 15px; background: #0d69ba; color: #fff; 
        text-align: center; border: none; font-size: 16px; font-weight: bold; 
        border-radius: 5px; cursor: pointer; margin-bottom: 20px; text-transform: uppercase;
    }
    
    /* Výsuvný panel (Off-canvas) */
    .ac-filter-offcanvas { 
        position: fixed; top: 0; left: -100%; width: 320px; max-width: 85%; height: 100vh; 
        background: #fff; z-index: 99999; overflow-y: auto; transition: left 0.3s ease; 
    }
    .ac-filter-offcanvas.is-open { left: 0; }
    
    /* Tmavé pozadie vzadu */
    .ac-filter-overlay { 
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh; 
        background: rgba(0,0,0,0.6); z-index: 99998; opacity: 0; visibility: hidden; 
        transition: opacity 0.3s ease; 
    }
    .ac-filter-overlay.is-open { opacity: 1; visibility: visible; }
    
    /* Krížik na zatvorenie menu */
    .ac-mobile-close { 
        display: block; position: absolute; top: 15px; right: 20px; 
        font-size: 30px; cursor: pointer; line-height: 1; color: #444; 
    }
}

/* Jemnejšia farba pre počty v zátvorke */
.ac-term-count {
    font-size: 13px;
    color: #999;
    margin-left: 6px;
    font-weight: 500;
}

/* Zakliknutý checkbox prefarbí aj číslo na modro */
.ac-custom-checkbox input:checked ~ .ac-term-count {
    color: #0d69ba;
    font-weight: 700;
}

/* --- Tlačidlo Zobraziť viac pre dlhé zoznamy --- */
.ac-show-more-btn {
    font-size: 13px;
    color: #0d69ba;
    font-weight: 700;
    cursor: pointer;
    margin-top: 5px;
    margin-bottom: 5px;
    transition: color 0.2s;
    display: inline-block;
    user-select: none;
}
.ac-show-more-btn:hover {
    color: #e53e3e;
}

/* --- TLAČIDLO NAČÍTAŤ ĎALŠIE PRODUKTY --- */
.ac-load-more-wrapper {
    text-align: center;
    margin: 40px 0;
    width: 100%;
    clear: both;
}
#ac-load-more-btn {
    background-color: #fff;
    color: #0d69ba;
    border: 2px solid #0d69ba;
    padding: 12px 35px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-block;
}
#ac-load-more-btn:hover {
    background-color: #0d69ba;
    color: #fff;
}

/* --- PROFI LOTTIE LOADER --- */
.ac-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15%; 
    z-index: 999;
    pointer-events: none; 
}