:root {
    --sp-primary: #fe5000;
    --sp-primary-dark: #e54500;
    --sp-primary-light: rgba(254, 80, 0, 0.1);
    --sp-bg: #F7F7F7;
    --sp-text: #111111;
    --sp-muted: #6B7280;
    --sp-border: #E5E7EB;
    --sp-success: #10B981;
    --sp-radius: 12px;
    --sp-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    --sp-shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --sp-gap: 10px;
    --sp-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation d'entrée pour l'offer box */
@keyframes sp-slide-up-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sp-offer-box {
    margin: 20px 0;
    padding: 0;
    animation: sp-slide-up-fade 0.6s var(--sp-transition) forwards;
}

.sp-box-title {
    font-family: var(--sp-title-font, inherit);
    font-size: var(--sp-title-size, 1.5em);
    font-weight: var(--sp-title-weight, 700);
    color: var(--sp-title-color, #1f2937);
    text-align: var(--sp-title-align, center);
    margin-bottom: 15px;
    display: block;
}

.sp-box-description {
    font-family: var(--sp-desc-font, inherit);
    font-size: var(--sp-desc-size, 14px);
    font-weight: var(--sp-desc-weight, 400);
    color: var(--sp-desc-color, #6b7280);
    text-align: var(--sp-desc-align, center);
    margin-bottom: 20px;
}

.sp-custom-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.sp-regular-price {
    text-decoration: line-through;
    color: var(--sp-muted);
    font-family: var(--sp-price-font, inherit);
    font-size: 0.9em;
}

.sp-promo-price {
    color: var(--sp-price-color, var(--sp-primary));
    font-family: var(--sp-price-font, inherit);
    font-size: var(--sp-price-size, 28px);
    font-weight: var(--sp-price-weight, 700);
}

/* Animations de titre */
@keyframes sp-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sp-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sp-slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sp-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes sp-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes sp-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.sp-anim-fadeIn { animation: sp-fadeIn 0.8s ease-out; }
.sp-anim-slideUp { animation: sp-slideUp 0.6s ease-out; }
.sp-anim-slideDown { animation: sp-slideDown 0.6s ease-out; }
.sp-anim-pulse { animation: sp-pulse 2s infinite; }
.sp-anim-bounce { animation: sp-bounce 1s; }
.sp-anim-shake { animation: sp-shake 0.5s; }

.sp-countdown-timer {
    background: #fff;
    border: 1px solid #ffcccc;
    color: #d32f2f;
    padding: 10px;
    border-radius: var(--sp-radius);
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9em;
}

.sp-countdown-text {
    font-weight: 600;
}

/* BOGO Display Styles */
.sp-bogo-display {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 25px 20px;
    border-radius: var(--sp-radius);
    border: 1px solid var(--sp-border);
}

.sp-bogo-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    padding: 20px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sp-bogo-step:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.sp-bogo-buy {
    border: 2px solid transparent;
    background: var(--sp-bogo-card-buy-bg, #fff);
}

.sp-bogo-get {
    border: 2px solid var(--sp-primary);
    background: var(--sp-bogo-card-get-bg, linear-gradient(135deg, #fff 0%, #fff7ed 100%));
}

.sp-product-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.sp-product-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--sp-border);
    transition: transform 0.3s ease;
}

.sp-bogo-step:hover .sp-product-preview img {
    transform: scale(1.05);
}

.sp-qty-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--sp-text) 0%, #374151 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.sp-bogo-promo-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--sp-bogo-badge-bg, #10b981);
    color: var(--sp-bogo-badge-color, #fff);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: sp-badge-pulse 2s ease-in-out infinite;
}

.sp-bogo-promo-badge.sp-badge-free {
    background: var(--sp-bogo-badge-bg, linear-gradient(135deg, #10b981 0%, #059669 100%));
}

.sp-bogo-promo-badge.sp-badge-percent {
    background: var(--sp-bogo-badge-bg, linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-dark) 100%));
}

.sp-bogo-info {
    text-align: center;
}

.sp-bogo-action {
    font-size: 12px;
    font-weight: 600;
    color: var(--sp-muted);
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-bogo-action-get {
    color: var(--sp-primary);
}

.sp-bogo-product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-text);
    margin: 0;
    line-height: 1.3;
}

.sp-bogo-label {
    margin-top: 10px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--sp-text);
}

/* Connecteur BOGO amélioré */
.sp-bogo-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
}

