/**
 * Frontend Styles
 * 
 * @package YAF
 */

/* ===== Filters Wrapper ===== */
.yaf-filters-wrapper {
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.yaf-filters-wrapper.yaf-hidden {
    max-height: 0;
    overflow: hidden;
    margin: 0;
    opacity: 0;
    visibility: hidden;
}

/* Filter container base styles - integrated in document flow */
.yaf-filters-container {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: none;
    overflow: visible;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 20px;
}

/* Smooth transitions when showing/hiding */
.yaf-filters-wrapper:not(.yaf-hidden) .yaf-filters-container {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Position classes - mainly for styling, not positioning */
.yaf-position-left .yaf-filters-container,
.yaf-position-right .yaf-filters-container {
    /* Side positions can have specific width if needed */
    max-width: 100%;
}

.yaf-position-top .yaf-filters-container,
.yaf-position-bottom .yaf-filters-container {
    /* Top/bottom positions take full width */
    width: 100%;
}

/* Horizontal layout for top/bottom positions */
.yaf-filters-wrapper.yaf-position-top .yaf-filters-list,
.yaf-filters-wrapper.yaf-position-bottom .yaf-filters-list {
    display: flex;
    flex-direction: row;
    gap: 20px;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 10px;
}

.yaf-filters-wrapper.yaf-position-top .yaf-filter,
.yaf-filters-wrapper.yaf-position-bottom .yaf-filter {
    min-width: 250px;
    flex-shrink: 0;
}

.yaf-filters-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

/* ===== Sticky Desktop - DISABLED ===== */
/* Sticky mode causes issues with filter positioning */
/*
@media (min-width: 769px) {
    .yaf-sticky .yaf-filters-container.is-sticky {
        position: fixed;
        top: 20px;
        z-index: 100;
        max-width: 300px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}
*/

/* ===== Mobile Toggle ===== */
.yaf-mobile-toggle {
    display: none;
    width: 100%;
    padding: 15px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.yaf-mobile-toggle:hover {
    background: #000;
}

.yaf-icon-filter::before {
    content: "⚙";
    font-size: 18px;
}

@media (max-width: 768px) {
    .yaf-mobile-toggle {
        display: flex;
    }
    
    .yaf-filters-container:not(.yaf-mobile-drawer) {
        display: block;
    }
    
    .yaf-mobile-drawer {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100%;
        background: #fff;
        z-index: 10001;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    }
    
    .yaf-mobile-drawer.is-open {
        display: block;
        right: 0;
    }
}

/* ===== Drawer Header ===== */
.yaf-drawer-header {
    display: none;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

@media (max-width: 768px) {
    .yaf-drawer-header {
        display: flex;
    }
}

.yaf-drawer-header h3 {
    margin: 0;
    font-size: 20px;
}

.yaf-drawer-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
}

.yaf-drawer-close:hover {
    color: #000;
}

/* ===== Drawer Overlay ===== */
.yaf-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.yaf-drawer-overlay.is-visible {
    display: block;
    opacity: 1;
}

body.yaf-drawer-open {
    overflow: hidden;
}

/* ===== Filters List ===== */
.yaf-filters-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.yaf-filters-list::-webkit-scrollbar {
    width: 6px;
}

.yaf-filters-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.yaf-filters-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.yaf-filters-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== Individual Filter ===== */
.yaf-filter {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.yaf-filter:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.yaf-filter-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.yaf-filter-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Checkbox List ===== */
.yaf-checkbox-list,
.yaf-radio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Multi-column support */
.yaf-checkbox-list.yaf-multi-column,
.yaf-radio-list.yaf-multi-column,
.yaf-button-list.yaf-multi-column {
    display: grid;
    gap: 8px;
}

/* Scrollable filter content */
.yaf-checkbox-list.yaf-scrollable,
.yaf-radio-list.yaf-scrollable,
.yaf-button-list.yaf-scrollable {
    padding-right: 8px;
}

.yaf-checkbox-list.yaf-scrollable::-webkit-scrollbar,
.yaf-radio-list.yaf-scrollable::-webkit-scrollbar,
.yaf-button-list.yaf-scrollable::-webkit-scrollbar {
    width: 6px;
}

.yaf-checkbox-list.yaf-scrollable::-webkit-scrollbar-track,
.yaf-radio-list.yaf-scrollable::-webkit-scrollbar-track,
.yaf-button-list.yaf-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.yaf-checkbox-list.yaf-scrollable::-webkit-scrollbar-thumb,
.yaf-radio-list.yaf-scrollable::-webkit-scrollbar-thumb,
.yaf-button-list.yaf-scrollable::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.yaf-checkbox-list.yaf-scrollable::-webkit-scrollbar-thumb:hover,
.yaf-radio-list.yaf-scrollable::-webkit-scrollbar-thumb:hover,
.yaf-button-list.yaf-scrollable::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.yaf-checkbox,
.yaf-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 0;
}

.yaf-checkbox input,
.yaf-radio input {
    margin: 0;
    cursor: pointer;
}

.yaf-checkbox:hover,
.yaf-radio:hover {
    color: #2271b1;
}

/* ===== Button List ===== */
.yaf-button-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yaf-button {
    padding: 8px 16px;
    background: #f0f0f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.yaf-button:hover {
    background: #e0e0e0;
    border-color: #999;
}

.yaf-button.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ===== Dropdown ===== */
.yaf-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* ===== Price Slider ===== */
.yaf-price-slider {
    padding: 10px 0;
}

/* Dual slider (2 range inputs) */
.yaf-price-slider-dual {
    position: relative;
    padding: 20px 0;
}

.yaf-price-slider-dual input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    pointer-events: none;
}

.yaf-price-slider-dual input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: grab;
    border: 3px solid #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: auto;
    transition: transform 0.2s;
}

.yaf-price-slider-dual input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
}

