/* ========================================
   SEARCH BAR MOBILE RESPONSIVE
   Mantiene el estilo actual pero optimizado para móvil
   ======================================== */

/* ===== DESKTOP FIRST - MANTENER ACTUAL ===== */
.airbnb-search-container {
    width: 100%;
    max-width: 928px;
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0 10px;
}

.search-bar-expanded {
    display: flex;
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
    background: white;
    border-radius: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-height: 64px;
}

/* ===== TABLET RESPONSIVE (768px - 1024px) ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    .airbnb-search-container {
        max-width: 95%;
        padding: 0 15px;
    }
    
    .search-bar-expanded {
        flex-wrap: wrap;
        min-height: auto;
        padding: 12px;
    }
    
    .search-bar-expanded-field {
        min-height: 56px;
        padding: 8px 16px;
    }
    
    .field-operation,
    .field-type {
        flex: 1 1 48%;
        border-right: 1px solid #e5e7eb;
        min-width: 180px;
    }
    
    .field-location {
        flex: 1 1 100%;
        border-top: 1px solid #e5e7eb;
        margin-top: 8px;
        padding-top: 16px;
    }
    
    .search-bar-expanded-controls {
        flex: 1 1 100%;
        justify-content: center;
        margin-top: 12px;
        gap: 12px;
    }
}

/* ===== MOBILE RESPONSIVE (≤768px) ===== */
@media (max-width: 768px) {
    .airbnb-search-container {
        max-width: 100%;
        padding: 0 12px;
        margin: 0 auto;
    }
    
    .search-bar-expanded {
        flex-direction: column;
        border-radius: 20px;
        padding: 16px;
        gap: 0;
        min-height: auto;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    }
    
    /* ===== CAMPOS VERTICALES STACKED ===== */
    .search-bar-expanded-field {
        width: 100%;
        flex: none;
        min-height: 56px;
        padding: 12px 16px;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        border-radius: 0;
        position: relative;
        transition: all 0.2s ease;
    }
    
    /* Primer campo con border-radius top */
    .field-operation {
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }
    
    /* Campo tipo en el medio */
    .field-type {
        border-radius: 0;
    }
    
    /* Campo ubicación más alto por las tags */
    .field-location {
        min-height: 76px;
        border-bottom: none;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }
    
    /* ===== LABELS Y VALUES MOBILE ===== */
    .search-bar-expanded-label {
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
        display: block;
    }
    
    .search-bar-expanded-value {
        font-size: 16px;
        color: #1e293b;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        line-height: 1.2;
    }
    
    /* ===== BOTONES TOUCH-FRIENDLY ===== */
    .search-bar-button {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        background: transparent;
        border: none;
        text-align: left;
        cursor: pointer;
        min-height: 44px;
        padding: 8px 0;
    }
    
    .search-bar-button:active {
        background-color: #f8fafc;
        transform: scale(0.98);
    }
    
    /* ===== CAMPO UBICACIÓN MOBILE ===== */
    .field-location .search-bar-expanded-input {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        min-height: 40px;
        padding: 8px 0;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .field-location .search-bar-expanded-input::-webkit-scrollbar {
        display: none;
    }
    
    /* Tags de ubicación optimized para mobile */
    .field-location .bg-gray-200 {
        background-color: #f1f5f9;
        color: #475569;
        border-radius: 12px;
        padding: 6px 12px;
        font-size: 14px;
        font-weight: 500;
        flex-shrink: 0;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s ease;
    }
    
    .field-location .bg-gray-200:hover {
        background-color: #e2e8f0;
        transform: translateY(-1px);
    }
    
    /* Botón remover tag */
    .field-location .bg-gray-200 button {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: #cbd5e1;
        color: #475569;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .field-location .bg-gray-200 button:hover {
        background-color: #ef4444;
        color: white;
    }
    
    /* Input de ubicación */
    .field-location input {
        flex: 1;
        min-width: 120px;
        background: transparent;
        border: none;
        outline: none;
        font-size: 16px;
        color: #1e293b;
        padding: 8px 0;
    }
    
    .field-location input::placeholder {
        color: #94a3b8;
        font-size: 15px;
    }
    
    /* ===== DROPDOWNS MOBILE ===== */
    .search-dropdown {
        position: fixed;
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 20px;
        width: auto;
        max-height: 60vh;
        background: white;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
        z-index: 9999;
        overflow: hidden;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .search-dropdown[x-show="true"] {
        transform: translateY(0);
    }
    
    .search-dropdown ul {
        max-height: 50vh;
        overflow-y: auto;
        padding: 8px;
    }
    
    .search-dropdown-item {
        padding: 16px 20px;
        font-size: 16px;
        color: #1e293b;
        border-radius: 12px;
        margin-bottom: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .search-dropdown-item:hover,
    .search-dropdown-item:active {
        background-color: #f1f5f9;
        color: #0f172a;
        transform: translateX(4px);
    }
    
    /* ===== CONTROLES MOBILE ===== */
    .search-bar-expanded-controls {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 16px;
        gap: 12px;
    }
    
    .filters-button {
        flex: 1;
        height: 48px;
        background: #f8fafc;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 15px;
        font-weight: 600;
        color: #475569;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .filters-button:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
        transform: translateY(-1px);
    }
    
    .filters-button:active {
        transform: translateY(0);
    }
    
    /* Badge de filtros activos */
    .filter-count-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        background: #ef4444;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 11px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Botón de búsqueda principal */
    .btn-dopamine {
        width: 56px;
        height: 48px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }
    
    .btn-dopamine:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(255, 87, 51, 0.3);
    }
    
    .btn-dopamine:active {
        transform: translateY(0);
    }
}

/* ===== MOBILE SMALL (≤480px) ===== */
@media (max-width: 480px) {
    .airbnb-search-container {
        padding: 0 8px;
    }
    
    .search-bar-expanded {
        padding: 12px;
    }
    
    .search-bar-expanded-field {
        min-height: 52px;
        padding: 10px 14px;
    }
    
    .field-location {
        min-height: 72px;
    }
    
    .search-bar-expanded-value {
        font-size: 15px;
    }
    
    .field-location .bg-gray-200 {
        font-size: 13px;
        padding: 5px 10px;
        min-height: 30px;
    }
    
    .field-location input {
        font-size: 15px;
    }
    
    .search-bar-expanded-controls {
        margin-top: 12px;
        gap: 10px;
    }
    
    .filters-button {
        height: 44px;
        font-size: 14px;
    }
    
    .btn-dopamine {
        width: 52px;
        height: 44px;
    }
    
    .search-dropdown {
        left: 8px;
        right: 8px;
        bottom: 16px;
    }
    
    .search-dropdown-item {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 44px;
    }
}

/* ===== ANIMACIONES Y TRANSICIONES ===== */
@media (max-width: 768px) {
    /* Backdrop para dropdowns */
    .search-dropdown::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .search-dropdown[x-show="true"]::before {
        opacity: 1;
    }
    
    /* Smooth scroll para tags */
    .field-location .search-bar-expanded-input {
        scroll-behavior: smooth;
    }
    
    /* Focus states mejorados */
    .search-bar-expanded-field:focus-within {
        background-color: #f8fafc;
        box-shadow: inset 0 0 0 2px #3b82f6;
    }
    
    /* Placeholder animation */
    .field-location input:focus::placeholder {
        transform: translateY(-2px);
        opacity: 0.7;
        transition: all 0.2s ease;
    }
}
