.csd-wrapper {
    margin: 0px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
    max-width: 1400px;
    padding: 0 10px; /* Padding laterale per mobile */
    box-sizing: border-box;
}

.csd-process-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 24px 0 0px 0;
    padding: 0;
    width: 100%;
    position: relative;
}

/* Stili per i singoli step - ottimizzati per layout lineare */
.csd-process-steps .csd-step {
    flex: 1;
    margin: 0;
    padding: 8px 4px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.csd-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.csd-step:hover {
    transform: translateY(-2px);
}

/* Frecce di progressione tra i passaggi */
.csd-process-steps .csd-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #007cba;
    font-weight: bold;
    z-index: 3;
}

.csd-step-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.csd-step:hover .csd-step-icon {
    transform: scale(1.1);
}

.csd-step-content h4 {
    margin: 0 0 2px 0;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.1;
}

.csd-step-content span {
    font-size: 10px;
    color: #6c757d;
    line-height: 1.2;
    margin: 0;
}

/* Ottimizzazioni performance mobile - SOLO quando NON in preview mode */
body:not(.stencil-preview-active) .csd-wrapper {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Gestione visibilità desktop/mobile per intro sections */
.csd-mobile-only {
    display: none; /* Nascosta su desktop */
}

.csd-desktop-only {
    display: block; /* Visibile su desktop */
}

/* Layout mobile: colonna singola - CONSOLIDATO */
@media (max-width: 768px) {
    /* Wrapper principale - cambio da grid a flex per controllo ordine */
    .csd-wrapper {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 8px;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        margin: 0;
    }
    
    /* Gestione visibilità intro sections su mobile */
    .csd-mobile-only {
        display: block; /* Mostra la versione mobile */
    }
    
    .csd-desktop-only {
        display: none; /* Nascondi la versione desktop */
    }
    
    /* Ordine elementi mobile - Sezione intro PRIMA del canvas */
    .csd-intro-section.csd-mobile-only {
        order: 0;  /* PRIMO - sopra tutto */
        margin-bottom: 15px;
        /* Rimuovo stili speciali: senza sfondo, padding, centratura */
    }
    
    .csd-canvas-container {
        order: 1;  /* SECONDO - dopo intro */
        margin-bottom: 15px;
    }
    
    .csd-control-group {
        order: 2;  /* TERZO - controlli alla fine */
    }
    
    .csd-controls {
        padding: 12px;
    }

    /* Sezione fasi processo - nascosta su mobile */
    .csd-process-steps {
        display: none;
    }

    .csd-step {
        min-width: 80px;
        max-width: 90px;
        padding: 12px 6px;
        flex-shrink: 0;
    }

    .csd-step:not(:last-child)::after {
        right: -15px;
        font-size: 16px;
    }

    .csd-step-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .csd-step-content h4 {
        font-size: 10px;
        margin-bottom: 2px;
        line-height: 1.1;
    }

    .csd-step-content span {
        font-size: 9px;
        line-height: 1.2;
    }

    /* Canvas ottimizzato per mobile */
    #csd-konva-container {
        height: auto !important;
        aspect-ratio: 1 / 1;
        max-height: 85vh;
        border-radius: 8px;
        overflow: hidden;
        touch-action: pan-x pan-y pinch-zoom;
    }
    
    /* Canvas controls mobile-friendly */
    .csd-canvas-controls {
        top: 5px;
        right: 5px;
        padding: 6px;
        border-radius: 12px;
        backdrop-filter: blur(8px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .csd-canvas-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-radius: 8px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .csd-zoom-display {
        font-size: 14px;
        font-weight: 700;
        min-width: 44px;
        padding: 8px 4px;
    }
    
    /* Stencil type cards responsive */
    .csd-stencil-type-card {
        width: auto;
        min-width: 120px;
        flex: 1;
        max-width: none;
    }
    
    .csd-stencil-types {
        justify-content: space-between;
        gap: 8px;
    }
    
    /* Radio labels responsive */
    .csd-radio-label {
        min-width: 100px;
        flex: 1;
        padding: 12px 8px;
        text-align: center;
    }
    
    /* Form controls ottimizzati per touch */
    .csd-control-row {
        flex-direction: column;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .csd-control-item {
        width: 100%;
        flex: 1;
        min-width: 0;
    }
    
    /* Input e select più grandi per touch */
    .csd-control-item input:not([type="number"]),
    .csd-control-item select,
    .csd-control-item textarea,
    input:not([type="number"]), select, textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 8px;
        border: 2px solid #e1e5e9;
        transition: all 0.2s ease;
        -webkit-appearance: none;
        touch-action: manipulation;
    }
    
    /* Input numerici mantengono le freccette native - SPECIFICITÀ MASSIMA */
    html body .csd-control-item input[type="number"],
    html body .csd-wrapper input[type="number"],
    html body div input[type="number"],
    html body input[type="number"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        min-height: 48px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        border: 2px solid #e1e5e9 !important;
        transition: all 0.2s ease !important;
        -webkit-appearance: auto !important;
        -moz-appearance: auto !important;
        appearance: auto !important;
        touch-action: manipulation !important;
    }

    /* Forza visibilità spin buttons WebKit */
    html body .csd-control-item input[type="number"]::-webkit-outer-spin-button,
    html body .csd-control-item input[type="number"]::-webkit-inner-spin-button,
    html body .csd-wrapper input[type="number"]::-webkit-outer-spin-button,
    html body .csd-wrapper input[type="number"]::-webkit-inner-spin-button,
    html body div input[type="number"]::-webkit-outer-spin-button,
    html body div input[type="number"]::-webkit-inner-spin-button,
    html body input[type="number"]::-webkit-outer-spin-button,
    html body input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: auto !important;
        opacity: 1 !important;
        display: block !important;
        height: auto !important;
        width: auto !important;
        margin: 0 !important;
        cursor: pointer !important;
    }
    
    .csd-control-item input:focus,
    .csd-control-item select:focus,
    .csd-control-item textarea:focus,
    .csd-control-item input[type="number"]:focus,
    input[type="number"]:focus {
        outline: none;
        border-color: #4ecdc4;
        box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
    }
    
    /* Label più grandi e spaziati */
    .csd-control-item label {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
        color: #2c3e50;
    }
    
    /* Evita zoom accidentale su iOS */
    input[type="text"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    
    /* Ottimizzazioni performance mobile */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* PREVENZIONE OVERFLOW LATERALE */
    body, html {
        overflow-x: hidden;
    }
    
    /* Assicura che tutti i contenitori non sforino */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Bottoni e controlli che potrebbero sfociare */
    .button, .csd-btn, input[type="button"], input[type="submit"] {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 8px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .button:active, .csd-btn:active {
        transform: scale(0.98);
    }
    
    /* Grid e flex che potrebbero sfociare */
    .csd-material-types.csd-icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }
    
    .csd-icon-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    
    /* Quantity e sconti uno sotto l'altro su mobile */
    .csd-quantity-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-top: 10px;
    }
    
    /* Quantity controls responsive */
    .csd-quantity-controls {
        justify-content: center;
        gap: 12px;
        flex-wrap: nowrap;
        order: 1;
    }
    
    .csd-quantity-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }
    
    /* Sezione pricing sconti sotto */
    .csd-quantity-pricing {
        order: 2;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        padding: 16px 12px;
    }
    
    .csd-quantity-info {
        font-size: 16px;
        text-align: center;
        justify-content: center;
    }
    
    .csd-per-piece-price {
        font-size: 15px;
        font-weight: bold;
        text-align: center;
    }
}

