/*
 * M/S Babu Enterprise - mobile first emergency responsive layer
 * This file is intentionally loaded LAST. It protects every public page
 * against fixed-width sections, overflowing media and cached legacy CSS.
 */

:root {
    --mobile-edge: clamp(14px, 4vw, 24px);
    --mobile-radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    position: relative;
}

main,
header,
footer,
nav,
section,
article,
aside,
.container,
.container-fluid,
.row,
[class^="col-"],
[class*=" col-"] {
    min-width: 0 !important;
    max-width: 100%;
}

.container,
.container-fluid {
    width: 100%;
}

img,
picture,
video,
canvas,
svg,
iframe,
object,
embed {
    max-width: 100% !important;
}

img,
video {
    height: auto;
}

iframe {
    width: 100%;
    border: 0;
}

pre,
code,
table {
    max-width: 100%;
}

p,
a,
span,
small,
strong,
label,
li,
th,
td,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: anywhere;
    word-break: normal;
}

input,
select,
textarea,
button,
.btn,
.form-control,
.form-select,
.input-group {
    max-width: 100%;
}

.form-control,
.form-select,
textarea.form-control {
    font-size: 16px !important;
}

.table-responsive,
.compare-table-wrap,
.pfx-spec-table-wrap,
.suote-spec-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Header works without relying on desktop assumptions. */
.navbar,
.navbar > .container,
.navbar > .container-fluid {
    width: 100%;
}

.navbar-brand {
    min-width: 0;
    max-width: calc(100% - 62px);
}

.navbar-brand > span {
    min-width: 0;
}

