/* Высота нижней панели разделов. Футер, тосты и кнопка «наверх» поднимаются на неё;
   пока открыта клавиатура, панель скрыта (класс на <html> ставит script.js). */
:root {
    --ua-tabbar-height: 0px;
}

@media (max-width: 767.98px) {
    :root {
        --ua-tabbar-height: 56px;
        scroll-padding-bottom: calc(var(--ua-tabbar-height) + env(safe-area-inset-bottom, 0px));
    }

    :root.is-tabbar-off {
        --ua-tabbar-height: 0px;
    }
}

.ua-mobile-footer {
    padding: 14px 20px calc(16px + var(--ua-tabbar-height) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--ua-footer-line);
    background: var(--ua-footer-surface);
    color: var(--ua-footer-text);
    font-size: 14px;
    line-height: 1.5;
}

.ua-mobile-footer__inner {
    max-width: 540px;
    margin-inline: auto;
}

.ua-mobile-footer__brand {
    display: flex;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--ua-footer-line);
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    gap: 8px;
}

.ua-mobile-footer a.ua-mobile-footer__wordmark {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ua-footer-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-decoration: none;
}

.ua-mobile-footer__utility,
.ua-mobile-footer__legal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    padding-block: 4px;
    border-bottom: 1px solid var(--ua-footer-line);
}

.ua-mobile-footer .ua-mobile-footer__link,
.ua-mobile-footer a.ua-mobile-footer__link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    padding: 9px 0;
    border: 0;
    background: none;
    color: var(--ua-footer-link);
    font: inherit;
    text-align: start;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.ua-mobile-footer button.ua-mobile-footer__link {
    width: 100%;
    cursor: pointer;
}

.ua-mobile-footer__help {
    min-width: 0;
}

.ua-mobile-footer summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    list-style: none;
    cursor: pointer;
}

.ua-mobile-footer summary::-webkit-details-marker {
    display: none;
}

.ua-mobile-footer__chevron {
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    margin: 0 3px 3px auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.ua-mobile-footer details[open] > summary .ua-mobile-footer__chevron {
    margin-bottom: 0;
    transform: rotate(225deg);
}

.ua-mobile-footer__help-links {
    padding-bottom: 6px;
}

.ua-mobile-footer__legal .ua-mobile-footer__link,
.ua-mobile-footer__help-links .ua-mobile-footer__link {
    font-size: 13px;
}

.ua-mobile-footer__privacy {
    grid-column: 1 / -1;
}

.ua-mobile-footer__language > summary {
    justify-content: space-between;
    min-height: 48px;
    color: var(--ua-footer-muted);
    font-size: 13px;
}

.ua-mobile-footer__current-language {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ua-footer-text);
    font-size: 14px;
}

.ua-mobile-footer__languages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-block: 4px 8px;
}

.ua-mobile-footer__language-current {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--ua-footer-text);
    overflow-wrap: anywhere;
}

.ua-mobile-footer__copyright {
    margin: 8px 0 0;
    color: var(--ua-footer-muted);
    font-size: 12px;
}

.ua-mobile-footer .pwa-install {
    margin: 0;
}

.ua-mobile-footer .pwa-install__button {
    min-height: 44px;
    padding: 8px 0 8px 8px;
    color: var(--ua-footer-link);
    font-size: 13px;
}

.ua-mobile-footer .pwa-install__label {
    display: inline;
}

.ua-mobile-footer :is(a, button):hover {
    color: var(--ua-footer-link-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ua-mobile-footer :is(a, button, summary):focus-visible {
    outline: 2px solid var(--ua-footer-link);
    outline-offset: 3px;
}

@media (max-width: 360px) {
    .ua-mobile-footer {
        padding-inline: 16px;
    }
}

/* Нижняя панель разделов (components/mobile_tabbar.html.twig) */
.ua-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(var(--ua-tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--ua-border);
    background: var(--ua-surface);
    box-shadow: 0 -4px 14px rgba(var(--ua-primary-deep-rgb), .08);
}

:root.is-tabbar-off .ua-tabbar {
    display: none;
}

.ua-tabbar__item,
a.ua-tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    color: var(--ua-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.ua-tabbar__icon {
    display: grid;
    width: 52px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    font-size: 17px;
    transition: background-color .18s ease, color .18s ease;
}

.ua-tabbar__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.ua-tabbar__item:hover,
a.ua-tabbar__item:focus {
    color: var(--ua-link-strong);
    text-decoration: none;
}

a.ua-tabbar__item.is-active {
    color: var(--ua-link-strong);
    font-weight: 600;
}

.ua-tabbar__item.is-active .ua-tabbar__icon {
    background: rgba(var(--ua-primary-rgb), .14);
}

.ua-tabbar__item.is-active .fa-regular::before {
    font-weight: 900;
}

a.ua-tabbar__item:active .ua-tabbar__icon {
    background: rgba(var(--ua-primary-rgb), .22);
}

a.ua-tabbar__item:focus-visible {
    outline: 2px solid var(--ua-link);
    outline-offset: -3px;
    border-radius: 12px;
}

/* 320–359px: «Маркетплейс»/«Marketplace» помещается без многоточия */
@media (max-width: 359.98px) {
    .ua-tabbar {
        padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
    }

    .ua-tabbar__item,
    a.ua-tabbar__item {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ua-tabbar__icon {
        transition: none;
    }
}
