/* ============================================================
   Contact Float Button — Frontend Styles v1.2.0
   ============================================================ */

/* ── Button base ───────────────────────────────────────────── */
.cfb-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9990;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* Smooth transitions for hover color changes */
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.3s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    outline: none;
}

.cfb-btn:hover {
    transform: scale(1.08);
    /* background/color overridden by PHP inline CSS */
}

/* focus-visible: same appearance as base — no ring, no color change */
.cfb-btn:focus-visible {
    outline: none;
    /* transform intentionally not applied on focus — keyboard UX stays calm */
}

/* ── Scrolling state: ring fades out while user scrolls ─── */
.cfb-btn--scrolling .cfb-btn__ring {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cfb-btn__ring {
    transition: opacity 0.35s ease;
}

.cfb-btn.cfb-btn--open {
    transform: scale(0.92);
}

/* ── Glass / Transparent mode ──────────────────────────────── */
/*
   mix-blend-mode on position:fixed elements blends against the viewport
   compositing layer, not the page content — this is a browser limitation
   that makes pure CSS blend unreliable for fixed buttons.

   Solution: lightweight JS reads page bg color via requestAnimationFrame
   (every frame while scrolling, idle otherwise). Ultra-responsive.
*/
.cfb-btn--blend {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.cfb-btn--blend .cfb-btn__icon  { transition: color 0.15s ease; }
.cfb-btn--blend .cfb-btn__ring text { transition: fill 0.15s ease; }

/* ── Icon ────────────────────────────────────────────────── */
.cfb-btn__icon {
    width: 26px;
    height: 26px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    transition: color 0.25s ease, transform 0.3s ease, opacity 0.3s ease;
}

.cfb-btn.cfb-btn--open .cfb-btn__icon {
    transform: scale(0.8);
    opacity: 0.6;
}

/* ── Rotating text ring ──────────────────────────────────── */
.cfb-btn__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    animation: cfb-spin 12s linear infinite;
    pointer-events: none;
}

.cfb-btn__ring text {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 2.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-transform: uppercase;
    transition: fill 0.25s ease;
}

.cfb-btn:hover .cfb-btn__ring,
.cfb-btn:focus-visible .cfb-btn__ring {
    animation-duration: 5s;
}

@keyframes cfb-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Overlay ─────────────────────────────────────────────── */
.cfb-overlay {
    position: fixed;
    inset: 0;
    z-index: 9980;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.cfb-overlay.cfb-overlay--visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Slide-in panel ──────────────────────────────────────── */
.cfb-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9995;
    width: min(460px, 100vw);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.cfb-panel.cfb-panel--open {
    transform: translateX(0);
}

.cfb-panel__inner {
    position: relative;
    height: 100%;
    background: #ffffff;
    box-shadow: -8px 0 48px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Panel header (colors overridden by inline CSS from PHP) */
.cfb-panel__header {
    padding: 40px 32px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    /* Default colors — overridden by PHP inline CSS */
    background: #ffffff;
    color: #1a1a2e;
}

.cfb-panel__header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
}

.cfb-panel__header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.7;
    color: inherit;
}

/* ── Close button ────────────────────────────────────────── */
.cfb-panel__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    /* Default colors overridden by PHP inline CSS */
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    padding: 0;
}

.cfb-panel__close:hover {
    opacity: 0.75;
    transform: rotate(90deg);
}

.cfb-panel__close svg {
    width: 16px;
    height: 16px;
    /* Default color overridden by PHP inline CSS */
    color: #555;
}

/* ── Panel form area ─────────────────────────────────────── */
.cfb-panel__form {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 40px;
    -webkit-overflow-scrolling: touch;
}

.cfb-panel__form::-webkit-scrollbar        { width: 4px; }
.cfb-panel__form::-webkit-scrollbar-track  { background: transparent; }
.cfb-panel__form::-webkit-scrollbar-thumb  { background: #e0e0e0; border-radius: 4px; }

/* ── Form field overrides ────────────────────────────────── */
.cfb-panel__form .wpcf7       { margin: 0; }
.cfb-panel__form .wpcf7-form  { display: flex; flex-direction: column; gap: 14px; }
.cfb-panel__form .wpcf7-form p { margin: 0; }

.cfb-panel__form input[type="text"],
.cfb-panel__form input[type="email"],
.cfb-panel__form input[type="tel"],
.cfb-panel__form input[type="url"],
.cfb-panel__form input[type="number"],
.cfb-panel__form select,
.cfb-panel__form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #2c3338;
    background: #fafafa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    outline: none;
    appearance: none;
}

.cfb-panel__form input:focus,
.cfb-panel__form select:focus,
.cfb-panel__form textarea:focus {
    border-color: #2ecc71;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.cfb-panel__form textarea { min-height: 120px; resize: vertical; }

.cfb-panel__form .wpcf7-not-valid-tip {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.cfb-panel__form .wpcf7-response-output {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    margin: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .cfb-btn {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    .cfb-btn__ring { width: 100px; height: 100px; }
    .cfb-btn__ring text { font-size: 9px; }
    .cfb-panel { width: 100vw; }
    .cfb-panel__header { padding: 28px 20px 18px; }
    .cfb-panel__form { padding: 20px; }
}
