/* ============================================================
   FLYER POPUP STYLES – Dayspring Heartcare
   ============================================================ */

/* ----- ROOT VARIABLES (Blue, Green, Red, White) ----- */
:root {
    --blue: #1e40af;
    --blue-light: #3b82f6;
    --blue-bg: #0f172a;
    --green: #059669;
    --green-light: #34d399;
    --red: #dc2626;
    --red-light: #f87171;
    --white: #ffffff;
    --gray-light: #f1f5f9;
    --gray-text: #475569;
}

/* ----- POPUP OVERLAY – HIDDEN BY DEFAULT ----- */
.flyer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none; /* ← HIDDEN BY DEFAULT – PAGE LOADS FIRST */
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 16px;
    animation: flyerFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* When shown (remove hidden class) */
.flyer-overlay.show {
    display: flex;
}

/* Fallback: if .hidden class is used */
.flyer-overlay.hidden {
    display: none !important;
}

@keyframes flyerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- POPUP CARD ----- */
.flyer-card {
    max-width: 480px;
    width: 100%;
    background: var(--white);
    border-radius: 48px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.flyer-card:hover {
    transform: translateY(-4px);
}

/* ----- HERO CAROUSEL ----- */
.flyer-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    background: #0f172a;
    overflow: hidden;
}
.flyer-carousel .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.flyer-carousel .slide.active {
    opacity: 1;
}
.flyer-carousel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.7) 100%);
    z-index: 2;
    pointer-events: none;
}
.flyer-carousel .carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}
.flyer-carousel .carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
    cursor: pointer;
}
.flyer-carousel .carousel-dots .dot.active {
    background: var(--white);
    width: 28px;
    border-color: var(--white);
}

/* ----- HEADER (Logo + Title) ----- */
.flyer-header {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.flyer-header .header-logo {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 60px;
    border: 2px solid rgba(255, 255, 255, 0.10);
    overflow: hidden;
}
.flyer-header .header-logo i {
    font-size: 2.2rem;
    color: var(--red-light);
    animation: flyerPulse 2s infinite;
}
.flyer-header .header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}
@keyframes flyerPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}
.flyer-header .header-text {
    flex: 1;
    min-width: 0;
}
.flyer-header .header-text h1 {
    font-size: clamp(1.0rem, 3.5vw, 1.6rem);
    font-weight: 900;
    line-height: 1.1;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.3px;
    margin: 0;
}
.flyer-header .header-text h1 .highlight-red {
    color: #fca5a5;
}
.flyer-header .header-text .sub-tag {
    display: block;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--green-light);
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 10px;
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.flyer-header .header-text .sub-tag i {
    margin-right: 4px;
    color: var(--blue-light);
}
.flyer-header .header-text .sub-tag .highlight-green {
    color: var(--green-light);
}

/* ----- CLOSE BUTTON ----- */
.flyer-close {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 10;
    background: rgba(220, 38, 38, 0.85);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 60px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.flyer-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--red);
}