.sp-bogo-connector-line {
    width: 2px;
    height: 25px;
    background: linear-gradient(to bottom, var(--sp-border), var(--sp-primary), var(--sp-border));
}

.sp-bogo-connector-icon {
    width: 36px;
    height: 36px;
    background: var(--sp-bogo-connector-color, linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-dark) 100%));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(254, 80, 0, 0.3);
}

.sp-bogo-connector-icon .dashicons {
    color: #fff;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Ribbon BOGO - Caché sur desktop */
.sp-bogo-ribbon {
    display: none;
}

/* Badge réduction sur produit acheté */
.sp-bogo-buy-discount-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
    z-index: 5;
}

.sp-bogo-buy.has-discount {
    border: 2px solid #f59e0b;
}

.sp-bogo-price-info {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sp-bogo-original-price {
    font-size: 12px;
    color: var(--sp-muted);
    text-decoration: line-through;
}

.sp-bogo-discounted-price {
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
}

/* Résumé BOGO */
.sp-bogo-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--sp-bogo-summary-bg, linear-gradient(135deg, #1f2937 0%, #374151 100%));
    color: var(--sp-bogo-summary-color, #fff);
    padding: 12px 20px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.sp-bogo-summary-icon {
    font-size: 20px;
}

.sp-bogo-summary-text {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}

/* ========================================
   BOGO MOBILE - DESIGN DEDIÉ & OPTIMISÉ
   ======================================== */

@media (max-width: 480px) {
    /* Container principal - Design carte verticale */
    .sp-bogo-display {
        flex-direction: column;
        gap: 0;
        padding: 0;
        background: transparent;
        border: none;
        margin-bottom: 15px;
    }
    
    /* Carte produit mobile */
    .sp-bogo-step {
        flex-direction: row;
        padding: 16px;
        border-radius: 16px;
        gap: 15px;
        text-align: left;
        align-items: center;
        margin: 0;
    }
    
    .sp-bogo-buy {
        background: #fff;
        border: 1px solid var(--sp-border);
        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }
    
    .sp-bogo-get {
        background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
        border: 2px solid var(--sp-primary);
        border-radius: 0 0 16px 16px;
        position: relative;
    }
    
    .sp-bogo-buy {
        background: var(--sp-bogo-card-buy-bg, #fff) !important;
    }
    
    .sp-bogo-get {
        background: var(--sp-bogo-card-get-bg, linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%)) !important;
    }
    
    /* Ribbon visible uniquement sur mobile */
    .sp-bogo-ribbon {
        display: block;
        position: absolute;
        top: 0;
        right: 15px;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        padding: 4px 12px;
        border-radius: 0 0 8px 8px;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
    
    .sp-bogo-step:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Image produit mobile */
    .sp-product-preview {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .sp-product-preview img {
        width: 70px;
        height: 70px;
        border-radius: 12px;
    }
    
    /* Badges sur mobile */
    .sp-qty-badge {
        bottom: -5px;
        right: -5px;
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .sp-bogo-promo-badge {
        top: -8px;
        right: -8px;
        font-size: 10px;
        padding: 4px 8px;
    }
    
    /* Info produit mobile */
    .sp-bogo-info {
        text-align: left;
        flex: 1;
    }
    
    .sp-bogo-action {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .sp-bogo-product-name {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
    }
    
    /* Connecteur mobile - Style trait */
    .sp-bogo-connector {
        flex-direction: row;
        padding: 0;
        margin: 0;
        height: 0;
        position: relative;
        z-index: 10;
    }
    
    .sp-bogo-connector-line {
        display: none;
    }
    
    .sp-bogo-connector-icon {
        width: 40px;
        height: 40px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        border: 3px solid #fff;
        box-shadow: 0 4px 15px rgba(254, 80, 0, 0.4);
    }
    
    .sp-bogo-connector-icon .dashicons {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }
    
    /* Résumé mobile - Sticky bottom style */
    .sp-bogo-summary {
        background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
        padding: 14px 20px;
        border-radius: 12px;
        margin-top: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }
    
    .sp-bogo-summary-icon {
        font-size: 22px;
        animation: sp-bounce-emoji 1s ease-in-out infinite;
    }
    
    @keyframes sp-bounce-emoji {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.2); }
    }
    
    .sp-bogo-summary-text {
        color: #fff;
        font-size: 13px;
        font-weight: 600;
    }
}

/* Très petit écran (iPhone SE, etc.) */
@media (max-width: 360px) {
    .sp-bogo-step {
        padding: 12px;
        gap: 12px;
    }
    
    .sp-product-preview img {
        width: 55px;
        height: 55px;
    }
    
    .sp-bogo-product-name {
        font-size: 13px;
    }
    
    .sp-bogo-get::before {
        font-size: 9px;
        padding: 3px 10px;
    }
    
    .sp-bogo-connector-icon {
        width: 34px;
        height: 34px;
    }
    
    .sp-bogo-summary {
        padding: 12px 15px;
    }
    
    .sp-bogo-summary-text {
        font-size: 12px;
    }
}

.sp-bogo-connector {
    color: var(--sp-muted);
}

.sp-bogo-connector .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.sp-timer-display {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: 700;
}

.sp-tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--sp-gap);
    margin-bottom: 20px;
}

.sp-tier-card {
    border: 2px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    position: relative;
    background: #fff;
    transition: all 0.3s var(--sp-transition);
    transform-origin: center;
    opacity: 0;
    animation: sp-tier-appear 0.4s var(--sp-transition) forwards;
}

/* Animation d'apparition échelonnée des tiers */
.sp-tier-card:nth-child(1) { animation-delay: 0.1s; }
.sp-tier-card:nth-child(2) { animation-delay: 0.2s; }
.sp-tier-card:nth-child(3) { animation-delay: 0.3s; }
.sp-tier-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes sp-tier-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sp-tier-card:hover {
    border-color: var(--sp-primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--sp-shadow);
}

.sp-tier-card.active {
    border-color: var(--sp-primary);
    background: linear-gradient(135deg, #fff 0%, var(--sp-primary-light) 100%);
    box-shadow: 0 8px 25px rgba(254, 80, 0, 0.2);
    transform: scale(1.03);
}

/* Effet de ripple au clic */
.sp-tier-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--sp-primary-light);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s, opacity 0.4s;
    opacity: 0;
    pointer-events: none;
}

.sp-tier-card:active::after {
    width: 200%;
    height: 200%;
    opacity: 0;
}

.sp-badge-popular {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sp-primary);
    color: var(--sp-on-primary, #fff);
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.sp-tier-qty {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--sp-text);
}

.sp-tier-save {
    display: block;
    font-size: 0.75em;
    color: #10B981;
    /* Green */
    font-weight: 600;
    margin-top: 2px;
}

.sp-tier-price {
    margin-top: 8px;
}

.sp-total {
    font-weight: 700;
    color: var(--sp-primary);
    font-size: 1.1em;
}

.sp-add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--sp-btn-start, var(--sp-primary)) 0%, var(--sp-btn-end, var(--sp-primary-dark)) 100%) !important;
    color: var(--sp-btn-text, #fff) !important;
    border-radius: var(--sp-radius);
    padding: 16px 24px !important;
    border: none !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none !important;
    transition: all 0.3s var(--sp-transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(254, 80, 0, 0.3);
}

/* Effet de brillance au survol */
.sp-add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.sp-add-to-cart-btn:hover::before {
    left: 100%;
}

.sp-add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(254, 80, 0, 0.4);
}

