/* ===== BUSCADOR Y SELECTOR DE HUÉSPEDES ===== */

/* ===== FADE IN DE CATEGORÍAS ===== */
.categorias-filtros, 
.categorias-dropdown-mobile {
    opacity: 0 !important;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none !important;
}

.categorias-filtros.visible, 
.categorias-dropdown-mobile.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#cabañas-container {
    transition: opacity 0.4s ease-in-out;
}

/* botones dentro sean clickeables cuando estén visibles */
.categorias-filtros.visible .categoria-btn,
.categorias-filtros.visible .btn-filtros,
.categorias-dropdown-mobile.visible .custom-select-display {
    pointer-events: auto !important;
}

.buscador-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid #ddd;
}

.form-buscador {
    display: flex;
    align-items: flex-end;
    padding: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.input-group {
    flex: 1;
    position: relative;
    min-width: 0;
}

.input-group:first-child {
    flex: 3;
    max-width: 60%;
}

.input-group.selector-huespedes {
    flex: 2;
    max-width: 40%;
}

.input-label {
    display: block;
    color: var(--text-dark);
    font-size: 14px;
    padding-left: 14px;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-buscador {
    height: 48px;
    padding: 0 0 0 16px;
    width: 100%;
    font-size: 16px;
    border: 1px solid #CCCCCC;
    background: white;
    box-sizing: border-box;
}

.input-buscador:focus {
    outline: none;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.1);
}

.input-buscador[readonly] {
    background-color: #F5F5F5;
    cursor: pointer;
}

#ubicacionInput {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

#huespedesInput {
    border-radius: 0 8px 8px 0;
}

.input-inactivo {
    background-color: #f5f5f5 !important;
    border-color: #ddd !important;
    color: #888 !important;
    cursor: not-allowed;
}

#ubicacionInput:focus {
    border-color: #FFBF00 !important;
    box-shadow: 0 0 0 2px rgba(255, 191, 0, 0.2) !important;
}

.input-buscador.active-huespedes {
    border-color: #FFBF00 !important;
    background: white !important;
}

/* Sugerencias de búsqueda */
.sugerencias-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1001;
    margin-top: 2px;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Selector de huéspedes */
.selector-huespedes {
    position: relative;
}

.dropdown-huespedes {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 20px;
    z-index: 1000;
    margin-top: 10px;
    min-width: 320px;
}

.dropdown-huespedes.active {
    display: block;
    z-index: 100000;
}

.huespedes-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.huespedes-option:last-child {
    border-bottom: none;
}

.huespedes-info {
    flex: 1;
}

.huespedes-info strong {
    display: block;
    color: #181818;
    font-size: 1rem;
    margin-bottom: 4px;
}

.huespedes-info small {
    color: #666;
    font-size: 0.85rem;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.counter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    font-size: 1.2rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.counter-btn:hover:not(:disabled) {
    border-color: #FFBF00;
    color: #181818;
}

.counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.counter-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: #181818;
}

.huespedes-resumen {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-huespedes {
    font-size: 0.95rem;
}

.total-huespedes strong {
    color: #181818;
}

.mascotas-info {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
}

.btn-cerrar-huespedes {
    background: #FFBF00;
    color: #181818;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cerrar-huespedes:hover {
    background: #E6AC00;
}

/* Botón Buscar */
.btn-buscar {
    font-size: 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 48px;
    min-width: 120px;
    max-width: 150px;
    justify-content: center;
    background: #FFBF00;
    color: #604135 !important;
    margin-left: 10px;
    flex-shrink: 0;
}

.btn-buscar:hover:not(:disabled) {
    background: #E6AC00;
    transform: translateY(-1px);
}

.btn-buscar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-buscar:not(:disabled) {
    cursor: pointer !important;
    opacity: 1 !important;
}

.btn-buscar-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

/* Media Queries específicas para el buscador */
@media (max-width: 950px) {
    .input-group:first-child {
        max-width: 75%;
    }
      .input-group.selector-huespedes {
        max-width: 35%;
    }
}

@media (max-width: 986px) and (min-width: 951px) {
    .form-buscador {
        padding: 0 20px;
    }
    
    .input-group:first-child {
        max-width: 75%;
    }
    
    .input-group.selector-huespedes {
        max-width: 35%;
    }
    
    .btn-buscar {
        min-width: 100px;
        max-width: 120px;
    }
    
    .input-label {
        font-size: 13px;
        padding-left: 10px;
    }
    
    .input-buscador {
        font-size: 15px;
        padding: 0 0 0 12px;
    }
}

@media (max-width: 850px) and (min-width: 611px) {
    .form-buscador {
        max-width: 95%;
    }
    
    .input-group:first-child {
        max-width: 50%;
    }
    
    .input-group.selector-huespedes {
        max-width: 35%;
    }

    .buscador-container {margin-bottom: 2em;
}

}


@media (max-width: 610px) {
    .form-buscador {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }
    
    .form-buscador .input-group,
    .form-buscador .selector-huespedes {
        width: 100%;
        margin: 0 auto;
        max-width: 100% !important;
    }
    
    .form-buscador .input-buscador {
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-buscador #searchBtn {
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
        font-size: 14px;
    }
    
    .btn-buscar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }

    #ubicacionInput {
        border-radius: 8px;
        border-right: 1px solid #ccc !important;
    }
    
    #huespedesInput {
        border-radius: 8px;
    }

    #searchBtn {
        margin-left: 0;
    }

     .buscador-container {margin-bottom: 2em;
}
}

