/* --- Desktop & Large Tablets (up to 1366px) --- */
@media (max-width: 1366.98px) {
    .steps-wrapper .step-content h3 {
        font-size: 20px;
    }

    .steps-wrapper .step {
        padding: 50px 10px;
    }

    .section-title h2 {
        font-size: 35px;
    }

    .asylon-grid {
        margin-bottom: 0px;
    }
}

/* --- Standard Tablets & Small Laptops (up to 1200px) --- */
@media (max-width: 1200.98px) {
    .asylon-card .card-text-block h2 {
        font-size: 18px;
        background: #fff;
        margin-bottom: 0px;
        padding-bottom: 4px;
        position: relative;
        z-index: 2121;
    }

    .site-container {
        padding: 0px 10px;
    }

    .inner-pages-header {
        min-height: 456px;
    }

    .header-nav .nav-list,
    .header-actions {
        display: none;
    }

    .hero-section {
        padding-top: 100px;
    }

    .hero-title h2 {
        font-size: 55px;
    }

    .mobile-menu {
        display: block;
    }

    .mobile-menu button {
        background: none;
        border: none;
        cursor: pointer;
    }

    .menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: 0.4s;
        z-index: 98;
    }

    .side-menu {
        display: block;
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: #0C2448;
        padding: 0px;
        transition: 0.4s ease-in-out;
        z-index: 99;
    }

    .side-menu.active {
        right: 0px;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .header-logo {
        display: flex;
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }

    .hero-section .hero-grid {
        gap: 150px;
    }

    :is(p) {
        font-size: 15px;
    }

    .section-title h2 br {
        display: none;
    }

    #sideMenu .nav-link {
        padding: 13.5px 0px;
        font-size: 16px;
        text-transform: capitalize;
        gap: 5px;
        color: #fff;
        display: block;
    }

    span#closeMenu {
        background: #4ab178;
        height: 40px;
        width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: #fff;
        position: absolute;
        right: 0;
        top: 0;
    }

    #sideMenu .nav-item a {
        padding: 10px 18px;
        border-bottom: 1px solid #eeeeee1a;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-list {
        list-style: none;
        padding: 0px;
        margin-bottom: 0px;
        margin-top: 55px;
    }
}

/* --- Tablets & iPhones (up to 1024px) --- */
@media (max-width: 1024.98px) {
    .hero-section .hero-grid {
        gap: 36px;
        grid-template-columns: 1fr;
    }

    .hero-title h2 {
        font-size: 60px;
    }

    .hero-section {
        padding-top: 120px;
        padding-bottom: 40px;
    }

    .mobile-image { display: block; }
    .pc-image { display: none; }

    .who-we-serve {
        padding-top: 70px;
        padding-bottom: 140px;
    }

    .serve-grid {
        grid-template-columns: 1fr;
    }

    .serve-grid .serve-card {
        padding: 28px;
        max-width: 720px;
        margin-inline: auto;
        min-height: auto;
    }

    /* --- STEPS WORKFLOW FINAL REFINEMENT --- */
    .steps-wrapper {
        display: flex;
        flex-direction: column;
        gap: 150px; /* Increased for breathing room between arrow and circle */
        padding-top: 100px; /* Safe space for top green circle */
        overflow: visible !important;
    }

    .steps-wrapper .step {
        position: relative;
        width: 100%;
        padding: 65px 25px 45px; 
        border-radius: 20px;
        overflow: visible !important;
    }

    .steps-wrapper .step-number {
        background: #4AB178 !important;
        color: #fff;
        width: 65px;
        height: 65px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 100px;
        position: absolute;
        top: -32px !important; 
        left: 50%;
        transform: translateX(-50%); /* Perfect centering */
        z-index: 20; 
        background-image: none !important;
        font-weight: bold;
    }

    .steps-wrapper .step::after {
        position: absolute;
        content: '';
        background-image: url(../images/Arrow-2.png);
        display: block;
        height: 100px;
        width: 100px;
        background-size: contain;
        background-repeat: no-repeat;
        left: 50%;
        top: auto;
        bottom: -120px; /* Aligned vertically in the gap */
        transform: translateX(-50%) rotate(15deg); 
        z-index: 10;
        opacity: 0.9;
    }

    /* FIX: Remove arrow after step 04 so it doesn't touch the button */
    .steps-wrapper .step:last-child::after {
        display: none !important;
        content: none !important;
    }

    .steps-wrapper .step::before {
        display: none !important;
    }

    .how-it-works .action-btn {
        margin-top: 60px;
        padding-bottom: 20px;
    }
    /* --- END WORKFLOW FIXES --- */

    .how-it-works { padding-bottom: 140px; }
    .why-asylon, .testimonials-block, .asylon-works { padding-bottom: 140px; }

    .footer-grid { grid-template-columns: 1fr; padding: 56px 0px; }
    .footer-right { gap: 72px; justify-content: start; margin-top: 50px; }

    .example-grid { grid-template-columns: 1fr 1fr; }
    .example-grid .example-card:last-child { grid-column: 1/3; }
    .why-grid { grid-template-columns: 1fr 1fr; }

    .Feature-Block { padding-top: 70px; padding-bottom: 127px; }
    .Feature-Card { min-height: auto; max-width: 100%; height: auto; }
    .root-btn a { width: 100%; text-align: center; }

    .Randy-grid { grid-template-columns: 1fr; gap: 50px; }
    .contact-asylon .contact-grid { grid-template-columns: 1fr; gap: 56px; }
    .contact-right form { display: flex; padding: 20px; flex-wrap: wrap; }
    .contact-right form .input-root { width: calc(100% - 57%); }
}

/* --- Mobile Smartphones (up to 575px) --- */
@media (max-width: 575.98px) {
    .hero-title h2 { font-size: 33px; }
    .hero-section { padding-top: 125px; padding-bottom: 55px; }

    .steps-wrapper { gap: 150px; } 
    .steps-wrapper .step { padding: 60px 20px 40px; }

    .asylon-card::after {
        position: absolute;
        content: '';
        background-image: url(../images/mobileArrow.png);
        height: 65px;
        width: 70px;
        background-size: contain;
        background-repeat: no-repeat;
        top: 144px;
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-grid { padding: 69px 0px; }
    .contact-right form { padding: 35px; flex-direction: column; }
    .contact-right form .input-root { width: 100%; }

    /* Cleanup extra background elements for mobile */
    .demo-form-section::after,
    .block-left2::before,
    .block-left::before,
    .cta-w1::before,
    .cta-w1::after,
    .asylon-works::before,
    .asylon-works::after,
    .why-asylon::before {
        display: none;
    }
}