/* ════════════════════════════════════════════════════
   Completa ordine — pannello offerta + barra countdown
   ════════════════════════════════════════════════════ */

.scco-modal,
.scco-bar {
    --scco-ink:    #111;
    --scco-muted:  #6b6b6b;
    --scco-line:   #ececec;
    --scco-accent: #ff5a4f;
    font-family: var(--sgc-font, var(--sg-font, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif));
    -webkit-font-smoothing: antialiased;
}

/* ── Anello (comune) ─────────────────────────────────── */

.scco-ring {
    display: block;
    width: 100%;
    height: 100%;
}

.scco-ring__track,
.scco-ring__bar {
    fill: none;
    stroke-width: 7;
}

.scco-ring__track {
    stroke: #f0f0f0;
}

.scco-ring__bar {
    /* colore: gradiente del logo nell'attributo stroke (ringSvg) */
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke .3s;
}

/* ── Pannello ────────────────────────────────────────── */

.scco-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.scco-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba( 17, 17, 17, .55 );
    -webkit-backdrop-filter: blur( 4px );
    backdrop-filter: blur( 4px );
    opacity: 0;
    transition: opacity .25s ease;
}

.scco-modal__box {
    position: relative;
    width: min( 420px, 100% );
    max-height: calc( 100vh - 40px );
    overflow: auto;
    padding: 36px 32px 26px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 80px rgba( 0, 0, 0, .28 );
    text-align: center;
    opacity: 0;
    transform: translateY( 16px ) scale( .96 );
    transition: opacity .25s ease, transform .35s cubic-bezier( .2, .9, .3, 1.2 );
}

.scco-modal.is-open .scco-modal__backdrop {
    opacity: 1;
}

.scco-modal.is-open .scco-modal__box {
    opacity: 1;
    transform: none;
}

.scco-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f4f4f4;
    color: var(--scco-ink);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

.scco-modal__close:hover {
    background: #e9e9e9;
}

.scco-modal__visual {
    position: relative;
    width: 148px;
    height: 148px;
    margin: 0 auto 18px;
}

/* L'anello si disegna all'apertura */
.scco-ring--big {
    filter: drop-shadow( 0 6px 18px rgba( 255, 62, 165, .18 ) );
}

.scco-ring--big .scco-ring__track {
    stroke: #f3f3f3;
}

.scco-ring--big .scco-ring__track,
.scco-ring--big .scco-ring__bar {
    stroke-width: 9;
}

/* Ultimo minuto: anche nel pannello il tempo diventa rosso */
.scco-modal.is-ending .scco-modal__time {
    background: #ffe9e7;
    color: var(--scco-accent);
}

.scco-modal__ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scco-modal__pct {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    color: var(--scco-ink);
}

.scco-modal__time {
    margin-top: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f4f4f4;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--scco-ink);
}

.scco-modal__title {
    margin: 0 0 10px !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -.03em !important;
    line-height: 1.2 !important;
    color: var(--scco-ink) !important;
    text-transform: none !important;
}

.scco-modal__text {
    margin: 0 auto 22px !important;
    max-width: 32em;
    font-size: 15px;
    line-height: 1.55;
    color: #444;
}

.scco-modal__cta {
    position: relative;
    display: block;
    width: 100%;
    padding: 16px 20px;
    overflow: hidden;
    border: none;
    border-radius: 14px;
    background: var(--scco-ink);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, background .15s;
}

/* Riflesso che attraversa il pulsante */
.scco-modal__cta::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient( 100deg, transparent, rgba( 255, 255, 255, .28 ), transparent );
    animation: scco-shine 2.6s ease-in-out 1s infinite;
}

@keyframes scco-shine {
    0%, 60% { left: -60%; }
    100%    { left: 130%; }
}

.scco-modal__cta:hover {
    background: #222;
    transform: translateY( -1px );
    box-shadow: 0 10px 24px rgba( 0, 0, 0, .18 );
}

.scco-modal__cta:disabled {
    cursor: default;
    opacity: .8;
    transform: none;
}

