@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
/* Impostazioni base e Scrollbar scura */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
}
.container {
    max-width: 1024px;
    margin: auto;
}
.card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}
.color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.color-circle.selected {
    border-color: #d5282d !important;
    transform: scale(1.1);
}
.color-circle[data-color="white"].selected {
    border-color: #000000;
}
.product-image {
    width: 100%;
    height: auto; /* A causa di #mat-image, questa non viene usata se #mat-image è definito */
    border-radius: 0.5rem;
    max-height: 400px;
    object-fit: contain;
}
.spm-btn {
    background-color: #333333;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background-color 0.2s;
    display: inline-block;
    text-align: center;
    font-weight: bold;
}
.spm-btn:hover {
    transform: scale(1.05);
    background-color: #1a1a1a;
}
.spm-btn-outline {
    background-color: white;
    color: #333333;
    border: 2px solid #333333;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background-color 0.2s;
    display: inline-block;
    text-align: center;
    font-weight: bold;
}
.spm-btn-outline:hover {
    transform: scale(1.05);
    background-color: #f0f0f0;
}
.progress-bar {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 1.5rem;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background-color: #d5282d;
    transition: width 0.5s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
}
.material-option, 
.logo-option, 
.optional-option {
    cursor: pointer;
}
.shape-button-container, 
.zoom-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1rem;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centra tutto verticalmente */
    
    background-color: transparent;
    border-radius: 1rem;
}
/* Effetto hover opzionale per il box */
.shape-button-container:hover,
.zoom-wrapper:hover {
    z-index: 50;
}

.shape-button-container img,
.zoom-wrapper img {
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    
    /* Limiti massimi */
    max-width: 100%;
    max-height: 250px; 
    
    cursor: crosshair;
}

.shape-button-container img {
    margin-bottom: 1.5rem;
}

/* Opzionale: rende i bottoni di una larghezza uniforme e centrata */
.shape-button-container .spm-btn {
    width: 100%;
    max-width: 220px; /* Larghezza massima per non farli diventare enormi */
}
.material-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}
.material-option img {
    max-width: 150px;
    margin-bottom: 0.5rem;
}
.logo-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}
.logo-option img {
    max-width: 150px;
    margin-bottom: 0.5rem;
}
.optional-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}
.optional-option img {
    max-width: 150px;
    margin-bottom: 0.5rem;
}
.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.color-name {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #ffffff;
}

.color-circle.selected + .color-name {
    color: #d5282d;              /* Rosso del brand */
    font-weight: 700;            /* Grassetto */
    text-decoration: underline;  /* Sottolineatura */
    text-underline-offset: 4px;  /* Distanzia la linea dal testo per eleganza */
    transition: all 0.3s ease;   /* Animazione fluida */
}


/* =========================================
   STILE SELEZIONE PER SFONDO SCURO (Fasi 2, 5, 6)
   ========================================= */

/* 1. Stile base dei contenitori delle opzioni */
/* Aggiungiamo un po' di padding e angoli arrotondati per prepararli all'effetto glow */
.material-option,
.logo-option,
.optional-option {
    padding: 15px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transizione morbida */
    border: 2px solid transparent; /* Bordo invisibile per evitare scatti quando si seleziona */
    /* Opzionale: un leggerissimo sfondo scuro per staccarli dal futuro sfondo nero totale */
    background-color: rgba(255, 255, 255, 0.03); 
}

/* 2. L'EFFETTO "GLOW" ROSSO ALLA SELEZIONE */
/* La magia di :has(input:checked) -> Seleziona il contenitore SE l'input dentro è spuntato */

.material-option:has(input:checked),
.logo-option:has(input:checked),
.optional-option:has(input:checked) {
    /* Bordo rosso sottile interno */
    border-color: #d5282d;
    
    /* Effetto Bagliore (Glow) esterno - Perfetto per sfondi scuri */
    /* Crea un alone rosso sfumato attorno all'elemento */
    box-shadow: 0 0 20px rgba(213, 40, 45, 0.4), inset 0 0 10px rgba(213, 40, 45, 0.1);
    
    /* Leggero sollevamento per dare profondità */
    transform: translateY(-4px);
    
    /* Cambia lo sfondo interno per farlo sembrare "acceso" */
    background-color: rgba(213, 40, 45, 0.05);
}

/* 3. EVIDENZIARE IL TESTO E L'IMMAGINE */

/* Rende il testo rosso, grassetto e aggiunge un leggero bagliore anche al testo */
.material-option:has(input:checked) label span,
.logo-option:has(input:checked) label span,
.optional-option:has(input:checked) label span {
    color: #d5282d;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(213, 40, 45, 0.5);
    transition: all 0.3s ease;
}

/* Aggiunge un bordo specifico anche attorno all'immagine per farla risaltare di più */
.material-option:has(input:checked) img,
.logo-option:has(input:checked) img,
.optional-option:has(input:checked) img {
    border: 2px solid #d5282d;
    border-radius: 8px; /* Arrotonda leggermente anche l'immagine */
    box-shadow: 0 4px 6px -1px rgba(213, 40, 45, 0.2);
}

