/**
 * Bokun Filters Widget - Clean & Simple Design
 */

/* ==========================================
   CONTAINER PRINCIPAL
   ========================================== */
.bokun-filters-container {
    position: relative;
}

/* ==========================================
   ACCORDION LAYOUT - DISABLED
   Funcionalidad de acordeón eliminada, los filtros siempre están expandidos
   ========================================== */

/* ==========================================
   VERTICAL LAYOUT (Simple - Default)
   ========================================== */
.bokun-filters-vertical .bokun-filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bokun-filters-vertical .bokun-filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bokun-filter-label {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    display: block;
}

/* ==========================================
   CHECKBOX LIST MEJORADO
   ========================================== */
.bokun-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bokun-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bokun-checkbox-item:hover {
    opacity: 0.8;
}

.bokun-checkbox-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 3px;
    border: 1.5px solid #d1d5db;
    transition: all 0.2s ease;
    accent-color: #ff6b35;
}

.bokun-checkbox-input:checked {
    background-color: #ff6b35;
    border-color: #ff6b35;
}

.bokun-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.bokun-count {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}

/* Show More Button - DISABLED
   Funcionalidad eliminada, todos los elementos siempre visibles */

/* ==========================================
   RANGE SLIDERS - MEJORADO
   ========================================== */
.bokun-price-slider-wrapper,
.bokun-duration-slider-wrapper {
    padding: 8px 0;
    width: 100%;
    position: relative;
}

.bokun-price-slider-wrapper .bokun-price-slider-track,
.bokun-duration-slider-wrapper .bokun-duration-slider-track {
    position: relative;
}

.bokun-price-display,
.bokun-duration-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.price-min-display,
.price-max-display,
.duration-min-display,
.duration-max-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.duration-unit-label {
    font-weight: 400;
    color: #64748b;
    font-size: 12px;
    margin-left: 2px;
}

/* Duration Controls */
.bokun-duration-controls {
    margin-bottom: 15px;
}

/* Duration Unit Selector */
.bokun-duration-unit-selector {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.bokun-unit-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bokun-unit-option:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.bokun-unit-radio {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.bokun-unit-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.bokun-unit-option:has(.bokun-unit-radio:checked) {
    background: #eff6ff;
    border-color: #3b82f6;
}

.bokun-unit-option:has(.bokun-unit-radio:checked) .bokun-unit-label {
    color: #3b82f6;
}

/* Slider Track Container */
.bokun-price-slider-track,
.bokun-duration-slider-track {
    position: relative;
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    margin: 24px 0 28px 0;
    width: 100%;
}

/* Range Selected Area */
.bokun-price-slider-range,
.bokun-duration-slider-range {
    position: absolute;
    height: 100%;
    border-radius: 10px;
    background: #ff6b35;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

/* Range Input Styling */
.bokun-filter-range {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0;
    left: 0;
    background: transparent;
    pointer-events: all;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    z-index: 2;
    margin-top: -4px;
}

/* Webkit Thumb Styles */
.bokun-filter-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 5px solid #ff6b35;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    position: relative;
    margin-top: -3px;
}

.bokun-filter-range::-webkit-slider-thumb:hover {
    border-width: 6px;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.25);
    transform: scale(1.05);
}

.bokun-filter-range::-webkit-slider-thumb:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Firefox Thumb Styles */
.bokun-filter-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 5px solid #ff6b35;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.bokun-filter-range::-moz-range-thumb:hover {
    border-width: 6px;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.25);
    transform: scale(1.05);
}

.bokun-filter-range::-moz-range-thumb:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Track Styles - MUY IMPORTANTE para alineación */
.bokun-filter-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border: none;
    border-radius: 3px;
}

.bokun-filter-range::-moz-range-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border: none;
    border-radius: 3px;
}

/* Asegurar que los inputs range no tengan estilos conflictivos */
input.bokun-filter-range {
    outline: none;
    border: none;
}

input.bokun-filter-range:focus {
    outline: none;
}

/* Ajuste específico para Chrome/Safari */
@supports (-webkit-appearance: none) {
    .bokun-filter-range {
        height: 6px;
    }
}

/* Ajuste específico para Firefox */
@-moz-document url-prefix() {
    .bokun-filter-range {
        height: 6px;
    }
}
/* ==========================================
   FILTER ACTIONS
   ========================================== */
.bokun-filters-actions {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.bokun-filter-button {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    color: #374151;
}

.bokun-filter-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* ==========================================
   RESULTS COUNT
   ========================================== */
.bokun-filters-results-count {
    padding: 12px 0;
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.results-count-text {
    font-size: 13px;
    color: #6b7280;
}

.results-count-number {
    font-weight: 700;
}
.bokun-filter-range
/* ==========================================
   LOADING STATE - SUTIL Y NO BLOQUEANTE
   ========================================== */
.bokun-filters-loading {
    display: none !important; /* Overlay bloqueante deshabilitado */
}

/* Indicador sutil cuando está filtrando */
.bokun-filters-form.bokun-filtering {
    position: relative;
}

.bokun-filters-form.bokun-filtering::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%);
    background-size: 200% 100%;
    animation: loading-bar 1s ease-in-out infinite;
    border-radius: 2px;
    z-index: 100;
}