/* Rimossa media query duplicata - tutto consolidato sopra */

/* Canvas Controls */
.csd-canvas-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.csd-zoom-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.csd-canvas-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #495057;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0;
}

.csd-canvas-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
}

.csd-canvas-btn:active {
    transform: translateY(0);
    background: #dee2e6;
}

.csd-zoom-display {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    min-width: 40px;
    text-align: center;
    padding: 0 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas Container Positioning */
.csd-canvas-container {
    position: relative;
}

/* Debug Panel Styles */
.csd-debug-separator {
    margin: 15px 0 10px 0 !important;
    border-top: 2px solid #4ecdc4;
    padding-top: 10px !important;
}

.csd-debug-separator .csd-debug-label {
    color: #4ecdc4 !important;
    font-size: 14px !important;
}

/* Quantity Row Container */
.csd-quantity-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 5px;
}

/* Quantity Controls */
.csd-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.csd-quantity-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.csd-quantity-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.csd-quantity-btn:active {
    transform: translateY(0);
    background: #004c70;
}

.csd-quantity-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#csd-quantity {
    font-size: 16px;
    font-weight: bold;
}

/* Quantity Pricing Section */
.csd-quantity-pricing {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex: 1;
}

.csd-quantity-info {
    font-size: 14px;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.csd-per-piece-price {
    font-size: 13px;
    font-weight: bold;
    color: #4ecdc4;
    margin: 0;
    white-space: nowrap;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#csd-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.csd-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.csd-controls {
    margin-bottom: 20px;
}

/* Stili per le sezioni */
.csd-section {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e1e1;
    margin-bottom: 10px;

}

.csd-section-header {
    background: linear-gradient(135deg,rgb(216, 216, 216) 0%,rgb(206, 206, 206) 100%);
    color: white;
    padding: 12px 15px;
    border-radius: 7px 7px 0 0;
    margin: 0;
}

.csd-section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
   
.csd-section-content {
    padding: 10px;
}

.csd-section:last-child {
    margin-bottom: 0;
}

/* File Upload Button Styles */
.csd-file-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.csd-file-upload-button {
    display: flex;
    /* flex-direction: column; */
    align-items: center;
    justify-content: center;
    padding: 10px 10px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
    /* min-width: 280px; */
    /* min-height: 80px; */
    width: 100%;
}

.csd-file-upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    background: linear-gradient(135deg, #5dd4cd 0%, #4fb3a4 100%);
}

.csd-file-upload-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(78, 205, 196, 0.3);
}

