/* ====================================
   PCEFACT PERU - Engagement System
   Popups, Barra Notificaciones, Testimonios
   ==================================== */

/* ===== OVERLAY COMUN ===== */
.engagement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: engFadeIn 0.3s ease;
}
.engagement-overlay.active {
    display: flex;
}

@keyframes engFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== POPUP CARD ===== */
.engagement-popup-card {
    background: #fff;
    border-radius: 20px;
    max-width: 480px;
    width: 92%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: engSlideUp 0.4s ease;
}

@keyframes engSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.engagement-popup-header {
    background: linear-gradient(135deg, #0056b3, #004494);
    padding: 30px 30px 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.engagement-popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.engagement-popup-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.engagement-popup-header .popup-icon {
    font-size: 48px;
    color: #fff;
    margin-bottom: 10px;
    display: block;
    position: relative;
    z-index: 1;
}
.engagement-popup-header h3 {
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}
.engagement-popup-header p {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    margin: 8px 0 0;
    position: relative;
    z-index: 1;
}

.engagement-popup-body {
    padding: 25px 30px 30px;
}

.engagement-popup-body .popup-offer {
    background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
    border: 2px solid #0056b3;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
}
.engagement-popup-body .popup-offer .offer-badge {
    display: inline-block;
    background: #0056b3;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.engagement-popup-body .popup-offer .offer-text {
    color: #0056b3;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
}

.engagement-form-group {
    margin-bottom: 12px;
}
.engagement-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.engagement-form-group input:focus {
    border-color: #0056b3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,86,179,0.1);
}
.engagement-form-group input::placeholder {
    color: #999;
}

.engagement-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0056b3, #0070e0);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.engagement-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,86,179,0.4);
}
.engagement-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.engagement-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}
.engagement-close-btn:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

.engagement-skip {
    text-align: center;
    margin-top: 12px;
}
.engagement-skip a {
    color: #888;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}
.engagement-skip a:hover {
    color: #555;
}

.engagement-benefits {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.engagement-benefit-tag {
    background: #f0f7ff;
    color: #0056b3;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.engagement-benefit-tag i {
    color: #28a745;
    font-size: 0.7rem;
}

/* ===== EXIT INTENT EXTRAS ===== */
.exit-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    color: #856404;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}
.exit-countdown i {
    color: #dc3545;
}
.exit-countdown #exitCountdown {
    font-weight: 800;
    color: #dc3545;
}

/* Success state */
.engagement-success {
    text-align: center;
    padding: 20px 0;
}
.engagement-success .success-icon {
    font-size: 56px;
    color: #28a745;
    margin-bottom: 15px;
    display: block;
}
.engagement-success h4 {
    color: #333;
    font-weight: 700;
    margin-bottom: 8px;
}
.engagement-success p {
    color: #666;
    font-size: 0.95rem;
}

/* ===== BARRA DE NOTIFICACIONES ===== */
.notification-bar {
    padding: 10px 0;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    z-index: 1100;
    animation: notifSlideDown 0.5s ease;
    font-family: 'Poppins', sans-serif;
}
.notification-bar.hidden {
    display: none;
}

@keyframes notifSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.notification-bar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.notification-bar .notif-text {
    flex: 0 1 auto;
    text-align: center;
}
.notification-bar .notif-text i {
    margin-right: 6px;
}
.notification-bar .btn-notif {
    background: rgba(255,255,255,0.95);
    color: #0056b3;
    border: none;
    padding: 5px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.notification-bar .btn-notif:hover {
    background: #fff;
    transform: scale(1.05);
    color: #0056b3;
}
.notification-bar .btn-close-notif {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}
.notification-bar .btn-close-notif:hover {
    color: #fff;
}

/* ===== TESTIMONIOS SECTION ===== */
.testimonios-section {
    padding: 80px 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
}
.testimonios-section .section-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(0,86,179,0.1), rgba(0,68,148,0.05));
    color: #0056b3;
    padding: 6px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}
.testimonios-section .section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 10px;
}
.testimonios-section .section-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.testimonio-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    height: 100%;
    transition: all 0.3s;
    position: relative;
}
.testimonio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.testimonio-card::before {
    content: '\201C';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 4rem;
    color: rgba(0,86,179,0.08);
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonio-stars {
    margin-bottom: 15px;
}
.testimonio-stars i {
    color: #ffc107;
    font-size: 0.9rem;
}
.testimonio-stars i.empty {
    color: #ddd;
}

.testimonio-text {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonio-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}
.testimonio-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0056b3, #0070e0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.testimonio-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.testimonio-info h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}
.testimonio-info p {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: #888;
}

/* Carousel controls */
.testimonios-carousel .carousel-control-prev,
.testimonios-carousel .carousel-control-next {
    width: 44px;
    height: 44px;
    background: #0056b3;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0,86,179,0.3);
    transition: all 0.3s;
}
.testimonios-carousel .carousel-control-prev { left: -22px; }
.testimonios-carousel .carousel-control-next { right: -22px; }
.testimonios-carousel .carousel-control-prev:hover,
.testimonios-carousel .carousel-control-next:hover {
    background: #004494;
    transform: translateY(-50%) scale(1.1);
}

.testimonios-carousel .carousel-indicators {
    bottom: -45px;
}
.testimonios-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    margin: 0 4px;
}
.testimonios-carousel .carousel-indicators button.active {
    background: #0056b3;
    width: 28px;
    border-radius: 5px;
}

/* Stats bar */
.testimonios-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.testimonios-stat-item {
    text-align: center;
}
.testimonios-stat-item .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0056b3;
    display: block;
}
.testimonios-stat-item .stat-label {
    font-size: 0.85rem;
    color: #888;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .engagement-popup-card {
        max-width: 95%;
        border-radius: 16px;
    }
    .engagement-popup-header {
        padding: 25px 20px 20px;
    }
    .engagement-popup-header .popup-icon {
        font-size: 36px;
    }
    .engagement-popup-header h3 {
        font-size: 1.25rem;
    }
    .engagement-popup-body {
        padding: 20px;
    }
    .engagement-benefits {
        justify-content: center;
    }

    .notification-bar {
        font-size: 0.82rem;
        padding: 8px 0;
    }
    .notification-bar .container {
        padding: 0 15px;
    }

    .testimonios-section {
        padding: 50px 0;
    }
    .testimonios-section .section-title {
        font-size: 1.6rem;
    }
    .testimonio-card {
        padding: 20px;
    }
    .testimonios-carousel .carousel-control-prev,
    .testimonios-carousel .carousel-control-next {
        display: none;
    }
    .testimonios-stats {
        gap: 20px;
        flex-wrap: wrap;
    }
    .testimonios-stat-item .stat-number {
        font-size: 1.4rem;
    }
}

@media (max-width: 575.98px) {
    .engagement-popup-header h3 {
        font-size: 1.1rem;
    }
    .engagement-popup-body .popup-offer .offer-text {
        font-size: 0.95rem;
    }
}
