/* ================================================================
   BARRA DE PESTAÑAS INFERIOR — solo dentro de las apps (iOS/Android)
   Se muestra únicamente con html.is-webview (js/layouts/webview.js)
   y en pantallas < 992px. En navegadores y en escritorio no existe.
   Capas: contenido < botón + del panel (1030) < barra (1034)
          < backdrop del menú (1037) < menú (1038) < modales (1055).
   ================================================================ */

.app-tabbar {
    display: none;
}

@media (max-width: 991.98px) {
    .is-webview {
        --app-tabbar-h: 64px;
        /* Separación de la cápsula con el borde inferior (flotante, estilo app) */
        --app-tabbar-gap: 12px;
        /* Alto total que ocupa la barra desde el borde inferior */
        --app-tabbar-space: calc(var(--app-tabbar-h) + var(--app-tabbar-gap) + env(safe-area-inset-bottom, 0px));
    }

    /* Cápsula flotante: separada de las orillas, redondeada y con sombra */
    .is-webview .app-tabbar {
        display: flex;
        position: fixed;
        left: 50%;
        bottom: calc(var(--app-tabbar-gap) + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        width: min(calc(100% - 28px), 440px);
        height: var(--app-tabbar-h);
        z-index: 1034;
        align-items: stretch;
        justify-content: space-around;
        padding: 6px;
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border: 1px solid rgba(17, 17, 17, 0.06);
        border-radius: 999px;
        box-shadow: 0 10px 30px rgba(17, 17, 17, 0.14), 0 2px 8px rgba(17, 17, 17, 0.06);
        -webkit-user-select: none;
        user-select: none;
    }

    .is-webview .app-tabbar__item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 0 2px;
        color: #8b919c;
        font-size: 0.66rem;
        font-weight: 500;
        letter-spacing: 0.1px;
        line-height: 1;
        text-decoration: none;
        background: transparent;
        border: 0;
        border-radius: 999px;
        transition: background-color 0.18s ease, color 0.18s ease;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Mismo alto para iconos y la pastilla central: las etiquetas quedan alineadas */
    .is-webview .app-tabbar__item > i {
        height: 26px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        line-height: 1;
    }

    .is-webview .app-tabbar__item:hover,
    .is-webview .app-tabbar__item:focus {
        color: #6b7280;
        text-decoration: none;
        outline: none;
    }

    /* Pestaña activa: pastilla de fondo dentro de la cápsula */
    .is-webview .app-tabbar__item.is-active {
        color: #111111;
        font-weight: 600;
        background: #eff0f2;
    }

    .is-webview .app-tabbar__item:active {
        scale: 0.94;
    }

    /* Pestaña central "Solicitar" */
    .is-webview .app-tabbar__item--primary {
        color: #111111;
    }

    .is-webview .app-tabbar__fab {
        width: 40px;
        height: 26px;
        border-radius: 999px;
        background: #111111;
        color: #ffffff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .is-webview .app-tabbar__fab i {
        font-size: 0.95rem;
    }

    /* Espacio para que la barra no tape el final de cada página */
    .is-webview .content-wrapper {
        padding-bottom: calc(var(--app-tabbar-space) + 16px) !important;
    }

    /* El botón "Más" de la barra abre el menú: se quita el del encabezado */
    .is-webview .main-header .nav-link.app-menu-toggle[data-widget="pushmenu"] {
        display: none !important;
    }

    /* Botón + del panel: arriba de la barra */
    .is-webview .panel-speed-dial {
        bottom: calc(var(--app-tabbar-space) + 14px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .is-webview .app-tabbar__item:active {
        scale: none;
    }
}
