/* ============================================
   BOTTOM NAVIGATION BAR
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    padding: 0 12px 12px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    pointer-events: none;
}

.bottom-nav__container {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 10px 40px rgba(26, 26, 46, 0.12),
        0 4px 12px rgba(26, 26, 46, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    pointer-events: auto;
}

/* === Элемент === */
.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    text-decoration: none;
    color: #8a8a9a;
    transition: all 0.25s ease;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item:hover {
    color: #645E66;
    background: rgba(155, 188, 254, 0.08);
}

.bottom-nav__item:active {
    transform: scale(0.92);
}

/* === Иконка === */
.bottom-nav__icon {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.bottom-nav__icon svg {
    width: 22px;
    height: 22px;
    transition: all 0.25s ease;
}

/* === Лейбл === */
.bottom-nav__label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1;
    transition: all 0.25s ease;
    white-space: nowrap;
}

/* === Активное состояние === */
.bottom-nav__item--active {
    color: #D82BCB;
    background: rgba(216, 43, 203, 0.08);
}

.bottom-nav__item--active .bottom-nav__icon {
    background: linear-gradient(135deg, rgba(237, 79, 93, 0.15) 0%, rgba(216, 43, 203, 0.15) 100%);
    color: #D82BCB;
}

.bottom-nav__item--active .bottom-nav__icon svg {
    transform: scale(1.05);
}

.bottom-nav__item--active .bottom-nav__label {
    font-weight: 700;
    background: linear-gradient(135deg, #ED4F5D 0%, #D82BCB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Бейдж корзины === */
.bottom-nav__badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ED4F5D 0%, #D82BCB 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(237, 79, 93, 0.4);
    font-family: 'Montserrat', sans-serif;
}


.bottom-nav--hidden {
    transform: translateY(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
}


body.has-bottom-nav #app,
body.has-bottom-nav .wrapper {
    padding-bottom: 100px;
}


@media (max-width: 767.98px) {
    .bottom-nav {
        padding: 0 0 0;
        bottom: 0;
    }

    .bottom-nav__container {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 8px 4px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        box-shadow:
            0 -4px 30px rgba(26, 26, 46, 0.1),
            0 -1px 0 rgba(255, 255, 255, 0.8) inset;
        border-bottom: none;
    }

    .bottom-nav__item {
        padding: 10px 4px;
    }

    .bottom-nav__icon {
        width: 28px;
        height: 28px;
    }

    .bottom-nav__icon svg {
        width: 22px;
        height: 22px;
    }

    .bottom-nav__label {
        font-size: 9.5px;
    }

    body.has-bottom-nav #app,
    body.has-bottom-nav .wrapper {
        padding-bottom: 85px;
    }
}

/* ============================================
   ПК ВЕРСИЯ (красивая компактная панель)
   ============================================ */
@media (min-width: 768px) {
    .bottom-nav {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 0;
    }

    .bottom-nav--hidden {
        transform: translateX(-50%) translateY(calc(100% + 40px));
    }

    .bottom-nav__container {
        padding: 12px 16px;
        gap: 8px;
    }

    .bottom-nav__item {
        padding: 10px 16px;
        gap: 6px;
        min-width: 80px;
    }

    .bottom-nav__icon {
        width: 36px;
        height: 36px;
    }

    .bottom-nav__icon svg {
        width: 24px;
        height: 24px;
    }

    .bottom-nav__label {
        font-size: 11px;
    }

    .bottom-nav__item:hover .bottom-nav__icon {
        background: rgba(155, 188, 254, 0.12);
    }

    .bottom-nav__item--active:hover {
        background: rgba(216, 43, 203, 0.12);
    }
}

/* Очень большие экраны */
@media (min-width: 1400px) {
    .bottom-nav__container {
        max-width: 600px;
        padding: 14px 20px;
        gap: 12px;
    }

    .bottom-nav__item {
        min-width: 100px;
        padding: 12px 20px;
    }
}

/* ============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ
   ============================================ */
@keyframes bottomNavAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767.98px) {
    @keyframes bottomNavAppear {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

.bottom-nav {
    animation: bottomNavAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

@media (min-width: 768px) {
    .bottom-nav {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 0;
    }

    .bottom-nav--hidden {
        transform: translateX(-50%) translateY(calc(100% + 40px));
    }
    .bottom-nav__item--catalog {
        display: none;
    }

    .bottom-nav__container {
        padding: 12px 16px;
        gap: 8px;
    }

    .bottom-nav__item {
        padding: 10px 16px;
        gap: 6px;
        min-width: 80px;
    }

    .bottom-nav__icon {
        width: 36px;
        height: 36px;
    }

    .bottom-nav__icon svg {
        width: 24px;
        height: 24px;
    }

    .bottom-nav__label {
        font-size: 11px;
    }

    .bottom-nav__item:hover .bottom-nav__icon {
        background: rgba(155, 188, 254, 0.12);
    }

    .bottom-nav__item--active:hover {
        background: rgba(216, 43, 203, 0.12);
    }
}