/* CENTRADO PERFECTO CON EXPANSIÓN SIMÉTRICA */

/* Contenedor principal */
.airbnb-search-container {
    width: 100%;
    max-width: 928px; /* Tamaño original exacto */
    margin-left: auto;
    margin-right: auto;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    padding: 0 10px;
}

/* Estado expandido con animación suave */
.airbnb-search-container.expanded {
    max-width: 1200px; /* Máximo expandido fijo para controlar la expansión */
    animation: smooth-expand 0.5s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

/* Animación de expansión controlada */
@keyframes smooth-expand {
    0% { max-width: 928px; }
    50% { max-width: 1220px; } /* Un poco más amplio para efecto rebote */
    100% { max-width: 1200px; }
}

/* Barra de búsqueda con estiramiento */
.search-bar-expanded {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: fit-content;
    flex-wrap: nowrap;
    overflow-x: visible;
}

/* Campos con estiramiento forzado */
.field-operation {
    flex: 0 0 auto;
    min-width: 140px;
    width: auto;
    max-width: none;
}

.field-type {
    flex: 0 0 auto;
    min-width: 140px;
    width: auto;
    max-width: none;
}

.field-location {
    flex: 1 1 auto;
    min-width: 250px;
    width: auto;
    position: relative;
}

/* Prevenir stackeo vertical de valores */
.search-bar-expanded-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Etiquetas de ubicación optimizadas */
.search-bar-location-tags {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-height: 32px; /* Altura fija */
    height: 32px; /* Fuerza altura exacta */
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding-right: 4px;
    width: 100%;
    scrollbar-width: thin; /* Firefox */
}

/* Ocultar scrollbar pero mantener funcionalidad */
.search-bar-location-tags::-webkit-scrollbar {
    height: 0px;
    background: transparent;
}

/* Estilos para el campo de entrada */
.search-bar-expanded input {
    background: transparent;
    border: none;
    outline: none;
}

/* Mejorar la apariencia y visibilidad del dropdown */
.search-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 5px);
    width: 100%;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
}

.search-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-dropdown-item:hover {
    background-color: #f5f5f5;
}

.search-bar-location-tag {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 4px;
    background-color: var(--color-bg-light);
    margin-right: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Forzar que los botones mantengan su forma */
.search-bar-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* Controles siempre a la derecha */
.search-bar-expanded-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 4px;
    padding-right: 4px;
    white-space: nowrap;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .airbnb-search-container {
        width: 100% !important;
        padding: 4px;
    }
    
    .search-bar-expanded {
        flex-wrap: wrap;
    }
    
    .field-operation,
    .field-type {
        flex: 1 1 45%;
        min-width: 0;
    }
    
    .field-location {
        flex: 1 1 100%;
        order: 3;
        margin-top: 8px;
        overflow-x: auto;
    }
}
