/**
 * Zavora 360 — frontend button styles.
 *
 * Loaded only on pages where the button actually renders (enqueue is
 * gated server-side by Z360_Widget::should_render_floating + the shortcode
 * handler).
 *
 * Background color is NOT in this file — it's set inline via the button's
 * style="" attribute so per-site customisation works without a custom
 * stylesheet. Everything else (size, position, hover, focus, type) lives
 * here.
 *
 * Class naming: z360- prefix on everything. The button has both a position
 * class (z360-btn-bottom-right, etc) and a size class (z360-btn-small, etc)
 * stacked. Inline / shortcode placement uses z360-btn--inline INSTEAD of a
 * position class (BEM-flavoured modifier so it's visually distinct).
 */

/* ─── Base button ─────────────────────────────────────────────────────── */
/* Shared by both floating and inline placements. */

.z360-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-align: center;
    white-space: nowrap;
    /* Reset link defaults that some themes apply globally. */
    box-sizing: border-box;
}

.z360-btn:hover,
.z360-btn:focus {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    outline: none;
}

.z360-btn:focus-visible {
    /* Accessibility — keyboard users need a visible focus ring. */
    outline: 3px solid rgba(29, 78, 216, 0.6);
    outline-offset: 2px;
}

.z360-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* ─── Size variants ──────────────────────────────────────────────────── */

.z360-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.z360-btn-medium {
    padding: 12px 22px;
    font-size: 15px;
}

.z360-btn-large {
    padding: 16px 28px;
    font-size: 17px;
}

/* ─── Floating positions ─────────────────────────────────────────────── */
/* position: fixed pins to the viewport; z-index high enough to clear
   anything reasonable (cookie banners, modals from most themes/plugins). */

.z360-btn-bottom-right,
.z360-btn-bottom-left,
.z360-btn-top-right,
.z360-btn-top-left {
    position: fixed;
    z-index: 2147483640;     /* one short of INT32_MAX — leave headroom for emergency overrides */
}

.z360-btn-bottom-right {
    bottom: 24px;
    right: 24px;
}

.z360-btn-bottom-left {
    bottom: 24px;
    left: 24px;
}

.z360-btn-top-right {
    top: 24px;
    right: 24px;
}

.z360-btn-top-left {
    top: 24px;
    left: 24px;
}

/* ─── Inline (shortcode) variant ─────────────────────────────────────── */
/* No position:fixed — flows with the surrounding content. Slight vertical
   margin so it doesn't crowd adjacent paragraphs. */

.z360-btn--inline {
    position: static;
    margin: 8px 0;
    vertical-align: middle;
}

/* ─── Mobile tweaks ──────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .z360-btn-bottom-right,
    .z360-btn-bottom-left {
        bottom: 16px;
    }
    .z360-btn-bottom-right,
    .z360-btn-top-right {
        right: 16px;
    }
    .z360-btn-bottom-left,
    .z360-btn-top-left {
        left: 16px;
    }
    .z360-btn-top-right,
    .z360-btn-top-left {
        top: 16px;
    }
    .z360-btn-large {
        /* Cap the large variant on small screens — full-size eats the
           viewport. */
        padding: 13px 22px;
        font-size: 15px;
    }
}

/* ─── Print ──────────────────────────────────────────────────────────── */
/* No floating button in printouts — visually noisy and the link
   doesn't work on paper. Inline shortcode variant prints fine since
   the author placed it deliberately. */

@media print {
    .z360-btn-bottom-right,
    .z360-btn-bottom-left,
    .z360-btn-top-right,
    .z360-btn-top-left {
        display: none !important;
    }
}

/* ─── Reduced motion ─────────────────────────────────────────────────── */
/* Respect prefers-reduced-motion: drop the hover lift animation. */

@media (prefers-reduced-motion: reduce) {
    .z360-btn {
        transition: none;
    }
    .z360-btn:hover,
    .z360-btn:focus {
        transform: none;
    }
}
