/* ============================================
   LENS CONFIGURATOR - Modern & Minimal Design
   Layout Verticale con Spazi per Immagini
   CON COLORI DIFFERENZIATI PER OGNI STEP
   ============================================ */

/* === VARIABILI COLORI === */
:root {
    --primary-color: #2c3e50;
    --primary-light: #34495e;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --success-color: #27ae60;
    --success-hover: #229954;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --text-dark: #2c3e50;
    --text-medium: #5a6c7d;
    --text-muted: #95a5a6;
    --border-color: #e8ecef;
    --border-hover: #cbd5e0;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-lighter: #fafbfc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-hover: 0 8px 16px rgba(52, 152, 219, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Colori Step - tonalità pastello */
    --step1-color: #e3f2fd;        /* Azzurro tenue */
    --step1-border: #90caf9;       
    --step1-accent: #42a5f5;
    
    --step2-color: #f3e5f5;        /* Viola tenue */
    --step2-border: #ce93d8;
    --step2-accent: #ab47bc;
    
    --step3-color: #e8f5e9;        /* Verde tenue */
    --step3-border: #81c784;
    --step3-accent: #66bb6a;
    
    --step4-color: #fff3e0;        /* Arancione tenue */
    --step4-border: #ffb74d;
    --step4-accent: #ffa726;
}

/* === RESET E BASE === */
.lens-configurator-modern {
    max-width: 980px;
    margin: 0 auto;
    padding: 10px 0px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.lens-configurator-modern * {
    box-sizing: border-box;
}

/* === HEADER CONFIGURATORE === */
.configurator-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.configurator-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.configurator-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
}

/* === PRODUCT INFO CARD === */
.product-info-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
}

.product-info-flex {
    display: flex;
    align-items: center;
    gap: 24px;
}

.product-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    flex: 1;
}

.product-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

.product-reference {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

.product-price-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-lighter);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.product-price-tag .price-label {
    font-size: 13px;
    color: var(--text-medium);
    font-weight: 500;
}

.product-price-tag .price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.btn-link-secondary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.btn-link-secondary:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

.btn-link-secondary .material-icons {
    font-size: 18px;
}

/* === CONFIGURATOR STEPS - CON COLORI DIFFERENZIATI === */
.configurator-step-modern {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.configurator-step-modern:hover {
    box-shadow: var(--shadow-md);
}

/* STEP 1 - Tipologia Lenti - Azzurro */
.configurator-step-modern[data-step="1"] {
    background: linear-gradient(to bottom, var(--step1-color) 0%, var(--bg-white) 100px);
    border-left: 4px solid var(--step1-accent);
}

.configurator-step-modern[data-step="1"] .step-number-badge {
    background: linear-gradient(135deg, var(--step1-accent), var(--step1-border));
}

/* STEP 2 - Prescrizione - Viola */
.configurator-step-modern[data-step="2"] {
    background: linear-gradient(to bottom, var(--step2-color) 0%, var(--bg-white) 100px);
    border-left: 4px solid var(--step2-accent);
}

.configurator-step-modern[data-step="2"] .step-number-badge {
    background: linear-gradient(135deg, var(--step2-accent), var(--step2-border));
}

/* STEP 3 - Spessore - Verde */
.configurator-step-modern[data-step="3"] {
    background: linear-gradient(to bottom, var(--step3-color) 0%, var(--bg-white) 100px);
    border-left: 4px solid var(--step3-accent);
}

.configurator-step-modern[data-step="3"] .step-number-badge {
    background: linear-gradient(135deg, var(--step3-accent), var(--step3-border));
}

/* STEP 4 - Trattamenti - Arancione */
.configurator-step-modern[data-step="4"] {
    background: linear-gradient(to bottom, var(--step4-color) 0%, var(--bg-white) 100px);
    border-left: 4px solid var(--step4-accent);
}

.configurator-step-modern[data-step="4"] .step-number-badge {
    background: linear-gradient(135deg, var(--step4-accent), var(--step4-border));
}

/* === STEP HEADER === */
.step-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.step-number-badge {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.step-info {
    flex: 1;
}

.step-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.step-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* === OPTIONS LIST VERTICAL === */
.options-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* === OPTION ROW (Layout Verticale) === */
.option-row {
    position: relative;
    display: block;
    cursor: pointer;
    margin: 0;
}

.option-row input[type="radio"],
.option-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-lighter);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    min-height: 100px;
}