.sp-add-to-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(254, 80, 0, 0.3);
}

/* État de chargement */
.sp-add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.sp-add-to-cart-btn.loading .sp-btn-text {
    opacity: 0;
}

.sp-add-to-cart-btn.loading .sp-loader {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Animation de succès */
@keyframes sp-btn-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: var(--sp-success); }
    100% { transform: scale(1); }
}

.sp-add-to-cart-btn.success {
    animation: sp-btn-success 0.5s var(--sp-transition);
}

.sp-secure-info {
    font-size: 0.8em;
    color: var(--sp-muted);
    text-align: center;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Hide standard add to cart if we want */
/* .single_add_to_cart_button, .quantity { display: none !important; } */
/* Since we inject before form, the form is still there. We might want to hide it via JS or CSS. 
   But "smart-promo" usually implies REPLACING the selector.
*/

/* Sticky Bar */
.sp-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 10px 20px;
    animation: spSlideUp 0.3s ease-out;
}

@keyframes spSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Eligible Products Links */
.sp-eligible-products {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.sp-eligible-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.sp-product-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-product-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 20px;
    font-size: 12px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.sp-product-link:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
}

.sp-product-link.active {
    background: #f0f0f0;
    font-weight: 600;
    pointer-events: none;
}

.sp-product-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Sticky Bar - High Priority */
.sp-sticky-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #fff !important;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1) !important;
    z-index: 999999 !important;
    /* Extremely high to beat themes */
    padding: 12px 20px !important;
    border-top: 1px solid #eee !important;
}