.csd-file-upload-button i {
    font-size: 28px;
    color: white;
    margin-bottom: 8px;
}

.csd-file-upload-button .upload-main-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
}

.csd-file-upload-button .upload-sub-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    line-height: 1.3;
    max-width: 250px;
}

/* File Upload Button - Stato con file selezionato */
.csd-file-upload-button.file-selected {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.csd-file-upload-button.file-selected:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.csd-file-upload-button.file-selected i {
    color: #fff;
}

/* File Upload Button - Stato "Nuovo file" */
.csd-file-upload-button.new-file-button {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    cursor: pointer;
}

.csd-file-upload-button.new-file-button:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
    transform: translateY(-2px);
}

.csd-file-upload-button.new-file-button i {
    color: #fff;
}

/* File Preview rimosso - non necessario */

#csd-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #495057;
}

#csd-file-info .file-icon {
    font-size: 20px;
    color: #28a745;
}

#csd-file-info .file-details {
    flex: 1;
}

#csd-file-info .file-name {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 2px;
}

#csd-file-info .file-size {
    font-size: 12px;
    color: #6c757d;
}

/* Drag and Drop Enhancement */
.csd-file-upload-button.drag-over {
    background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    transform: scale(1.02);
}


.csd-control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.csd-control-group select,
.csd-control-group textarea,
.csd-control-group input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 0;
}

.csd-control-group textarea {
    min-height: 50px;
    resize: vertical;
}

.csd-control-row {
    display: flex;
    gap: 15px;

}

.csd-control-item {
    flex: 1;
}

.csd-line-height input,
.csd-letter-spacing input {
    width: 100%;
}

