/**
 * Lens Configurator CSS - Amevista Clone
 * Full Page Modal Style
 */

/* ========================================
   RESET & BASE
   ======================================== */
* {
    box-sizing: border-box;
}

/* PULSANTE CONFIGURA LENTI - BORDO LED */
.lens-configurator-wrapper {
    padding: 0 !important;
    background: none !important;
    position: relative !important;
}

.lens-configurator-wrapper > .line {
    display: none !important;
}

#openLensConfig {
    background: #e80c00 !important;
    color: #fff !important;
    border: none !important;
    width: 100% !important;
    padding: 15px 20px !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    font-weight: 600 !important;
    min-height: 52px !important;
}

/* TUTTE LE LINEE */
#openLensConfig > span.line {
    position: absolute !important;
    display: block !important;
    background: #4CAF50 !important;
}

/* LINEA SOPRA - verde */
#openLensConfig > span.line:nth-of-type(1) {
    top: 0 !important;
    left: 0 !important;
    height: 3px !important;
    width: 100% !important;
    background: linear-gradient(90deg, transparent, #4CAF50) !important;
    animation: animTop 2s linear infinite !important;
}

/* LINEA DESTRA - arancione */
#openLensConfig > span.line:nth-of-type(2) {
    top: 0 !important;
    right: 0 !important;
    height: 100% !important;
    width: 3px !important;
    background: linear-gradient(180deg, transparent, #FF9800) !important;
    animation: animRight 2s linear infinite !important;
    animation-delay: 0.5s !important;
}

/* LINEA SOTTO - rosa - POSIZIONE FISSA */
#openLensConfig > span.line:nth-of-type(3) {
    top: 49px !important;
    left: 0 !important;
    height: 3px !important;
    width: 100% !important;
    background: linear-gradient(270deg, transparent, #E91E63) !important;
    animation: animBottom 2s linear infinite !important;
    animation-delay: 1s !important;
}

/* LINEA SINISTRA - blu */
#openLensConfig > span.line:nth-of-type(4) {
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 3px !important;
    background: linear-gradient(360deg, transparent, #2196F3) !important;
    animation: animLeft 2s linear infinite !important;
    animation-delay: 1.5s !important;
}

#openLensConfig > .btn-text {
    position: relative !important;
    z-index: 5 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

#openLensConfig > .btn-text::before {
    content: "" !important;
    display: inline-block !important;
    width: 22px !important;
    height: 22px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    flex-shrink: 0 !important;
}

#openLensConfig::before,
#openLensConfig::after {
    content: none !important;
}

#openLensConfig:hover {
    background: #c90a00 !important;
}

