/**
 * Blue Apulia - Search AJAX Styles (FASE 3)
 * File: assets/css/components/search-ajax.css
 * 
 * Stili dedicati per:
 * - Loading states e animazioni
 * - Risultati dinamici
 * - Transizioni smooth
 * - Mobile optimization
 * 
 * @package BlueApuliaChild
 */

/* ===================================
   SEZIONE RISULTATI RICERCA
   =================================== */

.search-results-section {
    padding: 3rem 0;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    transition: all 0.4s ease;
}

.search-results-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.search-results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-results-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.search-details {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 400;
}

.search-details span {
    display: inline-block;
    margin: 0 0.5rem;
}

/* ===================================
   GRIGLIA RISULTATI
   =================================== */

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    justify-content: center;
}
@media (max-width: 900px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }
}

.search-results-grid .alloggio-card {
    max-width: 400px;
    margin: 0 auto;
}

.search-result-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    position: relative;
}

.search-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007cba, #0056a0);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.search-result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,124,186,0.15);
    border-color: #007cba;
}

.search-result-card:hover::before {
    transform: scaleX(1);
}

/* ===================================
   IMMAGINI RISULTATI
   =================================== */

.search-result-card .alloggio-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.search-result-card .alloggio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.search-result-card:hover .alloggio-image img {
    transform: scale(1.05);
}

.alloggio-type-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.95);
    color: #2c3e50;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-results-grid .alloggio-image {
    aspect-ratio: 4/3;
    height: auto;
    min-height: 180px;
    max-height: 260px;
    overflow: hidden;
    background: #f8f8f8;
    border-radius: 12px 12px 0 0;
}

.search-results-grid .alloggio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: static !important;
}

/* ===================================
   CONTENUTO RISULTATI
   =================================== */

.search-result-card .alloggio-content {
    padding: 1.5rem;
}

