/* AYYAN SYSTEMS — FINAL MOBILE RESPONSIVE PATCH
   Fixes horizontal overflow, clipped hero/footer, touch targets,
   duplicate bottom navigation and missing mobile CRM login. */

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img, svg, video, iframe {
    max-width: 100%;
}

@media (max-width: 1199px) {
    .ayyan-mobile-login-btn {
        display: inline-flex !important;
    }
}

.ayyan-mobile-login-btn {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #172968;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 18px;
}

@media (max-width: 767px) {
    body {
        min-width: 0 !important;
        padding-bottom: 68px !important;
    }

    .main-wrapper, .home-twelve, main, section, footer {
        max-width: 100%;
    }

    .container, .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .row {
        --bs-gutter-x: 1.5rem;
    }

    /* Header */
    .ayyan-header-container {
        width: 100%;
        max-width: 100%;
        gap: 7px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .ayyan-logo-area {
        min-width: 0;
        margin-right: auto;
    }

    .ayyan-logo {
        width: 100px !important;
        height: 38px !important;
    }

    .ayyan-header-right {
        gap: 6px !important;
        margin-left: 0 !important;
    }

    .ayyan-language-switch {
        flex: 0 0 auto;
    }

    .ayyan-mobile-menu-btn {
        flex: 0 0 42px;
    }

    /* Public mobile navigation: one clean bottom bar only. */
    .mobile-bottom-bar {
        display: none !important;
    }

    .ayyan-mobile-bottom-bar {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100% !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
    }

    .ayyan-mobile-bottom-bar a {
        min-width: 0;
        overflow: hidden;
    }

    /* Hero: stack instead of keeping a desktop 1.25fr / .75fr layout. */
    .ay-hero-intro {
        padding: 36px 0 42px !important;
        overflow: hidden;
    }

    .ay-hero-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
        width: 100%;
    }

    .ay-hero-grid > * {
        width: 100% !important;
        min-width: 0 !important;
    }

    .ay-hero-intro h1 {
        font-size: clamp(32px, 9vw, 42px) !important;
        line-height: 1.1 !important;
        overflow-wrap: anywhere;
    }

    .ay-hero-sub {
        font-size: 16px !important;
    }

    .ay-hero-desc {
        font-size: 14px;
        line-height: 1.65;
    }

    .ay-hero-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .ay-new-btn {
        width: 100%;
        min-height: 48px;
    }

    .ay-hero-panel {
        width: 100% !important;
        padding: 22px !important;
        border-radius: 18px;
    }

    .ay-panel-list div {
        min-height: 44px;
    }

    /* Service cards: no horizontal strip on small screens. */
    .services-content-nine {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 16px !important;
    }

    .services-item-nine {
        width: 100% !important;
        height: 320px !important;
        min-width: 0 !important;
    }

    /* Generic flex sections must be allowed to wrap on phones. */
    .quick-actions-inner,
    .quick-actions-buttons,
    .trust-badges-row {
        flex-wrap: wrap !important;
    }

    .quick-actions-inner {
        gap: 16px !important;
    }

    .quick-actions-text,
    .quick-actions-buttons {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Footer: force Bootstrap columns to stay inside the viewport. */
    .footer-five {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow: hidden !important;
    }

    .footer-five .container,
    .footer-five .row {
        max-width: 100% !important;
    }

    .footer-five .footer-widget {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .footer-five .slide-five,
    .footer-five .slide-list {
        max-width: 100%;
        overflow: hidden;
    }

    .footer-five .slide-five .slide-list .services-slide h2 {
        font-size: 34px !important;
    }

    /* Floating call/WhatsApp buttons must not create horizontal overflow. */
    .btn-floating {
        right: 10px !important;
        width: 46px !important;
        height: 46px !important;
    }

    .btn-floating span {
        display: none !important;
    }
}

@media (max-width: 360px) {
    .ayyan-logo {
        width: 92px !important;
    }

    .ayyan-language-btn {
        min-width: 34px !important;
        padding: 0 6px !important;
        font-size: 11px !important;
    }

    .ayyan-language-switch {
        padding: 2px 3px !important;
    }

    .ayyan-mobile-login-btn,
    .ayyan-mobile-menu-btn {
        width: 40px !important;
        height: 40px !important;
        flex-basis: 40px !important;
    }

    .ay-hero-intro h1 {
        font-size: 30px !important;
    }

    .ay-hero-panel {
        padding: 18px !important;
    }
}
