/* Shared MY CNTM interface refinements.
 * Page-specific CSS remains responsible for content layouts; this file keeps
 * the common navigation, inner-page hero, focus, and mobile affordances aligned.
 */
:root {
    --ui-ink: #1f2937;
    --ui-muted: #68758a;
    --ui-line: #e3e8f2;
    --ui-surface: #ffffff;
    --ui-page: #f7f8fc;
    --ui-hero: linear-gradient(135deg, #f1f2ff 0%, #f5f3fc 100%);
    --ui-radius-card: 18px;
}

/* A shared inner-page hero. The homepage keeps its distinct two-column hero. */
.page-banner,
.enq-banner,
.q-banner,
.tm-search-hero,
.tm-banner,
.cb-hero,
.office-banner,
.partner-hero,
.es-hero,
.nf-hero {
    padding-block: clamp(52px, 6.2vw, 82px) !important;
    background: var(--ui-hero) !important;
    border-bottom: 1px solid var(--ui-line);
    color: var(--ui-ink) !important;
}

.page-banner h1,
.enq-banner h1,
.q-banner h1,
.tm-search-hero h1,
.tm-banner h1,
.cb-hero h1,
.office-banner h1,
.partner-hero h1,
.es-hero h1,
.nf-hero h1 {
    max-width: 980px;
    margin-inline: auto;
    color: var(--ui-ink) !important;
    font-size: clamp(2rem, 4vw, 2.75rem) !important;
    line-height: 1.16 !important;
    letter-spacing: -.025em;
}

.page-banner p,
.enq-banner p,
.q-banner p,
.tm-search-hero .intro,
.tm-banner p,
.cb-hero p,
.office-banner p,
.partner-hero p,
.es-hero p,
.nf-hero p {
    max-width: 780px;
    margin-inline: auto;
    color: var(--ui-muted) !important;
    font-size: clamp(1rem, 1.35vw, 1.1rem) !important;
    line-height: 1.75 !important;
    opacity: 1 !important;
}

.page-banner::before,
.office-banner::before,
.partner-hero::before {
    opacity: .48;
}

.cb-eyebrow,
.tm-banner .section-label {
    border-color: rgba(102, 126, 234, .18) !important;
    background: rgba(102, 126, 234, .09) !important;
    color: var(--primary) !important;
}

.cb-cta {
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(102, 126, 234, .22) !important;
}

.cb-stat {
    background: #fff !important;
    border-color: var(--ui-line) !important;
    color: var(--ui-ink) !important;
    box-shadow: 0 4px 12px rgba(31, 41, 55, .05);
}

.cb-stat b { color: var(--primary) !important; }
.cb-stat span { color: var(--ui-muted) !important; opacity: 1 !important; }

:where(.btn, .btn-primary, .tool-btn-primary, .tm-banner-cta, .tm-button,
       .qc-submit, .btn-apply, .enq-submit) {
    min-height: 48px !important;
    border-radius: 12px !important;
    font-weight: 700;
}

/* A single, visible keyboard focus treatment across page-specific controls. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(102, 126, 234, .42);
    outline-offset: 3px;
}

/* Compact desktop and tablet: keep the quote action at the top of the menu. */
.mobile-menu-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    margin: 0 0 16px;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff !important;
    font-weight: 750;
    text-align: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, .2);
}

.mobile-menu-cta:hover {
    color: #fff !important;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    :root { scroll-padding-top: 82px; }

    body { -webkit-tap-highlight-color: rgba(102, 126, 234, .14); }

    /* Keep form controls readable and prevent iOS Safari's focus zoom. */
    input,
    select,
    textarea {
        font-size: 16px !important;
        max-width: 100%;
    }

    button,
    [role="button"] { touch-action: manipulation; }

    .section-container,
    .footer-container { padding-inline: 18px; }

    .section-header { margin-bottom: 26px; }

    .page-banner,
    .enq-banner,
    .q-banner,
    .tm-search-hero,
    .tm-banner,
    .cb-hero,
    .office-banner,
    .partner-hero,
    .es-hero,
    .nf-hero {
        padding-block: 46px !important;
    }

    .cb-hero-inner {
        padding-inline: 18px;
    }
    .mobile-menu {
        top: 70px;
        padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-menu-link { min-height: 52px; padding-block: 15px; }

    .mobile-menu-link.mobile-menu-orders {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 54px;
        margin: 14px 0 4px;
        padding: 12px 14px !important;
        border: 1px solid rgba(102, 126, 234, .2);
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(102, 126, 234, .1), rgba(118, 75, 162, .08));
        color: var(--primary-dark) !important;
    }

    .mobile-menu-orders span { display: inline-flex; align-items: center; gap: 10px; }
    .mobile-menu-orders > i { color: var(--primary); font-size: 13px; }

    /* Fixed corner controls can obscure the last lines of cards on small screens. */
    .back-to-top,
    .cb-top { display: none !important; }

    .footer { padding: 46px 0 calc(24px + env(safe-area-inset-bottom)) !important; }
    .footer-grid { gap: 28px !important; }

    .cb-shortlist-fab {
        left: 12px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        min-height: 48px;
    }

    .cb-shortlist-panel {
        left: 10px !important;
        right: 10px !important;
        bottom: calc(70px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: none !important;
        max-height: min(72dvh, 620px) !important;
    }

    .cb-shortlist-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

    .cb-nav-inner { padding: 12px 16px !important; }
    .cb-main { padding: 26px 16px 78px !important; }
    .cb-nav-label { font-size: .75rem; }
    .cb-pills {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 2px 1px 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    .cb-pills::-webkit-scrollbar { display: none; }
    .cb-pill { min-height: 40px; padding: 7px 13px; scroll-snap-align: start; }

    .tm-wrap { gap: 14px !important; }
    .tm-section { padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important; }
    .tm-section .section-container,
    .tm-wrap,
    .tm-wrap > *,
    .tm-wrap > div,
    #goodsArea,
    .subgrid { min-width: 0; }
    .tm-toolbar { width: 100%; min-width: 0; border-radius: 14px; }
    .tm-search { width: 100%; min-width: 0; }
    .tm-search input { width: 100%; min-width: 0; }
    .tm-banner h1 { max-width: 100%; white-space: normal !important; overflow-wrap: anywhere; }
    .tm-banner-cta { display: flex; width: 100%; max-width: 100%; padding-inline: 14px; white-space: normal; line-height: 1.35; }
    .tm-btn { width: 100%; justify-content: center; white-space: normal; }
    .subgrid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .goods-row { align-items: flex-start; }
    .sl-panel {
        bottom: 0 !important;
        max-height: min(82dvh, 720px) !important;
        border-radius: 18px 18px 0 0 !important;
    }
    .sl-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 480px) {
    .section-container,
    .footer-container { padding-inline: 16px; }

    .page-banner h1,
    .enq-banner h1,
    .q-banner h1,
    .tm-search-hero h1,
    .tm-banner h1,
    .cb-hero h1,
    .office-banner h1,
    .partner-hero h1,
    .es-hero h1,
    .nf-hero h1 { font-size: clamp(1.8rem, 8vw, 2.2rem) !important; }
}

body.nav-menu-open { overflow: hidden; }

/* The floating chat only sits outside the content column on wide screens. */
@media (max-width: 1390px) {
    .floating-contact { display: none !important; }
}
