/**
 * Eyewear Configurator Modal - Styles
 */

/* BOTTONE PERSONALIZZA */
.eyewear-customize-button-wrapper {
    margin: 20px 0;
    text-align: center;
}

.eyewear-customize-btn {
    display: inline-block;
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    border: 2px solid #222 !important;
    background-color: #222 !important;
    color: #ffffff !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.eyewear-customize-btn:hover {
    background-color: #333 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.eyewear-customize-btn:active {
    transform: translateY(0);
}

.eyewear-customize-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* MODAL OVERLAY */
.eyewear-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s ease;
}

.eyewear-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.eyewear-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.eyewear-modal-content::-webkit-scrollbar {
    width: 8px;
}

.eyewear-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.eyewear-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.eyewear-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* MODAL CLOSE BUTTON */
.eyewear-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.eyewear-modal-close:hover {
    background: #ffffff;
    transform: rotate(90deg);
}

/* CONFIGURATOR CONTAINER IN MODAL */
#eyewear-configurator-modal .eyewear-configurator {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#eyewear-configurator-modal .configurator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* PREVIEW SECTION */
#eyewear-configurator-modal .preview-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: sticky;
    top: 40px;
}

#eyewear-configurator-modal .preview-section h3 {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    color: #222;
}

#eyewear-configurator-modal .eyewear-preview-container {
    position: relative;
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#eyewear-configurator-modal #eyewear-preview {
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
}

/* STEPS SECTION */
#eyewear-configurator-modal .steps-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#eyewear-configurator-modal .configurator-step {
    border-top: 2px solid #f0f0f0;
    padding-top: 30px;
}

#eyewear-configurator-modal .configurator-step:first-child {
    border-top: none;
    padding-top: 0;
}

#eyewear-configurator-modal .configurator-step h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #222;
}

/* FRAMES GRID */
#eyewear-configurator-modal .frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

#eyewear-configurator-modal .frame-card,
#eyewear-configurator-modal .lens-card,
#eyewear-configurator-modal .case-card {
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
    cursor: pointer;
}

#eyewear-configurator-modal input[type="radio"]:checked + .frame-card,
#eyewear-configurator-modal input[type="radio"]:checked + .lens-card,
#eyewear-configurator-modal input[type="radio"]:checked + .case-card {
    border-color: #222;
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#eyewear-configurator-modal .frame-card:hover,
#eyewear-configurator-modal .lens-card:hover,
#eyewear-configurator-modal .case-card:hover {
    border-color: #ccc;
}

#eyewear-configurator-modal .frame-name,
#eyewear-configurator-modal .lens-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#eyewear-configurator-modal .frame-card img {
    width: 100%;
    height: auto;
    margin: 8px 0;
    border-radius: 4px;
}

#eyewear-configurator-modal .color-preview {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

#eyewear-configurator-modal .color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

#eyewear-configurator-modal .color-dot:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* COLOR SELECTORS */
#eyewear-configurator-modal .frame-color-selector,
#eyewear-configurator-modal .lens-color-selector {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

#eyewear-configurator-modal .color-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#eyewear-configurator-modal .color-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#eyewear-configurator-modal .color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#eyewear-configurator-modal .color-option.selected {
    border-color: #222;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #222;
}

/* LENSES GRID */
#eyewear-configurator-modal .lenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

#eyewear-configurator-modal .lens-description {
    font-size: 11px;
    color: #999;
    margin-bottom: 10px;
    min-height: 30px;
}

#eyewear-configurator-modal .lens-price {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* CASES GRID */
#eyewear-configurator-modal .cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

#eyewear-configurator-modal .case-card {
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

/* PRICE SUMMARY */
#eyewear-configurator-modal .price-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e8e8e8;
}

#eyewear-configurator-modal .price-breakdown {
    font-size: 13px;
}

#eyewear-configurator-modal .price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: #555;
}

#eyewear-configurator-modal .price-row.total {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    padding-top: 12px;
    padding-bottom: 0;
}

#eyewear-configurator-modal .price-summary hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 12px 0;
}

#eyewear-configurator-modal .lens-price-row {
    color: #0066cc;
    font-weight: 600;
}

/* CONFIGURATOR ACTIONS */
#eyewear-configurator-modal .configurator-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

#eyewear-configurator-modal .configurator-actions .button {
    flex: 1;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease;
}

#eyewear-configurator-modal .eyewear-modal-close-btn {
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}

#eyewear-configurator-modal .eyewear-modal-close-btn:hover {
    background: #e0e0e0 !important;
}

#eyewear-configurator-modal .eyewear-add-to-cart-btn {
    background: #222 !important;
    color: #ffffff !important;
    border: 1px solid #222 !important;
}

#eyewear-configurator-modal .eyewear-add-to-cart-btn:hover {
    background: #333 !important;
    border-color: #333 !important;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    #eyewear-configurator-modal .configurator-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    #eyewear-configurator-modal .preview-section {
        position: relative;
        top: auto;
    }
}

@media (max-width: 640px) {
    #eyewear-configurator-modal .eyewear-configurator {
        padding: 20px;
    }

    #eyewear-configurator-modal .frames-grid,
    #eyewear-configurator-modal .lenses-grid,
    #eyewear-configurator-modal .cases-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 12px;
    }

    #eyewear-configurator-modal #eyewear-preview {
        max-height: 300px;
    }

    #eyewear-configurator-modal .configurator-actions {
        flex-direction: column;
    }

    #eyewear-configurator-modal .configurator-actions .button {
        width: 100% !important;
    }

    .eyewear-modal-content {
        padding: 20px 10px;
    }

    #eyewear-configurator-modal .eyewear-configurator {
        border-radius: 8px;
    }
}

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

.configurator-step {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