.csd-align-buttons {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.csd-align-btn {
    font-size: 20px;
    cursor: pointer;
    color: #555;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.csd-align-btn:hover {
    background-color: #f0f0f0;
}

.csd-align-btn.active {
    color: #4ecdc4;
    border-color: #4ecdc4;
    background-color: rgba(0, 115, 170, 0.1);
}

.csd-range-info {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

/* Stili per tipi di stencil */
/* Stili per il grid delle icone dei tipi di stencil */
.csd-icon-grid {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.csd-stencil-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    text-align: center;
    position: relative;
    height: 140px;
    justify-content: center;
    width: 150px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.csd-stencil-type-card:hover {
    border-color: #4ecdc4;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

.csd-stencil-type-card.selected {
    border-color: #4ecdc4;
    background: #f0f8ff;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

.csd-type-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.csd-stencil-type-card.selected .csd-type-icon {
    background: #4ecdc4;
    color: #fff;
}

.csd-type-icon img {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
}

.csd-type-icon i {
    font-size: 32px;
    color: #666;
}

.csd-stencil-type-card.selected .csd-type-icon i {
    color: #fff;
}

.csd-type-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.csd-stencil-type-card.selected .csd-type-label {
    color: #4ecdc4;
    font-weight: 600;
}

/* Fallback per stili legacy */
.csd-stencil-types {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.csd-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.csd-radio-label:hover {
    border-color: #4ecdc4;
    background-color: #f9f9f9;
}

.csd-radio-label input[type="radio"] {
    margin-right: 8px;
    width: auto;
}

.csd-radio-label input[type="radio"]:checked {
    accent-color: #4ecdc4;
}

.csd-radio-label input[type="radio"]:checked + span {
    font-weight: bold;
    color: #4ecdc4;
}

.csd-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.csd-actions button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #4ecdc4;
    color: white;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: bold;
}

.csd-actions button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.csd-actions button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#csd-konva-container, #csd-gallery-container {
    width: 100%;
    border-radius: 4px;
}

#csd-gallery-container {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

#csd-gallery-main-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.csd-gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0px;
    padding: 0px 0;
    justify-content: flex-start;
}

.csd-thumb {
    flex: 0 0 calc(20% - 8px);
    min-width: 55px;
    max-width: 55px;
    height: 55px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.csd-thumb:hover {
    border-color: #4ecdc4;
    transform: scale(1.05);
}

.csd-thumb.active {
    border-color: #4ecdc4;
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.5);
}

.csd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.csd-canvas-thumb {
    flex-direction: column;
    font-size: 11px;
    color: #555;
    text-align: center;
    line-height: 1.1;
    /* padding: 5px; */
}

.csd-canvas-thumb i {
    font-size: 24px;
    margin-bottom: 5px;
}

.csd-canvas-container {
    position: relative;
}

.csd-dimensions-info {
    text-align: center;
    padding: 15px 0;
    font-size: 16px;
    color: #333;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 10px;
}

.csd-dimensions-info .file-dimensions {
    color: #ff6b6b;
}

.csd-dimensions-info .total-dimensions {
    color: #4ecdc4;
}

.csd-ruler-legend {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.file-ruler-indicator {
    color: #ff6b6b;
    font-weight: bold;
    border-bottom: 2px dashed #ff6b6b;
    padding-bottom: 2px;
}

.total-ruler-indicator {
    color: #4ecdc4;
    font-weight: bold;
    border-bottom: 2px solid #4ecdc4;
    padding-bottom: 2px;
}

.csd-info {
    margin-top: 10px;
    text-align: center;
    position: relative;
}

.csd-info span {
    font-weight: bold;
}

.csd-info-lungo {
    margin-top: 10px;
    padding-right: 10px;
    padding-left: 10px;
    text-align: center;
    color: #fff;
    background-color: #4ecdc4;
    padding: 15px 0;
    font-weight: bold;
    font-size: 25px;
    border-radius: 8px;
}

.csd-estimated-cost {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: #4ecdc4;
    padding: 10px 20px;
    border-radius: 0 0 0 24px;
    font-weight: bold;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.csd-estimated-cost small,
.csd-estimated-cost-lungo small {
    font-size: 14px;
    margin-left: 5px;
}

.csd-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 998;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.csd-icon {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #495057;
    transition: all 0.2s ease;
    font-size: 14px;
}

.csd-icon:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #343a40;
}

/* Stati attivo/inattivo per le quote */
.csd-icon.quotes-on,
.csd-canvas-btn.quotes-on {
    background: #007bff;
    border-color: #0056b3;
    color: white;
}

.csd-icon.quotes-off,
.csd-canvas-btn.quotes-off {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.csd-icon.quotes-on:hover,
.csd-canvas-btn.quotes-on:hover {
    background: #0056b3;
    border-color: #004085;
}

.csd-icon.quotes-off:hover,
.csd-canvas-btn.quotes-off:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Tool Gomma - Stati attivo/inattivo */
.csd-canvas-btn.tool-active {
    background: #dc3545;
    border-color: #c82333;
    color: white;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.csd-canvas-btn.tool-active:hover {
    background: #c82333;
    border-color: #bd2130;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.35);
}

.csd-canvas-btn.tool-active:active {
    background: #bd2130;
    transform: translateY(0);
}

/* Gomma - Animazione pulsante */
.csd-canvas-btn.tool-active {
    animation: tool-pulse 2s ease-in-out infinite;
}

@keyframes tool-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.4);
    }
}

/* Demo Warning Message */
.csd-demo-warning {
    margin: 15px 0;
    padding: 15px 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    display: none; /* Nascosto per default */
    align-items: flex-start;
    gap: 12px;
}

/* Mostra il messaggio demo quando è attivo */
.csd-demo-warning.show-demo-message {
    display: flex;
}

.csd-demo-warning i.fas {
    color: #856404;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.csd-demo-warning p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
}

.csd-demo-warning strong {
    font-weight: 600;
    color: #664d03;
}

.csd-promo-text {
    text-align: center;
    padding: 15px 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff3cd;
    border-radius: 8px;
    margin: 15px 0;
}

/* Desktop: side by side layout for dimensions sections */
@media (min-width: 769px) {
    .csd-dimensions-desktop-row {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }
    
    .csd-dimensions-section {
        flex: 1;
    }
}

/* Stili per il riepilogo dimensioni */
.csd-total-dimensions-display {
    text-align: center;
    /* padding: 10px; */
    /* background: #f8f9fa; */
    /* border: 1px solid #e9ecef; */
    /* border-radius: 4px; */
    font-size: 14px;
    color: #495057;
}

#csd-total-width, #csd-total-height {
    font-weight: bold;
    color: #4ecdc4;
}

/* Debug pricing section - only visible to admins */
.csd-debug-pricing {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: 2px solid #c23616;
    margin-top: 15px;
}

.csd-section.csd-debug-pricing {
    position: fixed !important;
    top: 118px !important;
    right: 20px !important;
    width: 300px !important;
    z-index: 99999 !important;
    margin: 0 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

.csd-debug-pricing .csd-section-header {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 4px 8px;
    /* margin: -15px -15px 15px -15px; */
    border-radius: 8px 8px 0 0;
    cursor: move !important;
    user-select: none !important;
    position: relative !important;
}

.csd-debug-pricing .csd-section-header h4 {
    color: white;
    margin: 0 !important;
    display: inline-block !important;
}

.csd-debug-close {
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: white !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    transition: background 0.2s !important;
}

.csd-debug-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.csd-debug-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.2;
}

.csd-debug-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px dotted #ddd;
}

.csd-debug-row:last-child {
    border-bottom: none;
}

.csd-debug-label {
    font-weight: bold;
    color: #333;
}

.csd-debug-value {
    color: #4ecdc4;
    font-weight: normal;
}

.csd-debug-calculation {
    background: #f0f8ff;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    border: 1px solid #b3d9ff;
}

.csd-debug-total {
    background: #e8f5e8;
    padding: 8px;
    border-radius: 4px;
    border: 2px solid #28a745;
    font-size: 14px;
    font-weight: bold;
}

.csd-debug-total .csd-debug-label,
.csd-debug-total .csd-debug-value {
    font-weight: bold;
    color: #155724;
}

/* Ulteriori ottimizzazioni per schermi molto piccoli */
@media (max-width: 480px) {
    .csd-wrapper {
        padding: 5px;
        gap: 8px;
    }
    
    .csd-controls {
        padding: 10px;
    }

    /* Canvas su mobile tiny */
    #csd-konva-container {
        max-height: 80vh;
        border-radius: 6px;
    }

    .csd-canvas-controls {
        top: 3px;
        right: 3px;
        padding: 4px;
    }

    .csd-canvas-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Form email ottimizzato */
    .csd-email-form {
        margin: 0 -5px;
    }

    .csd-email-form p {
        font-size: 14px;
        margin-bottom: 10px;
        text-align: center;
    }

    #csdf-user-email {
        font-size: 16px !important;
        min-height: 50px !important;
        border-radius: 10px;
        padding: 15px !important;
        margin-bottom: 10px;
    }

    #csd-show-price-btn {
        width: 100% !important;
        min-height: 50px !important;
        font-size: 16px !important;
        font-weight: 600;
        border-radius: 10px;
        padding: 15px !important;
    }

    /* Material grid 1 colonna su schermi tiny */
    .csd-material-types.csd-icon-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .csd-material-card {
        min-height: 90px;
        padding: 14px 10px;
    }

    .csd-material-icon {
        width: 60px;
        height: 60px;
    }

    .csd-material-label {
        font-size: 13px;
    }

    .csd-thumb {
        flex: 0 0 calc(50% - 5px);
        height: 40px;
        min-width: 40px;
        max-width: 40px;
        border-radius: 6px;
    }

    h1 {
        font-size: 22px;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    h3 {
        font-size: 17px;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .csd-canvas-thumb span {
        display: none;
    }

    .csd-canvas-thumb i {
        margin-bottom: 0;
        font-size: 20px;
    }

    /* Input controls ancora più grandi */
    .csd-control-item input,
    .csd-control-item select,
    .csd-control-item textarea {
        min-height: 52px;
        font-size: 17px;
        padding: 14px 18px;
    }

    .csd-control-item label {
        font-size: 15px;
        margin-bottom: 10px;
    }
}

/* Ottimizzazioni per tablet in landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .csd-thumb {
        flex: 0 0 calc(25% - 7.5px);
        min-width: 50px;
        max-width: 50px;
        height: 50px;
    }

    .csd-control-row {
        flex-wrap: wrap;
    }

    .csd-control-item {
        flex: 0 0 calc(50% - 7.5px);
    }

    .csd-alignment,
    .csd-letter-spacing {
        flex: 0 0 100%;
    }
}

/* Fix avanzati per touch devices */
@media (hover: none) and (pointer: coarse) {
    /* Rimuovi highlight touch indesiderati */
    .csd-align-btn,
    .csd-thumb,
    .csd-icon,
    .csd-actions button,
    .csd-canvas-btn,
    .csd-material-card,
    button,
    input[type="button"],
    input[type="submit"] {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Migliora feedback tattile */
    .csd-material-card:active,
    .csd-canvas-btn:active,
    .button:active,
    .csd-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    /* Aumenta area touch per piccoli elementi */
    .csd-canvas-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .csd-thumb {
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        height: 40px;
    }

    /* Ottimizza scrolling touch */
    .csd-gallery-thumbnails,
    .csd-controls {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    /* Migliora visibilità focus per accessibilità */
    input:focus,
    select:focus,
    textarea:focus,
    button:focus {
        outline: 3px solid #4ecdc4;
        outline-offset: 2px;
    }
}

/* ===== EFFETTI 3D PER STENCIL ===== */
.stencil-3d-container {
    position: relative;
    display: inline-block;
}

.stencil-3d-shadow {
    position: absolute;
    top: 3px;
    left: 3px;
    filter: blur(2px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

.stencil-3d-highlight {
    position: absolute;
    top: -1px;
    left: -1px;
    filter: brightness(1.2);
    opacity: 0.08;
    z-index: 1;
    pointer-events: none;
}

/* Effetto 3D per SVG stencil - Ombra super sfumata e proporzionale */
.stencil-svg-3d {
    filter: drop-shadow(0 0 0 transparent);
    position: relative;
    transition: all 0.3s ease;
}

.stencil-svg-3d::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.03);
    border-radius: inherit;
    z-index: -1;
    filter: blur(3px);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.stencil-svg-3d:hover::after {
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.05);
    filter: blur(6px);
    transform: scale(1.04);
}

/* Canvas 3D Effect - Ombra super sfumata */
canvas.stencil-3d-canvas {
    position: relative;
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.02),
        0 4px 8px rgba(0,0,0,0.03),
        0 6px 12px rgba(0,0,0,0.02),
        0 8px 16px rgba(0,0,0,0.01);
    transition: box-shadow 0.3s ease;
}

canvas.stencil-3d-canvas:hover {
    box-shadow: 
        0 3px 6px rgba(0,0,0,0.03),
        0 6px 12px rgba(0,0,0,0.04),
        0 9px 18px rgba(0,0,0,0.03),
        0 12px 24px rgba(0,0,0,0.02);
}

/* Effetto materiale per lo stencil */
.stencil-material-effect {
    position: relative;
}

.stencil-material-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0.05) 25%,
        rgba(0,0,0,0.02) 50%,
        rgba(0,0,0,0.05) 75%,
        rgba(0,0,0,0.05) 100%);
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.stencil-material-effect:hover::before {
    opacity: 0.5;
}

