/* =========================================
   INHAND - PLOVOUCI MENU (MOBIL)
   Spodni lista ve stylu "glass" + plovouci tlacitko do kosiku
   Soubor: /user/documents/apollo/plovouci-menu.css
   ========================================= */

#inhand-nav,
#inhand-buybar {
    display: none;
}

@media (max-width: 767px) {

    :root {
        --inhand-nav-h: 64px;
        --inhand-nav-gap: 10px;
        --inhand-nav-space: calc(var(--inhand-nav-h) + var(--inhand-nav-gap) + env(safe-area-inset-bottom));
        --inhand-green: #9fb224;
        --inhand-green-dark: #7f9019;
        --inhand-ink: #2b2b2b;
    }

    /* ---------- Spodni lista ---------- */

    #inhand-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(var(--inhand-nav-gap) + env(safe-area-inset-bottom));
        z-index: 1010;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--inhand-nav-h);
        padding: 0 6px;
        border: 1px solid rgba(255, 255, 255, .65);
        border-radius: 26px;
        background: rgba(255, 255, 255, .72);
        -webkit-backdrop-filter: blur(22px) saturate(180%);
        backdrop-filter: blur(22px) saturate(180%);
        box-shadow:
            0 10px 30px rgba(20, 24, 10, .14),
            0 1px 0 rgba(255, 255, 255, .8) inset;
        font-family: inherit;
    }

    /* Starsi prohlizece bez podpory rozmazani: plne bila */
    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        #inhand-nav {
            background: rgba(255, 255, 255, .97);
        }
    }

    #inhand-nav .inhand-nav-item {
        position: relative;
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--inhand-ink);
        font-family: inherit;
        text-decoration: none !important;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color .2s ease, transform .15s ease;
    }

    #inhand-nav .inhand-nav-item:active {
        transform: scale(.92);
    }

    #inhand-nav .inhand-nav-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
    }

    #inhand-nav svg {
        display: block;
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    #inhand-nav .inhand-nav-label {
        font-size: 10.5px;
        font-weight: 500;
        line-height: 1;
        white-space: nowrap;
        opacity: .85;
    }

    /* Aktivni polozka: zelena a jemny podklad */
    #inhand-nav .inhand-nav-item.is-active,
    body.navigation-window-visible #inhand-nav .inhand-nav-menu,
    body.login-window-visible #inhand-nav .inhand-nav-account {
        color: var(--inhand-green-dark);
    }

    #inhand-nav .inhand-nav-item.is-active .inhand-nav-label,
    body.navigation-window-visible #inhand-nav .inhand-nav-menu .inhand-nav-label,
    body.login-window-visible #inhand-nav .inhand-nav-account .inhand-nav-label {
        font-weight: 700;
        opacity: 1;
    }

    #inhand-nav .inhand-nav-item.is-active::before,
    body.navigation-window-visible #inhand-nav .inhand-nav-menu::before,
    body.login-window-visible #inhand-nav .inhand-nav-account::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        width: 44px;
        height: 30px;
        margin-left: -22px;
        border-radius: 15px;
        background: rgba(159, 178, 36, .16);
        z-index: -1;
    }

    /* Kdyz je otevrene menu nebo prihlaseni, "Domu" neni aktivni */
    body.navigation-window-visible #inhand-nav .inhand-nav-home,
    body.login-window-visible #inhand-nav .inhand-nav-home {
        color: var(--inhand-ink);
    }

    body.navigation-window-visible #inhand-nav .inhand-nav-home::before,
    body.login-window-visible #inhand-nav .inhand-nav-home::before {
        display: none;
    }

    /* ---------- Kosik uprostred v kolecku ---------- */

    #inhand-nav .inhand-nav-cart {
        justify-content: flex-end;
        padding-bottom: 8px;
    }

    #inhand-nav .inhand-nav-cart::before {
        display: none !important;
    }

    #inhand-nav .inhand-nav-cart .inhand-nav-icon {
        position: absolute;
        top: -22px;
        left: 50%;
        width: 58px;
        height: 58px;
        margin-left: -29px;
        border: 4px solid rgba(255, 255, 255, .85);
        border-radius: 50%;
        background: linear-gradient(145deg, #b4c83a 0%, #9fb224 55%, #8a9b1c 100%);
        color: #fff;
        box-shadow:
            0 8px 20px rgba(127, 144, 25, .38),
            0 1px 0 rgba(255, 255, 255, .45) inset;
        box-sizing: border-box;
    }

    #inhand-nav .inhand-nav-cart svg {
        width: 25px;
        height: 25px;
        stroke-width: 2;
    }

    #inhand-nav .inhand-nav-cart .inhand-nav-label {
        font-weight: 600;
    }

    #inhand-nav .inhand-nav-cart.is-active .inhand-nav-label {
        color: var(--inhand-green-dark);
    }

    #inhand-nav .inhand-nav-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        border: 2px solid #fff;
        border-radius: 999px;
        background: var(--inhand-ink);
        color: #fff;
        font-size: 10.5px;
        font-weight: 800;
        line-height: 16px;
        text-align: center;
        box-sizing: border-box;
    }

    /* ---------- Plovouci tlacitko do kosiku (detail produktu) ---------- */

    #inhand-buybar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(var(--inhand-nav-space) + 22px);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 8px 8px 18px;
        border: 1px solid rgba(255, 255, 255, .65);
        border-radius: 24px;
        background: rgba(255, 255, 255, .78);
        -webkit-backdrop-filter: blur(22px) saturate(180%);
        backdrop-filter: blur(22px) saturate(180%);
        box-shadow: 0 10px 30px rgba(20, 24, 10, .14);
        opacity: 0;
        transform: translateY(16px);
        pointer-events: none;
        transition: opacity .25s ease, transform .25s ease;
        font-family: inherit;
    }

    #inhand-buybar.is-visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    #inhand-buybar .inhand-buybar-prices {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        line-height: 1.15;
    }

    #inhand-buybar .inhand-buybar-old {
        font-size: 12px;
        color: #8a8a8a;
        text-decoration: line-through;
    }

    #inhand-buybar .inhand-buybar-price {
        font-size: 19px;
        font-weight: 700;
        color: var(--inhand-ink);
        white-space: nowrap;
    }

    #inhand-buybar .inhand-buybar-btn {
        flex: 0 0 auto;
        height: 46px;
        padding: 0 22px;
        border: 0;
        border-radius: 999px;
        background: #343434;
        color: #fff;
        font-family: inherit;
        font-size: 15px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
    }

    #inhand-buybar .inhand-buybar-btn:active {
        background: #1f1f1f;
    }

    /* ---------- Rozvrzeni stranky ---------- */

    /* Misto pod listou, at nezakryva paticku */
    body.inhand-nav-on {
        padding-bottom: calc(var(--inhand-nav-space) + 16px);
    }

    body.inhand-nav-on.inhand-buybar-on {
        padding-bottom: calc(var(--inhand-nav-space) + 104px);
    }

    /* Otevrene menu a okna konci nad listou */
    body.inhand-nav-on #navigation {
        padding-bottom: calc(var(--inhand-nav-space) + 60px) !important;
    }

    body.inhand-nav-on .popup-widget {
        padding-bottom: calc(var(--inhand-nav-space) + 10px) !important;
    }

    /* Hlasky Shoptetu (napr. "Produkt byl pridan do kosiku") nad listou */
    body.inhand-nav-on .messages {
        bottom: calc(var(--inhand-nav-space) + 14px) !important;
    }

    body.inhand-nav-on.inhand-buybar-on .messages {
        bottom: calc(var(--inhand-nav-space) + 104px) !important;
    }

    /* Pri psani (otevrena klavesnice) lista i tlacitko zmizi */
    body.inhand-typing #inhand-nav,
    body.inhand-typing #inhand-buybar {
        display: none !important;
    }

    /* ---------- Horni hlavicka ---------- */

    /* Ikony uctu, kosiku a menu jsou dole v liste */
    body.inhand-nav-on .top-navigation-bar .responsive-tools {
        display: none !important;
    }

    /* Bily podklad horni listy (po skryti ikon by jinak prosvital obsah) */
    body.inhand-nav-on .top-navigation-bar {
        min-height: 50px;
        background: #fff;
    }

    /* Logo na stred */
    body.inhand-nav-on .top-navigation-bar .site-name {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
    }

    /* ---------- Intelimail ---------- */

    /* Na mobilu skryt trojuhelnik a mini popup s produktem */
    ._im-collect-sticker-wrap,
    #_im-popup-mini {
        display: none !important;
    }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    #inhand-nav .inhand-nav-item,
    #inhand-buybar {
        transition: none;
    }
}