.sp-sticky-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.sp-sticky-info {
    display: flex;
    flex-direction: column;
}

.sp-sticky-title {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sp-sticky-total {
    color: var(--sp-primary);
    font-weight: 700;
    font-size: 16px;
}

.sp-sticky-btn {
    flex-shrink: 0;
    background: var(--sp-primary) !important;
    color: var(--sp-on-primary) !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: var(--sp-radius) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(254, 80, 0, 0.2) !important;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
    /* Responsive intelligent basé sur le nombre de tiers */
    .sp-tiers-grid.sp-tiers-1 {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .sp-tiers-grid.sp-tiers-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    .sp-tiers-grid.sp-tiers-3,
    .sp-tiers-grid.sp-tiers-4 {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Plus de 4 tiers : 2 colonnes avec scroll */
    .sp-tiers-grid:not(.sp-tiers-1):not(.sp-tiers-2):not(.sp-tiers-3):not(.sp-tiers-4) {
        grid-template-columns: 1fr 1fr;
    }

    .sp-sticky-title {
        display: none;
    }

    .sp-sticky-content {
        justify-content: space-between;
        width: 100%;
    }
}

/* UX Enhancements: Toast & Loader */
.sp-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.95em;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

.sp-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sp-toast.success {
    background: #10B981;
}

.sp-toast.error {
    background: #EF4444;
}

/* Loader Spinner - Caché par défaut */
.sp-loader {
    display: none;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spSpin 1s ease-in-out infinite;
    vertical-align: middle;
}

/* Afficher le loader uniquement en état loading */
.sp-add-to-cart-btn.loading .sp-loader {
    display: inline-block;
}

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

/* Enhanced Interactions */
.sp-tier-card:hover {
    border-color: var(--sp-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sp-tier-card.active {
    border-color: var(--sp-primary);
    background: #fff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

/* Premium Popup styles */
.sp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.sp-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.sp-popup-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: var(--sp-radius);
    max-width: 500px;
    width: 90%;
    position: relative;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.85);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sp-popup-overlay.is-visible .sp-popup-container {
    transform: scale(1);
}

.sp-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.sp-popup-close:hover {
    opacity: 1;
}

.sp-popup-image img {
    width: 100%;
    border-radius: calc(var(--sp-radius) / 2);
    margin-bottom: 20px;
}

.sp-popup-inner-content {
    text-align: center;
}

.sp-popup-cta {
    display: inline-block;
    background: var(--sp-primary);
    color: var(--sp-on-primary) !important;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 20px;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sp-popup-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.sp-popup-lottie {
    margin-bottom: 20px;
}

/* Animations Trigger */
@keyframes sp-celebration {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.sp-celebrating {
    animation: sp-celebration 0.6s var(--sp-transition);
}

/* ========================================
   ANIMATIONS AVANCÉES UX
   ======================================== */

/* Animation du prix qui change */
@keyframes sp-price-update {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; color: var(--sp-success); }
    100% { transform: scale(1); opacity: 1; }
}

.sp-price-updated {
    animation: sp-price-update 0.4s var(--sp-transition);
}

/* Animation du badge populaire */
@keyframes sp-badge-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

.sp-badge-popular {
    animation: sp-badge-pulse 2s ease-in-out infinite;
}

/* Skeleton loader pendant le chargement */
.sp-skeleton {
    background: linear-gradient(
        90deg,
        var(--sp-border) 25%,
        #f0f0f0 50%,
        var(--sp-border) 75%
    );
    background-size: 200% 100%;
    animation: sp-skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes sp-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Animation du countdown */
.sp-countdown-timer {
    animation: sp-slide-up-fade 0.5s var(--sp-transition) forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

/* Effet de pulsation urgence sur le countdown */
@keyframes sp-urgency-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(211, 47, 47, 0); }
}

.sp-countdown-timer.sp-urgent {
    animation: sp-urgency-pulse 1.5s infinite;
    border-color: #d32f2f;
    background: #fff5f5;
}

/* Hover effect sur les produits éligibles */
.sp-product-link {
    transition: all 0.25s var(--sp-transition);
}

.sp-product-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Animation d'entrée des produits BOGO */
.sp-bogo-display {
    animation: sp-slide-up-fade 0.5s var(--sp-transition) forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.sp-bogo-step {
    transition: transform 0.3s var(--sp-transition);
}

.sp-bogo-step:hover {
    transform: scale(1.05);
}

/* Animation du connecteur BOGO */
@keyframes sp-connector-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

.sp-bogo-connector .dashicons {
    animation: sp-connector-pulse 2s ease-in-out infinite;
}

/* Tooltip amélioré */
.sp-tooltip {
    position: relative;
}

.sp-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--sp-text);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--sp-transition);
    pointer-events: none;
    z-index: 100;
}

.sp-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--sp-text);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--sp-transition);
}

.sp-tooltip:hover::after,
.sp-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Focus visible pour l'accessibilité */
.sp-tier-card:focus-visible,
.sp-add-to-cart-btn:focus-visible,
.sp-variation-option:focus-visible {
    outline: 3px solid var(--sp-primary);
    outline-offset: 2px;
}

/* Animation de l'icône panier */
@keyframes sp-cart-bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-3px); }
    75% { transform: translateY(2px); }
}