/* Animazione per effetto depth */
@keyframes stencil-depth-pulse {
    0% { 
        filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.06)); 
    }
    50% { 
        filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.08)); 
    }
    100% { 
        filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.06)); 
    }
}

.stencil-3d-active {
    animation: stencil-depth-pulse 2s infinite ease-in-out;
}

/* PNG Download Button */
#csd-download-png {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    transition: all 0.3s ease;
}

#csd-download-png:hover {
    background: linear-gradient(135deg, #218838, #1ba085) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

#csd-download-png:disabled {
    background: #6c757d !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Tech Message - Messaggio tecnici nella parte inferiore del canvas */
.csd-tech-message {
    position: absolute;
    bottom: 7px;
    background: rgba(255, 255, 255, 0.92);
    color: #333;
    padding: 4px 10px;
    font-size: 11px;
    line-height: 1.4;
    /* text-align: center; */
    z-index: 8;
    transition: opacity 0.3s ease;
}

.csd-tech-message i {
    color: #4ecdc4;
    margin-right: 6px;
    font-size: 10px;
}

.csd-tech-message:hover {
    background: rgba(255, 255, 255, 0.95);
}

.csd-tech-message .csd-tooltip-trigger {
    margin-left: 6px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.csd-tech-message .csd-tooltip-trigger:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Icons Container */
.csd-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 999;
    padding: 8px;
    backdrop-filter: blur(10px);
}

/* Global Info Icon - Icona info globale in alto a sinistra del canvas */
.csd-global-info-icon {
    cursor: pointer;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csd-global-info-icon:hover {
    transform: translateY(-2px);
}

.csd-global-info-icon svg {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.05));
}