/* ===== CATEGORÍAS ===== */
.categorias-filtros {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categorias-lista {
    display: flex;
    gap: 20px;
    align-items: center;
    width: 955px;
    height: 32px;
    justify-content: flex-start;
    padding-left: 0;
    margin-left: 0;
    margin-top: 2em;
    margin-bottom: 2em;
}

.categoria-btn {
    all: unset;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

.categoria-btn:hover {
    color: #181818;
}

/* Iconos para categorías */
.categoria-btn[data-categoria="todas"]::before {
    content: '';
    width: 24px;
    height: 24px;
    background: url('todas.png') center/contain no-repeat;
}

.categoria-btn[data-categoria="Cabaña,Casa"]::before {
    content: '';
    width: 24px;
    height: 24px;
    background: url('cabañas.png') center/contain no-repeat;
}

.categoria-btn[data-categoria="Complejo de cabaña"]::before {
    content: '';
    width: 24px;
    height: 24px;
    background: url('complejos.png') center/contain no-repeat;
}

.categoria-btn[data-categoria="Camping"]::before {
    content: '';
    width: 24px;
    height: 24px;
    background: url('camping-ico.png') center/contain no-repeat;
}

/* Iconos en el dropdown mobile */
.custom-select-option[data-value="todas"]::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('todas.png') center/contain no-repeat;
    margin-right: 8px;
}

.custom-select-option[data-value="Cabaña,Casa"]::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('cabañas.png') center/contain no-repeat;
    margin-right: 8px;
}

.custom-select-option[data-value="Complejo de cabaña"]::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('complejos.png') center/contain no-repeat;
    margin-right: 8px;
}

.custom-select-option[data-value="Camping"]::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('camping-ico.png') center/contain no-repeat;
    margin-right: 8px;
}

/* Icono para Hotel (desktop) */
.categoria-btn[data-categoria="Hotel"]::before {
    content: '';
    width: 24px;
    height: 24px;
    background: url('hotel-ico.png') center/contain no-repeat;
}

/* Icono para Hotel (mobile dropdown) */
.custom-select-option[data-value="Hotel"]::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('hotel-ico.png') center/contain no-repeat;
    margin-right: 8px;
}

/* Asegurar que se vean */
.custom-select-option {
    display: flex;
    align-items: center;
}

/* Icono en el display (cuando está cerrado) */
.custom-select-display::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('todas.png') center/contain no-repeat;
    margin-right: 8px;
}

/* Asegurar que el display muestre el icono */
.custom-select-display {
    display: flex;
    align-items: center;
}

/* Select móvil para categorías - VERSIÓN CUSTOM */
.categorias-dropdown-mobile {
    display: none;
    position: relative; /* Importante para el dropdown */
}

/* WRAPPER del custom select */
.custom-select-wrapper {
    width: 100%;
    position: relative;
}


.custom-select-display {
    max-width: 200px;
    padding: 5px 0px 5px 16px;
    border: 1px solid #AF9286;
    border-radius: 8px;
    background: #FEFDFC;
    color: #181818;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px; 
}

.custom-select-display:hover {
    border-color: #FFBF00;
}

.custom-select-display.active {
    border-color: #FFBF00;
    box-shadow: 0 0 0 2px rgba(255, 191, 0, 0.1);
}

.custom-select-display span {
    flex: 1; 
    text-align: left;
}

.custom-select-display svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0; /* Evita que se encoja */
}

.custom-select-display.active svg {
    transform: rotate(180deg);
}


.custom-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FEFDFC;
    border: 1px solid #AF9286;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow: hidden;
}


.custom-select-option {
    padding: 10px 16px;
    cursor: pointer;
    color: #181818;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: #FFF9E6;
}

