/**
 * Native phone dropdowns across the public Graham storefront.
 *
 * WooCommerce may visually replace a select with Select2. On phones this
 * stylesheet hides that replacement and restores the original select so the
 * operating system can present its familiar full-screen or wheel picker.
 */
@media (max-width: 782px), (hover: none) and (pointer: coarse) {
    html body select:not([multiple]) {
        -webkit-appearance: menulist !important;
        appearance: auto !important;
        background-color: #fff !important;
        background-image: none !important;
        border: 1px solid #9eb8c8 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
        color: #17324a !important;
        cursor: pointer;
        font-family: inherit !important;
        font-size: 16px !important;
        font-weight: 600;
        height: auto !important;
        line-height: normal !important;
        max-width: 100% !important;
        min-height: 48px !important;
        padding: 9px 12px !important;
        text-align: start;
        width: 100% !important;
    }

    html body select:not([multiple]):focus {
        border-color: #075da8 !important;
        box-shadow: 0 0 0 3px rgba(7, 93, 168, 0.14) !important;
        outline: 0 !important;
    }

    html body .select2-container,
    html body .selectWoo-container {
        display: none !important;
    }

    html body select.select2-hidden-accessible:not([multiple]),
    html body select.selectWoo-hidden-accessible:not([multiple]) {
        clip: auto !important;
        clip-path: none !important;
        display: block !important;
        height: auto !important;
        margin: 0 !important;
        overflow: visible !important;
        position: static !important;
        white-space: normal !important;
        width: 100% !important;
    }

    html body .graham-catalog-toolbar-ordering .woocommerce-ordering,
    html body .graham-catalog-main .woocommerce-ordering,
    html body .graham-filter-selects label,
    html body .graham-product-family,
    html body .graham-product-uom-picker,
    html body .graham-cart-uom-picker,
    html body .graham-shipping-address-selector {
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    html body .graham-mobile-category-picker select:not([multiple]) {
        background-color: #075da8 !important;
        border-color: #075da8 !important;
        color: #fff !important;
        font-weight: 750;
    }

    html body .graham-mobile-category-picker select:not([multiple]):focus {
        border-color: #12833c !important;
        box-shadow: 0 0 0 3px rgba(18, 131, 60, 0.2) !important;
    }

    html body .graham-mobile-category-picker select option {
        background-color: #075da8;
        color: #fff;
    }
}

/* Keep the shared mobile masthead identical on catalogue and information pages. */
@media (max-width: 767px) {
    html body .graham-header-branding-inner {
        justify-content: flex-start !important;
        text-align: left !important;
    }

    html body .graham-header-logo {
        justify-content: flex-start !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        text-align: left !important;
    }

    html body .graham-header-logo-image {
        height: auto !important;
        max-height: 58px !important;
        max-width: 70vw !important;
        object-fit: contain !important;
        object-position: left center !important;
        width: clamp(180px, 58vw, 240px) !important;
    }
}

/* Final small-screen layout pass, loaded after the component styles. */
@media (max-width: 560px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    html body {
        font-size: 16px;
    }

    html body img,
    html body video,
    html body iframe,
    html body canvas {
        height: auto;
        max-width: 100%;
    }

    html body .graham-header-info-inner,
    html body .graham-header-branding-inner,
    html body .graham-header-nav-inner,
    html body .graham-page-container,
    html body .graham-functional-banner-inner,
    html body .graham-catalog-shell {
        box-sizing: border-box !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    html body .graham-header-info-inner,
    html body .graham-header-branding-inner,
    html body .graham-header-nav-inner {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    html body .graham-page-container,
    html body .graham-functional-banner-inner,
    html body .graham-catalog-shell {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    html body .graham-catalog-intro,
    html body .graham-page-hero,
    html body .graham-home-hero,
    html body .graham-page-section {
        border-radius: 12px !important;
    }

    html body .graham-catalog-intro {
        gap: 14px !important;
        padding: 18px 14px !important;
    }

    html body .graham-catalog-intro h1,
    html body .graham-page-hero h1,
    html body .graham-home-hero h1 {
        font-size: clamp(1.55rem, 8vw, 2rem) !important;
        line-height: 1.08 !important;
        overflow-wrap: anywhere;
    }

    html body .graham-catalog-toolbar,
    html body .graham-catalog-toolbar-actions,
    html body .graham-catalog-view-switch,
    html body .graham-filter-actions {
        align-items: stretch !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    html body .graham-catalog-toolbar-ordering,
    html body .graham-catalog-toolbar-ordering .woocommerce-ordering,
    html body .graham-catalog-view-switch button,
    html body .graham-filter-actions button,
    html body .graham-filter-actions a {
        box-sizing: border-box !important;
        justify-content: center !important;
        margin: 0 !important;
        min-height: 44px;
        width: 100% !important;
    }

    html body .graham-catalog-filter-panel .graham-filter-selects,
    html body .graham-catalog-filter-panel .graham-filter-options {
        display: grid !important;
        gap: 9px !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
    }

    html body .graham-mobile-category-nav,
    html body .graham-category-card,
    html body .graham-catalog-main .wc-block-product,
    html body .graham-catalog-main ul.products li.product,
    html body .graham-contact-form-card,
    html body .graham-account-application-form,
    html body .graham-address-card,
    html body .graham-member-card,
    html body .wc-block-cart__main,
    html body .wc-block-cart__sidebar,
    html body .wc-block-checkout__main,
    html body .wc-block-checkout__sidebar {
        border-radius: 12px !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    html body :where(
        .graham-contact-form,
        .graham-account-application-form,
        .woocommerce-form,
        .woocommerce-checkout,
        .wc-block-checkout,
        .woocommerce-MyAccount-content
    ) :where(input:not([type="checkbox"]):not([type="radio"]), textarea) {
        box-sizing: border-box !important;
        font-size: 16px !important;
        max-width: 100% !important;
        min-height: 46px;
        width: 100% !important;
    }

    html body :where(
        .graham-contact-form,
        .graham-account-application-form,
        .woocommerce-form,
        .woocommerce-checkout,
        .wc-block-checkout,
        .woocommerce-MyAccount-content,
        .graham-catalog-main
    ) button,
    html body :where(
        .graham-contact-form,
        .graham-account-application-form,
        .woocommerce-form,
        .woocommerce-checkout,
        .wc-block-checkout,
        .woocommerce-MyAccount-content,
        .graham-catalog-main
    ) .button {
        min-height: 44px;
    }

    html body .woocommerce table.shop_table,
    html body .graham-document-table-wrap,
    html body .graham-product-link-results {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    html body.single-product div.product,
    html body.single-product div.product .woocommerce-product-gallery,
    html body.single-product div.product .summary,
    html body.single-product div.product form.cart {
        box-sizing: border-box !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* 0.10.120: catalogue dropdowns share the mobile category colour system. */
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
    html body.graham-catalog-view .graham-filter-selects select:not([multiple]),
    html body.graham-catalog-view .graham-catalog-toolbar-ordering select:not([multiple]),
    html body.graham-catalog-view .woocommerce-ordering select:not([multiple]) {
        background-color: #075da8 !important;
        border-color: #075da8 !important;
        color: #fff !important;
        font-weight: 750;
        min-height: 48px !important;
        width: 100% !important;
    }

    html body.graham-catalog-view .graham-filter-selects select:not([multiple]):focus,
    html body.graham-catalog-view .graham-catalog-toolbar-ordering select:not([multiple]):focus,
    html body.graham-catalog-view .woocommerce-ordering select:not([multiple]):focus {
        border-color: #12833c !important;
        box-shadow: 0 0 0 3px rgba(18, 131, 60, 0.2) !important;
    }

    html body.graham-catalog-view .graham-filter-selects select option,
    html body.graham-catalog-view .graham-catalog-toolbar-ordering select option,
    html body.graham-catalog-view .woocommerce-ordering select option {
        background-color: #075da8;
        color: #fff;
    }
}

/* 0.12.79: full-bleed mobile navigation and promotional bands. */
@media (max-width: 700px) {
    html body .graham-header-navigation .graham-header-nav-inner {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html body .graham-header-mobile-menu > summary {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    html body .graham-header-mobile-menu[open] > .graham-header-mobile-links {
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
    }

    html body.graham-page-design-active .graham-contact-strip,
    html body.graham-page-design-active .graham-home .graham-campaign-hero,
    html body.graham-page-design-active .graham-home .graham-winter-promotion {
        border-radius: 0 !important;
        box-sizing: border-box !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        max-width: 100vw !important;
        width: 100vw !important;
    }

    html body.graham-page-design-active .graham-contact-strip > .graham-page-container {
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: none !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        width: 100% !important;
    }

    html body.graham-page-design-active .graham-home .graham-campaign-hero {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html body.graham-page-design-active .graham-home .graham-campaign-hero-copy {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    html body.graham-page-design-active .graham-home .graham-winter-promotion > .graham-page-container {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
    }

    html body.graham-page-design-active .graham-home .graham-winter-promotion-copy {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* 0.13.57: catalogue sort is a compact command, not a full-size form field. */
@media (max-width: 700px) {
    html body.graham-catalog-view .graham-catalog-tools .graham-catalog-toolbar-ordering select:not([multiple]) {
        height: 34px !important;
        min-height: 34px !important;
        padding: 5px 28px 5px 9px !important;
        width: 146px !important;
    }
}

/* 0.13.340: compact, expandable catalogue filters on phones. */
@media (max-width: 700px) {
    html body.graham-catalog-view .graham-catalog-filter-panel > summary,
    html body.graham-catalog-view .graham-catalog-filter-panel[open] > summary {
        align-items: center !important;
        background: #fff !important;
        border: 1px solid #9eb8c8 !important;
        border-radius: 7px !important;
        color: #0b466f !important;
        display: inline-flex !important;
        font-size: 0.74rem !important;
        font-weight: 800 !important;
        gap: 8px !important;
        height: 34px !important;
        justify-content: space-between !important;
        min-height: 34px !important;
        padding: 5px 10px !important;
        width: 104px !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel > summary::after {
        border: solid currentColor;
        border-width: 0 2px 2px 0;
        content: "" !important;
        flex: 0 0 7px;
        height: 7px;
        margin: -4px 2px 0 0 !important;
        transform: rotate(45deg);
        transition: transform 160ms ease, margin 160ms ease;
        width: 7px;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel[open] > summary::after {
        margin: 4px 2px 0 0 !important;
        transform: rotate(-135deg);
    }

    html body.graham-catalog-view .graham-catalog-filter-panel > summary small {
        display: none !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel[open] > .graham-catalog-filters {
        background: #f7fafc !important;
        border: 1px solid #cbd9e3 !important;
        border-radius: 8px !important;
        gap: 10px !important;
        margin-top: 6px !important;
        padding: 10px !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-heading {
        display: none !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-selects {
        gap: 7px !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-selects label {
        gap: 3px !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-selects label > span {
        color: #405f73 !important;
        font-size: 0.7rem !important;
        font-weight: 800 !important;
        line-height: 1.15 !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-selects select:not([multiple]) {
        background-color: #fff !important;
        border-color: #9eb8c8 !important;
        color: #17324a !important;
        font-size: 15px !important;
        font-weight: 650 !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 6px 10px !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-selects select option {
        background-color: #fff !important;
        color: #17324a !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-options {
        gap: 6px !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-option {
        min-height: 30px !important;
        padding: 5px 7px !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-actions {
        align-items: center !important;
        display: grid !important;
        gap: 7px !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-actions button {
        background: #138a42 !important;
        border: 1px solid #138a42 !important;
        border-radius: 7px !important;
        color: #fff !important;
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        min-height: 40px !important;
        padding: 8px 14px !important;
        width: 100% !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-actions button:hover,
    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-actions button:focus-visible {
        background: #0f7437 !important;
        border-color: #0f7437 !important;
    }

    html body.graham-catalog-view .graham-catalog-filter-panel .graham-filter-actions a {
        color: #075da8 !important;
        font-size: 0.76rem !important;
        min-height: 40px !important;
        padding: 9px 6px !important;
        width: auto !important;
    }
}
