/* 
   SAP - Shortcodes V2 (Beta)
   Restyling ottimizzato per Core Web Vitals (No CLS, LCP optimization)
   Coeso nativamente con il tema AffiliatePrime.
*/

/* =========================================
   1. BASE & PERFORMANCE FIXES
   ========================================= */
.sap-v2-grid-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #dadce0);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sap-v2-grid-select-wrap, .sap-v2-grid-search-wrap {
    flex: 1;
    min-width: 250px;
}

.sap-v2-grid-select, .sap-v2-grid-search {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #dadce0);
    font-size: 0.95rem;
    color: #000000;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.sap-v2-grid-select:focus, .sap-v2-grid-search:focus {
    outline: none;
    border-color: var(--accent, #ff6900);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(255, 105, 0, 0.1);
}

.sap-v2-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    /* Fix CLS Assoluto: Riserva sempre le dimensioni */
    display: block;
}

/* =========================================
   2. CARD VERTICALE (sap_articolo standard)
   ========================================= */
.sap-v2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
    margin: 30px 0;
    /* align-items: stretch è il default: ogni cella si allunga all'altezza della più alta */
    align-items: stretch;
}

.sap-v2-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color, #dadce0);
    box-shadow: var(--shadow-current, 0 2px 5px rgba(0,0,0,0.1));
    display: flex;
    flex-direction: column;
    /* height: 100% garantisce che la card occupi tutta l'altezza della cella della griglia */
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* 'contain: content' rimosso: tagliava l'ombra box-shadow al hover */
}

.sap-v2-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.sap-v2-badge-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent, #ff6900);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(255, 105, 0, 0.4);
}

.sap-v2-card-img-wrap {
    position: relative;
    width: 100%;
    /* Fix CLS: Ratio 1:1 per i prodotti Amazon/AliExpress */
    aspect-ratio: 1 / 1;
    border-bottom: 1px solid var(--border-color, #dadce0);
    padding: 15px;
    background: rgba(250, 250, 250, 0.5);
    flex-shrink: 0;
}

/* Glassmorphism Badge Sconto */
.sap-v2-badge-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #d32f2f;
    font-size: 1.1rem;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 0, 0, 0.1);
    z-index: 2;
}

.sap-v2-card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* TITOLO: max 3 righe con CSS line-clamp, tooltip nativo via [title] attribute */
.sap-v2-card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
    margin: 0 0 15px 0;
    /* line-clamp: blocca il titolo a 3 righe e aggiunge "..." */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* flex-grow: 1 spinge verso il basso il blocco prezzo+bottone */
    flex-grow: 1;
}

/* BLOCCO PREZZO + BOTTONE: ancorato sempre in fondo alla card */
.sap-v2-card-footer {
    margin-top: auto;
}

.sap-v2-card-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.sap-v2-price-old {
    text-decoration: line-through;
    color: #333333;
    font-size: 0.9rem;
}

.sap-v2-price-current {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent, #ff6900);
}

.sap-v2-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #000000;
    color: #fff;
    font-weight: 700;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s;
}

