/* =========================================================================
   Flusso fullpage "Ambienta il prodotto con AI"
   Overlay a step: ambiente / luce / stile / loader / risultato.
   ========================================================================= */

.dnd-ai-flow {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #000;
    color: #fff;
    display: none;
    flex-direction: column;
    font-family: inherit;
    overflow: hidden;
}

.dnd-ai-flow.is-open {
    display: flex;
}

body.dnd-ai-flow-open {
    overflow: hidden;
}

/* --- Chrome (top bar) --- */
.dnd-ai-flow__chrome {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 34px;
    flex: 0 0 auto;
    z-index: 2;
}

.dnd-ai-flow__instruction {
    flex: 1 1 0;
    font-size: 14px;
    letter-spacing: .2px;
    color: #f2f2f2;
    min-width: 0;
}

.dnd-ai-flow__logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.dnd-ai-flow__logo img {
    height: 34px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.dnd-ai-flow__nav {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    font-size: 13px;
}

.dnd-ai-flow__navlink {
    color: #cfcfcf;
    text-decoration: none;
    transition: color .2s ease;
}

.dnd-ai-flow__navlink:hover {
    color: #fff;
}

/* Language switcher */
.dnd-ai-flow__lang {
    position: relative;
}

.dnd-ai-flow__lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    text-transform: lowercase;
}

.dnd-ai-flow__lang-current i {
    font-size: 10px;
}

.dnd-ai-flow__lang-dropdown {
    position: absolute;
    right: 0;
    top: 130%;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    min-width: 70px;
    display: none;
}

.dnd-ai-flow__lang.is-open .dnd-ai-flow__lang-dropdown {
    display: block;
}

.dnd-ai-flow__lang-dropdown li a {
    display: block;
    padding: 6px 16px;
    color: #cfcfcf;
    text-decoration: none;
    text-transform: lowercase;
}

.dnd-ai-flow__lang-dropdown li a:hover {
    color: #fff;
}

/* --- Body / steps --- */
.dnd-ai-flow__body {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 34px 60px;
    min-height: 0;
}

.dnd-ai-flow__step {
    display: none;
    width: 100%;
    max-width: 1100px;
}

.dnd-ai-flow__step.is-active {
    display: block;
    animation: dnd-ai-fade .35s ease;
}

@keyframes dnd-ai-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Cards --- */
.dnd-ai-flow__cards {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
}

.dnd-ai-card {
    position: relative;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 26px;
    overflow: hidden;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
    outline: none;
}

.dnd-ai-card--image {
    width: 150px;
    height: 150px;
}

.dnd-ai-card--luce {
    width: 232px;
    height: 250px;
    align-items: flex-end;
}

.dnd-ai-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}

.dnd-ai-card.is-selected {
    box-shadow: 0 0 0 2px #fff, 0 12px 30px rgba(0, 0, 0, .5);
}

.dnd-ai-card__pill {
    display: block;
    margin: 0 0 14px;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 13px;
    color: #2b2b2b;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    white-space: nowrap;
}

/* --- Loader --- */
.dnd-ai-flow__loader {
    text-align: center;
    padding: 40px 0;
}

.dnd-ai-flow__spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, .18);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dnd-ai-flow-spin 1s linear infinite;
}

@keyframes dnd-ai-flow-spin {
    to { transform: rotate(360deg); }
}

.dnd-ai-flow__loader-text {
    margin-top: 24px;
    font-size: 15px;
    color: #eaeaea;
}

/* --- Result --- */
.dnd-ai-flow__step[data-step="result"] {
    max-width: 1200px;
}

.dnd-ai-flow__result {
    display: flex;
    gap: 34px;
    align-items: flex-start;
    justify-content: center;
}

.dnd-ai-flow__result-image {
    flex: 0 1 auto;
    width: min(760px, calc(100% - 334px));
    max-width: 760px;
    max-height: 78vh;
    border-radius: 22px;
    overflow: hidden;
    background: #111;
    line-height: 0;
}

.dnd-ai-flow__result-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    object-position: center;
}

.dnd-ai-flow__result-side {
    flex: 0 0 300px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dnd-ai-flow__result-logo img {
    height: 30px;
    width: auto;
    filter: brightness(0) invert(1);
}

.dnd-ai-flow__product-card {
    background: #fff;
    color: #2b2b2b;
    border-radius: 16px;
    padding: 18px;
    text-align: center;
}

.dnd-ai-flow__product-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.dnd-ai-flow__product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dnd-ai-flow__product-title {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
}

.dnd-ai-flow__product-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: #888;
}

.dnd-ai-flow__summary {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.dnd-ai-flow__summary li {
    padding: 4px 0;
}

.dnd-ai-flow__summary li span {
    color: #9a9a9a;
}

.dnd-ai-flow__summary li strong {
    color: #fff;
    font-weight: 600;
}

.dnd-ai-flow__result-actions {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dnd-ai-flow__download,
.dnd-ai-flow__close-product {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: opacity .2s ease;
}

.dnd-ai-flow__download {
    background: #fff;
    color: #111;
}

.dnd-ai-flow__close-product {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .45);
}

.dnd-ai-flow__download:hover,
.dnd-ai-flow__close-product:hover {
    opacity: .85;
}

/* --- Error --- */
.dnd-ai-flow__error {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(237, 28, 36, .12);
    border: 1px solid rgba(237, 28, 36, .5);
    color: #ff8a8a;
    font-size: 13px;
    text-align: center;
    z-index: 3;
}

/* --- Responsive --- */
@media (max-width: 860px) {
    .dnd-ai-flow__chrome {
        padding: 16px 18px;
    }

    .dnd-ai-flow__instruction {
        font-size: 12px;
    }

    .dnd-ai-flow__logo img {
        height: 26px;
    }

    .dnd-ai-flow__body {
        padding: 16px 18px 50px;
    }

    .dnd-ai-flow__cards {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .dnd-ai-card--image {
        width: 130px;
        height: 130px;
        flex: 0 0 auto;
    }

    .dnd-ai-card--luce {
        width: 180px;
        height: 210px;
        flex: 0 0 auto;
    }

    .dnd-ai-flow__result {
        flex-direction: column;
        align-items: center;
        overflow-y: auto;
        max-height: 100%;
    }

    .dnd-ai-flow__result-image {
        width: 100%;
        max-width: none;
        max-height: 50vh;
        height: auto;
    }

    .dnd-ai-flow__result-image img {
        max-height: 50vh;
    }

    .dnd-ai-flow__result-side {
        flex: 0 0 auto;
        width: 100%;
        max-width: 420px;
    }

    .dnd-ai-flow__nav {
        gap: 14px;
        font-size: 12px;
    }
}
