/* TAPS Public Mobile Navigation v1.1.5
   - Restores the original header hamburger position
   - Adds a real PWA-style bottom navigation
   - Keeps the full drawer menu for all public links
*/

@media (max-width: 900px) {
    :root { --taps-mobile-nav-height: 68px; }

    body {
        padding-bottom: calc(var(--taps-mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .site-header {
        z-index: 1700 !important;
        overflow: visible !important;
    }

    .header-inner {
        height: 70px !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        overflow: visible !important;
    }

    .site-header .brand {
        position: relative;
        z-index: 1702;
        width: 175px !important;
        max-width: calc(100vw - 92px) !important;
        flex: 0 1 175px !important;
        margin: 0 !important;
    }

    /* Customer/quote buttons are available from mobile nav/drawer; they must not push the hamburger. */
    .header-inner > .ui-button.ui-button-dark,
    .header-inner > .header-cta {
        display: none !important;
    }

    /* Restore the hamburger to the far right of the header, with no jump when opened. */
    .menu-toggle,
    .menu-toggle.is-open {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        z-index: 1704 !important;
        display: flex !important;
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        margin: 0 0 0 auto !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;
        border: 1px solid rgba(255,255,255,.18) !important;
        border-radius: 12px !important;
        background: rgba(4,18,34,.76) !important;
        box-shadow: 0 10px 28px rgba(0,0,0,.18) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .menu-toggle span {
        display: block !important;
        width: 21px !important;
        height: 2px !important;
        margin: 2.5px 0 !important;
        border-radius: 99px !important;
        background: #fff !important;
        transform-origin: center !important;
        transition: transform .2s ease, opacity .2s ease !important;
    }

    .menu-toggle.is-open {
        border-color: rgba(67,216,244,.38) !important;
        background: #071a2d !important;
    }

    .menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg) !important; }
    .menu-toggle.is-open span:nth-child(2) { opacity: 0 !important; }
    .menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) !important; }

    /* Full mobile drawer. */
    .main-nav {
        position: fixed !important;
        z-index: 1701 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        display: flex !important;
        width: min(88vw, 390px) !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 84px 18px calc(92px + env(safe-area-inset-bottom, 0px)) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        color: #f4f8ff !important;
        border: 0 !important;
        border-left: 1px solid rgba(122,211,245,.14) !important;
        border-radius: 0 !important;
        background:
            radial-gradient(circle at 85% 8%, rgba(24,205,240,.12), transparent 28%),
            linear-gradient(160deg, #03101f 0%, #061b30 58%, #08243b 100%) !important;
        box-shadow: -30px 0 70px rgba(0,0,0,.38) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translate3d(104%,0,0) !important;
        transition: transform .28s ease, opacity .22s ease, visibility .22s ease !important;
    }

    .main-nav.is-open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translate3d(0,0,0) !important;
    }

    .main-nav::before {
        content: "MENÜ";
        display: block;
        padding: 0 9px 10px;
        color: #64dff3;
        font-size: 10px;
        line-height: 1;
        letter-spacing: .18em;
        font-weight: 900;
    }

    .main-nav > a,
    .nav-item > a {
        min-height: 44px;
        padding: 11px 10px !important;
        border-radius: 10px;
        color: #eef8ff !important;
        font-size: 14px;
        line-height: 1.25;
    }

    .main-nav > a::after,
    .nav-item > a::after { display: none !important; }

    .main-nav > a:hover,
    .main-nav > a:focus-visible,
    .nav-item > a:hover,
    .nav-item > a:focus-visible,
    .nav-item.submenu-open > a {
        background: rgba(255,255,255,.055) !important;
        color: #fff !important;
    }

    .nav-item { width: 100% !important; }
    .nav-arrow { margin-left: auto !important; color: #74d9ee !important; }
    .nav-item.submenu-open > a .nav-arrow { transform: rotate(180deg); }

    .nav-item.is-mega > .mega-menu,
    .nav-item.is-mega:hover > .mega-menu,
    .nav-item.is-mega:focus-within > .mega-menu,
    .dropdown {
        max-height: none !important;
    }

    .taps-mobile-menu-backdrop {
        position: fixed;
        z-index: 1699;
        inset: 0;
        border: 0;
        padding: 0;
        background: rgba(0,7,16,.62);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .22s ease, visibility .22s ease;
    }

    .taps-mobile-menu-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.taps-mobile-menu-open { overflow: hidden !important; }

    /* Real public mobile bottom navigation. */
    .taps-mobile-bottom-nav {
        position: fixed;
        z-index: 1500;
        left: 10px;
        right: 10px;
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
        height: 60px;
        padding: 5px 7px;
        display: grid;
        grid-template-columns: repeat(5, minmax(0,1fr));
        align-items: stretch;
        gap: 3px;
        border: 1px solid rgba(126,211,241,.18);
        border-radius: 18px;
        background: rgba(3,14,27,.94);
        box-shadow: 0 18px 48px rgba(0,0,0,.38);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .taps-mobile-bottom-nav__item {
        position: relative;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 4px 2px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #91a6b9;
        font: 700 9px/1.1 Inter, system-ui, sans-serif;
        letter-spacing: .01em;
        text-align: center;
        cursor: pointer;
        transition: color .18s ease, background .18s ease, transform .18s ease;
    }

    .taps-mobile-bottom-nav__item svg {
        width: 21px;
        height: 21px;
        flex: 0 0 21px;
        stroke: currentColor;
    }

    .taps-mobile-bottom-nav__item:hover,
    .taps-mobile-bottom-nav__item:focus-visible,
    .taps-mobile-bottom-nav__item.is-active {
        color: #fff;
        background: linear-gradient(180deg, rgba(21,125,255,.22), rgba(8,206,241,.08));
    }

    .taps-mobile-bottom-nav__item.is-active::before {
        content: "";
        position: absolute;
        top: 2px;
        width: 18px;
        height: 2px;
        border-radius: 99px;
        background: #08cef1;
        box-shadow: 0 0 12px rgba(8,206,241,.62);
    }

    .taps-mobile-bottom-nav__badge {
        position: absolute;
        top: 4px;
        left: calc(50% + 7px);
        min-width: 15px;
        height: 15px;
        padding: 0 4px;
        display: grid;
        place-items: center;
        border: 2px solid #071321;
        border-radius: 999px;
        background: #08cef1;
        color: #031018;
        font-size: 8px;
        font-weight: 900;
    }

    /* Keep floating install control above the mobile navigation. */
    [data-pwa-install] {
        bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Cookie banner should not cover the navigation while consent is pending. */
    .taps-cookie-banner {
        bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (max-width: 640px) {
    .site-header .brand {
        width: 154px !important;
        flex-basis: 154px !important;
    }

    .main-nav { width: min(92vw, 370px) !important; }

    .taps-mobile-bottom-nav {
        left: 6px;
        right: 6px;
        bottom: max(5px, env(safe-area-inset-bottom, 0px));
        border-radius: 16px;
    }
}

@media (min-width: 901px) {
    .taps-mobile-bottom-nav,
    .taps-mobile-menu-backdrop { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .main-nav,
    .taps-mobile-menu-backdrop,
    .menu-toggle span,
    .taps-mobile-bottom-nav__item { transition: none !important; }
}
