/* ===== ANIMATIONS ET INTERACTIONS ===== */

/* Animations au scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Animation décalée pour les grilles */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }

/* ===== ÉTATS DES BOUTONS ===== */
.btn-action.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-action.success {
    background: #27ae60 !important;
    color: white !important;
    transform: scale(1.1);
}

.btn-action.active {
    background: #e74c3c !important;
    color: white !important;
}

/* Animation bounce pour le compteur panier */
.cart-counter.bounce {
    animation: bounceScale 0.3s ease-out;
}

@keyframes bounceScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ===== SYSTÈME DE NOTIFICATIONS TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-out;
    border-left: 4px solid #3498db;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-content i {
    font-size: 1.2rem;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #333;
}

/* Types de toast */
.toast-success {
    border-left-color: #27ae60;
}

.toast-success .toast-content i {
    color: #27ae60;
}

.toast-error {
    border-left-color: #e74c3c;
}

.toast-error .toast-content i {
    color: #e74c3c;
}

.toast-warning {
    border-left-color: #f39c12;
}

.toast-warning .toast-content i {
    color: #f39c12;
}

.toast-info {
    border-left-color: #3498db;
}

.toast-info .toast-content i {
    color: #3498db;
}

/* ===== LAZY LOADING ===== */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* ===== ANIMATIONS DE CHARGEMENT ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== EFFETS DE SURVOL AVANCÉS ===== */
.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::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 ease;
    z-index: 1;
}

.product-card:hover::before {
    left: 100%;
}

/* Animation des badges produits */
.product-badge {
    animation: pulse 2s infinite;
}

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

/* ===== ANIMATIONS DES SECTIONS ===== */
.section-header {
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.6s ease;
}

.section-header.animate-in::after {
    width: 60px;
}

/* ===== MICRO-INTERACTIONS ===== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Animation des icônes */
.service-icon {
    position: relative;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon::before {
    transform: translate(-50%, -50%) scale(1.2);
}

/* ===== ANIMATIONS RESPONSIVES ===== */
@media (max-width: 768px) {
    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .toast {
        transform: translateY(-100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* ===== PRÉFÉRENCES D'ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .toast,
    .btn,
    .product-card,
    .service-icon {
        transition: none !important;
        animation: none !important;
    }
    
    .hero-section {
        transform: none !important;
    }
}

/* ===== ÉTATS DE FOCUS POUR L'ACCESSIBILITÉ ===== */
.btn:focus,
.btn-action:focus,
.toast-close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== ANIMATIONS DE CHARGEMENT DE PAGE ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    width: 100px;
    height: 100px;
    animation: logoSpin 2s ease-in-out infinite;
}

@keyframes logoSpin {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}