/* Full responsive + mobile performance polish */

html {
    overflow-x: clip;
}
body {
    overflow-x: clip;
    text-rendering: optimizeLegibility;
}
img, video, iframe, svg {
    max-width: 100%;
    height: auto;
}
.container {
    width: 100%;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

/* Skip paint work for below-the-fold sections */
.section:not(.section-compact):not(.hero-banner) {
    content-visibility: auto;
    contain-intrinsic-size: 1px 720px;
}

/* Product / category media: reserve space (CLS) */
.product-card img,
.cat-tile img,
.blog-card img,
.facility-card img,
.gallery-item img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
    background: #eef2f7;
}

/* Product card actions on narrow cards */
.product-card-actions {
    flex-direction: column;
}
.product-card-actions form,
.product-card-actions .btn-get-quote--card,
.product-card-actions .btn-add-cart {
    width: 100%;
}
@media (min-width: 480px) {
    .product-card-actions {
        flex-direction: row;
        align-items: stretch;
    }
    .product-card-actions form {
        flex: 1 1 0;
    }
    .product-card-actions .btn-get-quote--card {
        flex: 1 1 0;
        width: auto;
    }
}

/* ===== Large tablets / small desktops ===== */
@media (max-width: 1100px) {
    .hero-banner__grid {
        grid-template-columns: 1fr;
    }
    .hero-banner__media,
    .hero-banner .hero-slider {
        min-height: clamp(320px, 52vw, 460px);
    }
    .hero-banner__copy {
        padding: 28px 20px 36px;
        max-width: none;
    }
    .hero-banner__form {
        border-left: none;
        border-top: 1px solid rgba(15, 39, 68, 0.08);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

/* ===== Tablets ===== */
@media (max-width: 992px) {
    .about-grid,
    .inquiry-grid,
    .inquiry-contact-panel,
    .product-detail-layout,
    .products-layout {
        grid-template-columns: 1fr !important;
        flex-direction: column;
    }
    .cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    .product-grid,
    .product-grid--listing,
    .facility-grid,
    .blog-grid,
    .why-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    .industry-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .testimonial-slider {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .product-detail-layout {
        gap: 24px;
    }
    .product-sidebar .sticky-quote .form-row-2,
    .product-sidebar .enhanced-quote-box .form-row-2 {
        grid-template-columns: 1fr;
    }
    .product-detail-main {
        padding: 20px;
    }
}

/* ===== Phones / small tablets ===== */
@media (max-width: 768px) {
    :root {
        --header-h: 64px;
        --section-space: 48px;
    }

    .hero-banner__media,
    .hero-banner .hero-slider {
        min-height: clamp(280px, 68vw, 400px);
    }
    .slide-title {
        font-size: clamp(1.45rem, 7.5vw, 1.9rem);
        line-height: 1.2;
    }
    .slide-desc {
        font-size: 0.95rem;
        margin-bottom: 18px;
    }
    .slide-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .slide-actions .btn-primary,
    .slide-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }
    .hero-banner .slider-dots {
        left: 16px;
        bottom: 14px;
    }
    .hero-inquiry-card {
        max-width: none;
        margin: 0;
        box-shadow: none;
    }
    .hero-banner__form {
        padding: 16px;
    }

    .section {
        padding: var(--section-space) 0;
    }
    .section-title,
    .section-heading {
        text-align: left;
        margin-bottom: 28px;
        max-width: none;
    }
    .section-title h2,
    .section-heading h2 {
        font-size: clamp(1.4rem, 6vw, 1.75rem);
    }
    .section-title h2::after,
    .section-heading h2::after {
        margin-left: 0;
    }
    .section-title p,
    .section-heading p {
        margin-left: 0;
        font-size: 0.98rem;
    }

    .cat-grid,
    .product-grid,
    .product-grid--listing,
    .gallery-grid,
    .why-grid,
    .facility-grid,
    .blog-grid,
    .testimonial-slider,
    .related-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .industry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .cat-tile {
        min-height: 220px;
    }
    .product-card img {
        height: auto;
        min-height: 180px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .about-info {
        box-shadow: none;
    }
    .about-info td {
        padding: 10px 14px;
        display: block;
        width: 100% !important;
    }
    .about-info td:first-child {
        padding-bottom: 2px;
        border-bottom: none;
    }
    .about-info td:last-child {
        padding-top: 0;
        padding-bottom: 12px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .footer-static-pages__row {
        gap: 8px 14px;
    }
    .footer-static-pages__row a {
        white-space: normal;
    }

    .products-page .products-layout {
        flex-direction: column;
    }
    .sidebar-mobile-toggle {
        display: flex;
        width: 100%;
        min-height: 48px;
    }
    .category-sidebar {
        width: 100%;
        display: none;
        margin-bottom: 16px;
    }
    .category-sidebar.open {
        display: block;
    }

    .product-detail-page {
        padding: 16px 0 40px;
    }
    .product-detail-main {
        padding: 14px;
        border-left: none;
        border-right: none;
    }
    .product-detail-header {
        margin-bottom: 22px;
        padding-bottom: 18px;
    }
    .product-detail-header h1,
    .product-info h1 {
        font-size: clamp(1.35rem, 6vw, 1.75rem);
        overflow-wrap: anywhere;
    }
    .product-lead {
        font-size: 15px;
    }
    .product-price-box {
        padding: 14px 16px;
        margin: 16px 0;
    }
    .product-price-box .price-amount {
        font-size: clamp(1.25rem, 5vw, 1.6rem);
    }
    .product-gallery-main img {
        height: auto;
        max-height: none;
        aspect-ratio: 4 / 3;
    }
    .product-gallery-thumbs {
        gap: 8px;
        margin-top: 10px;
    }
    .product-gallery-thumbs .thumb {
        width: 64px;
        height: 50px;
        flex: 0 0 auto;
    }
    .product-trust-badges {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .trust-badge {
        padding: 10px 6px;
        font-size: 10px;
    }
    .product-tabs-enhanced .tab-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .product-tabs-enhanced .tab-nav button {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 48px;
        padding: 12px 14px;
        font-size: 12px;
    }
    .product-tabs-enhanced .tab-panel-inner {
        padding: 16px 12px;
        overflow-x: auto;
        overflow-wrap: anywhere;
    }
    .product-tabs-enhanced .tab-panel-inner img,
    .product-tabs-enhanced .tab-panel-inner table,
    .product-tabs-enhanced .tab-panel-inner iframe {
        max-width: 100%;
    }
    .spec-table-wrap {
        margin: 0 -4px;
        padding: 0 4px;
    }
    .spec-table-enhanced td {
        padding: 10px 12px;
        font-size: 13px;
        word-break: break-word;
    }
    .spec-table td:first-child {
        width: 40%;
        min-width: 110px;
    }
    .sticky-quote,
    .enhanced-quote-box {
        position: static;
        margin-top: 16px;
        padding: 16px;
        width: 100%;
    }
    .sticky-quote .form-row,
    .sticky-quote .form-row-2,
    .enhanced-quote-box .form-row,
    .enhanced-quote-box .form-row-2 {
        grid-template-columns: 1fr;
    }
    .quote-contact-quick {
        grid-template-columns: 1fr;
    }
    .quote-phone,
    .quote-whatsapp {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    .related-products-section {
        margin-top: 28px;
        padding-top: 22px;
    }
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    .inquiry-contact-list li {
        padding: 14px 0;
    }
    .form-row,
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .floating-widgets {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ===== Small phones ===== */
@media (max-width: 480px) {
    .container {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .industry-grid {
        grid-template-columns: 1fr;
    }
    .product-trust-badges {
        grid-template-columns: 1fr 1fr;
    }
    .related-grid {
        grid-template-columns: 1fr !important;
    }
    .product-breadcrumb {
        font-size: 12px;
    }
    .product-detail-main {
        padding: 12px 10px;
    }
    .product-gallery-thumbs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .hero-banner__media,
    .hero-banner .hero-slider {
        min-height: 260px;
    }
    .why-row,
    .why-item {
        grid-template-columns: 40px 1fr;
        padding: 18px 14px;
        gap: 12px;
    }
}

/* Landscape phones */
@media (max-width: 900px) and (orientation: landscape) {
    .hero-banner__media,
    .hero-banner .hero-slider {
        min-height: 240px;
    }
    .main-nav {
        max-height: 60vh;
    }
}

/* Prefer reduced data / motion */
@media (prefers-reduced-data: reduce) {
    .hero-banner .slide-media {
        display: none;
    }
    .section:not(.section-compact) {
        content-visibility: visible;
    }
}
