/* ==========================================================
   AstraNexo Design System
   Responsive
   ========================================================== */

@media (max-width: 1200px) {
    :root {
        --an-sidebar-width: 240px;
    }

    .an-grid-4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .an-grid-3 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 768px) {
    .an-sidebar {
        transform: translateX(-100%);
        width: min(280px, 86vw);
    }

    .an-sidebar.is-open {
        transform: translateX(0);
    }

    .an-main {
        margin-left: 0;
    }

    .an-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 90;

        display: none;

        background: rgba(9,14,25,.55);
    }

    .an-sidebar-overlay.is-open {
        display: block;
    }

    .an-mobile-menu-button {
        display: inline-flex;
    }

    .an-topbar {
        padding: 0 16px;
    }

    .an-page {
        padding: 20px 16px;
    }

    .an-page-header {
        flex-direction: column;
    }

    .an-grid-2,
    .an-grid-3,
    .an-grid-4 {
        grid-template-columns: 1fr;
    }

    .an-card-body {
        padding: 18px;
    }

    .an-table-responsive thead {
        display: none;
    }

    .an-table-responsive,
    .an-table-responsive tbody,
    .an-table-responsive tr,
    .an-table-responsive td {
        display: block;
        width: 100%;
    }

    .an-table-responsive tr {
        padding: 12px 14px;
        border-bottom: 1px solid var(--an-border);
    }

    .an-table-responsive td {
        display: flex;
        justify-content: space-between;
        gap: 16px;

        padding: 7px 0;
        border: 0;
    }

    .an-table-responsive td::before {
        content: attr(data-label);

        color: var(--an-text-muted);

        font-size: var(--an-text-xs);
        font-weight: 650;
    }

    .an-modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .an-modal {
        width: 100%;
        max-height: 88vh;

        border-radius:
            var(--an-radius-xl)
            var(--an-radius-xl)
            0
            0;
    }
}


@media (max-width: 480px) {
    h1 {
        font-size: 22px;
    }

    .an-page {
        padding: 16px 12px;
    }

    .an-row-between {
        align-items: flex-start;
        flex-direction: column;
    }

    .an-btn-mobile-block {
        width: 100%;
    }

    .an-toast-region {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .an-toast {
        width: 100%;
    }
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
