/* ==========================================================================
   HIDING DUPLICATES AND UNWANTED ELEMENTS
   ========================================================================== */
/* Hide the top panel that is NOT inside our wrapper (the one above the filters) */
body .woof_products_top_panel:not(.k-topbar-wrapper .woof_products_top_panel) {
    display: none !important;
}

/* Hide the RE-INICIALIZAR button */
.woof_reset_search_form,
.woof_reset_button_2,
[data-name="reset"] {
    display: none !important;
}

/* Hide duplicated result count and catalog ordering that WOOF shortcode outputs */
body .woocommerce-result-count:not(.k-topbar-controls .woocommerce-result-count),
body .woocommerce-ordering:not(.k-topbar-controls .woocommerce-ordering) {
    display: none !important;
}

/* ==========================================================================
   ACTIVE FILTERS STYLING (CHIPS DESIGN)
   ========================================================================== */
.k-topbar-wrapper .woof_products_top_panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 10px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Hide the prefix labels like "Recomendaciones:" or "Brands:" */
.k-topbar-wrapper .woof_products_top_panel > strong,
.k-topbar-wrapper .woof_products_top_panel > span {
    display: none !important;
}

/* Hide the old reset button */
.woof_reset_search_form, .woof_reset_button_2 {
    display: none !important;
}

/* Global Clear Filters Button */
.k-global-clear-filters {
    display: inline-block;
    float: right;
    margin: 5px 0 10px 15px;
    padding: 6px 15px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
.k-global-clear-filters:hover {
    background-color: #e0e0e0;
    color: #000;
    text-decoration: none;
}

/* Active filters container */
.k-topbar-wrapper > .woof_products_top_panel {
    display: block;
    width: 100%;
    margin-top: 15px;
    clear: both;
    overflow: hidden;
}
/* Style the filter chips */
.k-topbar-wrapper .woof_products_top_panel ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    float: left;
}

.k-topbar-wrapper .woof_products_top_panel ul li {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex;
}

.k-topbar-wrapper .woof_products_top_panel ul li a.woof_remove_ppi {
    background-color: #f7f7f7 !important;
    color: #1a1a2e !important;
    padding: 6px 12px !important;
    border-radius: 2px !important;
    border: none !important;
    font-size: 13px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    box-shadow: none !important;
    font-weight: 500;
}

/* The 'x' icon inside the chip */
.k-topbar-wrapper .woof_products_top_panel ul li a.woof_remove_ppi span {
    display: inline-block !important; /* Force show the 'x' icon since we hid spans above */
    color: #999;
    font-weight: normal;
    font-size: 14px;
}

/* Move the clear button to the right and style it as a link */
.k-topbar-wrapper .woof_products_top_panel .woof_clear_all {
    order: 99; /* Force it to the end of the flex container */
    background: transparent !important;
    color: #0056b3 !important; /* Link color */
    border: none !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    height: auto !important;
    line-height: normal !important;
}
.k-topbar-wrapper .woof_products_top_panel .woof_clear_all:hover {
    color: #003d82 !important;
    background: transparent !important;
}

/* ==========================================================================
   CUSTOM CHECKBOX DROPDOWN (SPLIT FILTERS)
   ========================================================================== */