.option-row:hover .option-content {
    border-color: var(--accent-color);
    background: var(--bg-white);
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

.option-row input:checked + .option-content {
    border-color: var(--accent-color);
    border-width: 2px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(52, 152, 219, 0.02) 100%);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.15);
}

/* === OPTION IMAGE CONTAINER === */
.option-image-container {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.option-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* IMMAGINE REALE (quando presente) */
.option-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ICONA FALLBACK (quando manca immagine) */
.option-icon-fallback {
    font-size: 40px;
    color: var(--accent-color);
    opacity: 0.7;
}

/* Nascondi fallback se c'è immagine */
.option-image img.option-img + .option-icon-fallback {
    display: none;
}

/* Mostra fallback se immagine non carica */
.option-image img.option-img[alt]:not([src]),
.option-image img.option-img[src=""] {
    display: none;
}

/* === THICKNESS VISUAL (per spessori) === */
.thickness-visual {
    background: linear-gradient(180deg, var(--bg-lighter) 0%, var(--bg-white) 100%);
}

.thickness-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 60px;
    padding: 10px;
}

.thickness-bars .bar {
    background: linear-gradient(180deg, var(--accent-color), var(--accent-hover));
    border-radius: 2px;
    width: 12px;
    transition: var(--transition);
}

/* 3 barre per massimo */
[data-thickness="massimo"] .bar-1 { height: 60%; }
[data-thickness="massimo"] .bar-2 { height: 80%; }
[data-thickness="massimo"] .bar-3 { height: 100%; }

/* 2 barre per medio */
[data-thickness="medio"] .bar-1 { height: 65%; }
[data-thickness="medio"] .bar-2 { height: 90%; }
[data-thickness="medio"] .bar-3 { display: none; }

/* 1 barra per minimo */
[data-thickness="minimo"] .bar-1 { height: 75%; }
[data-thickness="minimo"] .bar-2,
[data-thickness="minimo"] .bar-3 { display: none; }

.option-row:hover .thickness-bars .bar {
    transform: scaleY(1.1);
}

/* === OPTION TEXT === */
.option-text {
    flex: 1;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

.option-description {
    font-size: 13px;
    color: var(--text-medium);
    margin: 0;
    line-height: 1.5;
}

/* === OPTION PRICE === */
.option-price {
    flex-shrink: 0;
    text-align: right;
}

.price-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--success-color);
    display: block;
}

/* === OPTION SELECT INDICATOR === */
.option-select {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-icon,
.uncheck-icon {
    font-size: 28px;
    color: var(--text-muted);
    transition: var(--transition);
}

.option-row input:checked ~ .option-content .check-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* Per checkbox */
.checkbox-option .check-icon {
    display: none;
}

.checkbox-option .uncheck-icon {
    display: block;
}

.checkbox-option input:checked ~ .option-content .check-icon {
    display: block;
    color: var(--accent-color);
}

.checkbox-option input:checked ~ .option-content .uncheck-icon {
    display: none;
}

/* === BADGES === */
.recommended-badge,
.premium-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

.recommended-badge {
    background: linear-gradient(135deg, var(--success-color), var(--success-hover));
    color: white;
}

.premium-badge {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: white;
}

.recommended-badge .material-icons,
.premium-badge .material-icons {
    font-size: 14px;
}

/* === PRESCRIPTION UPLOAD MODERN === */
.prescription-upload-modern {
    max-width: 600px;
    margin: 0 auto;
}

.upload-area-modern {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-lighter);
    transition: var(--transition);
    cursor: pointer;
}

.upload-area-modern:hover {
    border-color: var(--accent-color);
    background: rgba(52, 152, 219, 0.05);
}

.upload-icon {
    margin-bottom: 16px;
}

.upload-icon .material-icons {
    font-size: 64px;
    color: var(--accent-color);
    opacity: 0.8;
}

.upload-text h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.upload-text p {
    font-size: 14px;
    color: var(--text-medium);
    margin: 0 0 6px 0;
}

