/* Sticky CTA bar — bottom on mobile, top strip on desktop.

   Design principles applied (from conversion-rate-optimization skill):
     - Single primary CTA per viewport (the only above-fold action)
     - Action verb + value: "Compare flights now" not "Submit"
     - Dismissible (respects user friction limits)
     - Tracks impression + click separately so we can compute CTR
     - Doesn't interfere with the main reading area: bottom-anchored
       on mobile so it doesn't cover the start of the article

   OKLCH brand-aligned: purple→blue gradient matches the existing
   header gradient + Learn-menu accent. */

.sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: stretch;
    background: linear-gradient(135deg,
        oklch(0.50 0.18 290),
        oklch(0.45 0.20 260));
    color: #fff;
    box-shadow: 0 -8px 24px -8px rgba(15, 23, 42, 0.25);
    transform: translateY(0);
    transition: transform 0.25s ease;
}

.sticky-cta__main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.sticky-cta__badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(4px);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.sticky-cta__provider {
    font-size: 0.92rem;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-cta__btn {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.95rem;
    background: rgba(255, 255, 255, 0.95);
    color: oklch(0.40 0.18 285);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}

.sticky-cta__main:hover .sticky-cta__btn {
    background: #fff;
    transform: translateY(-1px);
}

.sticky-cta__dismiss {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 0 1rem;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 400;
    flex-shrink: 0;
    transition: color 0.15s;
}
.sticky-cta__dismiss:hover {
    color: #fff;
}

/* Mobile: bottom bar (covers iOS Safari home-indicator) */
@media (max-width: 640px) {
    .sticky-cta {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .sticky-cta__badge {
        display: none;  /* hide badge on small screens — provider+CTA only */
    }
    .sticky-cta__provider {
        font-size: 0.85rem;
    }
    .sticky-cta__btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Desktop: top sticky strip instead — feels less spammy and doesn't
   cover the article footer + Amazon-shelf at the bottom of long pages */
@media (min-width: 900px) {
    .sticky-cta {
        bottom: auto;
        top: 0;
        box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.22);
    }
    .sticky-cta__main {
        max-width: 1100px;
        margin: 0 auto;
        padding: 0.7rem 1.5rem;
    }
}

/* Provide a small top-of-page offset on desktop so the strip doesn't
   visually merge into the existing site header. */
@media (min-width: 900px) {
    body:has(.sticky-cta) .site-header,
    body:has(.sticky-cta) .header {
        top: 44px;  /* compensate for the strip height */
    }
}
