/* --- TUE MODIFICHE AGGIORNATE --- */
.sfm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255, 0.8);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}
.sfm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sfm-modal {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.sfm-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    z-index: 20;
    transition: color 0.2s;
}
.sfm-close:hover { color: #000; }

.sfm-content-wrapper {
    padding: 50px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sfm-title {
    margin-bottom: 20px;
    font-size: 30px;
    line-height: 1.2;
    color: #222;
}

.sfm-body {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
}

body.sfm-no-scroll {
    overflow: hidden;
}

/* --- LOADER ANIMATO --- */
.sfm-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}
.sfm-loader {
    width: 40px;
    height: 40px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #121212;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* --- FRECCE NAVIGAZIONE (Viewport Fixed) --- */
.sfm-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 30, 30, 0.0) !important;
    color: #121212 !important;
    border: 0px solid rgba(255,255,255,0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 28px;
    padding-bottom: 4px;
    cursor: pointer;
    z-index: 10000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.0);
}

.sfm-nav:hover {
    background: #EAEAEA !important;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.0);
    border-color: #EAEAEA;
}

.sfm-prev { left: 40px; }
.sfm-next { right: 40px; }

.sfm-nav[disabled] {
    opacity: 0.1 !important;
    pointer-events: none;
    filter: grayscale(100%);
}

@media (max-width: 900px) {
    .sfm-nav {
        width: 45px;
        height: 45px;
        font-size: 20px;
        background: rgba(30, 30, 30, 0.9) !important;
        color: #fff !important; /* Su mobile meglio bianco su scuro per contrasto */
    }
    .sfm-prev { left: 10px; }
    .sfm-next { right: 10px; }
}
