.popup-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    z-index: 999999 !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 10px !important;
}

.popup-overlay.active {
    display: flex !important;
}

.popup-content {
    position: relative !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
}

.popup-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: rgba(255,255,255,0.9) !important;
    color: #333 !important;
    border: none !important;
    font-size: 18px !important;
    cursor: pointer !important;
    z-index: 1000000 !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

.popup-close:hover {
    background: rgba(255,255,255,1) !important;
}

.popup-image-container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    min-height: 200px !important;
}

.popup-whatsapp-link {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: opacity 0.2s ease !important;
    align-items: center !important;
    justify-content: center !important;
}

.popup-whatsapp-link:hover {
    opacity: 0.95 !important;
}

.popup-image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    cursor: pointer !important;
}

/* Default: nasconde tutte le immagini */
.desktop-image,
.mobile-image {
    display: none !important;
}

/* Mobile: mostra solo immagine mobile */
@media screen and (max-width: 768px) {
    .mobile-image {
        display: block !important;
    }
    .desktop-image {
        display: none !important;
    }

    .popup-content {
        width: calc(100vw - 20px) !important;
        max-width: 400px !important;
        max-height: 80vh !important;
        margin: 0 !important;
    }

    .popup-overlay {
        padding: 10px !important;
    }

    .popup-close {
        top: 5px !important;
        right: 5px !important;
        font-size: 16px !important;
        width: 28px !important;
        height: 28px !important;
    }
}

/* Tablet: mostra immagine desktop */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .desktop-image {
        display: block !important;
    }
    .mobile-image {
        display: none !important;
    }

    .popup-content {
        width: min(80vw, 600px) !important;
        max-height: 75vh !important;
    }
}

/* Desktop: mostra immagine desktop */
@media screen and (min-width: 1025px) {
    .desktop-image {
        display: block !important;
    }
    .mobile-image {
        display: none !important;
    }

    .popup-content {
        width: min(70vw, 800px) !important;
        max-height: 70vh !important;
    }
}

/* Schermi molto grandi */
@media screen and (min-width: 1400px) {
    .popup-content {
        width: min(60vw, 1000px) !important;
        max-height: 80vh !important;
    }
}
