/* ════════════════════════════════════════════════════
   Pannello "Aggiunto al carrello"
   ════════════════════════════════════════════════════ */

html.scadd-lock { overflow: hidden; }

.scadd {
    --scadd-ink:   #0f172a;
    --scadd-muted: #64748b;
    --scadd-line:  #e2e8f0;
    --scadd-ok:    #16a34a;
    position: fixed;
    inset: 0;
    z-index: 2147483000; /* sopra anche il banner dei cookie, che copriva i pulsanti */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--sgc-font, var(--sg-font, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif));
    -webkit-font-smoothing: antialiased;
}

.scadd__backdrop {
    position: absolute;
    inset: 0;
    background: rgba( 15, 23, 42, .5 );
    -webkit-backdrop-filter: blur( 6px );
    backdrop-filter: blur( 6px );
    opacity: 0;
    transition: opacity .25s ease;
}

.scadd__box {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 34px 26px 24px;
    border-radius: 24px;
    background: #fff;
    color: var(--scadd-ink);
    text-align: center;
    box-shadow: 0 30px 80px rgba( 15, 23, 42, .3 );
    opacity: 0;
    transform: translateY( 18px ) scale( .96 );
    transition: opacity .25s ease, transform .4s cubic-bezier( .2, .9, .3, 1.2 );
    overflow: hidden;
}

/* Filo nei colori del logo in cima */
.scadd__box::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 5px;
    background: linear-gradient( 90deg, #ff3ea5, #ffd23f, #3ed1f0, #8be04e );
}

.scadd.is-open .scadd__backdrop { opacity: 1; }
.scadd.is-open .scadd__box { opacity: 1; transform: none; }

.scadd__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--scadd-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.scadd__close:hover { background: #e2e8f0; color: var(--scadd-ink); }
.scadd__close svg { width: 16px; height: 16px; }

/* Spunta con anello sfumato */
.scadd__badge {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    padding: 4px;
}
/* Solo l'anello ruota: la spunta resta dritta */
.scadd__badge::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient( #ff3ea5, #ffd23f, #3ed1f0, #8be04e, #ff3ea5 );
    animation: scadd-spin 6s linear infinite;
}
.scadd__badge svg {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--scadd-ok);
    color: #fff;
    transform: scale( .6 );
    transition: transform .45s cubic-bezier( .2, 1.4, .4, 1 ) .1s;
}
.scadd.is-open .scadd__badge svg { transform: scale( 1 ); }
.scadd__tick {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
}
.scadd.is-open .scadd__tick {
    animation: scadd-draw .45s ease-out .3s forwards;
}

@keyframes scadd-spin { to { transform: rotate( 360deg ); } }
@keyframes scadd-draw { to { stroke-dashoffset: 0; } }

/* Coriandoli */
.scadd-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}
.scadd-burst i {
    position: absolute;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 2px;
    opacity: 0;
    animation: scadd-pop .9s cubic-bezier( .15, .7, .3, 1 ) forwards;
}
@keyframes scadd-pop {
    0%   { opacity: 1; transform: translate( 0, 0 ) rotate( 0 ) scale( .6 ); }
    70%  { opacity: 1; }
    100% { opacity: 0; transform: translate( var(--x), var(--y) ) rotate( var(--r) ) scale( 1 ); }
}

.scadd__title {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--scadd-ink);
}

.scadd__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--scadd-line);
    border-radius: 16px;
    background: #f8fafc;
    text-align: left;
}
.scadd__img {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--scadd-line);
}
.scadd__meta { flex: 1; min-width: 0; }
.scadd__name {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.scadd__details { margin-top: 2px; font-size: 12.5px; color: var(--scadd-muted); }
.scadd__price {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}
.scadd__total {
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.scadd__was {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}
.scadd__old {
    font-size: 12px;
    font-weight: 500;
    color: var(--scadd-muted);
    font-variant-numeric: tabular-nums;
}
.scadd__off {
    padding: 2px 6px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}

.scadd__count {
    margin: 12px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--scadd-muted);
}

.scadd__actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}
.scadd__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s;
}
.scadd__btn--primary {
    border: 0;
    background: var(--scadd-ink);
    color: #fff !important;
    box-shadow: 0 10px 24px rgba( 15, 23, 42, .22 );
}
.scadd__btn--primary:hover { transform: translateY( -1px ); box-shadow: 0 14px 30px rgba( 15, 23, 42, .28 ); }
.scadd__arrow { transition: transform .15s ease; }
.scadd__btn--primary:hover .scadd__arrow { transform: translateX( 3px ); }
.scadd__btn--ghost {
    border: 1px solid var(--scadd-line);
    background: #fff;
    color: var(--scadd-ink);
}
.scadd__btn--ghost:hover { border-color: #cbd5e1; background: #f8fafc; }
.scadd__btn:focus-visible { outline: 3px solid rgba( 62, 209, 240, .6 ); outline-offset: 2px; }

/* Telefono: foglio dal basso */
@media ( max-width: 600px ) {
    .scadd { align-items: flex-end; padding: 0; }
    .scadd__box {
        max-width: none;
        border-radius: 24px 24px 0 0;
        padding: 30px 18px calc( 18px + env( safe-area-inset-bottom ) );
        transform: translateY( 100% );
        transition: opacity .2s ease, transform .35s cubic-bezier( .2, .9, .3, 1 );
    }
    .scadd__title { font-size: 20px; }
}

@media ( prefers-reduced-motion: reduce ) {
    .scadd__box, .scadd__backdrop, .scadd__badge svg { transition: none; }
    .scadd__badge::before { animation: none; }
    .scadd__tick { stroke-dashoffset: 0; }
    .scadd.is-open .scadd__tick { animation: none; }
}