.sap-v2-btn:hover {
    background: var(--accent, #ff6900);
    transform: scale(1.02);
}

.sap-v2-card-disclaimer {
    font-size: 0.72rem;
    color: #666666;
    text-align: center;
    margin-top: 10px;
    line-height: 1.35;
    font-weight: 400;
}

/* =========================================
   3. LISTA ORIZZONTALE (sap_live_grid / box)
   ========================================= */
.sap-v2-interactive-wrapper, 
.sap-v2-grid-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.sap-v2-list-card {
    display: grid;
    grid-template-columns: 180px 1fr 200px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color, #dadce0);
    box-shadow: var(--shadow-current, 0 2px 5px rgba(0,0,0,0.1));
    align-items: center;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.sap-v2-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.sap-v2-list-img-link {
    display: block;
    padding: 15px;
    border-right: 1px solid var(--border-color, #dadce0);
}

.sap-v2-list-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.sap-v2-badge-ribbon-sm {
    position: absolute;
    top: 5px; left: 5px;
    font-size: 0.65rem; padding: 2px 6px;
    background: #000000; color: #fff;
    border-radius: 4px; font-weight: 700; z-index: 2;
}

.sap-v2-badge-discount-sm {
    position: absolute;
    bottom: 5px; right: 5px;
    font-size: 0.8rem; padding: 2px 6px;
    background: #d32f2f; color: #fff;
    border-radius: 4px; font-weight: 700; z-index: 2;
}

.sap-v2-list-content {
    padding: 20px;
}

.sap-v2-list-title {
    font-size: 1.25rem; font-weight: 700; margin: 0 0 10px 0; line-height: 1.3;
}

.sap-v2-list-desc {
    font-size: 0.95rem; color: #333333; margin: 0; line-height: 1.5;
}

.sap-v2-list-actions {
    padding: 20px;
    text-align: right;
    border-left: 1px solid rgba(0,0,0,0.05);
    background: rgba(250, 250, 250, 0.4);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sap-v2-list-pricing {
    margin-bottom: 15px;
}

.sap-v2-list-pricing .sap-v2-price-old {
    display: block; margin-bottom: 5px; font-size: 0.95rem;
}

.sap-v2-list-pricing .sap-v2-price-current {
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    .sap-v2-list-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .sap-v2-list-img-link { border-right: none; border-bottom: 1px solid var(--border-color, #dadce0); padding: 20px; }
    .sap-v2-list-img-wrap { max-width: 200px; margin: 0 auto; }
    .sap-v2-list-actions { border-left: none; border-top: 1px solid rgba(0,0,0,0.05); text-align: center; }
    .sap-v2-list-pricing .sap-v2-price-old { display: inline; margin-right: 10px; }
}

/* =========================================
   4. ROTATOR CAROUSEL
   ========================================= */
.sap-v2-rotator-widget {
    margin: 30px 0;
}
.sap-v2-widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 2px solid #000000;
    padding-bottom: 5px;
}
.sap-v2-rotator-container { position: relative; overflow: hidden; padding-bottom: 40px; }
.sap-v2-rotate-item { display: none; }
.sap-v2-rotate-item.active { display: block; animation: sapFadeIn 0.4s ease; }

@keyframes sapFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.sap-v2-rotator-nav {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px;
}
.sap-v2-nav-btn {
    background: #fff; border: 1px solid var(--border-color, #dadce0);
    border-radius: 50%; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); color: #000000;
}
.sap-v2-nav-btn:hover { background: var(--accent, #ff6900); color: #fff; border-color: var(--accent, #ff6900); }

/* =========================================
   5. COMPACT WIDGET & INLINE
   ========================================= */
.sap-v2-compact {
    display: flex; align-items: center; gap: 15px; padding: 10px;
    border: 1px solid var(--border-color, #dadce0); border-radius: 8px;
    margin-bottom: 15px; transition: background 0.2s; text-decoration: none!important;
}
.sap-v2-compact:hover { background: rgba(0,0,0,0.02); }
.sap-v2-compact-img { width: 60px; height: 60px; aspect-ratio: 1/1; flex-shrink: 0; border-radius: 4px; overflow: hidden;}
.sap-v2-compact-title { font-weight: 600; font-size: 0.95rem; color: #000000; line-height: 1.2; margin-bottom: 5px; }
.sap-v2-compact-price { font-weight: 800; color: var(--accent, #ff6900); font-size: 1.1rem; }

.sap-v2-inline-link {
    color: var(--accent, #ff6900);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sap-v2-inline-link:hover { text-decoration-thickness: 2px; }

/* Load More */
.sap-v2-load-more-wrap { text-align: center; margin-top: 20px; }
.sap-v2-load-more {
    background: transparent; color: #000000;
    border: 2px solid #000000;
    font-weight: 700; padding: 10px 30px; border-radius: 50px;
    cursor: pointer; text-transform: uppercase; font-size: 0.9rem;
    transition: all 0.2s;
}
.sap-v2-load-more:hover { background: #000000; color: #fff; }
.sap-v2-empty { font-weight: 600; padding: 30px; text-align: center; background: #fff9f5; border: 1px dashed var(--accent, #ff6900); border-radius: 8px; color: var(--accent, #ff6900);}

/* =========================================
   6. TABELLA COMPARATIVA V2
   ========================================= */
.sap-v2-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color, #dadce0);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
.sap-v2-compare-table { width: 100%; min-width: 600px; border-collapse: collapse; background: #fff; }
.sap-v2-compare-table td { vertical-align: top; padding: 15px; border-bottom: 1px solid var(--border-color, #dadce0); }
.sap-v2-table-label { width: 150px; font-weight: 700; color: #333333; background: #f8f9fa; font-size: 0.9rem; }
.sap-v2-table-img-cell { text-align: center; vertical-align: bottom; position: relative; }
.sap-v2-table-img-cell img { margin: 20px auto 0 auto; max-height: 120px; max-width: 90%; object-fit: contain; }
.sap-v2-table-text-cell { text-align: center; }
.sap-v2-table-text-cell a { text-decoration: none; color: #000000; font-weight: 600; font-size: 0.95rem; line-height: 1.3; display: block; }
.sap-v2-table-text-cell a:hover { color: var(--accent, #ff6900); }
.sap-v2-table-price-cell, .sap-v2-table-action-cell { text-align: center; }
.sap-v2-table-price { font-size: 1.3rem; font-weight: 800; color: var(--accent, #ff6900); }
.sap-v2-table-discount { font-size: 0.75rem; color: #fff; background: #d32f2f; padding: 3px 8px; border-radius: 20px; font-weight: 700; }
.sap-v2-table-action-cell .sap-v2-btn { display: inline-block; width: auto; padding: 10px 20px; font-size: 0.9rem; border-radius: 8px; }
.sap-v2-cell-highlight { background: rgba(255, 105, 0, 0.04) !important; border-left: 3px solid var(--accent, #ff6900); }
.sap-v2-table-badge { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 0.7rem; font-weight: 700; padding: 5px 12px; width: 90%; text-align: center; }
.sap-v2-table-badge--choice { background: #FBC02D; color: #111; border-radius: 0 0 8px 8px; }
.sap-v2-table-badge--best { background: #00a32a; color: #fff; font-size: 0.65rem; padding: 4px 10px; border-radius: 0 0 6px 6px; width: auto; }
.sap-v2-feat-list { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; color: #000000; }
.sap-v2-feat-list li { margin-bottom: 6px; line-height: 1.4; }
.sap-v2-toggle-wrap { margin-top: 5px; }
.sap-v2-toggle-wrap a { font-size: 0.8rem; color: var(--accent, #ff6900); text-decoration: none; font-weight: 600; }
.sap-v2-empty-feat { color: #ccc; }

/* =========================================
   7. PRO & CONTRO V2
   ========================================= */
.sap-v2-pros-cons-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid var(--border-color, #dadce0);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.sap-v2-pc-col { flex: 1; min-width: 250px; padding: 25px; }
.sap-v2-pc-con { background: #fafafa; border-left: 1px solid var(--border-color, #dadce0); }
.sap-v2-pc-title { margin-top: 0; display: flex; align-items: center; border-bottom: 2px solid; padding-bottom: 12px; margin-bottom: 18px; font-size: 1rem; }
.sap-v2-pc-title--pro { color: #00a32a; border-color: #00a32a; }
.sap-v2-pc-title--con { color: #d32f2f; border-color: #d32f2f; }
.sap-v2-pc-icon { font-size: 1.2rem; margin-right: 10px; }
.sap-v2-pc-list { list-style: none; padding: 0; margin: 0; }
.sap-v2-pc-list li { margin-bottom: 10px; display: flex; align-items: flex-start; color: #000000; font-size: 0.95rem; line-height: 1.5; }
.sap-v2-tick-pro { color: #00a32a; font-weight: 700; margin-right: 8px; flex-shrink: 0; }
.sap-v2-tick-con { color: #d32f2f; font-weight: 700; margin-right: 8px; flex-shrink: 0; }
.sap-v2-pc-empty { color: #999; font-style: italic; font-size: 0.85rem; }

@media (max-width: 768px) {
    .sap-v2-pros-cons-box { flex-direction: column; }
    .sap-v2-pc-col { width: 100% !important; border-left: none !important; border-top: 1px solid var(--border-color, #dadce0); }
}

/* =========================================
   8. RATING V2 (POTENZIATO)
   ========================================= */
.sap-v2-rating-box {
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 25px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.sap-v2-rating-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    min-width: 110px;
}
.sap-v2-rating-score-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}
.sap-v2-rating-score { font-size: 2.6rem; font-weight: 900; color: #0f172a; line-height: 1; }
.sap-v2-rating-max { font-size: 1.1rem; font-weight: 700; color: #94a3b8; }
.sap-v2-rating-stars { display: flex; align-items: center; gap: 3px; margin: 8px 0 4px; }
.sap-v2-star-icon { width: 20px; height: 20px; }
.sap-v2-rating-reviews { font-size: 0.78rem; font-weight: 600; color: #64748b; }
.sap-v2-rating-content {
    flex: 1;
    min-width: 0;
    border-left: 2px solid #e2e8f0;
    padding-left: 20px;
}
.sap-v2-rating-title { font-size: 1.1rem; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.sap-v2-rating-text { font-size: 0.95rem; color: #334155; line-height: 1.6; }

@media (max-width: 768px) {
    .sap-v2-rating-box { flex-direction: column; align-items: flex-start; text-align: left; }
    .sap-v2-rating-left { align-items: flex-start; text-align: left; }
    .sap-v2-rating-content { border-left: none; padding-left: 0; padding-top: 14px; border-top: 1px solid #e2e8f0; width: 100%; }
}

/* =========================================
   9. ALERT V2 (POTENZIATO)
   ========================================= */
.sap-v2-alert {
    padding: 18px 22px;
    margin: 24px 0;
    border-left: 5px solid;
    border-radius: 0 12px 12px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: 0 3px 12px rgba(0,0,0,0.03);
}
.sap-v2-alert-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sap-v2-alert-icon { font-size: 1.35rem; line-height: 1; flex-shrink: 0; }
.sap-v2-alert-title { font-size: 1.05rem; font-weight: 800; }
.sap-v2-alert-body { font-size: 0.95rem; line-height: 1.6; color: inherit; }
.sap-v2-alert-footer { margin-top: 14px; }
.sap-v2-alert-btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: transform 0.15s ease, filter 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.sap-v2-alert-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }

.sap-v2-alert-deal { background: #fff7ed; border-color: #f97316; color: #9a3412; }
.sap-v2-alert-deal .sap-v2-alert-btn { background: #f97316; color: #fff !important; }

.sap-v2-alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.sap-v2-alert-info .sap-v2-alert-btn { background: #3b82f6; color: #fff !important; }

.sap-v2-alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.sap-v2-alert-success .sap-v2-alert-btn { background: #22c55e; color: #fff !important; }

.sap-v2-alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.sap-v2-alert-warning .sap-v2-alert-btn { background: #f59e0b; color: #fff !important; }

.sap-v2-alert-danger { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.sap-v2-alert-danger .sap-v2-alert-btn { background: #ef4444; color: #fff !important; }

/* =========================================
   10. SPECS / SCHEDA TECNICA V2 (POTENZIATA)
   ========================================= */
.sap-v2-specs-table {
    margin: 25px 0 30px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,0.04);
}
.sap-v2-specs-header {
    background: #f8fafc;
    padding: 15px 22px;
    font-weight: 800;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: #0f172a;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
}
.sap-v2-specs-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.sap-v2-specs-table tr.even { background: #fff; }
.sap-v2-specs-table tr.odd { background: #f8fafc; }
.sap-v2-specs-table td { border-bottom: 1px solid #f1f5f9; padding: 12px 22px; color: #1e293b; }
.sap-v2-spec-label { font-weight: 700; color: #475569; width: 38%; }
.sap-v2-spec-value { font-weight: 600; color: #0f172a; }
.sap-v2-spec-full { font-weight: 500; color: #334155; }

/* Link & CTA Button */
.sap-v2-inline-link {
    color: var(--accent, #ff6900);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
    transition: color 0.15s;
}
.sap-v2-inline-link:hover {
    color: #e05d00;
    text-decoration: none;
}
.sap-v2-btn-link-wrap {
    margin: 20px 0;
    text-align: center;
}
.sap-v2-btn-standalone {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 13px 32px !important;
    background: var(--accent, #ff6900) !important;
    color: #fff !important;
    border-radius: 50px !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(255, 105, 0, 0.35) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.sap-v2-btn-standalone:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 105, 0, 0.45) !important;
    filter: brightness(1.08);
}

/* =========================================
   11. BESTSELLER V2
   ========================================= */
.sap-v2-bestseller-wrapper { margin-bottom: 30px; }
.sap-v2-bestseller-list { display: flex; flex-direction: column; gap: 15px; }
.sap-v2-bestseller-item { position: relative; padding-left: 55px; }
.sap-v2-rank-badge {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.8rem;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.sap-v2-rank-badge.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA000); color: #111; }
.sap-v2-rank-badge.rank-2 { background: linear-gradient(135deg, #C0C0C0, #9E9E9E); color: #fff; }
.sap-v2-rank-badge.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
.sap-v2-rank-badge.rank-other { background: #f0f0f0; color: #666; }

/* =========================================
   12. FLOATING SOCIAL STACK & FINAL CTA BOX - Premium Design
   ========================================= */
.social-stack {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, bottom 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform;
}

.social-stack.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Offset coordinato con la buy bar / sticky bar */
body.has-af-sticky-bar .social-stack,
body.has-sticky-buy-bar .social-stack {
    bottom: 80px;
}

.social-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Esteticamente affine al back-to-top */
    text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
}

.social-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.social-pill .pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-pill .pill-icon img,
.social-pill .pill-icon svg {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain;
    display: block;
    fill: #ffffff;
}

.social-pill .pill-text {
    display: none; /* Nascondiamo il testo per l'affinità con il back-to-top */
}

.telegram-pill {
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
}
.telegram-pill:hover {
    background: linear-gradient(135deg, #38b5f3 0%, #25a8e6 100%);
}

.facebook-pill {
    background: linear-gradient(135deg, #1877F2 0%, #1565D8 100%);
}
.facebook-pill:hover {
    background: linear-gradient(135deg, #2f85f3 0%, #176fe0 100%);
}

.final-cta-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 24px;
    margin: 30px auto;
    max-width: 650px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    border-left: 5px solid #ff6900;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
}

.final-cta-box::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(255,105,0,0.05) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    z-index: 1;
}

.final-cta-title {
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #000000;
    margin: 0 0 20px 0 !important;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.final-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.cta-btn img {
    width: 18px !important;
    height: 18px !important;
    display: inline-block !important;
    vertical-align: middle;
    margin: 0 !important;
}

.btn-live {
    background: #d32f2f;
    color: #ffffff !important;
}
.btn-live:hover {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.3);
}

.btn-telegram {
    background: #229ED9;
    color: #ffffff !important;
}
.btn-telegram:hover {
    background: #1e8fc4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 158, 217, 0.3);
}

@keyframes ctaPulse {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}
.pulse-effect {
    animation: ctaPulse 2.2s infinite;
}

@media screen and (max-width: 600px) {
    .final-cta-box {
        padding: 20px 15px;
        margin: 20px 0;
    }
    .final-cta-title {
        font-size: 14px;
        margin-bottom: 15px !important;
    }
    .final-cta-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .cta-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .social-stack {
        left: 15px;
        bottom: 15px;
        gap: 8px;
    }
    body.has-af-sticky-bar .social-stack,
    body.has-sticky-buy-bar .social-stack {
        bottom: 80px; /* Offset per buy bar mobile */
    }
    .social-pill {
        width: 40px;
        height: 40px;
    }
    .social-pill .pill-icon {
        width: 18px;
        height: 18px;
    }
    .social-pill .pill-icon img,
    .social-pill .pill-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* ==========================================================================