.search-result-card .alloggio-title {
    margin: 0 0 0.8rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.search-result-card .alloggio-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-result-card .alloggio-title a:hover {
    color: #007cba;
}

.alloggio-location {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

/* ===================================
   FEATURES E CARATTERISTICHE
   =================================== */

.alloggio-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.alloggio-features .feature {
    background: none !important;
    color: inherit !important;
    border: none !important;
    box-shadow: none !important;
}

.alloggio-excerpt {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================================
   FOOTER CARD
   =================================== */

.alloggio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f1f3f4;
}

.alloggio-price {
    font-weight: 600;
    color: #007cba;
    font-size: 1rem;
}

.alloggio-footer .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-primary {
    background: #007cba;
    color: white;
    border: 1px solid #007cba;
}

.btn-primary:hover {
    background: #0056a0;
    border-color: #0056a0;
    transform: translateY(-1px);
}

/* ===================================
   STATI DI CARICAMENTO
   =================================== */

.search-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f3f4;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: ba-spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes ba-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-loading p {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

/* ===================================
   STATO ERRORE
   =================================== */

.search-error {
    text-align: center;
    padding: 3rem 2rem;
    color: #e74c3c;
    background: #fff5f5;
    border-radius: 12px;
    margin: 2rem 0;
}

.search-error p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.search-error .btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-error .btn:hover {
    background: #c0392b;
}

/* ===================================
   NESSUN RISULTATO
   =================================== */

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
    background: white;
    border-radius: 12px;
    margin: 2rem 0;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.no-results p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.no-results a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.no-results a:hover {
    border-bottom-color: #007cba;
}

/* ===================================
   CONTATORE RISULTATI
   =================================== */

#search-results-count {
    font-size: 1rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

#search-results-count .search-details {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ===================================
   ANIMAZIONI DI TRANSIZIONE
   =================================== */

.default-alloggi {
    transition: all 0.4s ease;
}

.default-alloggi.hide {
    opacity: 0;
    transform: translateY(-20px);
}

.search-results-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.search-results-section.show {
    opacity: 1;
    transform: translateY(0);
}

/* Animazione fade-in per i risultati */
.search-result-card {
    opacity: 0;
    transform: translateY(20px);
    animation: ba-fadeInUp 0.6s ease forwards;
}

.search-result-card:nth-child(1) { animation-delay: 0.1s; }
.search-result-card:nth-child(2) { animation-delay: 0.2s; }
.search-result-card:nth-child(3) { animation-delay: 0.3s; }
.search-result-card:nth-child(4) { animation-delay: 0.4s; }
.search-result-card:nth-child(5) { animation-delay: 0.5s; }
.search-result-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes ba-fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .search-results-section {
        padding: 2rem 0;
    }
    
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-result-card .alloggio-image {
        height: 200px;
    }
    
    .search-result-card .alloggio-content {
        padding: 1.2rem;
    }
    
    .alloggio-features {
        gap: 0.6rem;
    }
    
    .alloggio-features .feature {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .alloggio-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .alloggio-footer .btn {
        text-align: center;
        width: 100%;
    }
    
    .search-loading {
        padding: 2rem 1rem;
    }
    
    .no-results {
        padding: 2rem 1rem;
    }
    
    .search-error {
        padding: 2rem 1rem;
    }

    .btn-reset-search {
        min-height: 20px;
    }
}

@media (max-width: 480px) {
    .search-results-header h2 {
        font-size: 1.5rem;
    }
    
    .search-result-card .alloggio-title {
        font-size: 1.1rem;
    }
    
    .search-result-card .alloggio-image {
        height: 180px;
    }
    
    .alloggio-type-badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ===================================
   DARK MODE SUPPORT (FUTURO)
   =================================== */

@media (prefers-color-scheme: dark) {
    .search-results-section {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .search-result-card {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .search-result-card .alloggio-title a {
        color: #e0e0e0;
    }
    
    .alloggio-features .feature {
        background: none !important;
        color: inherit !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .no-results,
    .search-error {
        background: #2d2d2d;
        color: #e0e0e0;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .search-results-section {
        background: white !important;
        box-shadow: none !important;
    }
    
    .search-result-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .search-loading,
    .search-error {
        display: none !important;
    }
}

/* Fix immagini card nei risultati di ricerca */
.search-results-grid .alloggio-image {
    height: 220px;
    padding-top: 0;
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}
.search-results-grid .alloggio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: static !important;
}

/* Header risultati: larghezza 70% e centrato */
.search-results-header {
    width: 70%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    background: #fff;
    position: relative;
    top: 0;
    z-index: 10;
}

/* Header risultati attaccato alla search bar, effetto cassetto */
.search-results-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ba-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.3s;
}

.search-results-header {
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

@media (max-width: 900px) {
    .alloggi-search-form, .search-results-header {
        width: 95%;
        border-radius: 14px;
    }
    .search-results-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
}

/* Spazio per futuri filtri avanzati */
.search-results-header .search-filters {
    margin-left: 16px;
    flex: 1 1 auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Gruppo filtri a sinistra */
.filters-group {
    display: flex;
    align-items: center;
    gap: 8px; /* Ridotto per le pillole */
    flex: 1; /* Prende lo spazio disponibile */
}

/* Animazione staggered per ogni filtro */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 99px; /* Pillola */
    padding: 4px 10px;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(5px);
    animation: filterSlideIn 0.3s ease forwards;
}

/* Animazione staggered per i filtri */
.search-bar-pill.search-bar-expanded .filter-toggle:nth-child(1) { animation-delay: 0.1s; }
.search-bar-pill.search-bar-expanded .filter-toggle:nth-child(2) { animation-delay: 0.2s; }
.search-bar-pill.search-bar-expanded .filter-toggle:nth-child(3) { animation-delay: 0.3s; }
.search-bar-pill.search-bar-expanded .filter-toggle:nth-child(4) { animation-delay: 0.4s; }

@keyframes filterSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-toggle:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px); /* Micro-sollevamento */
}

/* Toggle attivo */
.filter-checkbox:checked + .toggle-slider + .toggle-label {
    color: #007cba;
    font-weight: 600;
}

.filter-toggle:has(.filter-checkbox:checked) {
    background: #e6f3ff;
    border-color: #007cba;
}

/* Toggles filtri */
.filter-checkbox {
    display: none;
}

/* Toggle labels */
.toggle-label {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    user-select: none;
}

.search-results-count {
    font-size: 12px;
    color: #007cba;
    font-weight: 600;
    white-space: nowrap;
    padding: 0 6px; /* Spazio interno nella pillola */
}

/* ===================================
   SEARCH BAR - NUOVA VERSIONE PULITA
   =================================== */

/* Posizionamento: copiato dal backup funzionante */
.search-bar-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(-1 * var(--ba-search-bar-height) / 2);
    height: var(--ba-search-bar-height);
    z-index: var(--ba-search-bar-z-index);
    padding: 0 15px;
    pointer-events: none; /* Permetto click-through al container */
}

/* Contenitore form - deve essere trasparente */
.alloggi-search-form {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 201; /* Sopra overlay */
    pointer-events: auto; /* Riabilito i click sul form */
}

/* Barra search principale */
.search-bar-pill {
    background: #fff;
    border-radius: 99px; /* REGOLA 2: border radius 99px */
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Transizione fluida */
    height: var(--search-bar-height); /* Usa la variabile */
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 202; /* Z-index massimo nel gruppo search */
    pointer-events: auto; /* Assicuro che sia cliccabile */
    overflow: visible; /* Permette al calendario di uscire */
}

/* Contenitore principale con padding interno */
.search-bar-pill .search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px; /* REGOLA 3: padding 10px interno */
    position: relative;
    transition: padding 0.3s ease; /* Transizione padding */
}

/* Linea divisoria posizionata a 10px dai campi */
.search-bar-pill .search-grid::after {
    content: '';
    position: absolute;
    bottom: -10px; /* 10px sotto i campi input, rispettando il padding */
    left: 10px; /* Allineata al padding laterale */
    right: 10px; /* Allineata al padding laterale */
    height: 1px;
    background: #eee;
    opacity: 0;
    transform: scaleX(0); /* Inizia invisibile */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Doppia transizione */
}

.search-bar-pill.search-bar-expanded .search-grid::after {
    opacity: 1; /* Mostra la linea solo quando espansa */
    transform: scaleX(1); /* Animazione di crescita orizzontale */
}

/* Input fields con micro-animazioni */
.search-bar-pill .search-input {
    height: 40px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 99px;
    background: #f8f9fa;
    font-size: 14px;
    transition: all 0.2s ease, box-shadow 0.3s ease; /* Transizioni multiple */
}

.search-bar-pill .search-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,123,186,0.2);
    outline: none;
    transform: translateY(-1px); /* Leggero sollevamento al focus */
}