.csd-global-info-icon:hover svg {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08));
}

/* Animazione pulse subtile */
@keyframes info-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.csd-global-info-icon svg {
    animation: info-pulse 3s ease-in-out infinite;
}

.csd-global-info-icon:hover svg {
    animation: none;
}


/* Classe per nascondere l'icona quando disabilitata */
.csd-global-info-icon.tooltip-disabled {
    display: none !important;
}

/* Media query per mobile - messaggio più compatto */
@media (max-width: 768px) {
    .csd-tech-message {
        font-size: 10px;
        padding: 6px 10px;
        bottom: 5px;
        left: 5px;
        right: 5px;
    }
    
    .csd-tech-message i {
        font-size: 9px;
        margin-right: 4px;
    }
}

/* Mouse Zoom Hint - Icona mouse in basso a destra */
.csd-mouse-zoom-hint {
    position: absolute;
    bottom: 69px;
    right: 8px;
    background: rgb(79 79 79 / 70%);
    color: white;
    padding: 5px 5px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 10;
    cursor: help;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.csd-mouse-zoom-hint:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}

.csd-mouse-zoom-hint i {
    font-size: 14px;
}

.csd-mouse-zoom-hint .zoom-text {
    font-weight: 500;
    font-size: 11px;
}

/* Media query per mobile - nascondi hint mouse */
@media (max-width: 768px) {
    .csd-mouse-zoom-hint {
        display: none;
    }
}