.smooth-hidden,
.smooth-inner-section {
    max-height: 0;
    opacity: 0;
    overflow: hidden; /* Fondamentale per nascondere il contenuto mentre si chiude */
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, margin 0.3s;
}

/* Stato visibile (aggiunto via JS) */
.smooth-visible {
    max-height: 500px; /* Un valore abbastanza alto da contenere tutto */
    opacity: 1;
    margin-top: 1.5rem; /* Spazio quando si apre */
}

/* 2. STILE TASTO "SCEGLI FILE" PERSONALIZZATO */
/* Nasconde il vero input brutto */
.hidden-input {
    display: none;
}

/* Il finto tasto (Label) */
.spm-file-btn {
    display: inline-block;
    background-color: #1a1a1a; /* Scuro quasi nero */
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Effetto Hover e Glow Rosso */
.spm-file-btn:hover {
    border-color: #d5282d;
    background-color: #2a2a2a;
    box-shadow: 0 0 15px rgba(213, 40, 45, 0.4); /* Glow rosso */
    transform: translateY(-2px);
    color: #d5282d;
}

/* Quando un file è stato caricato (classe aggiunta via JS) */
.spm-file-btn.file-selected {
    background-color: #d5282d;
    border-color: #d5282d;
    color: white;
}

html {
    color-scheme: dark;
}

body {
    background-color: #000000 !important; /* Forza lo sfondo scuro */
    color: #f1f1f1 !important;
}

/* Override delle CARD (vincono su .card { background-color: white }) */
.card {
    background-color: #272727 !important;
    color: #f1f1f1 !important;
    border: 1px solid #3f3f3f !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5) !important;
}

/* Override dei TESTI Tailwind (vincono sulle classi nel HTML) */
.text-gray-800, .text-gray-700, .text-gray-600 {
    color: #aaaaaa !important;
}

h1, h2, h3, .font-bold, .font-semibold {
    color: #ffffff !important;
}

/* INPUT e SELECT */
input, select, textarea, .form-input, .form-select {
    background-color: #121212 !important;
    border: 1px solid #3e3e3e !important;
    color: #ffffff !important;
}

/* Focus Input */
input:focus, select:focus, textarea:focus {
    border-color: #d5282d !important;
    box-shadow: 0 0 0 3px rgba(213, 40, 45, 0.2) !important;
    outline: none !important;
}

/* BOTTONI */
.spm-btn-outline {
    background-color: transparent !important;
    color: #f1f1f1 !important;
    border: 2px solid #555 !important;
}

.spm-btn-outline:hover {
    background-color: #333 !important;
    border-color: #fff !important;
}

.spm-btn {
    background-color: #d5282d !important;
    color: white !important;
}

/* Barra progresso */
.progress-bar {
    background-color: #333333 !important;
}

/* Etichette e testi vari */
label span {
    color: #cccccc !important;
}

.shape-button-container img {
    cursor: crosshair; /* Cambia il cursore per indicare che si può ispezionare */
}

/* La lente stessa */
.img-zoom-lens {
    position: fixed;
    top: 0;
    left: 0;
    width: 180px;
    height: 180px;
    border: 2px solid #d5282d;
    border-radius: 50%;
    
    /* Ombra forte per staccarla dallo sfondo */
    box-shadow: 0 4px 25px rgba(0,0,0,0.8);
    
    background-repeat: no-repeat;
    background-color: #000000; /* Sfondo nero quando esci dai bordi */
    
    pointer-events: none !important; /* CRUCIALE: Il mouse ci passa attraverso */
    z-index: 9999;
    display: none;
}
.img-zoom-lens.active {
    display: block;
    opacity: 1;
}

/* Assicuriamo che il contenitore dell'immagine sia relativo per posizionare la lente */
.shape-button-container {
    position: relative;
}
.clickable-img {
    cursor: pointer; /* Cambia il cursore in "manina" */
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Effetto quando passi sopra col mouse */
.clickable-img:hover {
    transform: scale(1.05); /* Ingrandisce leggermente (5%) */
    filter: drop-shadow(0 10px 15px rgba(213, 40, 45, 0.3)); /* Aggiunge un'ombra rossa soffusa */
}

/* IMPORTANTE: Questo risolve un conflitto con lo zoom */
/* Se l'utente usa la lente, vogliamo comunque vedere la lente.
   Il cursore pointer funzionerà per il click, la lente per lo spostamento. */


#step-3 .zoom-wrapper img {
    max-height: 600px !important; /* Forza un'altezza massima molto maggiore */
    width: 100%;                  /* Occupa tutta la larghezza disponibile */
    max-width: 100%;
}

/* Opzionale: su schermi piccoli (mobile) riduciamola un po' */
@media (max-width: 1024px) {
    #step-3 .zoom-wrapper img {
        max-height: 350px !important;
    }
}