/* Bottone search con animazioni */
.alloggi-search-form .search-button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 99px !important; /* Sempre tondo */
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transizione avanzata */
}

.alloggi-search-form .search-button:hover {
    background: #0056a0;
    transform: translateY(-2px) scale(1.05); /* Sollevamento + ingrandimento */
    box-shadow: 0 4px 12px rgba(0,123,186,0.3);
}

.alloggi-search-form .search-button:active {
    transform: translateY(0) scale(0.95); /* Effetto click */
}

/* Stato espanso con transizioni avanzate */
.search-bar-pill.search-bar-expanded {
    border-radius: 20px;
    height: auto;
    min-height: 100px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    bottom: calc(1.1 * var(--ba-search-bar-height) / 2);
    /* La transizione è già definita nel .search-bar-pill */
}

/* Contenitore risultati con spazio sopra */
#search-results-container {
    padding-top: 100px;
}

/* Riposizionamento dinamico - COMMENTATO (non più utilizzato) */
/*
.search-bar-overlay.search-expanded {
    top: calc(var(--hero-height) - 20px) !important;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
*/

/* Filtri avanzati con animazione di fade-in staggered */
.search-bar-pill .search-advanced-filters {
    display: none;
    padding: 10px; /* stesso padding interno */
    margin-top: 10px; /* Spazio dalla linea divisoria */
    opacity: 0;
    transform: translateY(10px); /* Inizia leggermente spostato in basso */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.search-bar-pill.search-bar-expanded .search-advanced-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap; /* Una sola riga */
    gap: 16px;
    opacity: 1;
    transform: translateY(0); /* Animazione slide-up */
}

