@import url('https://fonts.googleapis.com/css2?family=Georama:ital,wdth,wght@0,150,300;1,150,300&family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --accent-color: #E7111F;
    --background-dark: #1d1d1b;
    --color-light: #FFF;
}

* {
    margin: 0;
    padding: 0;
    outline: 0;
    -webkit-box-sizing: border-box !important;
    box-sizing: border-box !important;
    transition: all 0.6s ease;

    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    font-size: 16px;
}

body.no-transition,
body.no-transition * {
    transition: none !important;
}

h2 {
    font-family: 'Georama', sans-serif;
    font-size: 1.5em;
}

h2 span {
    font-size: inherit;
    font-weight: 600;
}

.header-title {
    padding: 2vh;
}

/* Subtitle for each step */
.header-title .step-subtitle {
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
    font-size: 0.9em;
    width: 80%;
    margin-bottom: 1em;
}

h4 {
    font-family: 'Georama', sans-serif;
    font-weight: 600;
}

.active {
    color: var(--accent-color);
}

#steps-container > div {
    padding: 1em;
}

/* Container principale */
#configurator {
    display: flex;
    width: 100%;
    margin: auto;
    gap: 2rem;
    padding: 0 2vh;
    align-items: flex-start;

}

#configurator #steps-container h2 {
    padding: 1em 0;
    font-weight: 600;
}

#steps-container.fade {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Colonna sinistra */
#sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Preview 3D */
#canvas {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    /*box-shadow: 0 4px 12px rgba(0,0,0,0.1);*/
}

.layer {
    position: absolute;
    inset: 0;
}

.layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Features */

.features-container {
    background: #F6F5F5;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 4px 7px rgba(0, 0, 0, 0.1);
}

#features {
    background: #F6F5F5;
    padding: 1rem;
    border-radius: 5px;
    cursor: pointer;

}

/* Summary */
#summary {
    background: #F6F5F5;
    /*padding: 0 2vh ;*/


}

/* Summary */

#features + #summary {
    display: none;


}


#features.selected + #summary {
    display: block;
    padding: 1em 2vh;
}


#summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    border-bottom: 1px solid #cacaca;
    text-transform: capitalize;
}

#summary .summary-row div {
    flex: 1;
}

#summary .summary-row div:first-child {
    font-weight: 500;
}

#summary .summary-row div:last-child {
    font-weight: 200;
}

#summary .summary-row:last-child {
    border-bottom: none;
}

#summary .summary-value ul {
    list-style: none;

}

#summary .summary-value ul li {
    font-weight: 200;
}

/* Colonna destra */
#controls {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    padding: 1em 0;
}

#step-nav {
    background-color: var(--background-dark);
    width: 100%;
}

/* Navigation bar orizzontale */
#step-nav ul {
    padding: 0 1em;
    display: flex;
    list-style: none;
    gap: 0.5rem;

    margin-bottom: 2rem;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE10+ */
}

#step-nav ul::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

#step-nav li {
    position: relative;
    cursor: pointer;
    color: #aaa;
    padding: 1em;
    text-transform: uppercase;
    flex: 0 0 auto;
    scroll-snap-align: start;
}

#step-nav li.active {
    color: var(--color-light);
}

#step-nav li.active span {
    color: var(--accent-color);
}

#step-nav li.active::after {
    content: "";
    position: absolute;
    bottom: 0px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--color-light);
    width: 100%;
}

#step-nav li.disabled {
    pointer-events: none;
    opacity: 0.4;
    cursor: default;
}

/* Step content */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Griglia delle opzioni */
.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    flex-direction: column;
}

/* Box singola opzione */
.option-card {
    background: #f7f7f7;
    overflow: hidden;
    display: flex;
    align-items: center;
    text-align: center;
    cursor: pointer;
    justify-content: space-between;
    margin-left: 0.25em;
    min-height: 125px;
    padding: 0 3em;
}

.option-card.selected {
    border-left: 2px solid var(--background-dark);
    animation: pulse 0.3s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/*.option-card img {
  flex: 2;
}
.option-card .option-info {
  flex: 2;
}
.option-card .toggle-switch {
  flex: 1;
}*/

.option-card.unavailable {
    display: none;
}

.option-card picture {
    flex: 0.5;

}

.option-card img {

    object-fit: cover;
    object-fit: contain;
    flex: 0.25;
    height: 200px;
    width: 120px;
}

.option-card.color img {
    height: 70px;
    object-fit: contain;
}

.option-card.big img {
    height: 250px !important;
    width: 250px !important;
    object-fit: contain;
}

.option-card .option-info {
    flex: 0.8;
    margin-bottom: .5rem;
    padding: 0 .5rem;
}

.option-card .option-info h5 {
    margin: 0;
    font-size: 1.2rem;
}

.option-card .option-info p {
    margin: .25rem 0;
    font-size: .9rem;
    color: #555;
}

.option-card .toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    margin-top: .5rem;
}