.sp-cart-icon-animated {
    animation: sp-cart-bounce 0.4s var(--sp-transition);
}

/* Notification de stock faible */
.sp-low-stock-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #DC2626;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    animation: sp-badge-pulse 2s ease-in-out infinite;
}

/* Amélioration du toast */
.sp-toast {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sp-toast.success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.sp-toast.error {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

/* Confetti container */
.sp-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

/* Micro-interaction: économies highlight */
.sp-tier-save {
    transition: all 0.3s var(--sp-transition);
}

.sp-tier-card:hover .sp-tier-save,
.sp-tier-card.active .sp-tier-save {
    transform: scale(1.1);
    text-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Dark mode support (optionnel, respecte les préférences système) */
@media (prefers-color-scheme: dark) {
    .sp-offer-box.sp-dark-mode {
        --sp-bg: #1F2937;
        --sp-text: #F9FAFB;
        --sp-muted: #9CA3AF;
        --sp-border: #374151;
    }
}

/* ========================================
   STYLES POUR LES PRODUITS VARIABLES
   ======================================== */

.sp-variation-selector {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: var(--sp-radius);
    border: 1px solid var(--sp-border);
}

.sp-variation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sp-variation-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-variation-label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--sp-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-variation-option {
    padding: 10px 18px;
    border: 2px solid var(--sp-border);
    border-radius: 30px;
    background: #fff;
    color: var(--sp-text);
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sp-variation-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(254, 80, 0, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.sp-variation-option:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sp-variation-option:hover::before {
    width: 200%;
    height: 200%;
}

.sp-variation-option.active {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(254, 80, 0, 0.3);
    transform: scale(1.02);
}

.sp-variation-option.active::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: sp-pulse-dot 1.5s infinite;
}

@keyframes sp-pulse-dot {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateY(-50%) scale(0.8); }
}

.sp-variation-option.disabled,
.sp-variation-option[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.sp-variation-option.disabled:hover,
.sp-variation-option[disabled]:hover {
    transform: none;
    border-color: var(--sp-border);
}

/* Animation de sélection */
.sp-selected-animation {
    animation: sp-option-selected 0.3s ease;
}

@keyframes sp-option-selected {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.02); }
}

/* Prix de variation */
.sp-variation-price {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--sp-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-variation-regular-price {
    text-decoration: line-through;
    color: var(--sp-muted);
    font-size: 0.9em;
}

.sp-variation-sale-price {
    color: var(--sp-primary);
    font-weight: 700;
    font-size: 1.2em;
}

/* Bouton désactivé */
.sp-add-to-cart-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Swatches de couleur (optionnel) */
.sp-variation-option.is-color {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    position: relative;
}

.sp-variation-option.is-color span {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.sp-variation-option.is-color:hover span {
    opacity: 1;
}

/* Responsive */
@media (max-width: 600px) {
    .sp-variation-selector {
        padding: 15px;
    }
    
    .sp-variation-option {
        padding: 8px 14px;
        font-size: 0.85em;
    }
    
    .sp-variation-options {
        gap: 6px;
    }
}

/* ========================================
   STYLES PERSONNALISABLES VIA ADMIN
   ======================================== */

/* Widget avec variables personnalisées */
.sp-offer-box {
    border-radius: var(--sp-widget-radius, 16px);
    box-shadow: var(--sp-widget-shadow, 0 4px 15px rgba(0,0,0,0.1));
    padding: var(--sp-widget-padding, 24px);
    background: #fff;
    border: 1px solid var(--sp-border);
}

/* Layouts des tiers */
.sp-layout-grid .sp-tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--sp-gap);
}

.sp-layout-horizontal .sp-tiers-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--sp-gap);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.sp-layout-horizontal .sp-tier-card {
    flex: 0 0 auto;
    min-width: 120px;
}

.sp-layout-vertical .sp-tiers-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-gap);
}