/* Toggle slider con animazioni fluide */
.toggle-slider {
    width: 28px;
    height: 16px;
    background: #ddd;
    border-radius: 99px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transizione fluida */
}

.toggle-slider:before {
    content: '';
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: absolute;
    left: 2px;
    top: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Stessa curva */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Ombra per profondità */
}

.filter-checkbox:checked + .toggle-slider {
    background: #34C759;
    box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2); /* Glow effect */
}

.filter-checkbox:checked + .toggle-slider:before {
    transform: translateX(12px) scale(1.1); /* Movimento + leggero ingrandimento */
}

/* Toggle labels */
.toggle-label {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    user-select: none;
}

/* Pillola risultati con animazione */
.search-results-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    background: #f0f7ff;
    border: 1px solid #cce0f7;
    border-radius: 99px; /* Pillola contenitore */
    padding: 6px 8px;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(5px);
    animation: resultsPillIn 0.4s ease 0.3s forwards; /* Ritardo per apparire dopo i filtri */
}

@keyframes resultsPillIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-info:hover {
    background: #e6f0ff;
    transform: translateY(-1px);
}

/* Bottone reset con animazioni */
.btn-reset-search {
    background: #007cba;
    border: 1px solid #007cba;
    color: white;
    border-radius: 99px; /* Pillola interna */
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-reset-search:hover {
    background: #0056a0;
    border-color: #0056a0;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 2px 8px rgba(0,123,186,0.3);
}

.btn-reset-search:active {
    transform: translateY(0) scale(0.95);
}

/* Desktop version - CHECK-IN/CHECK-OUT GROUP */
.checkin-checkout-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.checkin-checkout-group .search-field {
    width: 100%;
}

.checkin-checkout-group .search-field input[type="date"] {
    width: 100%;
    border-radius: 99px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.checkin-checkout-group .search-field input[type="date"]:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,123,186,0.2);
    outline: none;
}

/* Desktop version - OSPITI CERCA GROUP */
.ospiti-cerca-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.ospiti-cerca-group .search-field {
    width: 100%;
}

.ospiti-cerca-group .search-field select {
    width: 100%;
    border-radius: 99px;
    background: #f8f9fa;
    padding: 0;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ospiti-cerca-group .search-field select:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,123,186,0.2);
    outline: none;
}