.k-custom-split-filter {
    flex: 1;
    min-width: 150px;
}
.k-check-dropdown {
    position: relative;
    width: 100%;
    font-family: inherit;
}
.k-check-dropdown-toggle {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: border-color 0.2s;
}
.k-check-dropdown-toggle:hover {
    border-color: #aaa;
}
.k-check-dropdown-toggle::after {
    content: "▼";
    font-size: 10px;
    color: #999;
    margin-left: 10px;
}
.k-check-dropdown-toggle.k-open::after {
    content: "▲";
}
.k-check-dropdown-panel {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    border-radius: 4px;
}
.k-check-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.k-check-count {
    color: #666;
}
.k-check-reset {
    color: #0056b3;
    text-decoration: none;
}
.k-check-reset:hover {
    text-decoration: underline;
}
.k-check-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}
.k-check-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    margin: 0 !important;
    transition: background 0.2s;
}
.k-check-item:hover {
    background: #f9f9f9;
}
.k-check-item input[type="checkbox"] {
    margin: 0 10px 0 0 !important;
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.k-check-item span {
    flex: 1;
}

/* ==========================================================================
   Husky (WOOF) Premium Glassmorphism Drawer
   ========================================================================== */

/* Drawer Overlay (Hidden by default) */
.k-husky-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.k-husky-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Stop body scroll when drawer is open */
body.k-husky-noscroll {
    overflow: hidden !important;
}

/* Drawer Content */
.k-husky-drawer-content {
    position: absolute;
    top: 0;
    left: -400px;
    width: 350px;
    max-width: 85vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.k-husky-drawer-overlay.active .k-husky-drawer-content {
    left: 0;
}

/* Desktop layout overrides: Show on side instead of overlay? 
   Wait, if we want it to be a real sidebar on desktop, we can override the overlay.
   But the user said "como una barra lateral (sidebar) en computadora y como panel oculto deslizable en móviles".
*/
@media (min-width: 1025px) {
    /* If we want it strictly as an off-canvas everywhere, we keep the above. 
       If we want it fixed on the left on desktop, we change it.
       Let's keep it off-canvas for now, it's very modern (like Zara/Mango).
       Actually, let's just make it a clean sliding drawer everywhere. */
}

/* Header */
.k-husky-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.5);
}

.k-husky-drawer-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.k-husky-drawer-header h3 i {
    color: #C783FF;
}

.k-husky-close-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.k-husky-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a2e;
}

/* Body (WOOF Container) */
.k-husky-drawer-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* ==========================================================================
   Husky (WOOF) Plugin Overrides
   ========================================================================== */

.woof_container {
    margin-bottom: 25px !important;
}

.woof_container:last-child {
    border-bottom: none !important;
}

.woof_container h4 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin-bottom: 15px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Checkboxes (Pill style) */
.woof_list_checkbox {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.woof_list_checkbox li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Hide original checkbox */
.woof_list_checkbox input[type="checkbox"],
.woof_list_radio input[type="radio"] {
    display: none !important;
}

/* Fake Pill Label */
.woof_list_checkbox label,
.woof_list_radio label {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 15px !important;
    background: #f8f9fa !important;
    border: 1px solid #eaeaea !important;
    border-radius: 20px !important;
    font-size: 0.9rem !important;
    color: #444 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

.woof_list_checkbox label:hover,
.woof_list_radio label:hover {
    background: #f0f0f0 !important;
    border-color: #ddd !important;
    transform: translateY(-1px) !important;
}

/* Checked State */
.woof_list_checkbox input[type="checkbox"]:checked + label,
.woof_list_radio input[type="radio"]:checked + label,
.woof_radio_term.checked label,
.woof_checkbox_term.checked label {
    background: linear-gradient(135deg, rgba(130, 87, 229, 0.1), rgba(236, 72, 153, 0.1)) !important;
    border-color: #C783FF !important;
    color: #1a1a2e !important;
    box-shadow: 0 4px 10px rgba(130, 87, 229, 0.15) !important;
}

/* Count */
.woof_checkbox_count,
.woof_radio_count {
    margin-left: 5px !important;
    font-size: 0.8rem !important;
    color: #888 !important;
    background: rgba(0,0,0,0.05) !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
}

.woof_checkbox_term.checked .woof_checkbox_count,
.woof_radio_term.checked .woof_radio_count {
    color: #C783FF !important;
    background: rgba(199, 131, 255, 0.15) !important;
}

/* Loader */
.woof_info_popup {
    background: linear-gradient(135deg, rgba(130, 87, 229, 0.9), rgba(236, 72, 153, 0.9)) !important;
    backdrop-filter: blur(10px) !important;
    border: none !important;
    border-radius: 30px !important;
    color: white !important;
    font-weight: bold !important;
    box-shadow: 0 10px 30px rgba(130, 87, 229, 0.4) !important;
}

/* Reset Button */
.woof_reset_search_form {
    background: #f8f9fa !important;
    color: #444 !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
    margin-top: 10px !important;
}

.woof_reset_search_form:hover {
    background: #fff !important;
    border-color: #1a1a2e !important;
    color: #1a1a2e !important;
}

/* Hide Price Filter entirely */
.woof_container_woof_price_filter,
.woof_price_search_container,
.woof_price_filter,
.woof_container_slider {
    display: none !important;
}