@keyframes animTop {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes animRight {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes animBottom {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes animLeft {
    0% { transform: translateY(100%); }
    100% { transform: translateY(-100%); }
}


/* ========================================
   BUTTON TRIGGER
   ======================================== */
   
.lens-configurator-wrapper {
    margin: 20px 0;
}

.btn-lens-config {
    width: 100%;
    background: #fff !important;
    color: #333 !important;
    padding: 14px 30px;
    border: 2px solid #000 !important;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-lens-config:hover {
    background: #000 !important;
    color: #fff !important;
}

/* ========================================
   FULL PAGE MODAL
   ======================================== */
.lens-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.lens-modal-fullpage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* ========================================
   MODAL HEADER
   ======================================== */
.lens-modal-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.lens-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: #333;
}

.lens-modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.lens-modal-close:hover {
    color: #333;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.lens-progress-container {
    background: #f8f8f8;
    padding: 25px 30px;
    border-bottom: 1px solid #e5e5e5;
}

.lens-progress-bar {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 15%;
    right: 15%;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.progress-line-active {
    position: absolute;
    top: 20px;
    left: 15%;
    width: 0%;
    height: 1px;
    background: #5cb85c;
    z-index: 2;
    transition: width 0.5s ease;
}

.lens-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 3;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    color: #999;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: 14px;
    transition: all 0.3s ease;
}

.lens-step.active .step-circle {
    background: #5cb85c;
    border-color: #5cb85c;
    color: #fff;
}

.lens-step.completed .step-circle {
    background: #5cb85c;
    border-color: #5cb85c;
    color: #fff;
}

.step-label {
    font-size: 12px;
    color: #999;
}

.lens-step.active .step-label {
    color: #333;
}

.lens-step.completed .step-label {
    color: #5cb85c;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.lens-modal-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Product Preview Panel */
.product-preview-panel {
    width: 400px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid #e5e5e5;
}

.product-preview-panel img {
    max-width: 100%;
    height: auto;
}

/* Configuration Panel */
.lens-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background: #fff;
}

.lens-config-step {
    display: none;
}

.lens-config-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.lens-config-step h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 400;
}

.lens-config-step p {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* ========================================
   PRESCRIPTION OPTIONS (VERTICAL)
   ======================================== */
.prescription-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
}

.prescription-option {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prescription-option:hover {
    border-color: #5cb85c;
    background: #f9f9f9;
}

.prescription-option.selected {
    border-color: #5cb85c;
    background: #f0f8ff;
}

.prescription-option-icon {
    width: 50px;
    margin-right: 20px;
}

.prescription-option-content h4 {
    font-size: 15px;
    margin-bottom: 5px;
    font-weight: 500;
}

.prescription-option-content p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* ========================================
   LENS TYPE GRID
   ======================================== */
.lens-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
}

.lens-type-option {
    padding: 25px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lens-type-option:hover {
    border-color: #5cb85c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lens-type-option.selected {
    border-color: #5cb85c;
    background: #f0f8ff;
}

.lens-type-icon {
    margin-bottom: 15px;
}

.lens-type-option h4 {
    font-size: 15px;
    margin-bottom: 8px;
    font-weight: 500;
}

.lens-type-option p {
    font-size: 13px;
    color: #666;
}

/* ========================================
   TREATMENTS GRID
   ======================================== */
.treatments-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 700px;
}

.treatment-option {
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.treatment-option:hover {
    border-color: #5cb85c;
}

.treatment-option.selected {
    border-color: #5cb85c;
    background: #f0f8ff;
}

.treatment-option h5 {
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.treatment-option p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* ========================================
   PRESCRIPTION FORM
   ======================================== */
.prescription-form {
    margin-top: 30px;
    padding: 25px;
    background: #f8f8f8;
    border-radius: 4px;
}

.prescription-table {
    width: 100%;
    border-collapse: collapse;
}

.prescription-table th {
    padding: 10px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #ddd;
}

.prescription-table td {
    padding: 10px;
    text-align: center;
    background: #fff;
    border: 1px solid #ddd;
}

.prescription-table input {
    width: 70px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.prescription-table input:focus {
    outline: none;
    border-color: #5cb85c;
}

/* ========================================
   UPLOAD SECTION
   ======================================== */
.upload-section {
    background: #f0f8ff;
    border: 2px dashed #5cb85c;
    border-radius: 4px;
    padding: 40px;
    text-align: center;
    margin-top: 30px;
}

.upload-btn {
    background: #5cb85c;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: #4cae4c;
}

/* ========================================
   SUMMARY
   ======================================== */
.summary-container {
    background: #f8f8f8;
    border-radius: 4px;
    padding: 30px;
}

.summary-item {
    margin-bottom: 15px;
}

.summary-item strong {
    display: inline-block;
    margin-right: 10px;
}

.price-summary {
    border-top: 1px solid #ddd;
    margin-top: 20px;
    padding-top: 20px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.price-line.total {
    font-size: 16px;
    font-weight: 500;
}

/* ========================================
   MODAL FOOTER
   ======================================== */
.lens-modal-footer {
    padding: 20px 30px;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back {
    background: #f5f5f5;
    color: #333;
}

.btn-back:hover {
    background: #e0e0e0;
}

.btn-next {
    background: #5cb85c;
    color: #fff;
}

.btn-next:hover {
    background: #4cae4c;
}

.btn-add-cart {
    background: #ff6b35;
    color: #fff;
}

.btn-add-cart:hover {
    background: #e55a2b;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
    .lens-modal-content {
        flex-direction: column;
    }
    
    .product-preview-panel {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .lens-modal-body {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .lens-type-grid {
        grid-template-columns: 1fr;
    }
    
    .treatments-grid {
        grid-template-columns: 1fr;
    }
    
    .prescription-table {
        font-size: 11px;
    }
    
    .prescription-table input {
        width: 50px;
        padding: 3px;
    }
    
    .lens-modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .lens-modal-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-preview-panel {
        padding: 20px;
    }
    
    .lens-modal-body {
        padding: 20px 15px;
    }
    
    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}
/* Overlay di caricamento per checkout */
.lens-checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lens-checkout-spinner {
    width: 70px;
    height: 70px;
    border: 6px solid #f3f3f3;
    border-radius: 50%;
    border-top: 6px solid #333;
    animation: lens-spinner 1s linear infinite;
}

.lens-checkout-message {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
}

@keyframes lens-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}