.yaf-price-slider-dual input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: grab;
    border: 3px solid #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: auto;
    transition: transform 0.2s;
}

.yaf-price-slider-dual input[type="range"]::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
}

/* Single slider with number inputs */
.yaf-price-slider-single {
    padding: 10px 0;
}

/* Range wrapper for single slider */
.yaf-price-slider-single .yaf-price-range-wrapper {
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 20px 0 25px 0;
}

.yaf-price-slider-single .yaf-price-range-track {
    position: absolute;
    height: 100%;
    background: #333;
    border-radius: 3px;
    transition: left 0.1s, right 0.1s;
}

.yaf-price-slider-single input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    pointer-events: none;
    top: -10px;
}

.yaf-price-slider-single input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: grab;
    border: 3px solid #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: auto;
    transition: transform 0.2s;
}

.yaf-price-slider-single input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
}

.yaf-price-slider-single input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: grab;
    border: 3px solid #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: auto;
    transition: transform 0.2s;
}

.yaf-price-slider-single input[type="range"]::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
}

/* Editable inputs below slider */
.yaf-price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.yaf-price-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.yaf-price-input-wrapper label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yaf-price-input-wrapper input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    transition: border-color 0.2s;
}

.yaf-price-input-wrapper input[type="number"]:focus {
    outline: none;
    border-color: #333;
}

.yaf-price-separator {
    flex: 0;
    padding-bottom: 10px;
    font-weight: 600;
    color: #999;
}

/* Price display (common for both) */
.yaf-price-slider input[type="range"] {
    width: 100%;
    margin: 10px 0;
    cursor: pointer;
}

.yaf-price-display {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #333;
    margin-top: 10px;
}

/* ===== Filter Actions ===== */
.yaf-filters-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/*
@media (min-width: 769px) {
    .is-sticky .yaf-filters-actions {
        position: sticky;
        bottom: 0;
        margin-left: -20px;
        margin-right: -20px;
        margin-bottom: -20px;
        padding: 20px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
}
*/

