/* Sticky CTA Button Plugin Styles */

/* ---------------------------------------------------------------------------
 * Button group (cluster)
 * ------------------------------------------------------------------------- */
.wp-sticky-cluster {
    position: fixed;
    z-index: 9999;
    display: flex;
    gap: 10px;
    margin: 0;
    box-sizing: border-box;
}

.wp-sticky-cluster.layout-vertical {
    flex-direction: column;
}

.wp-sticky-cluster.layout-horizontal {
    flex-direction: row;
    align-items: center;
}

/* Cross-axis alignment for vertical stacks, derived from the chosen corner */
.wp-sticky-cluster.layout-vertical.align-start  { align-items: flex-start; }
.wp-sticky-cluster.layout-vertical.align-center { align-items: center; }
.wp-sticky-cluster.layout-vertical.align-end    { align-items: flex-end; }

/* ---------------------------------------------------------------------------
 * Shared button base
 * ------------------------------------------------------------------------- */
.wp-sticky-button {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    border: none;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
}

.wp-sticky-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wp-sticky-button i {
    font-size: 16px;
    line-height: 1;
}

/* ---------------------------------------------------------------------------
 * CTA buttons (anchors)
 * ------------------------------------------------------------------------- */
.wp-sticky-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 25px;
    text-decoration: none;
    white-space: nowrap;
    /* Hidden by default; revealed on scroll or made visible by "always" mode */
    opacity: 0;
    visibility: hidden;
}

.wp-sticky-cta span {
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
 * Back to top button
 * ------------------------------------------------------------------------- */
.wp-sticky-back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
}

.wp-sticky-back-to-top:hover {
    transform: translateY(-3px) scale(1.05);
}

/* ---------------------------------------------------------------------------
 * Visibility states
 * ------------------------------------------------------------------------- */
.wp-sticky-cta.show,
.wp-sticky-back-to-top.show,
[data-display-behavior="always"] .wp-sticky-cta,
[data-display-behavior="always"] .wp-sticky-back-to-top {
    opacity: 1;
    visibility: visible;
}

@keyframes wpStickyFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wp-sticky-cta.show,
.wp-sticky-back-to-top.show {
    animation: wpStickyFadeInUp 0.3s ease;
}

/* Horizontal layout: visually join the buttons */
.wp-sticky-cluster.layout-horizontal .wp-sticky-cta:not(:only-of-type) {
    border-radius: 25px 10px 10px 25px;
}

/* ---------------------------------------------------------------------------
 * Default responsive behaviour (used when the mobile bar is NOT enabled).
 * Collapses CTAs to icon-only circles on small screens.
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .wp-sticky-cluster:not(.mobile-bar-on) .wp-sticky-cta {
        width: 48px;
        min-width: 48px;
        height: 48px;
        min-height: 48px;
        padding: 0;
        border-radius: 50%;
    }

    .wp-sticky-cluster:not(.mobile-bar-on) .wp-sticky-cta span {
        display: none;
    }

    .wp-sticky-cluster:not(.mobile-bar-on) .wp-sticky-back-to-top {
        width: 48px;
        height: 48px;
    }
}

/* ---------------------------------------------------------------------------
 * Accessibility
 * ------------------------------------------------------------------------- */
.wp-sticky-button:focus-visible {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .wp-sticky-button {
        border: 2px solid currentColor;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wp-sticky-button {
        transition: none;
    }
    .wp-sticky-button:hover {
        transform: none;
    }
    .wp-sticky-cta.show,
    .wp-sticky-back-to-top.show {
        animation: none;
    }
}

@media print {
    .wp-sticky-cluster {
        display: none !important;
    }
}

/* ---------------------------------------------------------------------------
 * Icon mappings (lightweight Unicode/emoji fallback — no external font needed)
 * ------------------------------------------------------------------------- */
.wp-sticky-button i[class*="fa-"] {
    font-style: normal;
    font-weight: normal;
    display: inline-block;
    text-decoration: inherit;
    line-height: normal;
    vertical-align: baseline;
}

.fa-rocket:before { content: "\1F680"; }
.fa-download:before { content: "\2B07"; }
.fa-phone:before { content: "\1F4DE"; }
.fa-envelope:before { content: "\2709"; }
.fa-shopping-cart:before { content: "\1F6D2"; }
.fa-play:before { content: "\25B6"; }
.fa-star:before { content: "\2B50"; }
.fa-heart:before { content: "\2764"; }
.fa-thumbs-up:before { content: "\1F44D"; }
.fa-fire:before { content: "\1F525"; }
.fa-bolt:before { content: "\26A1"; }
.fa-gift:before { content: "\1F381"; }
.fa-bullhorn:before { content: "\1F4E2"; }
.fa-comment:before { content: "\1F4AC"; }
.fa-user:before { content: "\1F464"; }
.fa-cog:before { content: "\2699"; }

/* Back to top icons */
.fa-chevron-up:before { content: "\25B2"; }
.fa-arrow-up:before { content: "\2191"; }
.fa-angle-up:before { content: "\02C4"; }
.fa-caret-up:before { content: "\25B2"; }
.fa-angle-double-up:before { content: "\2303"; }
.fa-long-arrow-alt-up:before { content: "\21E7"; }
.fa-sort-up:before { content: "\25B2"; }
.fa-level-up-alt:before { content: "\2197"; }
