/* Loki Mode: Global Responsive Fixes
   Target: Fix horizontal scrolling, stack grids, and fluid typography on mobile. */

/* 1. Global Overflow Protection */
body,
html {
    max-width: 100vw;
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* 2. Responsive Tables (The Scroll Fix) */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2rem;
    scrollbar-width: thin;
    /* Firefox */
}

/* Ensure tables inside don't force width on parent */
.table-responsive table {
    min-width: 600px;
    /* Force minimum width to trigger scroll only when needed */
    max-width: none;
    width: 100%;
}

/* 3. Fluid Typography Helper */
.text-fluid-h1 {
    font-size: clamp(2rem, 6vw, 3.5rem) !important;
    line-height: 1.1;
    word-break: break-word;
}

.text-fluid-h2 {
    font-size: clamp(1.75rem, 5vw, 2.75rem) !important;
}

/* 4. Grid Stacking Updates */
@media (max-width: 991px) {

    /* Stack columns on tablet/mobile */
    .row {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .col-4,
    .col-6,
    .col-3 {
        width: 100% !important;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Loki Grids */
    .loki-grid,
    .features-grid-pro,
    .winner-podium,
    .trust-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Hero Padding adjustments */
    .loki-hero,
    .hero-stage3 {
        padding: 3rem 1rem !important;
        min-height: auto !important;
    }

    /* Reduce margins */
    .mt-2xl,
    .mb-2xl {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .container {
        padding: 0 1rem;
    }
}

/* 5. Stage Specific Mobile Patches */

/* Stage 3 Hero Mobile */
@media (max-width: 768px) {
    .shape {
        display: none;
    }

    /* Hide complex animations on mobile for performance */
    .hero-title-pro3 {
        font-size: 2.5rem !important;
    }

    .hero-badge-pro3 {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
}

/* Stage 1 Mobile */
@media (max-width: 768px) {
    .loki-toggle-container {
        flex-direction: column;
        width: 100%;
        border-radius: 20px;
    }

    .loki-toggle-btn {
        width: 100%;
        text-align: center;
    }
}