/* Elementor Artwork Price Widget - Styles */

.elementor-artwork-price-widget {
    padding: 40px;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.artwork-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 20px;
}

.artwork-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498DB, #E74C3C);
    border-radius: 2px;
}

.artwork-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #7F8C8D;
    margin-bottom: 40px;
    margin-top: -20px;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.artwork-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.artwork-controls {
    flex: 1;
    min-width: 300px;
}

.control-group {
    margin-bottom: 30px;
}

.control-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.artwork-btn {
    flex: 1;
    min-width: 120px;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

/* Pulsanti senza lettere/numeri */
.artwork-btn .btn-label:only-child {
    margin-top: 0;
}

.artwork-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.artwork-btn:hover::before {
    width: 300px;
    height: 300px;
}

.artwork-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.artwork-btn:active {
    transform: translateY(-1px);
}

.artwork-btn.active {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.btn-letter {
    font-size: 1.5rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.btn-label {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.price-section {
    margin-top: 40px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.price-label {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 5px;
    animation: priceUpdate 0.3s ease;
}

.price-disclaimer {
    text-align: center;
    font-size: 13px;
    color: #95A5A6;
    font-style: italic;
    margin-bottom: 15px;
    line-height: 1.5;
    padding: 0 10px;
}

@keyframes priceUpdate {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.contact-btn {
    width: 100%;
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.contact-btn:hover::before {
    left: 100%;
}

.contact-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.contact-btn:active {
    transform: translateY(-1px);
}

.artwork-preview {
    flex: 1;
    min-width: 300px;
    position: sticky;
    top: 20px;
}

.preview-image-container {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Aspect ratio 4:3 */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.preview-image:hover {
    transform: scale(1.05);
}

.preview-image.updating {
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .artwork-container {
        flex-direction: column-reverse;
    }
    
    .artwork-preview {
        position: relative;
        top: 0;
        width: 100%;
    }
    
    .artwork-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .elementor-artwork-price-widget {
        padding: 25px;
    }
    
    .artwork-title {
        font-size: 1.75rem;
        margin-bottom: 30px;
    }
    
    .artwork-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
        margin-top: -15px;
    }
    
    .artwork-container {
        gap: 30px;
    }
    
    .button-group {
        gap: 10px;
    }
    
    .artwork-btn {
        min-width: 100px;
        padding: 12px 15px;
    }
    
    .btn-letter {
        font-size: 1.3rem;
    }
    
    .btn-label {
        font-size: 0.75rem;
    }
    
    .price-value {
        font-size: 2rem;
    }
    
    .price-disclaimer {
        font-size: 12px;
    }
    
    .contact-btn {
        font-size: 1rem;
        padding: 15px 25px;
    }
}

@media (max-width: 480px) {
    .elementor-artwork-price-widget {
        padding: 20px;
    }
    
    .artwork-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .artwork-subtitle {
        font-size: 0.9rem;
        margin-bottom: 25px;
        margin-top: -10px;
    }
    
    .control-group label {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .button-group {
        gap: 8px;
    }
    
    .artwork-btn {
        min-width: 80px;
        padding: 10px 12px;
        border-radius: 10px;
    }
    
    .btn-letter {
        font-size: 1.1rem;
    }
    
    .btn-label {
        font-size: 0.7rem;
    }
    
    .price-section {
        padding: 20px;
    }
    
    .price-display {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .price-label {
        font-size: 1rem;
    }
    
    .price-value {
        font-size: 1.8rem;
    }
    
    .price-disclaimer {
        font-size: 11px;
        margin-bottom: 12px;
    }
    
    .contact-btn {
        font-size: 0.95rem;
        padding: 14px 20px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.artwork-btn.loading,
.preview-image.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Print Styles */
@media print {
    .elementor-artwork-price-widget {
        box-shadow: none;
        padding: 20px;
    }
    
    .artwork-btn:hover,
    .contact-btn:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

/* Notifiche */
.artwork-notification {
    position: relative;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 100;
}

.artwork-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.artwork-notification-success {
    background-color: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
}

.artwork-notification-error {
    background-color: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
}

.artwork-notification-info {
    background-color: #d1ecf1;
    border: 2px solid #bee5eb;
    color: #0c5460;
}

/* Highlight Form CF7 */
.highlight-form {
    animation: highlightPulse 2s ease-in-out;
    border: 3px solid #3498DB !important;
    border-radius: 10px !important;
    padding: 20px !important;
    background-color: rgba(52, 152, 219, 0.05) !important;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(52, 152, 219, 0);
    }
}

/* Modale Contact Form */
.artwork-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.artwork-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.artwork-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.artwork-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modale Contact Form - Pulsante di chiusura corretto */
.artwork-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    /* Impedisce che diventi ovale in contesti flex */
    flex-shrink: 0; 
    border: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease; /* Rimosso transform da qui */
    z-index: 10;
}

.artwork-modal-close:hover {
    background: rgba(255, 255, 255, 0.5);
    /* Rimosso transform: rotate(90deg) per non ruotare tutto il cerchio */
}

.artwork-modal-close::before,
.artwork-modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    /* Aggiungiamo la transizione specifica per la rotazione delle linee */
    transition: transform 0.3s ease;
}

/* Posizione iniziale della X */
.artwork-modal-close::before {
    transform: rotate(45deg);
}

.artwork-modal-close::after {
    transform: rotate(-45deg);
}

/* --- EFFETTO ROTAZIONE SOLO DELLA X --- */
.artwork-modal-close:hover::before {
    transform: rotate(135deg); /* 45 + 90 */
}

.artwork-modal-close:hover::after {
    transform: rotate(45deg); /* -45 + 90 */
}

.artwork-modal-close svg {
    display: none;
}

.artwork-modal-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 2px solid #ecf0f1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.artwork-modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    padding-right: 40px;
}

.artwork-modal-selection {
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.artwork-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.artwork-modal-loading {
    text-align: center;
    padding: 40px 20px;
}

.artwork-modal-loading .spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498DB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.artwork-modal-loading p {
    color: #7F8C8D;
    font-size: 1rem;
}

.artwork-modal-form-container {
    display: none;
}

.artwork-modal-form-container.loaded {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Stili form CF7 nella modale */
.artwork-modal-form-container .wpcf7 {
    margin: 0;
}

/* Nascondi elementi non necessari nella modale */
.artwork-modal-form-container .artwork-contact-form h3 {
    display: none !important;
}

.artwork-modal-form-container .hidden-fields-container,
.artwork-modal-form-container .wpcf7-form > [style*="display: none"],
.artwork-modal-form-container .wpcf7-form > div[style*="position: absolute; left: -5000px"] {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* CSS personalizzato per #responsive-form nella modale */
.artwork-modal-form-container #responsive-form-modal,
.artwork-modal-form-container #responsive-form {
    max-width: 100%;
    margin: 0;
    width: 100%;
}

.artwork-modal-form-container .form-row {
    width: 100%;
    margin-bottom: 15px;
}

.artwork-modal-form-container .column-half,
.artwork-modal-form-container .column-full {
    float: left;
    position: relative;
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Forza gli input a occupare tutta la larghezza della colonna */
.artwork-modal-form-container #responsive-form input[type="text"],
.artwork-modal-form-container #responsive-form input[type="email"],
.artwork-modal-form-container #responsive-form input[type="tel"],
.artwork-modal-form-container #responsive-form textarea,
.artwork-modal-form-container #responsive-form-modal input[type="text"],
.artwork-modal-form-container #responsive-form-modal input[type="email"],
.artwork-modal-form-container #responsive-form-modal input[type="tel"],
.artwork-modal-form-container #responsive-form-modal textarea {
    width: 100% !important;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.artwork-modal-form-container .clearfix:after {
    content: "";
    display: table;
    clear: both;
}

/* Testo di accettazione e Checkbox */
.artwork-modal-form-container .accetto {
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 20px;
}

.artwork-modal-form-container .accetto input {
    margin-right: 8px;
}

.artwork-modal-form-container .accetto a {
    color: inherit;
    text-decoration: underline;
}

.artwork-modal-form-container .accetto a:hover {
    color: #667eea;
}

/* Media query per desktop nella modale */
@media only screen and (min-width: 48em) {
    .artwork-modal-form-container .column-half {
        width: 50%;
    }
}

/* Bottone invio personalizzato */
.artwork-modal-form-container .wpcf7-submit {
    float: right;
    width: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.artwork-modal-form-container .wpcf7-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Messaggi di risposta */
.artwork-modal-form-container .wpcf7 form .wpcf7-response-output {
    margin: 1em 0;
    padding: 0.8em 1em;
    border: 2px solid #46b450;
    background-color: #fff;
    clear: both;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Messaggio di successo specifico */
.artwork-modal-form-container div.wpcf7-mail-sent-ok {
    background: #8BC34A;
    color: white;
    border: none;
}

.artwork-modal-form-container .wpcf7-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2C3E50;
}

/* Stili input di default (sovrascritti dal CSS personalizzato se presente) */
.artwork-modal-form-container .wpcf7-form input[type="text"]:not([style*="width"]),
.artwork-modal-form-container .wpcf7-form input[type="email"]:not([style*="width"]),
.artwork-modal-form-container .wpcf7-form input[type="tel"]:not([style*="width"]),
.artwork-modal-form-container .wpcf7-form textarea:not([style*="width"]) {
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.artwork-modal-form-container .wpcf7-form input:focus,
.artwork-modal-form-container .wpcf7-form textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.artwork-modal-form-container .wpcf7-form textarea {
    min-height: 100px;
    resize: vertical;
}

.artwork-modal-form-container .wpcf7-response-output {
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.artwork-modal-form-container .wpcf7-mail-sent-ok {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.artwork-modal-form-container .wpcf7-validation-errors,
.artwork-modal-form-container .wpcf7-mail-sent-ng {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.artwork-modal-form-container .wpcf7-not-valid-tip {
    color: #E74C3C;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Layout form responsive nella modale */
.artwork-modal-form-container .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.artwork-modal-form-container .column-full {
    flex: 1 1 100%;
}

.artwork-modal-form-container .column-half {
    flex: 1 1 calc(50% - 7.5px);
}

.artwork-modal-form-container .column-half.accetto {
    display: flex;
    align-items: center;
}

.artwork-modal-form-container .wpcf7-acceptance {
    display: flex;
    align-items: center;
    gap: 8px;
}

.artwork-modal-form-container .wpcf7-acceptance input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
}

.artwork-modal-form-container .wpcf7-list-item {
    margin: 0 !important;
}

.artwork-modal-form-container .wpcf7-list-item-label {
    font-size: 0.9rem;
}

/* Responsive modale */
@media (max-width: 768px) {
    .artwork-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .artwork-modal-header {
        padding: 25px 25px 15px 25px;
    }
    
    .artwork-modal-title {
        font-size: 1.5rem;
    }
    
    .artwork-modal-body {
        padding: 25px;
    }
    
    .artwork-modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }
    
    .artwork-modal-close::before,
    .artwork-modal-close::after {
        width: 18px;
    }
    
    /* Layout a colonna singola su tablet/mobile */
    .artwork-modal-form-container .column-half {
        flex: 1 1 100%;
    }
    
    .artwork-modal-form-container .form-row.clearfix {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .artwork-modal {
        padding: 10px;
    }
    
    .artwork-modal-content {
        border-radius: 12px;
    }
    
    .artwork-modal-header {
        padding: 20px;
    }
    
    .artwork-modal-title {
        font-size: 1.3rem;
    }
    
    .artwork-modal-selection {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .artwork-modal-body {
        padding: 20px;
    }
}
