/*****************************************************************
    CONVERSION OPTIMIZATION CSS
    Features to maximize enquiries and reduce bounce rate
*****************************************************************/

/* Sticky CTA Bar - appears after scrolling */
.sticky-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #370b6f, #5a3d9e);
    color: #fff;
    padding: 15px 20px;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: none;
}

.sticky-cta-bar.show {
    transform: translateY(0);
    display: block;
}

.sticky-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    padding-right: 36px;
}

.sticky-cta-content {
    flex: 1;
    min-width: 200px;
}

.sticky-cta-content h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.sticky-cta-content p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.sticky-cta-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sticky-cta-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sticky-cta-btn-primary {
    background: #fff;
    color: #370b6f;
}

.sticky-cta-btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.sticky-cta-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sticky-cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sticky-cta-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.9;
    transition: opacity 0.2s, background 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sticky-cta-close:hover,
.sticky-cta-close:focus {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* Exit Intent Popup */
.exit-intent-modal {
    display: none;
    position: fixed;
    z-index: 100001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exit-intent-modal.show {
    display: flex;
    opacity: 1;
}

.exit-intent-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 20px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    animation: exitPopupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(55, 11, 111, 0.3);
}

@keyframes exitPopupSlideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.exit-intent-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.exit-intent-close:hover {
    color: #4a5568;
}

.exit-intent-icon {
    font-size: 48px;
    color: #7b68ee;
    margin-bottom: 20px;
}

.exit-intent-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.exit-intent-content p {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 25px;
    line-height: 1.6;
}

.exit-intent-offer {
    background: linear-gradient(135deg, #7b68ee, #6250d4);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.exit-intent-offer h3 {
    font-size: 22px;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.exit-intent-offer p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    color: #fff;
}

.exit-intent-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.exit-intent-btn {
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.exit-intent-btn-primary {
    background: #7b68ee;
    color: #fff;
}

.exit-intent-btn-primary:hover {
    background: #6250d4;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(123, 104, 238, 0.3);
}

.exit-intent-btn-secondary {
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.exit-intent-btn-secondary:hover {
    border-color: #cbd5e1;
    color: #475569;
}

/* Floating Call Button */
.floating-call-btn {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 9997;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
    }
    50% {
        box-shadow: 0 8px 32px rgba(16, 185, 129, 0.65);
    }
}

.floating-call-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 32px rgba(16, 185, 129, 0.55);
}

.floating-call-btn i {
    font-size: 26px;
}

/* Time-based engagement popup */
.engagement-popup {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9996;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 25px;
    max-width: 350px;
    transform: translateX(400px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid #7b68ee;
}

.engagement-popup.show {
    transform: translateX(0);
}

.engagement-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
}

.engagement-popup-close:hover {
    color: #4a5568;
}

.engagement-popup-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid #7b68ee;
}

.engagement-popup h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

.engagement-popup p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.5;
}

.engagement-popup-btn {
    width: 100%;
    padding: 12px;
    background: #7b68ee;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.engagement-popup-btn:hover {
    background: #6250d4;
    transform: translateY(-2px);
}

/* Trust indicators */
.trust-indicator-bar {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.trust-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-indicator-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.trust-indicator-item i {
    color: #10b981;
    font-size: 16px;
}

.trust-indicator-item strong {
    color: #1e293b;
}

/* Mobile responsive - COMPACT sticky bar (must not cover the page) */
@media only screen and (max-width: 767px) {
    .sticky-cta-bar {
        padding: 10px 12px 12px;
    }
    
    .sticky-cta-inner {
        gap: 8px;
        padding-right: 0;
        padding-top: 4px;
    }
    
    .sticky-cta-content {
        min-width: 0;
        flex: 1 1 100%;
        padding-right: 48px;
    }
    
    .sticky-cta-content h4 {
        font-size: 13px;
        margin: 0;
        line-height: 1.3;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    /* Hide the subtitle on mobile - saves a full line of space */
    .sticky-cta-content p {
        display: none;
    }
    
    .sticky-cta-buttons {
        width: 100%;
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .sticky-cta-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
        padding: 10px 8px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .sticky-cta-close {
        top: 6px;
        right: 6px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 26px;
        z-index: 10001;
    }
    
    /* When the sticky bar is visible, lift floating buttons above it
       so nothing overlaps and everything stays tappable */
    body.has-sticky-cta .wa-fab {
        bottom: 110px !important;
    }
    
    body.has-sticky-cta .floating-google-badge {
        bottom: 110px !important;
    }
    
    body.has-sticky-cta .floating-call-btn {
        bottom: 175px !important;
    }
    
    body.has-sticky-cta .wa-popup {
        bottom: 175px !important;
    }
    
    .exit-intent-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .exit-intent-content h2 {
        font-size: 22px;
    }
    
    .exit-intent-content p {
        font-size: 14px;
    }
    
    .exit-intent-offer h3 {
        font-size: 18px;
    }
    
    .exit-intent-buttons {
        flex-direction: column;
    }
    
    .exit-intent-btn {
        width: 100%;
        justify-content: center;
    }
    
    .floating-call-btn {
        width: 56px;
        height: 56px;
        bottom: 90px;
        right: 20px;
    }
    
    .floating-call-btn i {
        font-size: 24px;
    }
    
    .engagement-popup {
        bottom: 20px;
        right: 20px;
        max-width: calc(100% - 40px);
        padding: 20px;
    }
    
    .trust-indicators {
        gap: 15px;
        font-size: 11px;
    }
    
    .trust-indicator-item {
        font-size: 11px;
    }
}

@media only screen and (max-width: 479px) {
    /* Keep buttons side-by-side in ONE row - never stack vertically */
    .sticky-cta-btn {
        font-size: 11px;
        padding: 8px 8px;
    }
    
    .sticky-cta-btn i {
        font-size: 12px;
    }
    
    .exit-intent-icon {
        font-size: 40px;
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: 8px;
    }
}
