/* ============================================================
   CONTENITORE E ICONA ⓘ
   ============================================================ */

/* Contenitore dell'icona ⓘ */
.availability-container {
    position: relative;
    display: inline-block;
}

/* Icona ⓘ */
.availability-info {
    cursor: pointer;
    color: #0073aa;
    margin-left: 5px;
    font-weight: bold;
    font-size: 1em;
}

/* Blocca lo scroll del body quando il popup è attivo */
body.popup-open {
    overflow: hidden !important;
}

/* ============================================================
   OVERLAY (SFONDO OSCURATO)
   ============================================================ */

#availability-popup-overlay {
    display: none; /* Inizialmente nascosto */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 9998 !important; /* Sotto il popup, sopra tutto il resto */
    backdrop-filter: blur(2px);
}

/* ============================================================
   POPUP GENERALE (CENTRATO IN MEZZO ALLO SCHERMO)
   ============================================================ */

#availability-popup {
    display: none; /* Nascondi di default */
    position: fixed !important; /* Fisso rispetto allo schermo */
    top: 50% !important;        /* Al centro verticale */
    left: 50% !important;       /* Al centro orizzontale */
    transform: translate(-50%, -50%) !important; /* Offset per centratura perfetta */
    
    background: white;
    color: #333;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999 !important;
    
    max-width: 350px; 
    width: 90%; 
    text-align: center;
    white-space: normal;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

/* La freccia del fumetto viene rimossa perché ora il popup è centrale e non "appeso" all'icona */
#availability-popup::before {
    display: none !important;
}

/* ============================================================
   ICONINA X DI CHIUSURA (IN ALTO A DESTRA)
   ============================================================ */

.close-popup {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    transform: none !important;
    
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    
    background-color: #f0f0f0 !important;
    color: #333 !important;
    border-radius: 50%;
    font-size: 18px !important;
    cursor: pointer;
    z-index: 10001;
    font-weight: bold;
    line-height: 1;
}

.close-popup:hover {
    background-color: #e0e0e0 !important;
}

/* ============================================================
   MOBILE CORREZIONE (SMARTPHONE)
   ============================================================ */

@media (max-width: 767px) {
    #availability-popup {
        /* Mantiene la posizione fissa centrale anche su mobile */
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        
        width: 85% !important;
        max-width: 320px;
        padding: 40px 20px 25px; 
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    }

    #availability-popup-overlay {
        display: none; 
        position: fixed !important;
    }

    .close-popup {
        top: 12px !important;
        right: 12px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 20px !important;
    }
}