.brand-name,
.brand-subtitle {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-toggler {
    flex: 0 0 auto;
}

/* Shared sections */
.section-padding {
    padding-block: clamp(48px, 8vw, 110px) !important;
}

.page-hero,
.page-hero-small,
.spare-parts-hero {
    overflow: hidden;
}

.page-hero h1,
.page-hero-small h1,
.spare-parts-hero h1 {
    font-size: clamp(2rem, 8vw, 4rem) !important;
    line-height: 1.1 !important;
    text-wrap: balance;
}

.page-hero p,
.page-hero-small p,
.spare-parts-hero p {
    font-size: clamp(1rem, 3vw, 1.2rem) !important;
}

.solution-card,
.spare-part-card,
.value-card,
.form-card,
.filter-panel,
.compare-picker,
.cta-box,
.feature-box,
.partner-card,
.home-spare-card,
.business-person-card,
.contact-methods,
.about-image-wrap {
    min-width: 0;
    max-width: 100%;
}

.solution-card img,
.spare-part-card img,
.home-spare-card img,
.about-image-wrap img {
    width: 100%;
}

.category-filters {
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    -webkit-overflow-scrolling: touch;
}

.category-filters .filter-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.compare-table {
    min-width: 720px;
}

/* Homepage industrial design */
.home-industrial .industrial-hero,
.home-industrial .featured-machines-section,
.home-industrial .production-process-section,
.home-industrial .machine-showcase-section,
.home-industrial .spare-parts-industrial-section,
.home-industrial .company-story-section,
.home-industrial .partner-industrial-section,
.home-industrial .final-industrial-cta {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background-attachment: scroll !important;
}

.home-industrial .industrial-hero__row,
.home-industrial .hero-copy-panel,
.home-industrial .hero-machine-stage,
.home-industrial .hero-machine-card,
.home-industrial .industrial-products-grid,
.home-industrial .process-grid,
.home-industrial .machine-showcase-grid,
.home-industrial .spare-glass-grid,
.home-industrial .partner-industrial-grid,
.home-industrial .company-feature-list,
.home-industrial .final-industrial-cta__box {
    min-width: 0;
    max-width: 100%;
}

.home-industrial .industrial-hero__title {
    font-size: clamp(2.2rem, 8vw, 5.25rem) !important;
    line-height: 1.04 !important;
    letter-spacing: clamp(-2px, -.12vw, -1px) !important;
}

.home-industrial .industrial-section-title {
    font-size: clamp(2rem, 6vw, 4rem) !important;
    line-height: 1.1 !important;
}

.home-industrial .hero-machine-card,
.home-industrial .hero-machine-card__image-wrap,
.home-industrial .hero-machine-card__image,
.home-industrial .industrial-product-card__media,
.home-industrial .machine-showcase-tile,
.home-industrial .spare-glass-card__image,
.home-industrial .company-story-visual {
    width: 100%;
    max-width: 100%;
}

.home-industrial .hero-machine-card__image,
.home-industrial .industrial-product-card__media img,
.home-industrial .machine-showcase-tile img,
.home-industrial .spare-glass-card__image img,
.home-industrial .company-story-visual img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.home-industrial .technology-marquee,
.home-industrial .technology-marquee__viewport {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Product details */
.product-industrial-page .pfx-product-main,
.product-industrial-page .pfx-product-layout,
.product-industrial-page .pfx-showroom,
.product-industrial-page .pfx-gallery-panel,
.product-industrial-page .pfx-summary-panel,
.product-industrial-page .pfx-category-sidebar,
.product-industrial-page .commerce-product-gallery,
.product-industrial-page .commerce-gallery-stage,
.product-industrial-page .commerce-gallery-viewer,
.product-industrial-page .pfx-inquiry-shell,
.product-industrial-page .pfx-related-card {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
}

.product-industrial-page .pfx-product-layout {
    align-items: start;
}

.product-industrial-page .commerce-gallery-main-image,
.product-industrial-page .commerce-gallery-viewer video,
.product-industrial-page .commerce-gallery-viewer iframe {
    width: 100% !important;
    max-width: 100% !important;
}

.product-industrial-page .commerce-gallery-thumbs,
.product-industrial-page .pfx-section-nav-inner {
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.product-industrial-page .pfx-summary-panel h1,
.product-industrial-page .pfx-summary-panel h2,
.product-industrial-page .pfx-section-heading h2 {
    text-wrap: balance;
}

.product-industrial-page .pfx-primary-actions .btn,
.product-industrial-page .pfx-document-actions .btn {
    white-space: normal;
}

/* Footer and floating actions */
.site-footer,
.site-footer .container,
.site-footer .row,
.footer-bottom {
    min-width: 0;
    max-width: 100%;
}

.footer-contact a,
.footer-contact span {
    overflow-wrap: anywhere;
}

.whatsapp-float,
.back-to-top {
    max-width: none !important;
}

@media (max-width: 1199.98px) {
    .home-industrial .hero-machine-stage__gear--large,
    .home-industrial .hero-machine-stage__orbit--large {
        transform: scale(.82);
    }
}

@media (max-width: 991.98px) {
    .container,
    .container-fluid {
        --bs-gutter-x: 1.5rem;
    }

    .navbar .container {
        flex-wrap: wrap;
    }

    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        margin-top: .65rem;
        padding: .75rem;
        border: 1px solid rgba(15, 40, 68, .12);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 18px 42px rgba(15, 40, 68, .14);
        max-height: calc(100dvh - 92px);
        overflow-y: auto;
    }

    .navbar-nav {
        width: 100%;
        align-items: stretch !important;
        gap: .2rem !important;
    }

    .navbar-nav .nav-item,
    .navbar-nav .nav-link,
    .navbar-nav .btn {
        width: 100%;
    }

    .navbar-nav .nav-link {
        min-height: 46px;
        display: flex;
        align-items: center;
        padding: .7rem .85rem !important;
        border-radius: 12px;
    }

    .home-industrial .industrial-hero__row > [class*="col-"],
    .product-industrial-page .pfx-hero .row > [class*="col-"],
    .product-industrial-page .pfx-inquiry-shell > *,
    .company-story-section .row > [class*="col-"],
    .partner-industrial-section .row > [class*="col-"] {
        width: 100%;
    }

    .home-industrial .hero-machine-stage {
        width: min(100%, 700px);
        margin-inline: auto;
    }

    .home-industrial .process-grid,
    .home-industrial .partner-industrial-grid,
    .home-industrial .company-feature-list,
    .home-industrial .machine-showcase-grid,
    .home-industrial .industrial-products-grid,
    .home-industrial .spare-glass-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .home-industrial .machine-showcase-tile--1,
    .home-industrial .machine-showcase-tile--4 {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .product-industrial-page .pfx-product-layout {
        grid-template-columns: 1fr !important;
    }

    .product-industrial-page .pfx-category-sidebar {
        position: static !important;
        inset: auto !important;
    }

    .product-industrial-page .pfx-document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .spare-parts-intro {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 15.5px;
    }

    .container,
    .container-fluid {
        --bs-gutter-x: 1.15rem;
    }

    .topbar {
        display: none !important;
    }

    .navbar-brand {
        max-width: calc(100% - 58px);
    }

    .brand-logo {
        width: 43px !important;
        height: 43px !important;
    }

    .brand-name {
        font-size: .93rem !important;
        line-height: 1.1;
    }

    .brand-subtitle {
        max-width: 205px;
        font-size: .65rem !important;
        line-height: 1.15;
        white-space: nowrap;
    }

    .section-padding {
        padding-block: 54px !important;
    }

    .page-hero .container,
    .page-hero-small .container,
    .spare-parts-hero .container {
        padding-block: 48px !important;
    }

    .btn-lg {
        min-height: 48px;
        padding: .75rem 1rem;
        font-size: 1rem;
    }

    .filter-panel,
    .form-card,
    .compare-picker,
    .cta-box,
    .solution-card,
    .spare-part-card,
    .value-card {
        border-radius: var(--mobile-radius) !important;
    }

    .filter-panel,
    .form-card,
    .compare-picker,
    .cta-box {
        padding: 1rem !important;
    }

    .solution-image-wrap-large,
    .spare-part-image {
        min-height: 210px !important;
        height: auto !important;
        aspect-ratio: 4 / 3;
    }

    .solution-card .d-flex.gap-2.mt-auto,
    .spare-part-card .d-flex.gap-2.mt-auto {
        display: grid !important;
        grid-template-columns: 1fr 52px;
        width: 100%;
    }

    .home-industrial .industrial-hero {
        min-height: auto !important;
        padding-block: 64px 52px !important;
    }

    .home-industrial .hero-copy-panel {
        width: 100%;
        text-align: left;
    }

    .home-industrial .industrial-hero__actions,
    .home-industrial .final-industrial-cta__actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    .home-industrial .industrial-btn,
    .home-industrial .industrial-outline-link {
        width: 100% !important;
        justify-content: center;
        text-align: center;
    }

    .home-industrial .hero-trust-list {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
    }

    .home-industrial .hero-stat-grid {
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
    }

    .home-industrial .hero-stat {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .home-industrial .hero-machine-stage {
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
    }

    .home-industrial .hero-machine-card {
        min-height: 0 !important;
        height: auto !important;
        border-radius: 22px !important;
    }

    .home-industrial .hero-machine-card__image-wrap {
        min-height: 220px !important;
        aspect-ratio: 4 / 3;
    }

    .home-industrial .hero-floating-note {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: .7rem !important;
        animation: none !important;
        transform: none !important;
    }

    .home-industrial .hero-machine-stage__gear,
    .home-industrial .hero-machine-stage__orbit,
    .home-industrial .hero-scroll-cue,
    .home-industrial .industrial-hero__thread {
        display: none !important;
    }

    .home-industrial .industrial-products-grid,
    .home-industrial .process-grid,
    .home-industrial .machine-showcase-grid,
    .home-industrial .spare-glass-grid,
    .home-industrial .partner-industrial-grid,
    .home-industrial .company-feature-list {
        grid-template-columns: 1fr !important;
    }

    .home-industrial .industrial-product-card__media {
        height: auto !important;
        min-height: 220px;
        aspect-ratio: 4 / 3;
    }

    .home-industrial .machine-showcase-tile {
        min-height: 260px !important;
    }

    .home-industrial .company-story-visual {
        min-height: 280px !important;
    }

    .home-industrial .company-story-visual__badge {
        position: static !important;
        width: 100% !important;
        margin-top: .8rem;
        transform: none !important;
    }

    .home-industrial .final-industrial-cta__box {
        padding: 1.25rem !important;
        border-radius: 22px !important;
    }

    .product-industrial-page .pfx-hero {
        padding-block: 52px 42px !important;
    }

    .product-industrial-page .pfx-hero-copy h1 {
        font-size: clamp(2rem, 10vw, 3rem) !important;
    }

    .product-industrial-page .pfx-breadcrumb {
        width: 100%;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .product-industrial-page .pfx-hero-tags,
    .product-industrial-page .pfx-hero-stats,
    .product-industrial-page .pfx-quick-specs,
    .product-industrial-page .pfx-primary-actions,
    .product-industrial-page .pfx-feature-grid,
    .product-industrial-page .pfx-document-grid,
    .product-industrial-page .pfx-tech-grid,
    .product-industrial-page .pfx-trust-grid {
        grid-template-columns: 1fr !important;
    }

    .product-industrial-page .pfx-gallery-panel,
    .product-industrial-page .pfx-summary-panel,
    .product-industrial-page .pfx-category-sidebar,
    .product-industrial-page .pfx-inquiry-shell {
        padding: 1rem !important;
        border-radius: 18px !important;
    }

    .product-industrial-page .commerce-product-gallery {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    .product-industrial-page .commerce-gallery-thumbs {
        order: 2;
        display: flex !important;
        flex-direction: row !important;
        width: 100%;
        gap: .45rem;
        padding-top: .7rem;
        overflow-x: auto !important;
    }

    .product-industrial-page .commerce-gallery-thumb {
        flex: 0 0 66px !important;
        width: 66px !important;
        height: 66px !important;
    }

    .product-industrial-page .commerce-gallery-stage {
        order: 1;
        width: 100%;
    }

    .product-industrial-page .commerce-gallery-viewer {
        min-height: 300px !important;
        height: auto !important;
        padding: 3rem .65rem 2.25rem !important;
    }

    .product-industrial-page .commerce-gallery-main-image {
        width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
        object-fit: contain !important;
    }

    .product-industrial-page .commerce-gallery-viewer video,
    .product-industrial-page .commerce-gallery-viewer iframe {
        min-height: 230px !important;
        max-height: 300px !important;
    }

    .product-industrial-page .pfx-summary-panel h2 {
        font-size: clamp(1.65rem, 8vw, 2.25rem) !important;
    }

    .product-industrial-page .pfx-primary-actions .btn,
    .product-industrial-page .pfx-document-actions .btn {
        width: 100%;
    }

    .product-industrial-page .pfx-section-nav {
        top: 62px !important;
    }

    .product-industrial-page .pfx-section-nav-inner {
        justify-content: flex-start !important;
    }

    .product-industrial-page .pfx-section-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: .82rem .72rem !important;
        font-size: .76rem !important;
    }

    .product-industrial-page .pfx-story-visual {
        min-height: 250px !important;
    }

    .product-industrial-page .pfx-story-badge {
        position: static !important;
        width: 100% !important;
        margin-top: .8rem;
        transform: none !important;
    }

    .product-industrial-page .pfx-spec-table,
    .product-industrial-page .pfx-spec-table tbody,
    .product-industrial-page .pfx-spec-table tr,
    .product-industrial-page .pfx-spec-table th,
    .product-industrial-page .pfx-spec-table td {
        display: block !important;
        width: 100% !important;
    }

    .product-industrial-page .pfx-spec-table tr {
        padding: .8rem 1rem !important;
        border-bottom: 1px solid #e4ebf1;
    }

    .product-industrial-page .pfx-spec-table th,
    .product-industrial-page .pfx-spec-table td {
        padding: .2rem 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .product-industrial-page .pfx-document-actions {
        grid-template-columns: 1fr !important;
    }

    .product-industrial-page .pfx-inquiry-copy,
    .product-industrial-page .pfx-inquiry-form {
        padding: 1rem !important;
    }

    .product-industrial-page .pfx-related-heading {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .compare-floating-bar {
        left: var(--mobile-edge) !important;
        right: var(--mobile-edge) !important;
        bottom: calc(var(--mobile-edge) + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .compare-floating-bar > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .about-image-wrap .about-badge {
        position: static !important;
        width: 100% !important;
        margin-top: .8rem;
        transform: none !important;
    }

    .site-footer .row > [class*="col-"] {
        min-width: 0;
    }

    .footer-bottom {
        text-align: center;
    }

    .whatsapp-float {
        right: 12px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        width: 52px !important;
        height: 52px !important;
    }

    .back-to-top {
        right: 12px !important;
        bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 575.98px) {
    .brand-subtitle {
        max-width: 155px;
    }

    .page-hero .btn,
    .page-hero-small .btn,
    .spare-parts-hero .btn,
    .cta-box .btn {
        width: 100%;
    }

    .home-industrial .industrial-hero__title {
        font-size: clamp(2rem, 11vw, 2.65rem) !important;
    }

    .home-industrial .industrial-section-title {
        font-size: clamp(1.85rem, 9vw, 2.5rem) !important;
    }

    .home-industrial .hero-machine-card__image-wrap {
        min-height: 195px !important;
    }

    .home-industrial .machine-showcase-tile {
        min-height: 235px !important;
    }

    .product-industrial-page .commerce-gallery-viewer {
        min-height: 270px !important;
    }

    .product-industrial-page .commerce-gallery-main-image {
        max-height: 220px !important;
    }

    .compare-floating-bar > div:last-child {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 399.98px) {
    .container,
    .container-fluid {
        --bs-gutter-x: .9rem;
    }

    .brand-logo {
        width: 39px !important;
        height: 39px !important;
    }

    .brand-name {
        font-size: .83rem !important;
    }

    .brand-subtitle {
        display: none !important;
    }

    .navbar-toggler {
        min-width: 42px;
        min-height: 42px;
        padding: .3rem .5rem;
    }

    .home-industrial .industrial-hero__title {
        font-size: 2rem !important;
    }

    .product-industrial-page .commerce-gallery-viewer {
        min-height: 250px !important;
    }

    .product-industrial-page .commerce-gallery-main-image {
        max-height: 200px !important;
    }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 991.98px) {
    .navbar-collapse {
        max-height: calc(100dvh - 70px);
    }

    .home-industrial .industrial-hero {
        padding-block: 42px !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .home-industrial [data-home-parallax],
    .home-industrial .hero-machine-stage__gear,
    .home-industrial .hero-machine-stage__orbit {
        transform: none !important;
    }

    .solution-card:hover,
    .spare-part-card:hover,
    .industrial-product-card:hover,
    .pfx-related-card:hover,
    .partner-industrial-card:hover {
        transform: none !important;
    }
}

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

/* Keep the hero machine inside the document flow on phones. */
@media (max-width: 767.98px) {
    .home-industrial .hero-machine-card {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        margin: 0 !important;
        transform: none !important;
    }
}