.yaf-apply-filters,
.yaf-reset-filters {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.yaf-apply-filters {
    background: #333;
    color: #fff;
}

.yaf-apply-filters:hover {
    background: #000;
}

.yaf-apply-filters:disabled {
    background: #999;
    cursor: not-allowed;
}

.yaf-reset-filters {
    background: #f0f0f1;
    color: #333;
    border: 1px solid #ddd;
}

.yaf-reset-filters:hover {
    background: #e0e0e0;
}

/* ===== Loading State ===== */
.yaf-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== No Products ===== */
.no-products {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
    list-style: none;
}

/* ===== Responsive ===== */

/* Desktop - 1024px and up */
@media (min-width: 1024px) {
    /* Filters list layout */
    .yaf-filters-wrapper[data-columns-desktop="1"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-desktop="2"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-desktop="3"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-desktop="4"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Individual filter items in lists */
    .yaf-filters-wrapper[data-columns-desktop="1"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-desktop="1"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-desktop="1"] .yaf-button-list {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-desktop="2"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-desktop="2"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-desktop="2"] .yaf-button-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-desktop="3"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-desktop="3"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-desktop="3"] .yaf-button-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-desktop="4"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-desktop="4"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-desktop="4"] .yaf-button-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet - 768px to 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Filters list layout */
    .yaf-filters-wrapper[data-columns-tablet="1"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-tablet="2"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-tablet="3"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-tablet="4"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Individual filter items in lists */
    .yaf-filters-wrapper[data-columns-tablet="1"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-tablet="1"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-tablet="1"] .yaf-button-list {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-tablet="2"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-tablet="2"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-tablet="2"] .yaf-button-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-tablet="3"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-tablet="3"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-tablet="3"] .yaf-button-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-tablet="4"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-tablet="4"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-tablet="4"] .yaf-button-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile - Less than 768px */
@media (max-width: 767px) {
    /* Filters list layout */
    .yaf-filters-wrapper[data-columns-mobile="1"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-mobile="2"] .yaf-filters-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Individual filter items in lists */
    .yaf-filters-wrapper[data-columns-mobile="1"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-mobile="1"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-mobile="1"] .yaf-button-list {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .yaf-filters-wrapper[data-columns-mobile="2"] .yaf-checkbox-list,
    .yaf-filters-wrapper[data-columns-mobile="2"] .yaf-radio-list,
    .yaf-filters-wrapper[data-columns-mobile="2"] .yaf-button-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .yaf-filters-container {
        padding: 15px;
    }
    
    .yaf-filter-title {
        font-size: 15px;
    }
    
    .yaf-filters-actions {
        flex-direction: column;
    }
    
    .yaf-apply-filters,
    .yaf-reset-filters {
        width: 100%;
    }
}

/* ===== WooCommerce Integration ===== */
.woocommerce .yaf-filters-wrapper {
    margin-bottom: 30px;
}

.woocommerce-page .yaf-filters-wrapper {
    margin-bottom: 30px;
}

/* ===== Floating Filter Button ===== */
.yaf-floating-filter-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
}

.yaf-floating-filter-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.yaf-floating-filter-btn:hover {
    background: #000;
    transform: scale(1.1) translateY(0);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.yaf-floating-filter-btn.is-visible:hover {
    transform: scale(1.1) translateY(0);
}

.yaf-floating-filter-btn .yaf-icon-filter::before {
    content: "⚙";
    font-size: 24px;
    line-height: 1;
}

.yaf-floating-filter-btn .yaf-btn-text {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (min-width: 769px) {
    .yaf-floating-filter-btn {
        width: auto;
        height: auto;
        padding: 12px 24px;
        border-radius: 30px;
        flex-direction: row;
        gap: 8px;
    }
    
    .yaf-floating-filter-btn .yaf-btn-text {
        font-size: 13px;
    }
}

/* ===== Floating Mode Overlay ===== */
.yaf-floating-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.yaf-floating-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Floating filter container */
.yaf-filters-container.yaf-floating {
    position: fixed !important;
    z-index: 9998;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    animation: slideInFloating 0.3s ease;
}

@keyframes slideInFloating {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Position based floating styles */
.yaf-position-top .yaf-filters-container.yaf-floating {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px !important;
}

.yaf-position-bottom .yaf-filters-container.yaf-floating {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) !important;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px !important;
}

.yaf-position-left .yaf-filters-container.yaf-floating {
    top: 50%;
    left: 20px;
    transform: translateY(-50%) !important;
    width: 400px;
    max-width: 90vw;
    border-radius: 0 12px 12px 0 !important;
}

.yaf-position-right .yaf-filters-container.yaf-floating {
    top: 50%;
    right: 20px;
    transform: translateY(-50%) !important;
    width: 400px;
    max-width: 90vw;
    border-radius: 12px 0 0 12px !important;
}

/* Mobile floating mode */
@media (max-width: 768px) {
    .yaf-filters-container.yaf-floating {
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 90vw !important;
        max-height: 80vh !important;
        border-radius: 12px !important;
        display: block !important;
        z-index: 9998 !important;
    }
    
    /* Force display of filters content in floating mode */
    .yaf-filters-wrapper:not(.yaf-hidden) .yaf-filters-container.yaf-floating {
        display: block !important;
    }
    
    /* Force vertical layout on mobile floating */
    .yaf-filters-container.yaf-floating .yaf-filters-list {
        display: block !important;
        flex-direction: column !important;
        overflow-x: visible !important;
    }
    
    .yaf-filters-container.yaf-floating .yaf-filter {
        width: 100% !important;
        min-width: 100% !important;
        flex-shrink: 1 !important;
        border-right: none !important;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0 !important;
        padding-bottom: 20px !important;
        margin-bottom: 20px !important;
    }
    
    .yaf-filters-container.yaf-floating .yaf-filter:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
}

/* Prevent body scroll when floating is open */
body.yaf-floating-open {
    overflow: hidden;
}

/* Enhanced close button visibility in floating mode */
.yaf-floating .yaf-drawer-close {
    display: block !important;
    opacity: 1 !important;
}

.yaf-floating .yaf-drawer-header {
    display: flex !important;
}
    
    .yaf-floating-filter-btn .yaf-btn-text {
        font-size: 14px;
    }
}
/* ===== Customizer Features ===== */

/* Skeleton Loader */
.yaf-filters-container.yaf-loading {
    pointer-events: none;
}

.yaf-skeleton-wrapper {
    animation: yaf-pulse 1.5s ease-in-out infinite;
}

.yaf-skeleton-filter {
    margin-bottom: 20px;
}

.yaf-skeleton-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: yaf-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 12px;
    width: 60%;
}