.scco-modal__decline {
    margin-top: 12px;
    padding: 6px 10px;
    border: none;
    background: none;
    color: var(--scco-muted);
    font-family: inherit;
    font-size: 13.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.scco-modal__decline:hover {
    color: var(--scco-ink);
}

.scco-modal__note {
    margin: 14px 0 0 !important;
    font-size: 12px;
    color: #9a9a9a;
}

body.scco-modal-open {
    overflow: hidden;
}

/* ── Barra countdown ─────────────────────────────────── */

.scco-bar {
    --scco-lift: 0px;
    position: fixed;
    left: 50%;
    bottom: calc( 20px + var( --scco-lift ) );
    z-index: 9995;
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    max-width: calc( 100vw - 32px );
    padding: 10px 10px 10px 12px;
    border-radius: 20px;
    background: var(--scco-ink);
    color: #fff;
    box-shadow: 0 16px 40px rgba( 0, 0, 0, .28 );
    opacity: 0;
    transform: translate( -50%, 24px );
    transition: opacity .3s ease, transform .4s cubic-bezier( .2, .9, .3, 1.15 );
}

.scco-bar.is-visible {
    opacity: 1;
    transform: translate( -50%, 0 );
}

.scco-bar__ring {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}

.scco-bar .scco-ring__track {
    stroke: rgba( 255, 255, 255, .16 );
    stroke-width: 10;
}

.scco-bar .scco-ring__bar {
    stroke-width: 10;
}

.scco-bar__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.scco-bar__title {
    font-size: 14px;
    font-weight: 700;
}

.scco-bar__line {
    font-size: 13px;
    color: rgba( 255, 255, 255, .75 );
}

.scco-bar__time {
    margin-left: 2px;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.scco-bar__cta {
    flex-shrink: 0;
    margin-left: 6px;
    padding: 11px 16px;
    border-radius: 13px;
    background: #fff;
    color: var(--scco-ink) !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .12s, background .15s;
}

.scco-bar__cta:hover {
    background: #f0f0f0;
    transform: translateY( -1px );
}

/* Ultimo minuto */
.scco-bar.is-ending .scco-ring__bar,
.scco-bar.is-ending .scco-bar__time {
    stroke: var(--scco-accent);
    color: var(--scco-accent);
}

.scco-bar.is-ending .scco-bar__ring {
    animation: scco-pulse 1s ease-in-out infinite;
}

@keyframes scco-pulse {
    50% { transform: scale( 1.08 ); }
}

.scco-bar.is-expired {
    padding: 14px 18px;
}

.scco-bar__expired {
    font-size: 14px;
    font-weight: 600;
}

/* Sconto attivo ma metodo di pagamento escluso (bonifico) */
.scco-bar.is-paused .scco-bar__title {
    color: #ffd23f;
}

.scco-bar.is-paused .scco-bar__ring {
    opacity: .45;
}

/* ── Avviso sotto i metodi di pagamento ──────────────── */

.scco-paynote {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #f5d27a;
    border-radius: 14px;
    background: #fff8e1;
    color: #5c4300;
    font-family: var(--sgc-font, var(--sg-font, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif));
    animation: scco-paynote-in .25s ease-out;
}

.scco-paynote__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f2b705;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.scco-paynote__text {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

@keyframes scco-paynote-in {
    from { opacity: 0; transform: translateY( -4px ); }
}

/* ── Mobile ──────────────────────────────────────────── */

@media ( max-width: 600px ) {
    .scco-modal {
        align-items: flex-end;
        padding: 0;
    }

    .scco-modal__box {
        width: 100%;
        max-height: 92vh;
        padding: 30px 22px calc( 22px + env( safe-area-inset-bottom ) );
        border-radius: 24px 24px 0 0;
        transform: translateY( 40px );
    }

    .scco-modal__visual {
        width: 124px;
        height: 124px;
    }

    .scco-modal__pct {
        font-size: 32px;
    }

    .scco-modal__title {
        font-size: 21px !important;
    }

    .scco-bar {
        left: 10px;
        right: 10px;
        bottom: calc( 10px + var( --scco-lift ) + env( safe-area-inset-bottom ) );
        width: auto;
        max-width: none;
        transform: translateY( 24px );
    }

    .scco-bar.is-visible {
        transform: none;
    }

    .scco-bar__ring {
        width: 38px;
        height: 38px;
    }

    .scco-bar__title {
        font-size: 13px;
    }

    .scco-bar__line {
        font-size: 12px;
    }

    .scco-bar__cta {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media ( prefers-reduced-motion: reduce ) {
    .scco-modal__box,
    .scco-bar,
    .scco-ring__bar {
        transition: none;
    }

    .scco-modal__cta::after,
    .scco-bar.is-ending .scco-bar__ring,
    .scco-paynote {
        animation: none;
    }
}