.upload-formats {
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

.btn-upload {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-upload:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-upload .material-icons {
    font-size: 20px;
}

/* === UPLOAD PREVIEW === */
.upload-preview-modern {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #d4edda;
    border: 2px solid var(--success-color);
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.preview-icon .material-icons {
    font-size: 40px;
    color: var(--success-color);
}

.preview-info {
    flex: 1;
}

.preview-label {
    font-size: 12px;
    color: var(--text-medium);
    margin: 0 0 4px 0;
}

.preview-filename {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.btn-remove {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: white;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove:hover {
    background: var(--danger-color);
    color: white;
}

.btn-remove .material-icons {
    font-size: 16px;
}

/* === INFO BOX === */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: var(--radius-sm);
    margin-top: 20px;
}

.info-box .material-icons {
    font-size: 20px;
    color: #0c5460;
    flex-shrink: 0;
}

.info-box p {
    font-size: 13px;
    color: #0c5460;
    margin: 0;
    line-height: 1.6;
}

/* === PRESCRIZIONE OBBLIGATORIA - ALERT ROSSO === */
.required-indicator {
    color: var(--danger-color) !important;
    font-weight: bold;
    margin-left: 4px;
    font-size: 24px;
}

/* Animazione pulsante per prescrizione obbligatoria */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.required-indicator {
    animation: pulse 2s ease-in-out infinite;
}

/* Alert errore prescrizione */
#prescription-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-top: 20px;
    background: #f8d7da;
    border: 2px solid var(--danger-color);
    border-radius: var(--radius-md);
    color: #721c24;
}

#prescription-error .material-icons {
    font-size: 24px;
    color: var(--danger-color);
}

/* Bordo rosso area upload quando obbligatorio e mancante */
.prescription-missing .upload-area-modern {
    border-color: var(--danger-color) !important;
    border-width: 3px !important;
    background: #fff5f5 !important;
}

/* === SUMMARY SECTION === */
.summary-section-modern {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    margin: 32px 0;
    box-shadow: var(--shadow-md);
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 32px;
}

.summary-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.summary-list {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-medium);
}

.summary-list p {
    margin: 8px 0;
}

.summary-list strong {
    font-weight: 600;
    color: var(--text-dark);
}

.summary-list ul {
    margin: 8px 0;
    padding-left: 20px;
}

.summary-list li {
    margin: 4px 0;
}

/* === TOTAL CARD === */
.total-card {
    background: linear-gradient(135deg, var(--bg-lighter) 0%, var(--bg-white) 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.total-label {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

.total-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.total-divider {
    height: 2px;
    background: var(--border-color);
    margin: 12px 0;
}

.total-final .total-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.total-final .total-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--success-color);
}

.total-note {
    font-size: 11px;
    color: var(--text-muted);
    margin: 12px 0 0 0;
    line-height: 1.4;
    text-align: center;
}

/* === ACTION SECTION === */
.action-section-modern {
    text-align: center;
    padding: 32px 0;
}

.btn-whatsapp-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 48px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-modern:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp-modern:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.btn-whatsapp-modern .material-icons {
    font-size: 28px;
}

.action-note {
    font-size: 13px;
    color: var(--text-muted);
    margin: 16px 0 0 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .lens-configurator-modern {
        padding: 0px 0px;
    }

    .configurator-title {
        font-size: 24px;
    }

    .configurator-subtitle {
        font-size: 14px;
    }

    .product-info-flex {
        flex-direction: column;
        text-align: center;
    }

    .product-image {
        width: 100px;
        height: 100px;
    }

    .configurator-step-modern {
        padding: 20px;
    }

    .step-title {
        font-size: 18px;
    }

    .option-content {
        flex-wrap: wrap;
        gap: 16px;
        padding: 16px;
    }

    .option-image-container {
        width: 60px;
        height: 60px;
    }

    .option-text {
        flex: 1 1 100%;
        order: 3;
    }

    .option-price {
        order: 2;
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .btn-whatsapp-modern {
        width: 100%;
        padding: 16px 32px;
        font-size: 16px;
    }
}

/* === ANIMATIONS === */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.configurator-step-modern {
    animation: slideIn 0.4s ease-out;
}

/* === MATERIAL ICONS FIX === */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
}

/* === MODIFICA PAGINA SCHEGLI LA LENTE === */
body#module-lenschooser-selector #content.page-content.card.card-block {
    border: none !important;
    padding: 0 !important;
}