/* ==========================================================
   Basic Speed Group — additions
   Site search · Tablet menu · Quick Chat · Live Chat button
   Load after bsg-stylesheet.css.
   ========================================================== */

.nav-search-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-left: 12px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.35); border-radius: 50%;
    background: transparent; color: #fff; font-size: 16px; cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s;
}
.nav-search-btn:hover, .nav-search-btn:focus-visible {
    background: #ec6a00; border-color: #ec6a00; transform: scale(1.06); outline: none;
}
/* ---------- Mobile + tablet navbar (up to 1024px) ----------
   Logo | (space) | Search | gap = one search-icon width | Hamburger
   All three stay on one row inside the floating navbar. */
@media (max-width: 1024px) {
    .floating-nav .nav-container { display: flex; align-items: center; flex-wrap: nowrap; }
    .floating-nav .logo { order: 1; min-width: 0; }
    .nav-search-btn { order: 2; margin-left: auto; margin-right: 0; flex-shrink: 0; }
    .floating-nav .mobile-menu-btn {
        order: 3; display: flex; align-items: center; justify-content: center;
        position: relative; top: auto; right: auto; transform: none;
        width: 40px; height: 40px; margin-left: 40px; flex-shrink: 0;
        background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer;
    }
    .floating-nav .main-nav { order: 4; }
}
@media (max-width: 380px) {
    .nav-search-btn { width: 36px; height: 36px; font-size: 15px; }
    .floating-nav .mobile-menu-btn { width: 36px; height: 36px; margin-left: 36px; }
}