.ospiti-cerca-group .search-button-wrapper {
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ospiti-cerca-group .search-button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 99px !important;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ospiti-cerca-group .search-button:hover {
    background: #0056a0;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,123,186,0.3);
}

.ospiti-cerca-group .search-button:active {
    transform: translateY(0) scale(0.95);
}

/* REGOLA ULTRA SPECIFICA PER FORZARE DIMENSIONI */
.alloggi-search-form .ospiti-cerca-group .search-button-wrapper .search-button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 99px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-bar-overlay {
        padding: 0 0px;
        /* Rimosso bottom: -25px che sovrascriveva la configurazione principale */
        position: relative;
        top: 20px; /* POSIZIONATA DALLA FINE DEL HERO-CONTENT */
        bottom: auto;
    }
    
    /* RIMUOVI ALTEZZA FISSA SU MOBILE */
    .search-bar-pill {
        height: auto;
        min-height: auto;
        overflow: visible;
        border-radius: 30px;
        background: #ffffffc4;

    }
    
    .search-bar-pill .search-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    /* PILLOLA UNICA CHECK-IN/CHECK-OUT */
    .checkin-checkout-group {
        display: flex;
        gap: 0; /* Nessun gap interno */
        width: 100%;
        border-radius: 99px;
        overflow: hidden;
        border: 1px solid #ddd;
        background: #f8f9fa;
    }
    
    .checkin-checkout-group .search-field {
        flex: 1;
    }
    
    .checkin-checkout-group .search-field:first-child input[type="date"] {
        border-radius: 99px 0 0 99px; /* Solo sinistra arrotondata */
        border-right: none;
        border: none;
        background: transparent;
    }
    
    .checkin-checkout-group .search-field:last-child input[type="date"] {
        border-radius: 0 99px 99px 0; /* Solo destra arrotondata */
        border-left: none;
        border: none;
        background: transparent;
    }
    
    /* FORZA VISIBILITÀ PLACEHOLDER SU IPHONE */
    .checkin-checkout-group input[type="date"]::placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    .checkin-checkout-group input[type="date"]::-webkit-input-placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    .checkin-checkout-group input[type="date"]::-moz-placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    .checkin-checkout-group input[type="date"]:-ms-input-placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    /* FORZA APPARENZA E COLORE SU IPHONE */
    .checkin-checkout-group input[type="date"] {
        appearance: none !important;
        -webkit-appearance: none !important;
        color: #222 !important;
        font-size: 16px !important;
        padding: 12px 16px !important;
    }
    
    /* HACK SOLO PER SAFARI/WEBKIT (desktop e mobile) */
    @media not all and (min-resolution:.001dpcm) { @supports (-webkit-appearance:none) {
        .checkin-checkout-group input[type="date"] {
            appearance: none !important;
            -webkit-appearance: none !important;
            color: #222 !important;
            font-size: 16px !important;
            padding: 12px 16px !important;
        }
    }}
    
    /* SOLUZIONE COMPLETA PER DATEPICKER SU IPHONE */
    .checkin-checkout-group input[type="date"] {
        -webkit-appearance: none;
        -moz-appearance: textfield;
        appearance: none;
        
        /* Forza la visualizzazione come testo */
        display: block;
        background: white;
        color: #333;
        border: 1px solid #ccc;
        padding: 8px 12px;
        font-size: 16px;
        
        /* Nasconde l'icona del calendario su alcuni browser */
        background-image: none;
    }
    
    /* Nasconde l'icona del calendario su WebKit */
    .checkin-checkout-group input[type="date"]::-webkit-calendar-picker-indicator {
        display: none;
        -webkit-appearance: none;
    }
    
    /* STILE PER INPUT TEXT CHE SIMULA DATE (iOS) */
    .checkin-checkout-group input.date-text {
        -webkit-appearance: none;
        appearance: none;
        display: block;
        background: white;
        color: #333;
        border: 1px solid #ccc;
        padding: 8px 12px;
        font-size: 16px;
        background-image: none;
        border-radius: 0;
    }
    
    /* STILE PER FLATPICKR DATEPICKER */
    .checkin-checkout-group input.ba-datepicker {
        -webkit-appearance: none;
        appearance: none;
        color: #222 !important;
        font-size: 16px !important;
        padding: 12px 16px !important;
        background: transparent;
        border: none;
        border-radius: 0;
    }
    
    /* Forza visibilità placeholder */
    .checkin-checkout-group input.ba-datepicker::placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    .checkin-checkout-group input.ba-datepicker::-webkit-input-placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    .checkin-checkout-group input.ba-datepicker::-moz-placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    .checkin-checkout-group input.ba-datepicker:-ms-input-placeholder {
        color: #666 !important;
        opacity: 1 !important;
    }
    
    /* FORZA FLATPICKR SU MOBILE */
    @media (max-width: 768px) {
        .flatpickr-calendar {
            position: fixed !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
            z-index: 99999 !important;
            background: white !important;
            border-radius: 12px !important;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
        }
        
        .flatpickr-calendar.open {
            display: block !important;
        }
        
            /* Nascondi COMPLETAMENTE datepicker nativi su mobile */
    input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        background: transparent !important;
    }
    
    /* FORZA FLATPICKR SU IPHONE */
    @media (max-width: 768px) {
        /* FORZA FLATPICKR SU IPHONE */
        input[name="checkin"],
        input[name="checkout"] {
            -webkit-appearance: none !important;
            appearance: none !important;
            background: transparent !important;
            color: #333 !important;
            font-size: 16px !important; /* Previene zoom su iOS */
        }
        
        /* FORZA ANCORA DI PIÙ SU IPHONE */
        input[name="checkin"]::-webkit-calendar-picker-indicator,
        input[name="checkout"]::-webkit-calendar-picker-indicator {
            display: none !important;
            -webkit-appearance: none !important;
        }
        
        input[name="checkin"]::-webkit-inner-spin-button,
        input[name="checkin"]::-webkit-outer-spin-button,
        input[name="checkout"]::-webkit-inner-spin-button,
        input[name="checkout"]::-webkit-outer-spin-button {
            -webkit-appearance: none !important;
            margin: 0 !important;
        }
    }
    
    /* EVIDENZIAZIONE GIORNI FLATPICKR */
    .flatpickr-day.inRange {
        background: #007bff !important;
        color: white !important;
        border-color: #007bff !important;
    }
    
    .flatpickr-day.inRange:hover {
        background: #0056b3 !important;
        color: white !important;
    }
        
        /* Nascondi l'icona del calendario nativo */
        input[type="date"]::-webkit-calendar-picker-indicator {
            display: none !important;
            -webkit-appearance: none !important;
        }
        
        input[type="date"]::-webkit-inner-spin-button,
        input[type="date"]::-webkit-outer-spin-button {
            -webkit-appearance: none !important;
            margin: 0 !important;
        }
        
        /* Forza i campi ba-datepicker a rimanere text */
        input.ba-datepicker {
            -webkit-appearance: none !important;
            appearance: none !important;
            background: transparent !important;
        }
    }
    
    .ospiti-cerca-group {
        display: flex;
        gap: 8px;
        align-items: center;
        width: 100%;
    }
    
    .ospiti-cerca-group .search-field {
        flex: 1;
    }
    
    .ospiti-cerca-group .search-button-wrapper {
        flex-shrink: 0;
    }
    
    .search-bar-pill.search-bar-expanded .search-advanced-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 0;
        margin: 0 10px;
    }
    
    /* Stesso stile per homepage */
    .search-advanced-filters {
        border-top: 1px solid #dcdcdc;
        padding-top: 10px;
    }
    
    .search-results-info {
        margin-left: 0;
        gap: 8px;
    }
    
    /* Filter toggles su mobile */
    .filters-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* FLATPICKR CALENDAR - Z-INDEX ALTO */
