.academix-floating-apps-button {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Helvetica', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 130px;
    padding: 10px 15px;
    background-color: #ffffff !important;
    color: #0021c8 !important;
    border: 1px solid #ffffff !important;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 9;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: all 0.2s ease;
}

.academix-floating-apps-button svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.academix-floating-apps-button span {
    font-size: inherit;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Helvetica', sans-serif;
    margin-left: 5px;
    display: inline-block;
}

.bb-mobile-header-wrapper {
    position: relative;
}

.site-header-container {
    position: relative;
}

.bb-mobile-header-wrapper .academix-floating-apps-button {
    position: absolute !important;
    top: 100%;
    right: 22px;
    z-index: 1000;
    border-radius: 0 0 5px 5px;
}

.site-header-container .academix-floating-apps-button {
    position: absolute !important;
    top: 100%;
    right: 22px;
    z-index: 99;
    border-radius: 0 0 5px 5px;
}

/* ==========================
   Modal de Materiales (Apps)
   ========================== */
.acx-apps-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 100000; /* sobre Header, menús y BB overlays */
    /* iOS/iPadOS: asegurar stacking y aceleración */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.acx-apps-modal.is-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.acx-apps-modal-bg {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1),
                background-color 300ms cubic-bezier(0.25, 0.1, 0.25, 1),
                backdrop-filter 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    will-change: opacity, backdrop-filter, background-color;
}

.acx-apps-modal.is-open .acx-apps-modal-bg {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.acx-apps-modal-content {
    position: relative;
    background: #7a7a7af2;
    border-radius: 60px;
    padding: 40px 30px 30px;
    min-width: 350px;
    min-height: 400px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(50px) scale(0.9);
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.25, 0.1, 0.25, 1) 150ms,
                opacity 400ms cubic-bezier(0.25, 0.1, 0.25, 1) 150ms,
                width 280ms ease, max-width 280ms ease,
                height 280ms ease, max-height 280ms ease,
                border-radius 280ms ease, padding 200ms ease;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 40px);
    overflow: hidden;
}

.acx-apps-modal.is-open .acx-apps-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.acx-apps-modal-title {
    color: #fff !important;
    font-size: 1.8rem !important;
    font-weight: 400;
    margin-bottom: 40px;
    text-align: center;
    font-family: 'Helvetica', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-wrap: balance;
    user-select: none;
}

.acx-apps-modal-apps {
    display: flex;
    gap: 48px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

/* Vista reproductor (iframe) */
.acx-apps-player {
    display: none;
    width: 100%;
    height: 100%;
}
.acx-apps-modal-content.show-player .acx-apps-player {
    display: flex;
    flex-direction: column;
}
.acx-apps-modal-content.show-player .acx-apps-modal-title,
.acx-apps-modal-content.show-player .acx-apps-modal-apps {
    display: none;
}

/* Casi pantalla completa cuando hay una app abierta */
.acx-apps-modal-content.is-fullscreen {
    width: 96vw;
    max-width: 96vw;
    height: calc(96dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(96dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 24px;
    padding: 16px 16px 16px 16px;
}

.acx-apps-player-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.acx-btn {
    background: #ffffff;
    color: #0a2ccf;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.acx-btn:active { transform: scale(0.98); }
.acx-btn:focus { outline: 3px solid rgba(255,255,255,0.4); outline-offset: 1px; }

.acx-player-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    flex: 1 1 auto;
    user-select: none;
    font-family: 'Helvetica', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-wrap: balance;
}

.acx-player-body {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #101010;
}
.acx-player-loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 600;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.acx-player-loader[aria-hidden="true"] { display: none; }

.acx-player-iframe {
    border: 0;
    width: 100%;
    height: 100%;
    background: #ffffffce;
}

.acx-apps-modal-app {
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    transition: transform 0.2s ease-in-out;
}

.acx-apps-modal-app img {
    border-radius: 11px;
    width: 95px;
    height: 95px;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transition: transform 0.2s ease-in-out, filter 0.2s ease-in-out;
    cursor: pointer;
    user-select: none;
}

.acx-apps-modal-app:hover img {
    transform: scale(1.05);
    filter: brightness(0.9);
}

.acx-apps-modal-app-label {
    max-width: 95px;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    text-wrap: balance;
    user-select: none;
    margin-top: 4px;
    font-weight: 500;
    font-family: 'Helvetica', sans-serif;
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 600px) {
    .acx-apps-modal-content {
        min-width: min(92vw, 560px);
        padding: 20px 5vw 20px 5vw;
        border-radius: 32px;
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    }

    .acx-apps-modal-content.is-fullscreen {
        width: 98vw;
        max-width: 98vw;
        height: calc(98dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: calc(98dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        border-radius: 16px;
        padding: 12px 12px 12px 12px;
    }

    .acx-apps-modal-apps {
        gap: 18px;
        justify-content: center;
    }

    .acx-apps-modal-app {
        width: 80px;
    }

    .acx-apps-modal-app img {
        width: 60px;
        height: 60px;
    }

    .acx-apps-modal-app-label {
        font-size: 0.8rem;
    }
}

/* Scroll interno si el contenido sobrepasa el alto máximo */
.acx-apps-modal-content::-webkit-scrollbar {
    width: 8px;
}
.acx-apps-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 4px;
}