:root {
    --jy-mobile-nav-brand-red: #7a0f1a;
    --jy-mobile-nav-brand-red-deep: #4d060e;
    --jy-mobile-nav-text: rgba(255, 255, 255, .78);
    --jy-mobile-nav-active: #fff;
}

.jy-mobile-bottom-nav,
.jy-mobile-search-sheet,
.jy-mobile-search-backdrop {
    display: none;
}

@media (max-width: 1024px) {
    body.jy-mobile-bottom-nav-enabled {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    .jy-mobile-bottom-nav {
        display: block;
        position: fixed;
        z-index: 99998;
        left: 50%;
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
        width: min(calc(100% - 20px), 620px);
        transform: translateX(-50%);
        pointer-events: none;
    }

    .jy-mobile-bottom-nav__glass {
        position: relative;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        min-height: 68px;
        padding: 6px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, .20);
        border-radius: 24px;
        background:
            linear-gradient(180deg, rgba(150, 24, 38, .78) 0%, rgba(86, 8, 18, .83) 100%);
        box-shadow:
            0 16px 40px rgba(35, 0, 5, .28),
            inset 0 1px 0 rgba(255, 255, 255, .18),
            inset 0 -1px 0 rgba(255, 255, 255, .05);
        -webkit-backdrop-filter: saturate(155%) blur(24px);
        backdrop-filter: saturate(155%) blur(24px);
        pointer-events: auto;
    }

    .jy-mobile-bottom-nav__glass::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background:
            radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .20), transparent 30%),
            linear-gradient(110deg, rgba(255, 255, 255, .08), transparent 42%);
    }

    .jy-mobile-bottom-nav__item {
        position: relative;
        z-index: 1;
        appearance: none;
        -webkit-appearance: none;
        display: flex;
        min-width: 0;
        min-height: 56px;
        margin: 0;
        padding: 7px 2px 6px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: 0;
        border-radius: 18px;
        outline: 0;
        background: transparent;
        color: var(--jy-mobile-nav-text);
        font: inherit;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        cursor: pointer;
        transition: background-color .16s ease, color .16s ease, transform .16s ease;
    }

    .jy-mobile-bottom-nav__item:visited {
        color: var(--jy-mobile-nav-text);
    }

    .jy-mobile-bottom-nav__item:active {
        transform: scale(.96);
    }

    .jy-mobile-bottom-nav__item.is-active {
        background: rgba(255, 255, 255, .15);
        color: var(--jy-mobile-nav-active);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
    }

    .jy-mobile-bottom-nav__item.is-active:visited {
        color: var(--jy-mobile-nav-active);
    }

    .jy-mobile-bottom-nav__icon {
        display: grid;
        width: 25px;
        height: 25px;
        place-items: center;
    }

    .jy-mobile-bottom-nav__icon svg,
    .jy-mobile-search-form-icon svg {
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .jy-mobile-bottom-nav__label {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: inherit;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.1;
        letter-spacing: .02em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .jy-mobile-search-backdrop {
        position: fixed;
        z-index: 99996;
        inset: 0;
        background: rgba(15, 0, 3, .18);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }

    .jy-mobile-search-backdrop.is-open {
        display: block;
    }

    .jy-mobile-search-sheet {
        position: fixed;
        z-index: 99999;
        left: 50%;
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
        width: min(calc(100% - 24px), 610px);
        padding: 9px;
        transform: translateX(-50%);
        border: 1px solid rgba(255, 255, 255, .22);
        border-radius: 22px;
        background: rgba(88, 8, 18, .78);
        box-shadow: 0 18px 50px rgba(35, 0, 5, .28);
        -webkit-backdrop-filter: saturate(150%) blur(24px);
        backdrop-filter: saturate(150%) blur(24px);
    }

    .jy-mobile-search-sheet.is-open {
        display: block;
    }

    .jy-mobile-search-form {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
        min-height: 50px;
        padding: 5px 5px 5px 14px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 16px;
        background: rgba(255, 255, 255, .13);
        color: #fff;
    }

    .jy-mobile-search-form-icon {
        display: grid;
        width: 21px;
        height: 21px;
        place-items: center;
        color: rgba(255,255,255,.85);
    }

    .jy-mobile-search-form input[type="search"] {
        width: 100%;
        min-width: 0;
        height: 42px;
        margin: 0 !important;
        padding: 0 4px !important;
        border: 0 !important;
        outline: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #fff !important;
        font-size: 16px !important;
        line-height: 42px;
    }

    .jy-mobile-search-form input[type="search"]::placeholder {
        color: rgba(255,255,255,.63);
        opacity: 1;
    }

    .jy-mobile-search-form button {
        min-width: 58px;
        height: 40px;
        margin: 0;
        padding: 0 12px;
        border: 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, .94);
        color: var(--jy-mobile-nav-brand-red-deep);
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
        cursor: pointer;
    }

    @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
        .jy-mobile-bottom-nav__glass,
        .jy-mobile-search-sheet {
            background: rgba(89, 9, 20, .96);
        }
    }
}

@media (max-width: 390px) {
    .jy-mobile-bottom-nav {
        width: calc(100% - 14px);
    }
    .jy-mobile-bottom-nav__glass {
        min-height: 64px;
        padding: 5px;
        border-radius: 21px;
    }
    .jy-mobile-bottom-nav__item {
        min-height: 54px;
        border-radius: 16px;
    }
    .jy-mobile-bottom-nav__icon {
        width: 23px;
        height: 23px;
    }
    .jy-mobile-bottom-nav__label {
        font-size: 10px;
    }
}

@media (min-width: 1025px) {
    body.jy-mobile-bottom-nav-enabled {
        padding-bottom: 0;
    }
}
