/* Nutriforce Pop-ups - Frontend Styles */

.popnfup-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popnfup-popup.popnfup-active {
    opacity: 1;
    visibility: visible;
}

.popnfup-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Desktop: Image à gauche, contenu à droite */
.popnfup-popup-container {
    position: relative;
    display: flex;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.popnfup-popup.popnfup-active .popnfup-popup-container {
    transform: scale(1) translateY(0);
}

.popnfup-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.popnfup-popup-close:hover {
    background: #fff;
    transform: scale(1.1);
}

/* Image */
.popnfup-popup-image {
    flex: 0 0 45%;
    max-width: 45%;
    overflow: hidden;
}

.popnfup-popup-image img {
    width: 100%;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    display: block;
}

/* Image mobile cachée par défaut sur desktop */
.popnfup-popup-image .popnfup-img-mobile {
    display: none;
}

.popnfup-popup-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popnfup-popup-content h2 {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

.popnfup-popup-content p {
    margin: 0 0 16px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #444;
}

.popnfup-popup-content p:last-of-type {
    margin-bottom: 24px;
}

/* Buttons */
.popnfup-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popnfup-btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.popnfup-btn-primary {
    background: #111;
    color: #fff;
    border-color: #111;
}

.popnfup-btn-primary:hover {
    background: #333;
    border-color: #333;
    color: #fff;
    transform: translateY(-2px);
}

.popnfup-btn-secondary {
    background: transparent;
    color: #666;
    border-color: #ddd;
}

.popnfup-btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

/* Newsletter Form */
.popnfup-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popnfup-form-group {
    position: relative;
}

.popnfup-form-group input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.popnfup-form-group input[type="email"]:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.popnfup-form-group input[type="email"]::placeholder {
    color: #999;
}

.popnfup-form-success {
    text-align: center;
    color: #16a34a;
    font-weight: 600;
    padding: 20px;
    background: #f0fdf4;
    border-radius: 8px;
    margin-top: 8px;
}

/* ===================
   MOBILE
   =================== */
@media (max-width: 768px) {
    .popnfup-popup-container {
        flex-direction: column;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .popnfup-popup-image {
        flex: 0 0 auto;
        max-width: 100%;
        height: 185px;
    }

    /* Afficher image mobile, cacher image desktop */
    .popnfup-popup-image .popnfup-img-desktop {
        display: none;
    }

    .popnfup-popup-image .popnfup-img-mobile {
        display: block;
    }

    .popnfup-popup-content {
        padding: 24px;
    }

    .popnfup-popup-content h2 {
        font-size: 22px;
    }

    .popnfup-popup-content p {
        font-size: 14px;
    }

    .popnfup-popup-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .popnfup-popup-content {
        padding: 20px;
    }

    .popnfup-popup-content h2 {
        font-size: 20px;
    }

    .popnfup-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .popnfup-popup-image {
        height: 200px;
    }
}

/* Animation d'entrée */
@keyframes popnfup-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popnfup-fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes popnfup-slideUp {
    from { transform: scale(0.9) translateY(30px); }
    to { transform: scale(1) translateY(0); }
}

@keyframes popnfup-slideDown {
    from { transform: scale(1) translateY(0); }
    to { transform: scale(0.9) translateY(30px); }
}

.popnfup-popup.popnfup-active {
    animation: popnfup-fadeIn 0.3s ease forwards;
}

.popnfup-popup.popnfup-active .popnfup-popup-container {
    animation: popnfup-slideUp 0.4s ease forwards;
}

/* Animation de sortie */
.popnfup-popup.popnfup-closing {
    animation: popnfup-fadeOut 0.25s ease forwards;
}

.popnfup-popup.popnfup-closing .popnfup-popup-container {
    animation: popnfup-slideDown 0.25s ease forwards;
}