.custom-select-option.selected {
    background: #FFEBB0;
    font-weight: 500;
}


.select-categorias-native {
    display: none; 
}

/* Media Queries para categorías */
@media (max-width: 850px) {
    /* Categorías y filtros */
    .categorias-filtros .categorias-lista {
        display: none;
    }
  
    .categorias-dropdown-mobile {
        display: block;
        margin-bottom: 1rem;
        width: 50%;
    }
  
    .categorias-filtros {
        justify-content: flex-end;
        width: 50%;
        float: right;
        padding: 0;
    }
}

@media (max-width: 610px) {
    /* Categorías */
    .categorias-filtros .categorias-lista {
        display: none;
    }
  
    .categorias-dropdown-mobile {
        display: block;
        margin-bottom: 1rem;
        width: 50%;
    }
  
    .categorias-filtros {
        justify-content: flex-end;
        width: 50%;
        float: right;
        padding: 0;
    }
}

/* ===== FILTROS ===== */
.btn-filtros {
    background: none;
    border: 0;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 16px;
    padding: 0.5rem 0 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filtros:hover {
    border-color: #CCCCCC;
    background: #F9F9F9;
}

.filtros-wrapper {
    position: relative;
    display: inline-block;
}

.filtros-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: #FEFDFC;
    border-radius: 8px;
    padding: 16px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 8px;
}

.filtros-dropdown.active {
    display: block;
}

.filtro-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.filtro-item:last-child {
    border-bottom: none;
}

.filtro-item label {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
    color: #181818;
    gap: 10px;
}

.filtro-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filtro-checkbox:checked {
    background: #FFD454;
    border-color: #E9EBF8;
}

.filtro-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: black;
    font-size: 12px;
    font-weight: bold;
}

.filtro-checkbox:hover {
    border-color: #FFD454;
}

/* CONTEXTO-FILTROS POSICIONAMIENTO */
.cabañas-grid .contexto-filtros {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: nowrap !important;
    z-index: 1 !important;
    grid-column: 1 / -1; 
}

.contexto-filtros + .cabaña-card {
    margin-top: 0;
}

.filtro-contexto {
    background: #FFEBB0;
    border-radius: 16px;
    padding: 8px 16px;
    pointer-events: auto !important;
    cursor: pointer !important;
    transition: background 0.2s;
}

.filtro-contexto:hover {
    background: #FFD454;
}

.contexto-filtros-container {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    padding: 0 !important;
}

.contexto-contador {
    margin: 4em 0 0 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

.btn-limpiar-filtros {
    all: unset;
    cursor: pointer;
    white-space: nowrap;
    pointer-events: auto !important;
}

.btn-limpiar-filtros:hover {
    color: #333;
}

.btn-filtros, .filtros-wrapper {
    position: relative;
    z-index: 10 !important;
}

.btn-filtros {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 9999 !important;
}

.filtros-wrapper {
    position: relative !important;
    z-index: 9999 !important;
}


@media (max-width: 850px) {
   
    .filtros-dropdown {
        width: 240px;
        right: 10px;
    }
}

@media (max-width: 610px) {
   
    .filtros-dropdown {
        width: calc(100vw - 40px);
        max-width: 280px;
        right: 20px;
    }
}

/* CATEGORÍA ACTIVA CON FONDO AMARILLO */

.categoria-btn.categoria-activa {
    font-weight: 600;
    background: #FFBF00 !important;
    border-radius: 8px !important;
}


.categoria-btn.categoria-activa::before {
    filter: brightness(0.8);
}


.categoria-btn.categoria-activa:hover {
    background: #FFBF00  !important;
    border-color: #E6AC00 !important;
        border-radius: 8px !important;
}


.categoria-btn[data-categoria="todas"].categoria-activa {
    background: #FFBF00 !important;
    border-color: #E6AC00 !important;
}

.categoria-btn[data-categoria="todas"].categoria-activa:hover {
    background: #E6AC00 !important;
}

.categoria-btn {

    color: #666;
    cursor: pointer !important; 
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    pointer-events: auto !important; 
}

.categoria-btn:hover {
    background: #FFBF00 !important;
    color: #181818 !important;
    border-radius: 8px !important;
}


.categoria-btn:not(.categoria-activa) {
    color: #666 !important; 
}

.categoria-btn:not(.categoria-activa):hover {
    color: #181818 !important;
}


.categoria-btn[disabled],
.categoria-btn.disabled {
    pointer-events: none !important;
    opacity: 0.5 !important;
}


.categoria-btn:not([disabled]):not(.disabled) {
    opacity: 1 !important;
    pointer-events: auto !important;
}