/* =================================
   POPUP VECTORIZER - LOADER INDIVIDUALI
   ================================= */

/* Loader per singolo thumbnail */
.thumb-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

.loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: thumb-spin 1s linear infinite;
    margin-bottom: 8px;
}

.loader-text {
    font-size: 11px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

@keyframes thumb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Stili per thumbnail vettoriali */
.vr-thumb.vector {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.vr-thumb.vector:hover {
    border-color: #007cba;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.vr-thumb.vector.selected {
    border-color: #007cba;
    background: #e7f3ff;
}

.vr-thumb.vector .image-container {
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vr-thumb.vector .image-container img {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.3s ease;
}

/* 🔄 Inversione colori per preview nel popup */
.vr-thumb.vector .image-container img.inverted {
    filter: invert(1);
    -webkit-filter: invert(1);
    -moz-filter: invert(1);
    -o-filter: invert(1);
    -ms-filter: invert(1);
}

/* ========================================
   LOADER PULSANTE CONFERMA POPUP
   ======================================== */

/* Pulsante con loader */
#confirm-selection-btn.loading {
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    cursor: not-allowed;
}

/* Spinner FontAwesome nel pulsante */
#confirm-selection-btn .fa-spinner {
    animation: fa-spin 1s infinite linear;
    margin-right: 8px;
}

/* Animazione spinner se FontAwesome non è disponibile */
@keyframes button-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fallback spinner CSS puro */
#confirm-selection-btn.loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: button-spinner 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Nascondi il fallback se FontAwesome è presente */
#confirm-selection-btn .fa-spinner + ::before {
    display: none;
}

