/* Blocco scroll fondo pagina quando modale è attiva */
body.search-popup-open {
    overflow: hidden !important;
    touch-action: none !important;
}

/* Modal overlay */
.search-popup {
    position: fixed;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(36, 65, 89, 0.16);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    overscroll-behavior: contain;
}

/* Popup box vero e proprio */
.search-popup-content {
    background: #fff;
    border-radius: 18px;
    border: 2px solid #e1e6ec;
    box-shadow: 0 4px 18px rgba(40,60,120,0.13), 0 2px 10px rgba(98,165,111,0.06);
    padding: 2.3em 2.3em 1.2em 2.3em;
    max-width: 420px;
    width: 97%;
    max-height: 60vh;
    overflow-y: auto;
    font-family: 'Georgia', serif;
    color: #264159;
    text-align: left;
    animation: popup-fade-in 0.24s;
    position: relative;
    -webkit-overflow-scrolling: touch; /* scroll fluido su iOS */
    box-sizing: border-box;
}

/* Animazione di comparsa */
@keyframes popup-fade-in {
    from {transform: scale(.97) translateY(20px); opacity: 0;}
    to   {transform: scale(1)   translateY(0);   opacity: 1;}
}

/* Link stile card nel popup */
.search-popup-content a {
    display: block;
    margin-bottom: 1.18em;
    padding: 0.65em 0.85em;
    border-radius: 12px;
    color: #295084;
    background: #f8fbfd;
    border: 1.5px solid #b5c1d1;
    text-decoration: none !important;
    font-size: 1.09em;
    transition: background 0.13s, border 0.13s, color 0.13s;
    font-family: 'Georgia', serif;
}
.search-popup-content a:hover {
    background: #edf2f6;
    border-color: #6697c1;
    color: #206140;
    box-shadow: 0 2px 10px #62a56f2c;
}

/* Descrizione sintetica sotto il titolo */
.search-popup-content .desc {
    color: #3b5678;
    font-size: .96em;
    margin-top: 0.23em;
    display: block;
    line-height: 1.3;
}

/* Responsive popup mobile */
@media (max-width: 600px) {
  .search-popup-content {
    max-width: 97vw !important;
    padding: 1em 0.6em 0.8em 0.6em;
  }
  .search-popup-content a {
      font-size: .98em;
      padding: 0.5em;
  }
}