/**
 * GEC Frontend Framework
 * Sticky bottom action bar — phones and tablets (owner 2026-11-07)
 *
 * Markup: template-parts/components/mobile-action-bar.php. Same breakpoint as the mobile
 * navigation (header.css, max-width 61.99rem). Also hides the placeholder AI chat widget
 * there: its fixed 340px panel overflows narrow phones (owner 2026-11-07, temporary).
 *
 * @package GEC_Academy_Child
 */

.gec-mobile-action-bar,
.gec-mobile-action-bar__spacer {
    display: none;
}

@media (max-width: 61.99rem) {
    .gec-mobile-action-bar__spacer {
        display: block;
        block-size: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    .gec-mobile-action-bar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: var(--z-fixed, 1030);
        display: flex;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
        border-block-start: var(--border-width) var(--border-style) var(--color-border);
        background: var(--color-surface);
        box-shadow: 0 -6px 20px rgba(17, 24, 39, .08);
    }

    .gec-mobile-action-bar__action {
        display: inline-flex;
        flex: 1 1 0;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-block-size: 46px;
        padding-inline: var(--space-2);
        border-radius: var(--radius-button);
        color: var(--color-text-inverse);
        font-size: .875rem;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }

    .gec-mobile-action-bar__action:focus-visible {
        outline: 2px solid var(--color-text-primary);
        outline-offset: 2px;
    }

    .gec-mobile-action-bar__action--zalo {
        background: var(--color-success-600);
    }

    .gec-mobile-action-bar__action--zalo:active {
        background: var(--color-success-700);
    }

    .gec-mobile-action-bar__action--schedule {
        background: var(--color-primary-600);
    }

    .gec-mobile-action-bar__action--schedule:active {
        background: var(--color-primary-700);
    }

    .gec-mobile-action-bar__icon {
        flex: none;
        inline-size: 1.125rem;
        block-size: 1.125rem;
    }

    /* The open mobile menu reaches the bottom of the screen; the bar would cover its last items
       (Giỏ hàng, Đăng nhập) on short phones. Step aside while the menu is open. */
    body:has(.gec-mobile-nav.is-open) .gec-mobile-action-bar {
        display: none;
    }

    /* Placeholder AI assistant: hidden on phones and tablets until the real assistant ships. */
    #chatWidget {
        display: none;
    }
}

/* Under 360px both labels still fit on one line without the icons. */
@media (max-width: 22.5rem) {
    .gec-mobile-action-bar {
        gap: 6px;
        padding-inline: 8px;
    }

    .gec-mobile-action-bar__action {
        font-size: .8125rem;
    }

    .gec-mobile-action-bar__icon {
        display: none;
    }
}