.flatpickr-calendar {
    z-index: 99999 !important;
}

/* OSPITI COUNTER - Pillola unica */
.ospiti-counter-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 99px;
    overflow: visible;
    background: #f8f9fa;
}

.counter-arrow {
    background: #f8f9fa;
    border: none;
    border-radius: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
}

.counter-minus {
    border-radius: 99px 0 0 99px;
}

.counter-plus {
    border-radius: 0 99px 99px 0;
}

.counter-arrow:hover {
    background: #e9ecef;
    color: #333;
}

.counter-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ospiti-counter-wrapper .ospiti-select {
    flex: 1;
    border: none;
    border-radius: 0;
    background: #f8f9fa;
    padding: 8px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    box-shadow: none;
}

.counter-arrow {
    background: #f8f9fa;
    border: none;
    border-radius: 0;
    width: 24px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
    box-shadow: none;
    outline: none;
}

.counter-minus {
    border-radius: 99px 0 0 99px;
    justify-content: flex-end;
    padding-right: 4px;
}

.counter-plus {
    border-radius: 0 99px 99px 0;
    justify-content: flex-start;
    padding-left: 4px;
}

.counter-arrow:focus {
    outline: none;
    box-shadow: none;
}

.ospiti-counter-wrapper .ospiti-select {
    flex: 1;
    border: none;
    border-radius: 0;
    background: #f8f9fa;
    padding: 8px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    box-shadow: none;
    outline: none;
    text-align: center;
}

.ospiti-counter-wrapper .ospiti-select:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

/* ELIMINA HOVER E FOCUS CON !important */
.counter-arrow:focus,
.counter-arrow:hover,
.counter-arrow:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    background: #f8f9fa !important;
}

.ospiti-counter-wrapper .ospiti-select:focus,
.ospiti-counter-wrapper .ospiti-select:hover,
.ospiti-counter-wrapper .ospiti-select:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    background: #f8f9fa !important;
}
