/* WhatsApp Popup Styles */
.whatsapp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh; /* Hauteur viewport pour mobile */
    height: 100dvh; /* Dynamic viewport pour navigateurs modernes */
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll sur iOS */
}

.whatsapp-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.whatsapp-popup {
    background: #2a2a2a;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    margin: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.whatsapp-popup-overlay.show .whatsapp-popup {
    transform: scale(1);
}

.whatsapp-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent; /* Supprime highlight sur mobile */
    touch-action: manipulation; /* Améliore le toucher */
}

.whatsapp-popup-close:hover,
.whatsapp-popup-close:active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
}

.whatsapp-popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

.whatsapp-popup-content {
    padding: 50px 40px 40px;
    text-align: center;
}

.whatsapp-popup-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 10px 40px rgba(37, 211, 102, 0.3);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(37, 211, 102, 0.3);
    }
    50% {
        box-shadow: 0 10px 60px rgba(37, 211, 102, 0.5);
    }
}

.whatsapp-popup-icon i {
    font-size: 50px;
    color: white;
}

.whatsapp-popup-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.whatsapp-popup h2 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.whatsapp-popup-highlight {
    color: #25D366;
    display: block;
    font-size: 36px;
}

.whatsapp-popup p {
    color: #b0b0b0;
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 35px;
}

.whatsapp-popup-benefits {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.whatsapp-popup-benefit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 15px;
}

.whatsapp-popup-benefit:last-child {
    margin-bottom: 0;
}

.whatsapp-popup-benefit i {
    color: #25D366;
    font-size: 18px;
}

.whatsapp-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whatsapp-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.whatsapp-popup-btn-primary {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    position: relative;
    overflow: hidden;
}

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

.whatsapp-popup-btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Desktop hover effects */
@media (hover: hover) {
    .whatsapp-popup-btn-primary:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 35px rgba(37, 211, 102, 0.5);
    }
    
    .whatsapp-popup-btn-secondary:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        border-color: #777;
    }
}

.whatsapp-popup-btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-popup-btn-secondary {
    background: transparent;
    color: #888;
    border: 2px solid #444;
    font-weight: 600;
    transition: all 0.3s ease;
}

.whatsapp-popup-btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.whatsapp-popup-btn i {
    margin-right: 10px;
    font-size: 20px;
}

.whatsapp-popup-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FFD700;
    font-size: 14px;
    font-weight: 600;
    margin-top: 15px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.whatsapp-popup-timer i {
    font-size: 16px;
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .whatsapp-popup {
        max-width: 540px;
    }
    
    .whatsapp-popup-close {
        width: 48px;
        height: 48px;
        font-size: 32px;
        top: 18px;
        right: 18px;
    }
    
    .whatsapp-popup-close:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: rotate(90deg) scale(1.15);
    }
    
    .whatsapp-popup-content {
        padding: 55px 45px 45px;
    }
    
    .whatsapp-popup-icon {
        width: 110px;
        height: 110px;
        margin-bottom: 35px;
    }
    
    .whatsapp-popup-icon i {
        font-size: 55px;
    }
    
    .whatsapp-popup h2 {
        font-size: 34px;
    }
    
    .whatsapp-popup-highlight {
        font-size: 38px;
    }
    
    .whatsapp-popup p {
        font-size: 18px;
    }
    
    .whatsapp-popup-btn {
        padding: 19px 45px;
        font-size: 18px;
    }
    
    .whatsapp-popup-btn:hover {
        transform: translateY(-2px);
    }
    
    .whatsapp-popup-benefit {
        font-size: 16px;
    }
}

/* Tablet Responsive */
@media (min-width: 641px) and (max-width: 1023px) {
    .whatsapp-popup {
        max-width: 520px;
    }
    
    .whatsapp-popup-close {
        width: 46px;
        height: 46px;
        font-size: 30px;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .whatsapp-popup-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: max(10px, env(safe-area-inset-top)); /* Support notch iPhone */
    }
    
    .whatsapp-popup {
        width: 100%;
        max-height: none;
        margin: 10px 0;
        border-radius: 20px;
    }
    
    .whatsapp-popup-content {
        padding: 60px 20px 25px;
    }
    
    .whatsapp-popup-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 24px;
        background: rgba(255, 255, 255, 0.15);
    }
    
    .whatsapp-popup h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .whatsapp-popup-highlight {
        font-size: 26px;
    }
    
    .whatsapp-popup p {
        font-size: 15px;
        margin-bottom: 25px;
    }
    
    .whatsapp-popup-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .whatsapp-popup-icon i {
        font-size: 35px;
    }
    
    .whatsapp-popup-badge {
        font-size: 11px;
        padding: 6px 16px;
        margin-bottom: 15px;
    }
    
    .whatsapp-popup-benefits {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .whatsapp-popup-benefit {
        font-size: 14px;
        margin-bottom: 10px;
        gap: 8px;
    }
    
    .whatsapp-popup-benefit i {
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .whatsapp-popup-btn {
        padding: 16px 25px;
        font-size: 15px;
        font-weight: 700;
    }
    
    .whatsapp-popup-btn i {
        font-size: 18px;
        margin-right: 8px;
    }
    
    .whatsapp-popup-timer {
        font-size: 12px;
        margin-top: 12px;
    }
    
    .whatsapp-popup-buttons {
        gap: 10px;
    }
}

/* Très petits écrans */
@media (max-width: 380px) {
    .whatsapp-popup-content {
        padding: 55px 15px 20px;
    }
    
    .whatsapp-popup h2 {
        font-size: 22px;
    }
    
    .whatsapp-popup-highlight {
        font-size: 24px;
    }
    
    .whatsapp-popup-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Mode paysage mobile */
@media (max-width: 900px) and (max-height: 500px) {
    .whatsapp-popup-overlay {
        align-items: flex-start;
    }
    
    .whatsapp-popup {
        max-height: 95vh;
        margin: 10px auto;
    }
    
    .whatsapp-popup-content {
        padding: 50px 25px 20px;
    }
    
    .whatsapp-popup-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .whatsapp-popup-icon i {
        font-size: 30px;
    }
    
    .whatsapp-popup h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .whatsapp-popup p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .whatsapp-popup-benefits {
        padding: 12px;
        margin-bottom: 15px;
    }
}

/* Animation d'entrée */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
