/* ========================================
   MABROUK FOMO PRO - STYLES OPTIMISÉS
   Version 1.1.0 - Expérience client maximale
   ======================================== */

/* ========================================
   1. BANDEAU DÉFILANT (TICKER)
   ======================================== */

.fomo-ticker-wrapper {
    background: #1a1a1a;
    overflow: hidden;
    padding: 12px 0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fomo-ticker {
    display: flex;
    animation: scroll-ticker 35s linear infinite;
    white-space: nowrap;
}

.fomo-ticker-item {
    display: inline-block;
    padding: 0 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: white;
    letter-spacing: 0.5px;
}

@keyframes scroll-ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.fomo-ticker-wrapper:hover .fomo-ticker {
    animation-play-state: paused;
}

/* ========================================
   2. BADGE "NOUVEAU" SUR PRODUITS
   ======================================== */

.new-badge-mabrouk {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1a1a1a;
    color: white;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    z-index: 10;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.new-badge-mabrouk.single {
    top: 15px;
    left: 15px;
    font-size: 11px;
    padding: 6px 14px;
}

/* ========================================
   3. BADGE STOCK LIMITÉ
   ======================================== */

.stock-urgency-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff5722 0%, #ff9800 100%);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    margin: 10px 0 15px 0;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
    animation: shake 3s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

/* Barre de progression du stock */
.stock-progress-wrapper {
    margin: 15px 0 20px 0;
}

.stock-progress-label {
    display: flex;
    justify-content: space-between;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    margin-bottom: 8px;
    color: #666;
}

.stock-progress-label span:last-child {
    font-weight: 600;
    color: #ff5722;
}

.stock-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.stock-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff5722 0%, #ff9800 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

/* ========================================
   4. BADGE VENTES RÉCENTES
   ======================================== */

.recent-sales-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    color: #e65100;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    border-radius: 15px;
    margin: 5px 0 10px 0;
}

/* ========================================
   5. COMPTEUR DE VIEWERS (OPTIMISÉ)
   ======================================== */

.viewers-counter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    margin: 12px 0 8px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: #666;
    transition: all 0.3s ease;
}

.viewers-counter:hover {
    background: #f0f0f0;
    border-color: #d8d8d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    animation: blink-subtle 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes blink-subtle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0);
    }
}

.viewer-count {
    font-weight: 600;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

/* ========================================
   6. NOTIFICATIONS FOMO (BAS GAUCHE)
   ======================================== */

#mabrouk-fomo-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: 350px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: none;
    z-index: 99999;
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: 'Poppins', sans-serif;
    border-left: 4px solid #ff9c81;
}

#mabrouk-fomo-notification.show {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.fomo-notification-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fomo-notification-content {
    flex: 1;
}

.fomo-notification-text {
    font-size: 12px;
    color: #666;
    margin: 0 0 5px 0;
    line-height: 1.4;
}

.fomo-notification-product {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 5px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fomo-notification-time {
    font-size: 11px;
    color: #999;
    margin: 5px 0 0 0;
}

.fomo-notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.fomo-notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

/* Animations des notifications */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-100px) scale(0.8);
    }
}

#mabrouk-fomo-notification.hiding {
    animation: slideOutLeft 0.3s ease-out forwards;
}

/* ========================================
   7. OPTIMISATIONS ESPACEMENT
   ======================================== */

/* Réduire l'espace après la galerie produit */
.woocommerce-product-gallery {
    margin-bottom: 30px !important;
}

/* Réduire l'espace avant "S'assortit parfaitement" */
.related.products,
.upsells.products,
.product-content-bottom,
.product-related-wrapper {
    margin-top: 30px !important;
    padding-top: 20px !important;
}

/* Espacer les onglets Matière/Composition */
.woocommerce-tabs {
    margin-top: 25px !important;
}

/* Assurer que tout est bien aligné */
.summary.entry-summary {
    padding-bottom: 20px;
}

/* Éviter les doubles marges */
.product_meta {
    margin-bottom: 15px !important;
}

/* ========================================
   8. AMÉLIORATIONS UX TAILLES
   ======================================== */

/* Style des tailles en rupture de stock */
.variations_form .value select option:disabled {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Si les tailles sont des boutons */
button.variation-selector:disabled,
.size-selector.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

button.variation-selector:disabled::after,
.size-selector.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 1px;
    background: #999;
    transform: translateY(-50%) rotate(-12deg);
}

/* ========================================
   9. POLISH GÉNÉRAL
   ======================================== */

/* Smooth scrolling pour toute la page */
html {
    scroll-behavior: smooth;
}

/* Améliorer la lisibilité des prix */
.woocommerce-Price-amount {
    font-weight: 600;
}

/* Badge promo plus visible */
.onsale {
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ========================================
   10. RESPONSIVE OPTIMISÉ
   ======================================== */

@media (max-width: 768px) {
    /* Ticker */
    .fomo-ticker-item {
        font-size: 11px;
        padding: 0 30px;
    }
    
    /* Badge nouveau */
    .new-badge-mabrouk {
        font-size: 9px;
        padding: 4px 10px;
    }
    
    /* Stock badge */
    .stock-urgency-badge {
        font-size: 11px;
        padding: 6px 14px;
    }
    
    /* Ventes récentes */
    .recent-sales-badge {
        font-size: 10px;
        padding: 5px 12px;
    }
    
    /* Viewers counter */
    .viewers-counter {
        font-size: 10px;
        padding: 6px 12px;
        margin: 10px 0 6px 0;
    }
    
    .live-dot {
        width: 5px;
        height: 5px;
    }
    
    /* Notifications */
    #mabrouk-fomo-notification {
        max-width: 300px;
        bottom: 15px;
        left: 15px;
        padding: 14px;
        border-radius: 8px;
    }
    
    .fomo-notification-image {
        width: 55px;
        height: 55px;
    }
    
    .fomo-notification-text {
        font-size: 11px;
    }
    
    .fomo-notification-product {
        font-size: 12px;
    }
    
    .fomo-notification-time {
        font-size: 10px;
    }
    
    /* Réduire l'espace sur mobile */
    .woocommerce-product-gallery {
        margin-bottom: 20px !important;
    }
    
    .related.products,
    .upsells.products {
        margin-top: 25px !important;
        padding-top: 15px !important;
    }
}

@media (max-width: 480px) {
    /* Ticker ultra compact */
    .fomo-ticker-item {
        font-size: 10px;
        padding: 0 25px;
    }
    
    /* Compteur viewers encore plus petit */
    .viewers-counter {
        font-size: 9px;
        padding: 5px 10px;
    }
    
    .live-dot {
        width: 4px;
        height: 4px;
    }
    
    /* Notifications compactes */
    #mabrouk-fomo-notification {
        max-width: 280px;
        bottom: 10px;
        left: 10px;
        padding: 12px;
    }
    
    .fomo-notification-image {
        width: 50px;
        height: 50px;
    }
}

/* ========================================
   11. PERFORMANCE & ACCESSIBILITÉ
   ======================================== */

/* Préférence mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mode sombre (si le site le supporte) */
@media (prefers-color-scheme: dark) {
    .viewers-counter {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
    }
    
    .viewer-count {
        color: white;
    }
}

/* Focus visible pour accessibilité */
.fomo-notification-close:focus-visible {
    outline: 2px solid #ff9c81;
    outline-offset: 2px;
}

/* ========================================
   FIN DES STYLES
   ======================================== */