/* ====================================================
   GLOBAL MOBILE RESPONSIVE LAYER
   Loaded last on every page so it overrides page-level
   <style> blocks. Layout only - no content changes.
==================================================== */

/* ---------- Base safety (all sizes) ---------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

img {
    height: auto;
}

/* Long words / emails / URLs should wrap instead of overflowing */
p, li, td, th, a, h1, h2, h3, h4, h5, h6, span {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Tables never push the page wider than the screen */
.dim-table-wrapper,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fluid auto-fit grids that used fixed 320/340px minimums */
.features {
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)) !important;
}

/* ====================================================
   TABLET (<= 991px)
==================================================== */
@media (max-width: 991px) {

    /* Bootstrap rows that were forced to flex should still wrap */
    .row[style*="display: flex"],
    .row[style*="display:flex"] {
        flex-wrap: wrap !important;
    }

    .solution-hero,
    .capability-hero {
        padding: 70px 0 60px 0;
    }

    .solution-hero h1,
    .capability-hero h1 {
        font-size: 36px;
    }

    .universal-transparent-text h3 {
        font-size: 50px;
    }

    .transparent-text h1 {
        font-size: 60px;
        right: 0;
    }

    .section-title h2,
    .section-title-premium h2 {
        font-size: 30px;
    }

    .about-content {
        padding: 30px 0;
    }
}