/* ================================================== */
/* PROFESSIONAL PRICE LOADER STYLES */
/* ================================================== */

/* Loader a pallini bianchi per il calcolo del prezzo */
.csd-price-loading {
    pointer-events: none;
    transition: all 0.3s ease;
}

.csd-loading-dots {
    display: inline-block;
    text-align: center;
    line-height: 1;
}

.csd-loading-dots::before {
    content: '● ● ●';
    color: white;
    font-size: 14px;
    letter-spacing: 4px;
    animation: csd-dots-pulse 1.5s infinite;
}

/* Animazione pulsante per i pallini */
@keyframes csd-dots-pulse {
    0%, 20% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    80%, 100% {
        opacity: 0.3;
    }
}

/* Smooth transitions per tutti gli stati del prezzo */
.csd-estimated-cost,
.csd-estimated-cost-lungo {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stato di aggiornamento completato */
.csd-price-updated {
    animation: csd-price-updated 0.6s ease-out;
}

@keyframes csd-price-updated {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(78, 205, 196, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
}

/* Loading dots per testi più lunghi */
.csd-price-calculating::after {
    content: '';
    animation: csd-dots 1.5s infinite;
}

@keyframes csd-dots {
    0%, 20% {
        content: 'Calcolo';
    }
    40% {
        content: 'Calcolo.';
    }
    60% {
        content: 'Calcolo..';
    }
    80%, 100% {
        content: 'Calcolo...';
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .csd-loading-dots::before {
        font-size: 12px;
        letter-spacing: 3px;
    }
}

/* Accessibilità: Riduci animazioni per utenti che lo preferiscono */
@media (prefers-reduced-motion: reduce) {
    .csd-loading-dots::before {
        animation: none;
        opacity: 0.8;
    }

    .csd-price-updated {
        animation: none;
    }
}