.option-card .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.option-card .toggle-switch .toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: .3s;
}

.option-card .toggle-switch .toggle-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--color-light);
    border-radius: 50%;
    transition: .3s;
}

.option-card .toggle-switch input:checked + .toggle-slider {
    background: #000;
}

.option-card .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Pulsante Avanti/Indietro */
.nav-buttons {
    margin: 2rem 0;
    text-align: right;
}

.pdf-actions button,
.nav-buttons button {
    font-family: 'Georama', sans-serif;
    background: #000;
    color: var(--color-light);
    cursor: pointer;

    border: 1px solid var(--background-dark);
    border-radius: 30px;


    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 400;
    display: inline-flex;
    padding: 16px 30px;
    align-items: center;
    transition: 0.3s;
    width: fit-content;
}

.nav-buttons button:disabled {
    opacity: .5;
    cursor: default;
}

.nav-buttons button + button {
    margin-left: 1rem;

}

/* Layout riepilogo PDF */
#pdf-layout {
    width: 100%;
    max-width: 794px;
    min-height: 1123px;
    margin: auto;
    background: #fff;
    color: #000;
    padding: 1rem;
}

#pdf-layout h2 {
    font-family: 'Kanit', sans-serif;
    font-size: 2em;
    text-align: center;
    margin-bottom: 1rem;
}

#pdf-layout .features-container {
    box-shadow: none;

}

#features.selected + #summary {
    padding: 1em 2em;
}

#pdf-layout picture img {
    width: 100%;
    object-fit: contain;
    /*margin-bottom: 1rem;*/
}

.download-button {
    margin-top: 1rem;
    background: #000;
    color: #fff;
    border: none;
    padding: .75rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
}

.quote-button {
    margin-top: 1rem;
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: .75rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
}

.pdf-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1em 0;
}

.model-title {
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-family: 'Georama', sans-serif;
    font-size: 1.8em;
}

/* Layout riepilogo orizzontale */
#configurator.summary-layout {
    gap: 0;
    overflow-x: hidden;
}

#configurator.summary-layout #controls,
#configurator.summary-layout #sidebar {
    flex: 0 0 50%;
}

#configurator.summary-layout .features-container {
    width: 100%;
}


#configurator.summary-layout > .pdf-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    #configurator {
        flex-direction: column-reverse;
    }

    #controls,
    #sidebar {
        width: 100%;
    }

    #canvas {
        height: 40vh;
    }


    .option-card {
        flex-direction: column;
        padding: 1em 1em 2em;
    }

    .option-card img {
        height: 150px;
    }

    .option-card.color img {
        height: 70px
    }

}


/******************************* LOADER */

#loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    z-index: 999;
    text-align: center;
    cursor: wait;
}

#loader:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10vh;
    height: 10vh;
    transform: translate(-50%, -50%);
    background-image: url(images/sprite_loading.png);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
    animation-name: rotate;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

#loader #bytes {
    position: absolute;
    top: calc(50% + 10vh);
    left: 50%;
    width: 50vw;
    transform: translate(-50%, -50%);
}

.loading #loader {
    display: block;
}

@-webkit-keyframes rotate {
    from {
        -webkit-transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        -webkit-transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Popup */
#popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: var(--color-light);
    z-index: 1000;
    text-align: center;
}

#popup .box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--background-dark);
    padding: 2vh 4vh;
    border-radius: 4px;
    max-width: 80vw;
}

#popup button {
    margin-top: 1em;
    padding: 0.5em 1em;
    background: var(--accent-color);
    color: var(--color-light);
    border: none;
    cursor: pointer;
}

.popup-visible #popup {
    display: block;
}

/* Quote modal */
#quote-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

#quote-modal .modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-dark);
    color: var(--color-light);
    padding: 4vh 6vh;
    border-radius: 6px;
    width: 90%;
    max-width: 420px;
}

#quote-modal h2 {
    margin-top: 0;
    margin-bottom: 1em;
}

#quote-modal input,
#quote-modal textarea {
    width: 100%;
    padding: 0.5em 0.75em;
    margin-bottom: 1em;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    background: var(--background-light);
    color: var(--color-dark);
}

#quote-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5em;
}

#quote-modal .modal-actions button {
    padding: 0.5em 1.25em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#quote-modal .quote-send {
    background: var(--accent-color);
    color: var(--color-light);
}

#quote-modal #quote-cancel {
    background: var(--background-light);
    color: var(--color-dark);
}

.quote-modal-visible #quote-modal {
    display: block;
}