.sp-layout-vertical .sp-tier-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 16px 20px;
}

.sp-layout-vertical .sp-tier-qty {
    font-size: 1em;
}

.sp-layout-vertical .sp-tier-price {
    margin-top: 0;
    text-align: right;
}

.sp-layout-vertical .sp-badge-popular {
    position: static;
    transform: none;
    margin-left: auto;
    margin-right: 15px;
}

/* Tiers avec variables personnalisées */
.sp-offer-box .sp-tier-card {
    background: var(--sp-tier-bg, #f9fafb);
    border-color: var(--sp-tier-border, #e5e7eb);
    border-radius: var(--sp-tier-radius, 12px);
}

.sp-offer-box .sp-tier-card:hover {
    border-color: var(--sp-tier-border-active, var(--sp-primary));
}

.sp-offer-box .sp-tier-card.active {
    background: var(--sp-tier-bg-active, #fff7ed);
    border-color: var(--sp-tier-border-active, var(--sp-primary));
}

/* Bouton avec variables personnalisées */
.sp-offer-box .sp-add-to-cart-btn {
    border-radius: var(--sp-btn-radius, 12px);
    box-shadow: var(--sp-btn-shadow, 0 4px 15px rgba(254, 80, 0, 0.35));
}

.sp-offer-box .sp-add-to-cart-btn:hover {
    box-shadow: var(--sp-btn-shadow, 0 6px 20px rgba(254, 80, 0, 0.4));
}

/* Countdown avec variables personnalisées */
.sp-offer-box .sp-countdown-timer {
    background: var(--sp-countdown-bg, #fef3c7);
    color: var(--sp-countdown-text, #92400e);
}

/* Position du countdown */
.sp-countdown-top .sp-countdown-timer {
    order: -1;
    margin-bottom: 20px;
    margin-top: 0;
}

.sp-countdown-bottom .sp-countdown-timer {
    order: 10;
    margin-top: 20px;
    margin-bottom: 0;
}

/* Badge positions */
.sp-offer-box[data-badge-position="top-left"] .sp-badge-popular {
    left: 10px;
    right: auto;
    transform: none;
}

.sp-offer-box[data-badge-position="top-right"] .sp-badge-popular {
    left: auto;
    right: 10px;
    transform: none;
}

.sp-offer-box[data-badge-position="top-center"] .sp-badge-popular {
    left: 50%;
    transform: translateX(-50%);
}

/* Badge animations */
.sp-offer-box[data-badge-animation="pulse"] .sp-badge-popular {
    animation: sp-badge-pulse 2s ease-in-out infinite;
}

.sp-offer-box[data-badge-animation="bounce"] .sp-badge-popular {
    animation: sp-badge-bounce 1s ease-in-out infinite;
}

.sp-offer-box[data-badge-animation="shake"] .sp-badge-popular {
    animation: sp-badge-shake 0.5s ease-in-out infinite;
}

@keyframes sp-badge-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes sp-badge-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Animations d'entrée du widget */
.sp-anim-fadeIn {
    animation: sp-widget-fadeIn 0.6s ease forwards;
}

.sp-anim-slideUp {
    animation: sp-widget-slideUp 0.6s ease forwards;
}

.sp-anim-scaleIn {
    animation: sp-widget-scaleIn 0.5s ease forwards;
}

.sp-anim-bounceIn {
    animation: sp-widget-bounceIn 0.8s ease forwards;
}

@keyframes sp-widget-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sp-widget-slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sp-widget-scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes sp-widget-bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}