/* ==========================================================================
   Video animato "tipologie di negozio" (index.html)
   Ogni .sta-scene è una scena; js/store-types-anim.js le fa scorrere
   e costruisce la barra di avanzamento stile player.
   ========================================================================== */

.sta {
    --sta-orange: #faa752;
    --sta-orange-2: #ef7f36;
    --sta-cyan: #21c6db;
    --sta-ink: #2f2f35;
    --sta-muted: #6b6b73;
    max-width: 780px;
    margin: 30px auto 34px;
    text-align: left;
}

.sta-screen {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    background: linear-gradient(135deg, #fffaf4 0%, #fdeedd 100%);
    border: 1px solid #fbe3cb;
    box-shadow: 0 26px 50px -28px rgba(239, 127, 54, .55);
}

/* macchie di colore che fluttuano sullo sfondo.
   Sfumatura radiale al posto di filter: blur(), molto più leggera da disegnare */
.sta-blob {
    position: absolute;
    border-radius: 50%;
    opacity: .7;
    pointer-events: none;
}

.sta-blob--a {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, #fcc58a 0%, rgba(252, 197, 138, 0) 70%);
    top: -120px;
    right: -100px;
    animation: staFloat 9s ease-in-out infinite;
}

.sta-blob--b {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, #a8e9f1 0%, rgba(168, 233, 241, 0) 70%);
    bottom: -110px;
    left: -90px;
    animation: staFloat 11s ease-in-out infinite reverse;
}

/* in pausa o fuori schermo: ferma anche le decorazioni continue */
.sta.is-paused .sta-blob,
.sta.is-paused .sta-icon::after { animation-play-state: paused; }

@keyframes staFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 24px); }
}

/* ---------- Scene ---------- */
.sta-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px 52px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease, transform .5s ease, visibility 0s linear .5s;
}

    .sta-scene.is-active {
        opacity: 1;
        visibility: visible;
        transition: opacity .5s ease, transform .5s ease, visibility 0s;
    }

    .sta-scene.is-leaving {
        opacity: 0;
        visibility: visible;
        transform: translateX(-40px);
    }

.sta-icon {
    position: relative;
    flex: 0 0 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sta-orange), var(--sta-orange-2));
    box-shadow: 0 20px 36px -16px rgba(239, 127, 54, .8);
}

    .sta-icon svg {
        width: 70px;
        height: 70px;
        fill: none;
        stroke: #fff;
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* anello tratteggiato che ruota attorno all'icona */
    .sta-icon::after {
        content: "";
        position: absolute;
        inset: -14px;
        border-radius: 50%;
        border: 2px dashed rgba(239, 127, 54, .45);
        animation: staSpin 14s linear infinite;
    }

@keyframes staSpin { to { transform: rotate(360deg); } }

.sta-text {
    flex: 1;
    min-width: 0;
}

.sta-kicker {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sta-orange-2);
    background: #fff;
    border-radius: 30px;
    padding: 5px 12px;
    margin-bottom: 12px;
    box-shadow: 0 6px 14px -10px rgba(239, 127, 54, .7);
}

.sta .sta-text h3 {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--sta-ink);
    margin: 0 0 10px;
}

.sta .sta-text p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--sta-muted);
    margin: 0 0 16px;
}

.sta-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .sta-chips li {
        font-size: 13px;
        font-weight: 500;
        color: var(--sta-ink);
        background: #fff;
        border: 1px solid #fbe3cb;
        border-radius: 30px;
        padding: 6px 13px;
    }

        .sta-chips li::before {
            content: "";
            display: inline-block;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--sta-cyan);
            margin-right: 7px;
            vertical-align: 2px;
        }

/* scena finale: centrata, chip più grandi */
.sta-scene--final {
    justify-content: center;
    text-align: center;
}

    .sta-scene--final .sta-chips {
        justify-content: center;
        max-width: 520px;
        margin: 6px auto 0;
    }