/* ---------- Tablet only (769–1024px): same slide-in drawer as mobile ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
    .floating-nav .main-nav ul {
        position: fixed; top: 0; right: -100%; width: 60%; max-width: 420px; height: 100vh;
        flex-direction: column; align-items: stretch; gap: 0; margin: 0;
        padding: 90px 0 30px; background: #ec6a00; overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0,0,0,.25); transition: right .5s ease; z-index: 1000;
    }
    .floating-nav .main-nav ul.show { right: 0; }
    .floating-nav .main-nav li { width: 100%; border-bottom: 1px solid rgba(255,255,255,.15); }
    .floating-nav .main-nav li > a { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; border-radius: 0; }
    .floating-nav .main-nav li > a::after { display: none; }
    .floating-nav .main-nav .cta-button { margin: 18px 28px 0; justify-content: center; border-radius: 30px; }
    .floating-nav .main-nav li:last-child { border-bottom: 0; }
    .floating-nav .dropdown .dropdown-content,
    .floating-nav .dropdown:hover .dropdown-content {
        position: static; display: block; min-width: 0; box-shadow: none; border-top: 0;
        max-height: 0; overflow: hidden; opacity: 1; visibility: visible; transform: none;
        background: rgba(255,255,255,.95); transition: max-height .4s ease;
    }
    .floating-nav .dropdown.active .dropdown-content { max-height: 320px; }
    .floating-nav .dropdown-content a { padding: 12px 40px; }
    .floating-nav .mobile-menu-btn { z-index: 1002; }
}

.site-search {
    position: fixed; inset: 0; z-index: 10000; display: none;
    background: rgba(10,10,10,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 10vh 20px 20px; overflow-y: auto;
}
.site-search.open { display: block; animation: ssFade .18s ease-out; }
@keyframes ssFade { from { opacity: 0; } to { opacity: 1; } }
.site-search-panel {
    max-width: 720px; margin: 0 auto; background: #141414; color: #fff;
    border: 1px solid #2a2a2a; border-radius: 14px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.site-search-bar {
    display: flex; align-items: center; gap: 12px; padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
}
.site-search-bar > i { color: #ec6a00; font-size: 18px; }
.site-search-input {
    flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
    color: #fff; font-size: 18px; font-family: inherit;
}
.site-search-input::placeholder { color: #888; }
.site-search-close {
    background: #222; color: #bbb; border: 0; border-radius: 6px;
    padding: 6px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.site-search-close:hover { color: #fff; background: #333; }
.site-search-suggest { padding: 14px 20px 18px; }
.site-search-suggest-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #888; margin-bottom: 10px; }
.site-search-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.site-search-chip {
    background: #1f1f1f; color: #ddd; border: 1px solid #2f2f2f; border-radius: 999px;
    padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.site-search-chip:hover { border-color: #ec6a00; color: #fff; }
.site-search-results { list-style: none; margin: 0; padding: 6px 0; max-height: 60vh; overflow-y: auto; }
.site-search-results li a {
    display: flex; gap: 14px; align-items: flex-start; padding: 12px 20px;
    color: #fff; text-decoration: none; border-left: 3px solid transparent;
}
.site-search-results li a:hover, .site-search-results li.active a {
    background: #1d1d1d; border-left-color: #ec6a00;
}
.ss-icon {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px;
    background: rgba(236,106,0,.14); color: #ec6a00;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.ss-body { min-width: 0; }
.ss-title { font-weight: 600; font-size: 15px; }
.ss-title mark, .ss-desc mark { background: none; color: #ec6a00; }
.ss-desc { color: #aaa; font-size: 13px; margin-top: 2px; line-height: 1.45; }
.ss-type {
    display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: #888;
    border: 1px solid #333; border-radius: 4px; padding: 1px 6px; vertical-align: 2px;
}
.site-search-empty { padding: 22px 20px; color: #aaa; font-size: 14px; }
.site-search-empty a { color: #ec6a00; }
.site-search-foot {
    display: flex; justify-content: space-between; padding: 10px 20px;
    border-top: 1px solid #2a2a2a; font-size: 12px; color: #777;
}
.site-search-foot kbd {
    background: #222; border: 1px solid #333; border-radius: 4px;
    padding: 1px 5px; font-family: inherit; font-size: 11px; color: #bbb;
}
body.search-open { overflow: hidden; }

/* ---------- Quick Chat lightbox ---------- */
.mobile-cta-bar .mobile-cta-chat { cursor: pointer; border: 0; background: none; font: inherit; color: inherit; }
.mobile-cta-chat .chat-dot {
    display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%;
    background: #2ecc71; box-shadow: 0 0 0 0 rgba(46,204,113,.6); animation: chatPulse 2s infinite; vertical-align: 1px;
}
@keyframes chatPulse { 70% { box-shadow: 0 0 0 8px rgba(46,204,113,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }

.quick-chat {
    position: fixed; inset: 0; z-index: 10001; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0,0,0,.6); padding: 16px;
    opacity: 0; visibility: hidden;
    transition: opacity 2.5s ease, visibility 0s linear 2.5s;   /* 2.5s open & close */
}
.quick-chat.open { opacity: 1; visibility: visible; transition: opacity 2.5s ease, visibility 0s; }
.quick-chat-window {
    width: 100%; max-width: 420px; height: min(620px, calc(100vh - 32px)); height: min(620px, calc(100dvh - 32px));
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; color: #222; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
    transform: translateY(40px) scale(.96); transition: transform 2.5s cubic-bezier(.2,.8,.2,1);
}
.quick-chat.open .quick-chat-window { transform: none; }
@media (min-width: 600px) { .quick-chat { align-items: center; } }
@media (prefers-reduced-motion: reduce) {
    .quick-chat, .quick-chat.open, .quick-chat-window { transition-duration: .01s; }
}

.qc-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #ec6a00; color: #fff; }
.qc-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.qc-avatar img { width: 30px; height: auto; }
.qc-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.qc-status { font-size: 12px; opacity: .9; }
.qc-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; margin-right: 6px; }
.qc-close {
    margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.2); color: #fff; font-size: 20px; line-height: 1;
}
.qc-close:hover { background: rgba(255,255,255,.35); }

