/*
 * GMBF Group — mobile & tablet responsive layer
 * Load after styles.css. Keeps touch-friendly nav, hero scaling, and widget layout.
 */

@media (max-width: 992px) {
    .header-bar {
        gap: 8px;
    }

    /* ——— Drawer navigation ——— */
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .magic-toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0;
        gap: 0;
    }

    .magic-toggle-label {
        display: none;
    }

    .ambient-player {
        left: 10px;
        bottom: 10px;
        width: min(280px, calc(100vw - 102px));
    }

    .ambient-reopen {
        left: 10px;
        bottom: 10px;
    }

    .ambient-toast {
        left: 10px;
        bottom: 130px;
        max-width: min(300px, calc(100vw - 110px));
    }

    .magic-hint {
        top: 68px;
        right: 10px;
        font-size: 0.68rem;
        padding: 7px 10px;
        max-width: min(230px, calc(100vw - 20px));
    }

    header.site-header.nav-open {
        z-index: 10040;
    }

    header nav {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        width: min(320px, 88vw);
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        margin: 0;
        padding: max(76px, env(safe-area-inset-top, 0px) + 56px) 16px max(28px, env(safe-area-inset-bottom, 0px) + 16px);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 6px;
        background: #ffffff;
        box-shadow: -16px 0 48px rgba(15, 23, 42, 0.2);
        transform: translate3d(100%, 0, 0);
        transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 10050;
        border-left: 1px solid #e8edf5;
        box-sizing: border-box;
    }

    body.theme-night header nav {
        background: #0b1220;
        border-left-color: rgba(148, 163, 184, 0.24);
        box-shadow: -16px 0 48px rgba(2, 6, 23, 0.65);
    }

    body.theme-night header nav a:not(.cta-button) {
        color: #e2e8f0;
        text-shadow: none !important;
        -webkit-font-smoothing: antialiased;
        text-rendering: geometricPrecision;
    }

    body.theme-night header nav a:not(.cta-button) .nav-label {
        color: #e2e8f0;
        opacity: 1;
        text-shadow: none !important;
    }

    body.theme-night header nav a:not(.cta-button)::before {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(148, 163, 184, 0.22);
        box-shadow: none;
    }

    body.theme-night header nav a:not(.cta-button):hover,
    body.theme-night header nav a:not(.cta-button):focus-visible,
    body.theme-night header nav a[aria-current="page"]:not(.cta-button) {
        color: #ffffff;
        text-shadow: none !important;
    }

    body.theme-night header nav a:not(.cta-button) .nav-icon {
        color: #93c5fd;
        background: rgba(148, 163, 184, 0.2);
        border-color: rgba(148, 163, 184, 0.32);
    }

    body.magic-on header nav a:not(.cta-button) {
        animation: none !important;
        transform: none !important;
    }

    body.menu-open header nav {
        transform: translate3d(0, 0, 0);
    }

    header nav a:not(.cta-button) {
        justify-content: flex-start;
        padding: 14px 16px;
        border-radius: 12px;
        font-size: 0.95rem;
        animation: none;
    }

    header nav .cta-button {
        margin-left: 0;
        margin-top: 16px;
        margin-bottom: 8px;
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
        text-align: center;
    }

    .nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10030;
        margin: 0;
        padding: 0;
        border: none;
        background: rgba(15, 23, 42, 0.48);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        cursor: pointer;
    }

    body.menu-open .nav-backdrop {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
        overscroll-behavior: contain;
    }

    /* ——— Hero / home slider ——— */
    .hero-container {
        height: min(92vh, 680px);
        min-height: 380px;
    }

    .hero-content {
        justify-content: flex-end;
        align-items: center;
        padding: 56px 5% 96px;
        box-sizing: border-box;
        background: linear-gradient(
            165deg,
            rgba(15, 23, 42, 0.88) 0%,
            rgba(22, 32, 62, 0.72) 55%,
            rgba(15, 23, 42, 0.55) 100%
        );
    }

    .hero-content h1 {
        font-size: clamp(1.42rem, 5.4vw, 2rem);
        line-height: 1.18;
        margin-bottom: 10px;
    }

    .hero-content h2 {
        font-size: clamp(0.88rem, 3.5vw, 1.08rem);
        line-height: 1.5;
        margin-bottom: 18px;
    }

    .tagline {
        font-size: 0.68rem;
        letter-spacing: 1.4px;
        margin-bottom: 8px;
    }

    .hero-cta-row {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 28px;
        gap: 10px;
    }

    .hero-live-strip {
        margin-top: -8px;
        margin-bottom: 20px;
        gap: 8px;
        max-width: 340px;
    }

    .hero-live-pill {
        font-size: 0.76rem;
        padding: 7px 10px;
    }

    .main-cta {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 18px;
        text-align: center;
        font-size: 0.95rem;
    }

    .slide-dots {
        bottom: max(14px, env(safe-area-inset-bottom, 14px));
        z-index: 36;
        padding-bottom: 2px;
    }

    .dot {
        height: 11px;
        width: 11px;
        margin: 0 4px;
    }

    .prev,
    .next {
        padding: 11px 10px;
        font-size: 15px;
        margin-top: -20px;
    }

    /* ——— Trust strip ——— */
    .trust-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 5%;
    }

    .trust-logos {
        width: 100%;
        justify-content: flex-start;
    }

    /* ——— Products page TOC pills ——— */
    .products-toc {
        gap: 8px 10px;
        padding: 0 4px;
    }

    .products-toc a {
        font-size: 0.78rem;
        padding: 8px 12px;
    }

    /* ——— AI chat: compact, no animated ring (avoids overlap artifacts) ——— */
    .gmbf-assist {
        right: max(12px, env(safe-area-inset-right, 12px));
        bottom: max(12px, env(safe-area-inset-bottom, 12px));
        z-index: 1100;
    }

    .gmbf-assist-toggle {
        min-width: 0;
        max-width: calc(100vw - 24px);
        padding: 11px 14px;
        border-radius: 999px;
        gap: 8px;
    }

    .gmbf-assist-toggle-text strong {
        font-size: 0.76rem;
        line-height: 1.3;
    }

    .gmbf-assist-panel {
        width: min(360px, calc(100vw - 20px));
    }

    .gmbf-assist-form button {
        flex-shrink: 0;
    }

    /* Inner pages — headings */
    .products-services-hero h1,
    .clients-page-hero h1 {
        font-size: clamp(1.42rem, 5vw, 1.9rem);
        line-height: 1.2;
    }

    .products-services-lead,
    .clients-page-lead {
        font-size: 0.96rem;
        padding: 0 4px;
    }

    .policy-wrapper {
        margin-left: 4%;
        margin-right: 4%;
        padding: 22px 16px 36px;
    }

    .policy-wrapper h1 {
        font-size: 1.35rem;
        line-height: 1.28;
    }
}

/* Very narrow phones: FAB-style assistant */
@media (max-width: 380px) {
    .theme-toggle,
    .magic-toggle,
    .nav-toggle {
        width: 36px;
        height: 36px;
    }

    .nav-toggle-bar {
        left: 9px;
        width: 18px;
    }

    .nav-toggle-bar:nth-child(1) {
        top: 12px;
    }

    .nav-toggle-bar:nth-child(2) {
        top: 18px;
    }

    .nav-toggle-bar:nth-child(3) {
        top: 24px;
    }

    .magic-hint {
        top: 62px;
        right: 8px;
    }

    .gmbf-assist-toggle-text {
        display: none;
    }

    .gmbf-assist-toggle {
        width: 54px;
        height: 54px;
        min-width: 0;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .gmbf-assist-avatar {
        width: 30px;
        height: 30px;
        font-size: 22px;
    }
}

@media (min-width: 993px) {
    .nav-backdrop {
        display: none !important;
    }
}
