/**
 * Styles for Stampa CAD module frontend
 */

/* ==================================================
   NASCONDI CAMPO QUANTITY PER STAMPA CAD
   Il modulo stampa-cad gestisce le copie per singolo file
   ================================================== */
.stampa-digitale-form-container[data-module="stampa-cad"] ~ .quantity,
.stampa-digitale-form-container[data-module="stampa-cad"] + .quantity,
form.cart:has(.stampa-digitale-form-container[data-module="stampa-cad"]) > .quantity,
form.cart:has(.stampa-digitale-form-container[data-module="stampa-cad"]) .single_add_to_cart_button + .quantity,
body.single-product .quantity:has(+ .single_add_to_cart_button):not(.stampa-cad-moved) {
    display: none !important;
}

/* Nascondi quantity tramite classe JS (fallback per browser senza :has) */
body.stampa-cad-product .quantity:not(.stampa-cad-moved) {
    display: none !important;
}

/* ==================================================
   STILE PER IL PULSANTE AGGIUNGI AL CARRELLO SPOSTATO
   ================================================== */
.stampa-cad-add-to-cart-container {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.stampa-cad-add-to-cart-container .single_add_to_cart_button {
    width: 100%;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stampa-cad-add-to-cart-container .single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Campo di upload file */
.stampa-cad-field {
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Assicura che il contenitore tavole sfrutti tutta la larghezza */
.stampa-cad-tavole-container {
    width: 100%;
    max-width: 100%;
}

/* Contenitore form principale - sfrutta larghezza colonna */
.stampa-digitale-form-container[data-module="stampa-cad"] {
    width: 100%;
    max-width: 100%;
}

.stampa-cad-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

/* Nascondi gli input file originali */
.stampa-cad-field input[type="file"] {
    display: none;
}

/* Stili per la dropzone */
.stampa-cad-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background-color: #fafafa;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stampa-cad-dropzone:hover {
    border-color: #0073aa;
    background-color: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stampa-cad-dropzone.dragover {
    border-color: #0073aa;
    background-color: #e6f3ff;
    box-shadow: 0 0 12px rgba(0,115,170,0.3);
    transform: scale(1.02);
}

/* Contenuto della dropzone */
.dropzone-content {
    pointer-events: none;
}

.upload-icon {
    margin-bottom: 15px;
    color: #0073aa;
    opacity: 0.7;
}

.upload-icon svg {
    display: block;
    margin: 0 auto;
}

.upload-text .main-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.upload-text .sub-text {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Lista dei file caricati */
.file-list {
    margin-top: 15px;
    width: 100%;
}

/* File item layout migliorato */
.file-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e0e4e7;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Impedisce che il click sul file-item apra l'upload */
.file-item * {
    pointer-events: auto;
}

.file-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #c0c4c7;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 6px;
    word-break: break-word;
    line-height: 1.2;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.file-size {
    font-size: 12px;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.file-status {
    font-size: 12px;
    color: #27ae60;
    background: #d5f4e6;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.file-analysis {
    font-size: 13px;
    color: #34495e;
    margin-bottom: 10px;
    font-weight: 500;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
}

.file-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.copies-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copies-control label {
    font-size: 13px;
    color: #34495e;
    font-weight: 500;
    margin: 0;
}

.copies-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.copies-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #495057;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copies-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.copies-btn:active {
    background: #dee2e6;
}

.copies-input {
    width: 50px;
    height: 32px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    background: #fff;
    color: #212529;
}

.copies-input:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
    background: #fff;
}

.cost-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.cost-per-copy {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.total-cost {
    font-size: 14px;
    color: #28a745;
    font-weight: 700;
}

.file-actions {
    margin-left: 12px;
    flex-shrink: 0;
}

.file-action.remove-file {
    width: auto;
    height: auto;
    padding: 8px 12px;
    border: 2px solid #dc3545;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #dc3545;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.file-action.remove-file:hover {
    background: #dc3545;
    color: #fff;
}

.file-action.remove-file svg {
    flex-shrink: 0;
}

.remove-file-text {
    white-space: nowrap;
}

/* Migliora la leggibilità dei file multipli */
.woocommerce .cart_item dd br + text,
.order_item dd br + text {
    display: block;
    margin-top: 6px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .woocommerce dl.variation dd,
    .woocommerce .shop_table .product-meta dd,
    .order-meta-list dd {
        padding: 8px;
        font-size: 12px;
    }
    
    .woocommerce .cart_item [data-title*="Link"] dd a,
    .order_item [data-title*="Link"] a {
        display: block;
        margin: 4px 0;
        text-align: center;
    }
    
    .file-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .file-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .cost-display {
        align-items: center;
    }
    
    .file-actions {
        margin-left: 0;
        align-self: center;
    }
}

/* Stati di loading */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.file-status {
    animation: pulse 2s infinite;
}

.file-status:not(:contains("corso")) {
    animation: none;
}

/* Stili per formati riconosciuti */
.file-analysis .format-tag {
    display: inline-block;
    padding: 2px 6px;
    background-color: #0073aa;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}

.file-analysis .pages-count {
    color: #666;
    font-style: italic;
}

.file-analysis .cost-display {
    font-weight: 600;
    color: #28a745;
}

/* Stili aggiuntivi per compatibilità */
.stampa-cad-files-preview {
    display: none;
}

/* Override per temi che potrebbero interferire */
.stampa-cad-field * {
    box-sizing: border-box;
}

.stampa-cad-dropzone *,
.file-item *,
.stampa-cad-grand-total * {
    box-sizing: border-box;
}

/* Stili migliorati per la preview dei file durante l'upload */
.stampa-cad-files-preview {
    margin-top: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stampa-cad-files-preview .preview-title {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #0073aa;
    display: flex;
    align-items: center;
}

.stampa-cad-files-preview .preview-title:before {
    content: "📄";
    margin-right: 8px;
    font-size: 16px;
}

.stampa-cad-files-preview .files-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.stampa-cad-files-preview .file-item {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stampa-cad-files-preview .file-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    border-color: #0073aa;
}

.stampa-cad-files-preview .file-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 6px;
    word-break: break-word;
    line-height: 1.4;
}

.stampa-cad-files-preview .file-size {
    color: #6c757d;
    font-size: 11px;
    font-weight: normal;
}

.stampa-cad-files-preview .file-info {
    background: #f1f3f4;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    padding: 8px 10px;
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.4;
    color: #495057;
}

.stampa-cad-files-preview .file-info.loading {
    background: linear-gradient(90deg, #f1f3f4 25%, #e9ecef 50%, #f1f3f4 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: #6c757d;
    font-style: italic;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.stampa-cad-files-preview .file-copies {
    margin: 8px 0;
    padding: 6px 8px;
    background: #e3f2fd;
    border-radius: 4px;
    border-left: 3px solid #2196f3;
}

.stampa-cad-files-preview .file-copies label {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: #1565c0;
    margin: 0;
}

.stampa-cad-files-preview .copies-input {
    width: 50px !important;
    margin-left: 8px !important;
    padding: 2px 6px !important;
    border: 1px solid #2196f3 !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    text-align: center;
    background: #fff;
}

.stampa-cad-files-preview .remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.stampa-cad-files-preview .remove-file:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(220,53,69,0.3);
}

/* Miglioramenti per il riepilogo totali */
.stampa-cad-grand-total {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #0073aa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0,115,170,0.1);
}

.stampa-cad-grand-total h4 {
    color: #0073aa;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
}

.stampa-cad-grand-total h4:before {
    content: "💰";
    margin-right: 10px;
    font-size: 18px;
}

.cost-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 6px 0;
    background: #ffffff;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cost-line:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cost-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

/* Miglioramenti per l'errore */
.file-analysis.error {
    color: #e74c3c;
    background: #fdf2f2;
    border-left-color: #e74c3c;
}

/* Stile per le informazioni compatte */
.file-analysis {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.2px;
}

/* Miglioramenti per le dimensioni dei badge */
.file-size, .file-status {
    white-space: nowrap;
    min-width: fit-content;
}

/* Miglioramenti per il text wrapping su file con molte informazioni */
.file-analysis.long-content {
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f8f9fa;
}

.file-analysis.long-content::-webkit-scrollbar {
    width: 6px;
}

.file-analysis.long-content::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.file-analysis.long-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Stili responsive per file con molte informazioni */
.file-item.complex-file {
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.file-item.complex-file .file-info {
    width: 100%;
}

.file-item.complex-file .file-analysis {
    margin-bottom: 8px;
}

/* Migliora la leggibilità del testo lungo */
.file-name, .file-analysis {
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Layout compatto per schermi piccoli */
@media (max-width: 480px) {
    .file-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .file-analysis {
        font-size: 12px;
        padding: 4px 8px;
        max-height: 100px;
    }

    .copies-control {
        font-size: 12px;
    }

    .copies-input-group {
        scale: 0.9;
    }

    /* Su mobile, forza sempre layout a colonna per file complessi */
    .file-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .file-controls {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .cost-display {
        align-items: flex-end !important;
        text-align: right;
    }
}

/* Tabs Navigation */
.stampa-cad-tabs-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0;
}

.stampa-cad-tab-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #ddd;
    border-bottom: none;
    background: #f5f5f5;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: -1px;
    border-radius: 4px 4px 0 0;
}

.stampa-cad-tab-btn:hover {
    background: #fff;
}

.stampa-cad-tab-btn.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    color: #2271b1;
}

/* Tabs Content */
.stampa-cad-tabs-content {
    background: #fff;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.stampa-cad-tab {
    display: none;
}

.stampa-cad-tab.active {
    display: block;
}

/* Stili per il campo note aggiuntive */
.stampa-cad-field textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

.stampa-cad-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Note informative per i titoli */
.stampa-cad-section-title {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.stampa-cad-section-title .info-icon {
    margin-left: 8px;
    color: #0073aa;
    cursor: help;
    font-size: 16px;
}

.stampa-cad-info-note {
    display: block;
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f0f7ff;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
}

.stampa-cad-info-note.visible {
    display: block;
}

/* Stile per gli hint sui file multipli */
.stampa-cad-multiple-hint {
    display: block;
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 8px;
    opacity: 0.8;
}

.stampa-cad-upload-limit-note {
    display: block;
    font-size: 12px;
    color: #1565c0;
    font-style: italic;
    margin-top: 4px;
    margin-bottom: 6px;
}

/* Stili per la sezione opzioni di stampa */
.stampa-cad-print-options {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.stampa-cad-print-options-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 20px;
}

/* Layout a 2 colonne per utilizzare tutto lo spazio orizzontale */
.stampa-cad-row-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    align-items: start;
}

.stampa-cad-col-left,
.stampa-cad-col-right {
    width: 100%;
    min-width: 0;
}

/* Su schermi più grandi, aumenta il gap */
@media (min-width: 1024px) {
    .stampa-cad-row-two-cols {
        gap: 40px;
    }
}

/* Su tablet */
@media (max-width: 1023px) and (min-width: 769px) {
    .stampa-cad-row-two-cols {
        gap: 25px;
    }
    
    .stampa-cad-print-options {
        padding: 18px;
    }
    
    .radio-option-inline {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Gestione visibilità del campo Lato stampa nel layout a 2 colonne con Grid */
.stampa-cad-row-two-cols.hide-left-column {
    grid-template-columns: 0fr 1fr;
    gap: 0;
}

.stampa-cad-row-two-cols.hide-left-column .stampa-cad-col-left {
    width: 0;
    overflow: hidden;
    opacity: 0;
}

.stampa-cad-row-two-cols.hide-left-column .stampa-cad-col-right {
    width: 50%;
    max-width: 50%;
}

.stampa-cad-option-group {
    flex: 1;
    min-width: 200px;
    width: 100%;
}

.option-group-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
}

.required {
    color: #dc3545;
    font-weight: 700;
}

.radio-group-inline {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-option-inline {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
    justify-content: center;
}

.radio-option-inline:hover {
    border-color: #0073aa;
    background-color: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.radio-option-inline input[type="radio"] {
    margin-right: 8px;
    margin-top: 0;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.radio-option-inline input[type="radio"]:checked + .radio-text {
    color: #0073aa;
    font-weight: 600;
}

/* Alternativa compatibile al selettore :has() */
.radio-option-inline.selected {
    border-color: #0073aa;
    background-color: #e6f3ff;
    box-shadow: 0 0 8px rgba(0,115,170,0.2);
}

.radio-text {
    color: #555;
    transition: color 0.2s ease;
}

/* Responsive design per mobile */
@media (max-width: 768px) {
    .stampa-cad-print-options {
        padding: 15px;
    }
    
    .stampa-cad-print-options-row {
        flex-direction: column;
        gap: 20px;
    }
    
    /* Layout responsive per le 2 colonne - passa a singola colonna su mobile */
    .stampa-cad-row-two-cols {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stampa-cad-row-two-cols.hide-left-column {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stampa-cad-row-two-cols.hide-left-column .stampa-cad-col-left {
        display: block;
        width: 100%;
        overflow: visible;
        opacity: 1;
    }
    
    .stampa-cad-row-two-cols.hide-left-column .stampa-cad-col-right {
        width: 100%;
        max-width: 100%;
    }
    
    .stampa-cad-option-group {
        min-width: 100%;
    }
    
    .radio-group-inline {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .radio-option-inline {
        flex: 1;
        min-width: auto;
        justify-content: center;
    }
}

/* ==================================================
   RILEGATURA PER FILE (modalità multi-file)
   Quando ci sono più file, la rilegatura appare dentro ogni blocco file
   ================================================== */
.file-binding-control {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f0f7ff;
    border: 1px solid #c4e0f9;
    border-radius: 6px;
    border-left: 3px solid #0073aa;
}

.file-binding-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.file-binding-options {
    display: flex;
    gap: 15px;
}

.file-binding-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.file-binding-option:hover {
    border-color: #0073aa;
    background-color: #f0f7ff;
}

.file-binding-option input[type="radio"] {
    margin-right: 6px;
}

.file-binding-option input[type="radio"]:checked + span {
    color: #0073aa;
    font-weight: 600;
}

/* Stato selezionato per l'opzione rilegatura */
.file-binding-option:has(input:checked) {
    border-color: #0073aa;
    background-color: #e6f3ff;
}

/* Responsive per rilegatura file */
@media (max-width: 480px) {
    .file-binding-options {
        gap: 10px;
    }

    .file-binding-option {
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* ==================================================
   POPUP CONFERMA AGGIUNTA CARRELLO
   ================================================== */
.stampa-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stampa-popup .popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.stampa-popup .popup-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    border: 3px solid #28a745;
    overflow: hidden;
}

.stampa-popup .popup-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0fff4 0%, #d4edda 100%);
    border-bottom: 1px solid #c3e6cb;
}

.stampa-popup .popup-header h3 {
    margin: 0;
    color: #28a745;
    font-size: 1.3em;
}

.stampa-popup .popup-body {
    padding: 24px;
}

.stampa-popup .popup-body p {
    margin-bottom: 16px;
    color: #333;
    line-height: 1.6;
}

.stampa-popup .popup-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.stampa-popup .popup-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.stampa-popup .popup-btn.primary {
    background: #2271b1;
    color: white;
}

.stampa-popup .popup-btn.primary:hover {
    background: #135e96;
    transform: translateY(-2px);
}

.stampa-popup .popup-btn.secondary {
    background: #6c757d;
    color: white;
}

.stampa-popup .popup-btn.secondary:hover {
    background: #5a6268;
}

@media (max-width: 480px) {
    .stampa-popup .popup-content {
        width: 95%;
        margin: 10px;
    }

    .stampa-popup .popup-buttons {
        flex-direction: column;
    }

    .stampa-popup .popup-btn {
        width: 100%;
    }
}