/* Long mobile menu scrolls instead of running off-screen */
@media (max-width: 991px) {
    .nav-menu.active {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
}

/* ====================================================
   MOBILE (<= 767px)
==================================================== */
@media (max-width: 767px) {

    body {
        overflow-x: hidden;
    }

    .container,
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* ---------- Headings ---------- */
    .solution-hero h1,
    .capability-hero h1,
    .hero-content h1,
    .carousel-caption h1 {
        font-size: 28px !important;
        line-height: 1.25;
    }

    .section-title h2,
    .section-title-premium h2,
    .section-title-line h2,
    .inner-about-heading,
    .inner-about-in,
    .banner-overlay h2,
    .contact h2,
    .brochure h2,
    .quote-form h2,
    .category-title {
        font-size: 24px !important;
        line-height: 1.3;
    }

    .inner-about-heading,
    .inner-about-in {
        margin-top: 0 !important;
    }

    .inner-heading {
        font-size: 21px;
    }

    .inner-heading span {
        font-size: 17px;
    }

    .universal-transparent-text h3 {
        font-size: 36px !important;
        margin-top: 0;
    }

    .transparent-text h1 {
        font-size: 40px;
        position: static;
    }

    .lead-magnet-card h3,
    .promo-left h3,
    .cta-card h3 {
        font-size: 22px;
    }

    .stat-item h3 {
        font-size: 30px;
    }

    /* Inline-styled big headings */
    h1[style*="font-size"],
    h2[style*="font-size"] {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    h3[style*="font-size: 2"],
    h3[style*="font-size:2"],
    h3[style*="font-size: 3"],
    h3[style*="font-size:3"] {
        font-size: 20px !important;
    }

    /* Large decorative icons */
    i[style*="font-size: 80px"],
    i[style*="font-size:80px"],
    i[style*="font-size: 100px"],
    i[style*="font-size: 150px"] {
        font-size: 56px !important;
    }

    .solution-hero p,
    .capability-hero p {
        font-size: 15px;
    }

    .section-title p {
        font-size: 15px;
    }

    .about-content p {
        font-size: 16px;
    }

    /* ---------- Section spacing ---------- */
    .solution-hero,
    .capability-hero {
        padding: 50px 0 40px 0;
    }

    .section-about,
    .section-products,
    .section-expertise,
    .section-updates,
    .section-values,
    .section-padding,
    .client-section-outer,
    .promo-section,
    .legacy-intro-section,
    .machinery-section,
    .capability-section,
    .content-section {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .product-img-section {
        padding: 35px 0;
    }

    section[style*="padding: 80px"],
    section[style*="padding:80px"],
    section[style*="padding: 70px"],
    section[style*="padding: 60px"],
    section[style*="padding: 50px"] {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    .section-title,
    .section-title-premium {
        margin-bottom: 30px;
    }

    /* ---------- Cards / boxes ---------- */
    .content-box,
    .tech-spec-box,
    .feature-card,
    .oem-box,
    .qc-box,
    .service-box,
    .value-card,
    .quote-form {
        padding: 24px 20px;
        margin-bottom: 20px;
    }

    .cta-card,
    .lead-magnet-card,
    .calc-promo-card {
        padding: 30px 20px;
        margin: 30px 0;
    }

    .lead-magnet-card::before,
    .calc-promo-card::after {
        width: 200px;
        height: 200px;
    }

    div[style*="padding: 60px 20px"] {
        padding: 35px 15px !important;
    }

    /* ---------- Buttons ---------- */
    .btn-premium,
    .btn-outline-premium,
    .btn-hero,
    .main-btn-2 {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .btn-outline-premium[style*="margin-left"] {
        margin-left: 0 !important;
        margin-top: 12px;
    }

    /* Rows nested directly in rows double the negative gutter */
    .row > .row {
        margin-left: 0;
        margin-right: 0;
    }

    /* Blog list cards */
    .solution .image-box {
        margin-left: 0;
        margin-right: 0;
    }

    .solution .content-box {
        padding: 40px 20px 24px 20px;
    }

    .solution .content-box h2 {
        font-size: 20px;
    }

    /* ---------- Hero slider (home) ---------- */
    .slider-container {
        height: 480px;
    }

    .carousel-caption {
        width: 88% !important;
    }

    .dot-indicators {
        bottom: 14px;
    }

    .carousel-caption p {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* ---------- Grids ---------- */
    .stats-grid,
    .grid,
    .product-grid,
    .capability-grid,
    .legacy-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .values-grid,
    .hero-grid,
    .about-bullets {
        grid-template-columns: 1fr;
    }

    .industry-card {
        padding: 25px 12px;
    }

    .about-badge {
        bottom: 12px;
        right: 12px;
        padding: 10px 14px;
    }

    /* Client logos: 3 per row instead of 1 */
    .cleint-section > .col-md-2 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    /* ---------- Banner headers ---------- */
    .banner-wrapper {
        height: 160px;
    }

    .banner-overlay {
        left: 16px;
        right: 16px;
        bottom: 25px;
    }

    .section-about[style*="100vh"],
    .section-about {
        height: auto !important;
        min-height: 0;
    }

    /* ---------- Tables ---------- */
    table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    td, th {
        padding: 6px 8px;
        font-size: 13px !important;
    }

    /* Numeric dimension tables scroll sideways instead of squashing */
    .dim-table td,
    .dim-table th {
        white-space: nowrap;
    }

    /* ---------- Text blocks ---------- */
    .text-justify,
    p[style*="text-align: justify"] {
        text-align: left !important;
    }

    .rts-single-service-ten p.disc {
        width: 100%;
    }

    /* ---------- Footer ---------- */
    .footer .row > [class*="col-lg-"] {
        margin-bottom: 25px;
    }

    .footer-logo img {
        max-width: 200px;
    }

    .bg-column {
        margin-bottom: 35px;
    }
}

/* ====================================================
   SMALL PHONES (<= 480px)
==================================================== */
@media (max-width: 480px) {

    .solution-hero h1,
    .capability-hero h1,
    .hero-content h1,
    .carousel-caption h1 {
        font-size: 24px !important;
    }

    .section-title h2,
    .section-title-premium h2,
    .section-title-line h2,
    .inner-about-heading,
    .inner-about-in,
    .banner-overlay h2,
    .contact h2,
    .brochure h2,
    .quote-form h2,
    .category-title,
    h1[style*="font-size"],
    h2[style*="font-size"] {
        font-size: 21px !important;
    }

    .universal-transparent-text h3 {
        font-size: 30px !important;
    }

    .stats-grid,
    .grid,
    .product-grid,
    .capability-grid,
    .legacy-metrics-grid {
        grid-template-columns: 1fr;
    }

    /* Industry tiles are small - keep two per row */
    .section-expertise .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .industry-card h3 {
        font-size: 13px;
    }

    .industry-icon {
        font-size: 28px;
    }

    .cleint-section > .col-md-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .btn-premium,
    .btn-outline-premium {
        display: block;
        width: 100%;
    }

    .cta-card,
    .lead-magnet-card,
    .calc-promo-card {
        padding: 25px 16px;
    }
}