/* ----- USP ROTATOR ----- */
.flyer-usp {
    background: var(--white);
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    min-height: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.flyer-usp .usp-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gray-text);
    font-weight: 700;
    margin-bottom: 4px;
}
.flyer-usp .usp-label i {
    color: var(--green);
    margin-right: 6px;
}
.flyer-usp .usp-text-wrapper {
    position: relative;
    width: 100%;
    text-align: center;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flyer-usp .usp-text {
    position: absolute;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--blue-bg);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    padding: 0 4px;
    width: 100%;
}
.flyer-usp .usp-text.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.flyer-usp .usp-text .usp-icon {
    color: var(--red);
    margin-right: 8px;
    font-size: 1rem;
}
.flyer-usp .usp-text .usp-highlight {
    color: var(--green);
    font-weight: 900;
}
.flyer-usp .usp-dots {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.flyer-usp .usp-dot {
    width: 8px;
    height: 8px;
    border-radius: 60px;
    background: #cbd5e1;
    transition: all 0.3s ease;
    cursor: pointer;
}
.flyer-usp .usp-dot.active {
    width: 22px;
    background: var(--blue);
}
.flyer-usp .usp-dot.active.green-dot {
    background: var(--green);
}
.flyer-usp .usp-dot.active.red-dot {
    background: var(--red);
}

/* ----- FEATURES ----- */
.flyer-features {
    padding: 14px 20px 8px 20px;
    background: var(--white);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
}
.flyer-features .feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-text);
}
.flyer-features .feature-item i {
    width: 30px;
    height: 30px;
    background: var(--gray-light);
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.flyer-features .feature-item i.fa-phone {
    color: var(--green);
}
.flyer-features .feature-item i.fa-envelope {
    color: var(--red);
}
.flyer-features .feature-item i.fa-location-dot {
    color: var(--blue);
}
.flyer-features .feature-item i.fa-globe {
    color: var(--green);
}
.flyer-features .feature-item .f-text {
    line-height: 1.3;
}
.flyer-features .feature-item .f-text small {
    display: block;
    font-weight: 400;
    font-size: 0.65rem;
    color: #94a3b8;
}

/* ----- DUAL CTA ----- */
.flyer-cta-wrap {
    padding: 8px 20px 16px 20px;
    background: var(--white);
}
.flyer-cta-wrap .cta-group {
    display: flex;
    gap: 10px;
    width: 100%;
}
.flyer-cta-wrap .cta-btn {
    flex: 1;
    text-align: center;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 14px 8px;
    border-radius: 60px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}
.flyer-cta-wrap .cta-red {
    background: var(--red);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}
.flyer-cta-wrap .cta-red:hover {
    background: #b91c1c;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}
.flyer-cta-wrap .cta-green {
    background: var(--green);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}
.flyer-cta-wrap .cta-green:hover {
    background: #047857;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.4);
}
.flyer-cta-wrap .cta-btn i {
    font-size: 1rem;
}

/* ----- SOCIAL FOOTER ----- */
.flyer-social {
    background: var(--white);
    padding: 10px 20px 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 2px solid #f1f5f9;
}
.flyer-social span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-text);
    letter-spacing: 0.5px;
}
.flyer-social span i {
    margin-right: 6px;
    color: var(--blue);
}
.flyer-social .social-icons {
    display: flex;
    gap: 10px;
}
.flyer-social .social-icons a {
    width: 42px;
    height: 42px;
    border-radius: 60px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--gray-text);
    transition: all 0.25s ease;
    text-decoration: none;
    border: 2px solid transparent;
}
.flyer-social .social-icons a.fb:hover {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}
.flyer-social .social-icons a.wa:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.3);
}
.flyer-social .social-icons a.x:hover {
    background: var(--red);
    color: white;
    border-color: var(--red);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}
.flyer-social .social-icons a.li:hover {
    background: #0a66c2;
    color: white;
    border-color: #0a66c2;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(10, 102, 194, 0.3);
}
.flyer-social .social-icons a.yt:hover {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 0, 0, 0.3);
}

/* ----- LOADING OVERLAY (for CTA redirects) ----- */
#flyerLoadingOverlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 50;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 48px;
}
#flyerLoadingOverlay.show {
    display: flex;
}
#flyerLoadingOverlay .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: flyerSpin 0.8s linear infinite;
}
#flyerLoadingOverlay p {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 16px 0 0 0;
}

@keyframes flyerSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ----- RESPONSIVE ----- */
@media (max-width: 520px) {
    .flyer-card {
        border-radius: 32px;
    }
    .flyer-carousel {
        height: 170px;
    }
    .flyer-header {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 8px 10px;
        gap: 10px;
        border-radius: 16px;
    }
    .flyer-header .header-logo {
        width: 44px;
        height: 44px;
    }
    .flyer-header .header-logo i {
        font-size: 1.8rem;
    }
    .flyer-header .header-text h1 {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }
    .flyer-header .header-text .sub-tag {
        font-size: 0.5rem;
        padding: 0px 8px;
    }
    .flyer-close {
        top: 12px;
        right: 14px;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .flyer-usp {
        padding: 12px 14px 8px 14px;
        min-height: 68px;
    }
    .flyer-usp .usp-text {
        font-size: 0.95rem;
    }
    .flyer-features {
        grid-template-columns: 1fr 1fr;
        padding: 10px 14px 6px 14px;
        gap: 4px 10px;
    }
    .flyer-features .feature-item {
        font-size: 0.72rem;
    }
    .flyer-features .feature-item i {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
    .flyer-cta-wrap {
        padding: 6px 14px 12px 14px;
    }
    .flyer-cta-wrap .cta-btn {
        font-size: 0.75rem;
        padding: 12px 4px;
        gap: 4px;
    }
    .flyer-cta-wrap .cta-btn i {
        font-size: 0.8rem;
    }
    .flyer-social {
        padding: 8px 14px 12px 14px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .flyer-social .social-icons {
        justify-content: center;
    }
    .flyer-social .social-icons a {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    .flyer-carousel .carousel-dots .dot {
        width: 8px;
        height: 8px;
    }
    .flyer-carousel .carousel-dots .dot.active {
        width: 20px;
    }
    #flyerLoadingOverlay {
        border-radius: 32px;
    }
}
@media (max-width: 380px) {
    .flyer-features {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .flyer-usp .usp-text {
        font-size: 0.85rem;
    }
    .flyer-cta-wrap .cta-group {
        flex-direction: column;
        gap: 8px;
    }
    .flyer-cta-wrap .cta-btn {
        font-size: 0.85rem;
        padding: 14px 0;
    }
}