.yaf-skeleton-item {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: yaf-shimmer 1.5s ease-in-out infinite;
    border-radius: 3px;
    margin-bottom: 8px;
    width: 85%;
}

.yaf-skeleton-item:nth-child(2n) {
    width: 70%;
    animation-delay: 0.1s;
}

.yaf-skeleton-item:nth-child(3n) {
    width: 80%;
    animation-delay: 0.2s;
}

@keyframes yaf-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes yaf-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Results Count */
.yaf-results-count {
    padding: 12px 15px;
    background: #f8f9fa;
    border-left: 3px solid #2271b1;
    border-radius: 3px;
    font-size: 14px;
    color: #333;
    margin-bottom: 20px;
    display: none;
}

.yaf-results-count.yaf-visible {
    display: block;
}

.yaf-count-number {
    font-weight: 600;
    color: #2271b1;
}

/* Show More / Show Less Button */
.yaf-show-more {
    background: none;
    border: none;
    color: #2271b1;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 0;
    text-decoration: underline;
    display: block;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.yaf-show-more:hover {
    color: #135e96;
}

.yaf-show-more:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.yaf-hidden-item {
    display: none;
}

/* Applied Message (Toast) */
.yaf-applied-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #46b450;
    color: #fff;
    padding: 15px 30px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999999;
    display: none;
    font-size: 14px;
    font-weight: 500;
    animation: yaf-fadeInMessage 0.3s ease;
}

.yaf-applied-message.yaf-visible {
    display: block;
}

@keyframes yaf-fadeInMessage {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Keyboard Navigation Focus States */
body.yaf-keyboard-nav .yaf-filter-item:focus-within,
body.yaf-keyboard-nav .yaf-checkbox-item:focus-within,
body.yaf-keyboard-nav .yaf-radio-item:focus-within {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 3px;
}

body.yaf-keyboard-nav button:focus,
body.yaf-keyboard-nav input[type="checkbox"]:focus,
body.yaf-keyboard-nav input[type="radio"]:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Loading State on Buttons */
.yaf-apply-filters.yaf-loading,
.yaf-reset-filters.yaf-loading {
    pointer-events: none;
    opacity: 0.6;
}

.yaf-button-loading {
    display: none;
}

.yaf-apply-filters.yaf-loading .yaf-button-text {
    display: none;
}

.yaf-apply-filters.yaf-loading .yaf-button-loading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.yaf-button-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: yaf-spin 0.8s linear infinite;
}

@keyframes yaf-spin {
    to { transform: rotate(360deg); }
}