.qc-body { flex: 1; overflow-y: auto; padding: 16px; background: #f6f6f6; display: flex; flex-direction: column; gap: 10px; }
.qc-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.qc-msg.bot { align-self: flex-start; background: #fff; border: 1px solid #e8e8e8; border-bottom-left-radius: 4px; }
.qc-msg.user { align-self: flex-end; background: #ec6a00; color: #fff; border-bottom-right-radius: 4px; }
.qc-msg a { color: #ec6a00; font-weight: 600; }
.qc-msg.user a { color: #fff; }
.qc-cta {
    display: inline-block; margin-top: 8px; padding: 8px 14px; border-radius: 20px;
    background: #ec6a00; color: #fff !important; text-decoration: none; font-size: 13px;
}
.qc-typing { align-self: flex-start; background: #fff; border: 1px solid #e8e8e8; border-radius: 16px; padding: 12px 14px; }
.qc-typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #bbb; animation: qcBounce 1.2s infinite; }
.qc-typing span:nth-child(2) { animation-delay: .15s; }
.qc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes qcBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.qc-quick { display: flex; gap: 8px; padding: 10px 12px 0; overflow-x: auto; background: #fff; border-top: 1px solid #eee; scrollbar-width: none; }
.qc-quick::-webkit-scrollbar { display: none; }
.qc-chip {
    flex-shrink: 0; padding: 7px 12px; border-radius: 999px; border: 1px solid #ec6a00;
    background: #fff; color: #ec6a00; font-size: 13px; cursor: pointer; font-family: inherit;
}
.qc-chip:hover { background: #ec6a00; color: #fff; }
.qc-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: #fff; }
.qc-input {
    flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid #ddd; border-radius: 22px;
    font-size: 16px; font-family: inherit; outline: none;   /* 16px stops iOS zoom */
}
.qc-input:focus { border-color: #ec6a00; }
.qc-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #ec6a00; color: #fff; cursor: pointer; font-size: 16px; flex-shrink: 0; }
.qc-foot { text-align: center; font-size: 11px; color: #999; padding: 0 12px 10px; background: #fff; }
body.chat-open { overflow: hidden; }
@media (max-width: 600px) {
    .site-search { padding: 0; }
    .site-search-panel { border-radius: 0; min-height: 100%; border: 0; }
    .site-search-results { max-height: none; }
    .site-search-foot { display: none; }
}

/* ---------- Desktop / tablet Live Chat button (replaces Scroll to Top above 768px) ---------- */
.live-chat-btn { display: none; }

@media (min-width: 769px) {
    .scroll-to-top, #scrollToTop { display: none !important; }

    .live-chat-btn {
        position: fixed; right: 28px; bottom: 28px; z-index: 9999;
        display: flex; align-items: center; justify-content: center;
        width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
        background: #ec6a00; color: #fff; font-size: 24px;
        box-shadow: 0 10px 28px rgba(236,106,0,.45), 0 2px 6px rgba(0,0,0,.2);
        transition: transform .25s ease, box-shadow .25s ease;
    }
    .live-chat-btn:hover, .live-chat-btn:focus-visible {
        transform: translateY(-3px) scale(1.05); outline: none;
        box-shadow: 0 14px 34px rgba(236,106,0,.55), 0 2px 6px rgba(0,0,0,.2);
    }
    .live-chat-dot {
        position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%;
        background: #2ecc71; border: 2px solid #fff; animation: chatPulse 2s infinite;
    }
    /* "Live Chat" label slides out to the left on hover */
    .live-chat-label {
        position: absolute; right: 74px; top: 50%; transform: translate(8px, -50%);
        white-space: nowrap; padding: 8px 14px; border-radius: 20px;
        background: #141414; color: #fff; font-size: 14px; font-weight: 600;
        opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
    }
    .live-chat-btn:hover .live-chat-label, .live-chat-btn:focus-visible .live-chat-label { opacity: 1; transform: translate(0, -50%); }
    body.chat-open .live-chat-btn { opacity: 0; pointer-events: none; }
}

/* ---------- Stand-alone pages with no mobile CTA bar: Live Chat circle on phones too ---------- */
@media (max-width: 768px) {
    .bsg-no-cta-bar .live-chat-btn {
        position: fixed; right: 18px; bottom: 18px; z-index: 9999;
        display: flex; align-items: center; justify-content: center;
        width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
        background: #ec6a00; color: #fff; font-size: 22px;
        box-shadow: 0 10px 28px rgba(236,106,0,.45), 0 2px 6px rgba(0,0,0,.2);
    }
    .bsg-no-cta-bar .live-chat-dot {
        position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%;
        background: #2ecc71; border: 2px solid #fff;
    }
    .bsg-no-cta-bar .live-chat-label { display: none; }
    body.bsg-no-cta-bar.chat-open .live-chat-btn { opacity: 0; pointer-events: none; }
}

/* ---------- Homepage "Our Coaches": 4 across on desktop/tablet, 2 x 2 on phones ---------- */
.page-home .coaches .coaches-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.page-home .coaches .coaches-grid .coach-item {
    width: auto; max-width: none; min-width: 0; margin: 0; flex: none;
    text-align: center;
}
.page-home .coaches .coaches-grid .coach-image {
    display: block; width: 100%; max-width: 220px; height: auto;
    aspect-ratio: 1 / 1; object-fit: cover; margin: 0 auto 14px;
}
@media (max-width: 1024px) {
    .page-home .coaches .coaches-grid { gap: 20px; }
}
@media (max-width: 768px) {
    .page-home .coaches .coaches-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
    .page-home .coaches .coaches-grid .coach-name { font-size: 1rem; }
    .page-home .coaches .coaches-grid .coach-title { font-size: .85rem; }
}
