
/* ==========================================
   THE ENGINEERS GROUP - RESPONSIVE STYLES
   Mobile, Tablet and Desktop
   ========================================== */

/* Prevent horizontal overflow */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

img,
video,
iframe,
embed,
object {
    max-width: 100%;
}

.container {
    width: min(calc(100% - 40px), 1240px);
    margin-right: auto;
    margin-left: auto;
}

/* Tablet and smaller laptops */
@media (max-width: 1050px) {
    .container {
        width: min(calc(100% - 36px), 1240px);
    }

    .teg-hero-grid {
        gap: 28px;
    }

    .teg-section {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .teg-section-heading {
        margin-bottom: 28px;
    }

    .teg-woocommerce-container {
        min-width: 0;
    }

    .teg-woocommerce-container .woocommerce-breadcrumb,
    .teg-breadcrumbs {
        overflow-wrap: anywhere;
    }
}

/* Tablets */
@media (max-width: 800px) {
    .container {
        width: calc(100% - 32px);
    }

    .teg-section {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .teg-section-heading h2 {
        font-size: clamp(25px, 4vw, 32px);
    }

    .teg-section-heading-row {
        align-items: flex-start;
        gap: 16px;
    }

    .teg-woocommerce-container {
        padding-top: 24px;
        padding-bottom: 35px;
    }

    .teg-woocommerce-container table {
        max-width: 100%;
    }

    .teg-woocommerce-container input,
    .teg-woocommerce-container select,
    .teg-woocommerce-container textarea {
        max-width: 100%;
    }

    .teg-woocommerce-container .cart-collaterals,
    .teg-woocommerce-container .cart_totals {
        max-width: 100%;
    }
}

/* Mobile devices */
@media (max-width: 600px) {
    .container {
        width: calc(100% - 30px);
    }

    body {
        font-size: 15px;
    }

    .teg-section {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .teg-section-heading {
        margin-bottom: 24px;
    }

    .teg-section-heading h2 {
        font-size: 26px;
        line-height: 1.3;
    }

    .teg-section-heading p {
        font-size: 13px;
    }

    .teg-section-heading-row {
        flex-direction: column;
    }

    .teg-button {
        max-width: 100%;
        text-align: center;
    }

    .teg-breadcrumbs {
        margin-bottom: 20px;
        font-size: 11px;
        line-height: 1.8;
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    select,
    textarea {
        max-width: 100%;
        font-size: 16px;
    }

    /* WooCommerce notices */
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error {
        padding: 16px 16px 16px 42px !important;
        font-size: 13px;
        line-height: 1.7;
    }

    .woocommerce-message .button,
    .woocommerce-info .button,
    .woocommerce-error .button {
        float: none !important;
        display: inline-flex;
        margin: 10px 0 0 !important;
    }

    /* Cart and checkout tables */
    .teg-woocommerce-container .shop_table {
        font-size: 12px;
    }

    .teg-woocommerce-container .shop_table th,
    .teg-woocommerce-container .shop_table td {
        padding: 9px 7px;
    }

    .teg-woocommerce-container .cart_item .product-thumbnail img {
        width: 48px;
    }

    .teg-woocommerce-container .coupon {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .teg-woocommerce-container .coupon input,
    .teg-woocommerce-container .coupon button {
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .teg-woocommerce-container .checkout-button,
    .teg-woocommerce-container #place_order {
        width: 100%;
    }

    /* Product tabs */
    .teg-woocommerce-container div.product .woocommerce-tabs ul.tabs {
        flex-wrap: wrap;
    }

    /* Avoid oversized content */
    .teg-single-content pre,
    .teg-page-content pre {
        max-width: 100%;
        overflow-x: auto;
    }

    .teg-single-content iframe,
    .teg-page-content iframe {
        max-width: 100%;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .container {
        width: calc(100% - 24px);
    }

    .teg-section {
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .teg-section-heading h2 {
        font-size: 23px;
    }

    .teg-woocommerce-container .shop_table th,
    .teg-woocommerce-container .shop_table td {
        padding: 7px 5px;
        font-size: 11px;
    }
}

/* Respect reduced-motion accessibility preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
