/* WP Modal Pro - Stili Frontend */
.wp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.wp-modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wp-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Dimensioni Desktop */
.wp-modal-container.size-small { max-width: 500px; width: 90%; }
.wp-modal-container.size-medium { max-width: 700px; width: 90%; }
.wp-modal-container.size-large { max-width: 900px; width: 90%; }
.wp-modal.container.size-xlarge { max-width: 1100px; width: 90%; }

/* Layout generale */
.wp-modal-content {
    display: flex;
    height: 100%;
}

/* Con immagine */
.wp-modal-container.has-image .wp-modal-image {
    flex: 0 0 45%;
    background: #f5f5f5;
}

.wp-modal-container.has-image .wp-modal-text {
    flex: 0 0 55%;
    padding: 40px;
    overflow-y: auto;
    max-height: 80vh;
}

/* Solo immagine */
.wp-modal-container.image-only .wp-modal-image {
    width: 100%;
    height: 100%;
}

.wp-modal-container.image-only .wp-modal-text {
    display: none;
}

/* Solo testo */
.wp-modal-container.text-only {
    max-width: 600px;
}

.wp-modal-container.text-only .wp-modal-image {
    display: none;
}

.wp-modal-container.text-only .wp-modal-text {
    padding: 50px;
    overflow-y: auto;
    max-height: 80vh;
}

/* Senza immagine */
.wp-modal-container.no-image .wp-modal-text {
    padding: 50px;
    overflow-y: auto;
    max-height: 80vh;
}

/* Immagine */
.wp-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Pulsante chiusura SVG */
.wp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wp-modal-close:hover {
    background: #f8f8f8;
    transform: rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wp-modal-close svg {
    width: 20px;
    height: 20px;
    color: #333;
    stroke-width: 2.5;
}

.wp-modal-close:hover svg {
    color: #000;
}

/* Per modale solo immagine */
.wp-modal-container.image-only .wp-modal-close {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.wp-modal-container.image-only .wp-modal-close:hover {
    background: white;
    border-color: white;
}

/* Testo */
.wp-modal-text {
    flex: 1;
}

.wp-modal-text h1,
.wp-modal-text h2,
.wp-modal-text h3 {
    color: #1a1a1a;
    margin-top: 0;
    font-weight: 700;
}

.wp-modal-text p {
    color: #444;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Footer e pulsante */
.wp-modal-footer {
    margin-top: 30px;
    text-align: center;
}

.wp-modal-close-button {
    padding: 12px 32px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wp-modal-close-button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.25);
}

/* Scrollbar */
.wp-modal-text::-webkit-scrollbar {
    width: 6px;
}

.wp-modal-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wp-modal-text::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-modal-container {
        width: 95% !important;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .wp-modal-content {
        flex-direction: column;
    }
    
    .wp-modal-container.has-image .wp-modal-image {
        flex: 0 0 200px;
        height: 200px;
    }
    
    .wp-modal-container.has-image .wp-modal-text,
    .wp-modal-container.text-only .wp-modal-text,
    .wp-modal-container.no-image .wp-modal-text {
        padding: 25px;
        max-height: calc(95vh - 200px);
    }
    
    .wp-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .wp-modal-close svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .wp-modal-container.has-image .wp-modal-image {
        height: 180px;
    }
    
    .wp-modal-container.has-image .wp-modal-text,
    .wp-modal-container.text-only .wp-modal-text,
    .wp-modal-container.no-image .wp-modal-text {
        padding: 20px;
        max-height: calc(95vh - 180px);
    }
}