@keyframes loading-bar {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   HORIZONTAL LAYOUT
   ========================================== */
.bokun-filters-horizontal .bokun-filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.bokun-filters-horizontal .bokun-filter-group {
    flex: 1;
    min-width: 180px;
}

/* ==========================================
   GRID LAYOUT
   ========================================== */
.bokun-filters-grid .bokun-filters-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .bokun-filters-grid .bokun-filters-wrapper {
        grid-template-columns: 1fr;
    }

    .bokun-filters-horizontal .bokun-filters-wrapper {
        flex-direction: column;
    }
}

/* ==========================================
   NO RESULTS MESSAGE
   ========================================== */
.bokun-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

.bokun-no-results p {
    margin: 0;
    font-size: 15px;
}

/* ==========================================
   FORZAR 2 COLUMNAS EN RESULTADOS DE BOKUN
   - Se aplica únicamente cuando el contenedor de resultados
     tiene el atributo data-bokun-results="true" para evitar
     interferir con otros grids de la página.
   - Usa !important y un selector más específico para sobreescribir
     reglas de Elementor como .elementor-grid-3 .elementor-grid
 ========================================== */
[data-bokun-results="true"] .elementor-loop-container.elementor-grid,
[data-bokun-results="true"] .elementor-loop-container.elementor-grid .elementor-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
}

/* Responsive: en pantallas pequeñas una columna */
@media (max-width: 768px) {
    [data-bokun-results="true"] .elementor-loop-container.elementor-grid,
    [data-bokun-results="true"] .elementor-loop-container.elementor-grid .elementor-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   ASEGURAR QUE CADA TARJETA RELLENE SU COLUMNA
   - Forzar que los items del loop ocupen 100% del ancho
   - Evita que el contenido quede comprimido en una columna estrecha
 ========================================== */
[data-bokun-results="true"] .elementor-loop-container.elementor-grid > * {
    width: 100% !important;
    min-width: 0 !important; /* evita overflows que contraen las columnas */
    box-sizing: border-box !important;
}

[data-bokun-results="true"] .elementor-loop-container.elementor-grid .elementor-post,
[data-bokun-results="true"] .elementor-loop-container.elementor-grid .elementor-loop-item,
[data-bokun-results="true"] .elementor-loop-container.elementor-grid .elementor-post.elementor-grid-item {
    display: block !important;
    width: 100% !important;
    align-self: stretch !important;
}

[data-bokun-results="true"] .elementor-loop-container.elementor-grid .elementor-post__card,
[data-bokun-results="true"] .elementor-loop-container.elementor-grid .elementor-loop-item > * {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Asegurar que las imágenes no forcen un ancho pequeño */
[data-bokun-results="true"] .elementor-loop-container.elementor-grid img {
    max-width: 100% !important;
    height: auto !important;
}

/* ==========================================
   MOBILE SIDEBAR (RESPONSIVE)
   ========================================== */
.bokun-filters-mobile-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background-color: #ff6b35;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: background-color 0.3s;
}

.bokun-filters-mobile-toggle:hover {
    background-color: #e55a2b;
}

.bokun-filters-mobile-toggle i {
    font-size: 16px;
}

.bokun-filters-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bokun-filters-mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.bokun-filters-mobile-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bokun-filters-mobile-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .bokun-filters-mobile-sidebar .bokun-filters-mobile-toggle {
        display: flex;
    }
    
    .bokun-filters-mobile-sidebar .bokun-filters-mobile-header {
        display: flex;
    }

    .bokun-filters-mobile-sidebar .bokun-filters-form {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background-color: #fff;
        z-index: 9999;
        overflow-y: auto;
        transition: right 0.3s ease-in-out;
        padding: 0;
        box-shadow: -4px 0 15px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
    }

    .bokun-filters-mobile-sidebar .bokun-filters-form.is-open {
        right: 0;
    }

    .bokun-filters-mobile-sidebar .bokun-filters-mobile-overlay.is-active {
        display: block;
        opacity: 1;
    }
    
    .bokun-filters-mobile-sidebar .bokun-filters-wrapper {
        padding: 0 20px 20px;
        flex-grow: 1;
    }
    
    .bokun-filters-mobile-sidebar .bokun-filters-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 15px 20px;
        border-top: 1px solid #e5e7eb;
        margin-top: auto;
    }
    
    /* Prevenir scroll en el body cuando el sidebar está abierto */
    body.bokun-filters-open {
        overflow: hidden;
    }
}