.sta-chips--lg li {
    font-size: 16px;
    padding: 9px 18px;
}

/* ---------- Entrata degli elementi della scena attiva ---------- */
.sta-scene.is-active .sta-icon { animation: staPop .8s cubic-bezier(.2, .9, .3, 1.3) both; }
.sta-scene.is-active .sta-kicker { animation: staUp .6s ease both .15s; }
.sta-scene.is-active h3 { animation: staUp .6s ease both .25s; }
.sta-scene.is-active p { animation: staUp .6s ease both .4s; }
.sta-scene.is-active .sta-chips li { animation: staChip .5s cubic-bezier(.2, .9, .3, 1.3) both; }
.sta-scene.is-active .sta-chips li:nth-child(1) { animation-delay: .6s; }
.sta-scene.is-active .sta-chips li:nth-child(2) { animation-delay: .75s; }
.sta-scene.is-active .sta-chips li:nth-child(3) { animation-delay: .9s; }
.sta-scene.is-active .sta-chips li:nth-child(4) { animation-delay: 1.05s; }
.sta-scene.is-active .sta-chips li:nth-child(5) { animation-delay: 1.2s; }
.sta-scene.is-active .sta-chips li:nth-child(6) { animation-delay: 1.35s; }

@keyframes staPop {
    from { opacity: 0; transform: scale(.5) rotate(-20deg); }
    to { opacity: 1; transform: none; }
}

@keyframes staUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@keyframes staChip {
    from { opacity: 0; transform: translateY(10px) scale(.8); }
    to { opacity: 1; transform: none; }
}

/* ---------- Barra stile player ---------- */
.sta-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 0 6px;
}

.sta-play {
    flex: 0 0 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sta-orange), var(--sta-orange-2));
    box-shadow: 0 8px 16px -8px rgba(239, 127, 54, .9);
    transition: transform .2s ease;
}

    .sta-play:hover { transform: scale(1.08); }
    .sta-play:focus-visible { outline: 2px solid var(--sta-cyan); outline-offset: 3px; }

    .sta-play svg {
        width: 16px;
        height: 16px;
        fill: #fff;
    }

    .sta-play .sta-ic-play { display: none; }
    .sta.is-paused .sta-play .sta-ic-play { display: block; }
    .sta.is-paused .sta-play .sta-ic-pause { display: none; }

.sta-progress {
    flex: 1;
    display: flex;
    gap: 6px;
}

.sta-seg {
    flex: 1;
    height: 5px;
    border: 0;
    padding: 0;
    border-radius: 5px;
    background: #f3e3d3;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

    .sta-seg span {
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, var(--sta-orange), var(--sta-orange-2));
        transform: scaleX(0);
        transform-origin: left;
    }

    .sta-seg.is-done span { transform: scaleX(1); }
    .sta-seg.is-active span { animation: staFill var(--sta-dur, 3.8s) linear forwards; }
    .sta.is-paused .sta-seg.is-active span { animation-play-state: paused; }

@keyframes staFill { to { transform: scaleX(1); } }

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
    .sta-screen { aspect-ratio: auto; height: 400px; border-radius: 16px; }
    .sta-scene { flex-direction: column; justify-content: center; text-align: center; gap: 22px; padding: 28px 20px; }
    .sta-icon { flex: 0 0 96px; width: 96px; height: 96px; }
    .sta-icon svg { width: 46px; height: 46px; }
    .sta-icon::after { inset: -10px; }
    .sta .sta-text h3 { font-size: 24px; }
    .sta .sta-text p { font-size: 14.5px; }
    .sta-chips { justify-content: center; }
    .sta-chips--lg li { font-size: 14px; padding: 7px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sta-blob, .sta-icon::after { animation: none; }
    .sta-scene.is-active .sta-icon,
    .sta-scene.is-active .sta-kicker,
    .sta-scene.is-active h3,
    .sta-scene.is-active p,
    .sta-scene.is-active .sta-chips li { animation: none; }
}
