/*
 * BrakeQuip Products — parts-catalogue styling.
 *
 * The design premise: this shop sells 254 small metal fittings that look
 * nearly identical in a photograph, and several have no photograph at
 * all. The buyer arrives already knowing "M10 x 1.0, 3/16 tube,
 * stainless" and needs to find that one part. So specification is the
 * primary content and the photograph is supporting evidence — the
 * reverse of a normal storefront.
 *
 * IBM Plex throughout: IBM drew it for technical documentation. Mono
 * carries every specification and price, because a parts book sets its
 * data in mono and because tabular figures are genuinely easier to
 * compare down a column.
 *
 * Styling only. No URLs, page titles, template files or markup
 * structure change here; everything is a visual property or an additive
 * element, so nothing already indexed moves.
 *
 * Divi ships a lot of high-specificity CSS, so some rules need
 * !important to land. That is the parent theme's doing, not enthusiasm.
 */

:root {
    --bq-ink: #14181b;
    --bq-graphite: #232a30;
    --bq-graphite-soft: #2d353d;
    --bq-steel: #78838d;
    --bq-steel-light: #a9b3bb;
    --bq-rule: #d8dde1;
    --bq-rule-soft: #e8ecee;
    --bq-paper: #fff;
    --bq-paper-2: #f4f6f7;
    --bq-signal: #ffc300;
    --bq-signal-dark: #e0ab00;
    --bq-stock: #17703f;
    --bq-nostock: #a33a2b;

    --bq-display: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
    --bq-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bq-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------------------------------------------------------------
   Foundations
   --------------------------------------------------------------- */

body,
.et_pb_text,
p {
    font-family: var(--bq-body);
    color: var(--bq-ink);
}

body {
    background: var(--bq-paper);
    font-size: 15px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.et_pb_module_header,
.woocommerce-loop-product__title,
.product_title,
.woocommerce ul.products li.product h2 {
    font-family: var(--bq-display) !important;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--bq-ink);
    text-transform: none;
}

h1, .product_title {
    font-size: 2.1rem;
    line-height: 1.12;
}

a {
    color: var(--bq-ink);
    text-decoration-color: var(--bq-rule);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--bq-ink);
    text-decoration-color: var(--bq-signal);
}

/* ---------------------------------------------------------------
   The spec line — the signature element.
   A monospace, pipe-delimited data strip reading like a line in a
   parts book. It is the thing the customer is actually scanning for,
   so it appears everywhere a product does.
   --------------------------------------------------------------- */

.bq-spec {
    font-family: var(--bq-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--bq-steel);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
    margin: 4px 0 0;
}

.bq-spec__item {
    white-space: nowrap;
}

.bq-spec__item + .bq-spec__item::before {
    content: "│";
    color: var(--bq-rule);
    margin-right: 10px;
}

.bq-spec__item--part {
    color: var(--bq-ink);
    font-weight: 500;
}

/* ---------------------------------------------------------------
   Header

   The logo is a PNG on a solid white ground, so on a dark bar it can
   only ever read as a white patch. Rather than fight that, the header
   is light and the logo sits on its own background. The industrial
   weight moves to the find-a-part bar directly beneath it and to the
   footer, which keeps the two dark bands the design is built on.
   --------------------------------------------------------------- */

#main-header,
#main-header.et-fixed-header {
    background-color: var(--bq-paper) !important;
    box-shadow: none;
    border-bottom: 1px solid var(--bq-rule);
}

#logo {
    max-height: 56px !important;
}

#top-menu li a,
#et-top-navigation .et-cart-info span {
    color: var(--bq-ink) !important;
    font-family: var(--bq-display);
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    padding-bottom: 6px;
}

/* Yellow is unreadable as text on white, so the accent moves to a rule
   under the active item instead. */
#top-menu li a::after {
    content: "";
    display: block;
    height: 3px;
    margin-top: 4px;
    background: transparent;
    transition: background 0.12s ease;
}

#top-menu li a:hover::after {
    background: var(--bq-rule);
}

#top-menu li.current-menu-item > a::after {
    background: var(--bq-signal);
}

#top-menu li a:hover,
#top-menu li.current-menu-item > a {
    color: var(--bq-ink) !important;
    opacity: 1;
}

#et_top_search .et-cart-info,
#et_search_icon::before,
.et-cart-info span::before {
    color: var(--bq-ink) !important;
}

.et_mobile_menu {
    background: var(--bq-paper);
    border-top-color: var(--bq-signal);
}

.et_mobile_menu li a {
    color: var(--bq-ink) !important;
    font-family: var(--bq-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.mobile_menu_bar::before {
    color: var(--bq-ink) !important;
}

/* ---------------------------------------------------------------
   Find-a-part bar
   --------------------------------------------------------------- */

.bq-specbar {
    background: var(--bq-graphite-soft);
    padding: 9px 0;
}

.bq-specbar__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.bq-specbar__label {
    font-family: var(--bq-mono);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--bq-steel-light);
    white-space: nowrap;
}

.bq-specbar form {
    display: flex;
    flex: 1 1 340px;
    min-width: 260px;
}

.bq-specbar input[type="search"] {
    flex: 1;
    border: 1px solid rgb(255 255 255 / 16%);
    border-right: 0;
    background: rgb(0 0 0 / 18%);
    color: #fff;
    padding: 9px 13px;
    font-family: var(--bq-mono);
    font-size: 13px;
    border-radius: 0;
}

.bq-specbar input[type="search"]::placeholder {
    color: #7d8892;
}

.bq-specbar input[type="search"]:focus {
    outline: 0;
    border-color: var(--bq-signal);
}

.bq-specbar button {
    background: var(--bq-signal);
    color: var(--bq-ink);
    border: 0;
    padding: 9px 20px;
    font-family: var(--bq-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 14px;
    cursor: pointer;
    border-radius: 0;
}

.bq-specbar button:hover {
    background: var(--bq-signal-dark);
}

/* ---------------------------------------------------------------
   Product listing as a parts book
   Rows, not cards. Fifty-five near-identical fittings are compared
   down a column, and a photograph of each one tells you nothing.
   --------------------------------------------------------------- */

.woocommerce ul.products,
.woocommerce-page ul.products {
    display: block !important;
    margin: 0 !important;
    border-top: 1px solid var(--bq-rule);
}

/* WooCommerce's own default styles carry a ul.products.columns-3 (or
   -2, -4...) variant, which was outscoring the rules below at exactly
   this specificity — confirmed live: related-products lists render
   with columns-3 and were computing float:left/width:30.75% despite
   the !important here. .products.products is a no-op for matching
   (the same class twice still just means "has class products") but
   counts twice for specificity, which is enough to win regardless of
   which columns-N variant WooCommerce applies or which stylesheet
   loaded last. */
.woocommerce ul.products.products li.product,
.woocommerce-page ul.products.products li.product {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: both;
    display: block;
    border-bottom: 1px solid var(--bq-rule-soft);
    background: transparent;
    box-sizing: border-box;
    transition: background 0.12s ease;
}

.woocommerce ul.products li.product:hover {
    background: var(--bq-paper-2);
}

/* Divi wraps the whole row — image, title, spec and price — in one
   anchor, so the row grid belongs on the anchor, not the list item.
   The thumbnail spans both rows; title sits above its spec line. */
.woocommerce ul.products.products li.product > a.woocommerce-LoopProduct-link,
.woocommerce-page ul.products.products li.product > a.woocommerce-LoopProduct-link {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "thumb title price"
        "thumb spec  price";
    align-items: center;
    column-gap: 18px;
    row-gap: 2px;
    padding: 12px 6px;
    text-decoration: none;
}

.woocommerce ul.products li.product .et_shop_image {
    grid-area: thumb !important;
    display: block;
    margin: 0;
}

.woocommerce ul.products li.product .et_shop_image .et_overlay {
    display: none;
}

.woocommerce ul.products li.product a img {
    width: 64px !important;
    height: 64px;
    object-fit: contain;
    margin: 0 !important;
    background: var(--bq-paper-2);
    border: 1px solid var(--bq-rule-soft);
    box-shadow: none;
}

.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    grid-area: title !important;
    font-size: 0.98rem !important;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0;
    align-self: end;
}

.woocommerce ul.products li.product .bq-spec {
    grid-area: spec !important;
    align-self: start;
    margin: 0;
}

.woocommerce ul.products li.product .price {
    grid-area: price !important;
    font-family: var(--bq-mono) !important;
    font-size: 1.05rem !important;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--bq-ink) !important;
    text-align: right;
    white-space: nowrap;
    margin: 0 !important;
    align-self: center;
}

.woocommerce ul.products li.product .price del {
    color: var(--bq-steel) !important;
    font-size: 0.85rem;
}

/* Add-to-cart sits outside the anchor when Divi renders one. */
.woocommerce ul.products li.product > .button,
.woocommerce ul.products li.product > .added_to_cart {
    display: inline-block;
    margin: 0 6px 12px !important;
}

/* Buttons: square, quiet, and the only place the signal colour is
   allowed to shout. */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    background: var(--bq-ink) !important;
    color: #fff !important;
    font-family: var(--bq-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
    border-radius: 0;
    border: 0;
    padding: 8px 16px;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: var(--bq-signal) !important;
    color: var(--bq-ink) !important;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce div.product form.cart .button {
    background: var(--bq-signal) !important;
    color: var(--bq-ink) !important;
    padding: 12px 26px;
    font-size: 15px;
}

.woocommerce a.button.alt:hover,
.woocommerce div.product form.cart .button:hover {
    background: var(--bq-signal-dark) !important;
}

/* Understated on purpose -- a fact worth knowing at the moment someone's
   looking at one part's price, not a banner competing with Add to Cart. */
.bq-wholesale-nudge {
    font-family: var(--bq-mono);
    font-size: 12px;
    color: var(--bq-steel);
    margin: 10px 0 0;
}

.bq-wholesale-nudge a {
    color: var(--bq-steel);
    text-decoration-color: var(--bq-rule);
}

.bq-wholesale-nudge a:hover {
    color: var(--bq-ink);
    text-decoration-color: var(--bq-signal);
}

/* ---------------------------------------------------------------
   Category overview — browsing, not comparing
   /categories/ renders the [product_categories] shortcode inside the
   same <ul class="products"> wrapper as an ordinary product listing,
   and each <li> carries both "product" and "product-category" classes
   -- so the parts-book row treatment above (li.product) was silently
   collapsing the category grid into the same single-column list.
   Browsing ~30 distinct categories is the opposite job from comparing
   near-identical fittings: a photo is exactly what tells Banjo Bolts
   apart from Bleed Screws at a glance, so this gets its own grid.

   :has(li.product-category) is what scopes this to the category
   overview specifically — first attempt left this unscoped and it
   also grid-ified the real /shop/ product rows, which broke that
   layout outright (confirmed live, caught by screenshot, fixed same
   session). A ul.products on /shop/ or any /product-category/*
   archive never contains a .product-category child, only .product
   ones, so this selector cannot match those pages. */
.woocommerce ul.products.products:has(li.product-category) {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    column-gap: 20px;
    row-gap: 20px;
    border-top: 0;
}

/* The float-layout clearfix (content:" "; display:table) on this ul
   still generates real boxes once display is grid, and a generated
   box with content counts as a grid item -- it was silently claiming
   the first cell and pushing every real category tile over by one,
   leaving a blank slot at the start of every row of three/four.
   Confirmed by reading computed ::before/::after content and diffing
   grid-column position against DOM order, not guessed. */
.woocommerce ul.products.products:has(li.product-category)::before,
.woocommerce ul.products.products:has(li.product-category)::after {
    content: none;
    display: none;
}

.woocommerce ul.products.products li.product.product-category,
.woocommerce-page ul.products.products li.product.product-category {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    display: block !important;
    border: 1px solid var(--bq-rule);
    background: var(--bq-paper);
    transition: border-color 0.12s ease, background 0.12s ease;
}

.woocommerce ul.products li.product-category:hover {
    border-color: var(--bq-ink);
    background: var(--bq-paper-2);
}

.woocommerce ul.products li.product-category > a {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    text-decoration: none;
    padding: 16px 16px 14px;
}

/* Image sits on its own light-table backdrop rather than bare white,
   so a mostly-white product photo (chrome fittings, stainless hose)
   still reads as a framed tile and not as edgeless empty space. */
.woocommerce ul.products li.product-category > a img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 10px;
    margin-bottom: 12px;
    background: var(--bq-paper-2);
    border: 1px solid var(--bq-rule-soft);
}

.woocommerce ul.products li.product-category .woocommerce-loop-category__title {
    font-size: 15px;
    line-height: 1.3;
}

/* The count reads as a data tag, not a parenthetical -- same mono
   spec-line language used everywhere else a number qualifies a part
   (.bq-spec), so the category grid reads as one catalogue index
   rather than a bolted-on WooCommerce default. */
.woocommerce ul.products li.product-category mark.count {
    display: block;
    background: none;
    color: var(--bq-steel);
    font-family: var(--bq-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.02em;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--bq-rule-soft);
}

@media (width <= 600px) {
    .woocommerce ul.products.products:has(li.product-category) {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------------------------------------------------------------
   Single product — laid out like a drawing's title block
   --------------------------------------------------------------- */

.woocommerce div.product .product_title {
    margin-bottom: 10px;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    font-family: var(--bq-mono);
    font-weight: 500;
    font-size: 1.9rem;
    font-variant-numeric: tabular-nums;
    color: var(--bq-ink);
}

/* The title block: labelled fields in mono, ruled like a drawing
   sheet rather than styled like a badge row. */
.bq-titleblock {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    border: 1px solid var(--bq-rule);
    margin: 0 0 22px;
}

.bq-titleblock__cell {
    padding: 9px 12px;
    border-right: 1px solid var(--bq-rule);
}

.bq-titleblock__cell:last-child {
    border-right: 0;
}

.bq-titleblock__label {
    display: block;
    font-family: var(--bq-mono);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 10px;
    color: var(--bq-steel);
    margin-bottom: 3px;
}

.bq-titleblock__value {
    font-family: var(--bq-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--bq-ink);
}

/* WooCommerce's own stock line, beside the add-to-cart button. It is
   the single source of availability on the page — the title block
   deliberately does not repeat it. */
.woocommerce div.product .stock {
    font-family: var(--bq-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.woocommerce div.product .stock.in-stock {
    color: var(--bq-stock);
}

.woocommerce div.product .stock.out-of-stock {
    color: var(--bq-nostock);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    padding: 0;
    border-bottom: 1px solid var(--bq-rule);
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before {
    border-bottom: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin: 0 22px 0 0;
    padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    border-bottom-color: var(--bq-ink);
    background: transparent;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    font-family: var(--bq-display);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    font-size: 14px;
    color: var(--bq-steel);
    padding: 10px 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--bq-ink);
}

/* Specification tables already present in many descriptions. Divi
   rendered these almost invisibly; here they are set as data. */
.woocommerce div.product .woocommerce-Tabs-panel table,
.woocommerce div.product #tab-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-family: var(--bq-mono);
    font-size: 13px;
}

.woocommerce div.product .woocommerce-Tabs-panel table th,
.woocommerce div.product #tab-description table th {
    background: transparent;
    color: var(--bq-steel);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 10px;
    text-align: left;
    padding: 6px 12px 6px 0;
    border-bottom: 1px solid var(--bq-ink);
}

.woocommerce div.product .woocommerce-Tabs-panel table td,
.woocommerce div.product #tab-description table td {
    border-bottom: 1px solid var(--bq-rule-soft);
    padding: 8px 12px 8px 0;
    color: var(--bq-ink);
}

.woocommerce div.product table th p,
.woocommerce div.product table td p {
    color: inherit;
    font-family: inherit;
    margin: 0;
    padding: 0;
    line-height: 1.45;
}

/* ---------------------------------------------------------------
   Shop furniture
   --------------------------------------------------------------- */

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering select {
    font-family: var(--bq-mono);
    font-size: 12px;
    color: var(--bq-steel);
}

.woocommerce nav.woocommerce-pagination ul {
    border: 0;
}

.woocommerce nav.woocommerce-pagination ul li {
    border: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span.current {
    font-family: var(--bq-mono);
    font-size: 13px;
    border-radius: 0;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--bq-ink);
    color: #fff;
}

.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info {
    border-top-color: var(--bq-ink);
    background: var(--bq-paper-2);
    font-family: var(--bq-body);
}

.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-info::before {
    color: var(--bq-ink);
}

/* Divi draws a vertical rule where a sidebar would be; keep that
   hidden regardless of layout below. */
.woocommerce-page #main-content .container::before,
.single-product #main-content .container::before {
    display: none;
}

/* #left-area was previously forced to 100% width sitewide on the
   assumption the sidebar was empty. It isn't: #sidebar carries a real,
   populated "Product categories" widget on every woocommerce-page and
   single-product template, plus layered-nav filters (material, thread
   type, threads, thread length) on category archives. Forcing full
   width pushed that real navigation below the entire product grid —
   confirmed on /shop/, every /product-category/ page, and single product
   pages alike, not just on mobile. Removing the override lets Divi's
   own et_right_sidebar layout (already the active body class) render
   the sidebar beside the content on desktop, same as Divi intends. */

/* Divi's own #sidebar/#left-area float rules only exist inside its
   "@media (min-width: 981px)" block (confirmed by reading the live
   inline Divi core CSS directly, not guessed from a code comment) —
   below that width neither element floats at all, so they're just two
   plain block children of #content-area and stack in DOM order:
   #left-area (breadcrumb + grid + pagination) always before #sidebar
   (category + filter widgets). Flexing that same wrapper and visually
   reordering the two needs no template/markup change — #content-area
   already uniquely wraps only these two elements on the shop, category
   and single-product templates (all three carry .woocommerce-page). */
@media (width <= 980px) {
    .woocommerce-page #content-area {
        display: flex;
        flex-direction: column;
    }

    .woocommerce-page #sidebar {
        order: -1;
    }
}

/* The "Product categories" dropdown: selectWoo does enhance it (this
   isn't a raw unstyled <select> — that one's hidden at height:1px),
   but two things were wrong with the visible replacement:

   1. Width: some option labels run long ("Tools>All Tools>Tube
      Flaring and Bending  (8)"), and nothing tied the widget's own
      inline width:100% to #sidebar's box, so the longest label pushed
      it past the sidebar edge.
   2. Vertical alignment ("looks misaligned"): .select2-selection__
      rendered computes line-height 28px + 7.5px top/bottom padding =
      43px tall, sitting inside a .select2-selection parent fixed at
      28px. The label sits top-aligned in the taller inner box and the
      overflow just gets clipped by the shorter outer one — it was
      never actually centered, confirmed by reading the live computed
      styles, not guessed. Explicit height/line-height on both ends
      fixes it regardless of what font-size the theme inherits here. */
#sidebar select.dropdown_product_cat,
#sidebar .select2-container {
    max-width: 100%;
    box-sizing: border-box;
}

#sidebar .select2-selection__rendered {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sidebar .select2-container .select2-selection--single {
    height: 38px;
    display: flex;
    align-items: center;
}

#sidebar .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: normal;
    padding-top: 0;
    padding-bottom: 0;
}

#sidebar .select2-container .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

#main-footer {
    background: var(--bq-graphite);
    border-top: 1px solid var(--bq-graphite-soft);
}

#footer-widgets .footer-widget,
#footer-widgets .footer-widget li,
#footer-widgets .footer-widget li a,
#footer-bottom,
#footer-info,
#footer-info a {
    color: var(--bq-steel-light) !important;
    font-family: var(--bq-body);
}

#main-footer .footer-widget h4 {
    font-family: var(--bq-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff !important;
}

#footer-widgets .footer-widget li a:hover,
#footer-info a:hover {
    color: var(--bq-signal) !important;
}

#footer-bottom {
    background: rgb(0 0 0 / 20%);
}

#footer-info {
    font-family: var(--bq-mono);
    font-size: 12px;
}

/* ---------------------------------------------------------------
   Small screens: the row collapses, specs stay
   --------------------------------------------------------------- */

@media (width <= 640px) {
    .woocommerce ul.products li.product > a {
        grid-template-columns: 52px minmax(0, 1fr);
        grid-template-areas:
            "thumb title"
            "thumb spec"
            "price price";
        row-gap: 4px;
    }

    .woocommerce ul.products li.product a img {
        width: 52px !important;
        height: 52px;
    }

    .woocommerce ul.products li.product .price {
        text-align: left;
        margin-top: 6px !important;
    }

    /* The homepage hero image (wp-image-1103, natural size 2600x1314)
       has a fixed-height Divi module setting that doesn't scale with
       width. On mobile that leaves the module's width shrunk to fit
       the screen but its height untouched, so object-fit:fill stretches
       the image nearly 2x taller than its real proportions to cover the
       mismatch — measured at 312x556 rendered vs. ~312x158 true aspect.
       height:auto lets it size by its own ratio again; this only
       touches sizing, not which image or what it shows.

       Divi's own generated CSS also sets min-height:556px on this
       image specifically (.et_pb_image_0 .et_pb_image_wrap img) — no
       !important on their side, but min-height acts as a floor
       regardless of what height:auto computes, so object-fit:contain
       alone just centered the small image inside a still-556px-tall
       box instead of actually shrinking it. Confirmed via a real
       measurement, not assumed: fixing object-fit without this would
       have left the box the same oversized height. */
    .wp-image-1103 {
        height: auto !important;
        min-height: 0 !important;
        object-fit: contain !important;
    }

    /* The search bar's form had a 260px floor that, combined with the
       label, doesn't fit a narrow phone screen without cramming. Stack
       it instead of letting flex-wrap fight for the space. */
    .bq-specbar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .bq-specbar form {
        min-width: 0;
        flex-basis: auto;
    }

    /* auto-fit with a 120px floor produces an unpredictable column
       count on a narrow phone — sometimes 1, sometimes an awkward 3.
       A firm 2 columns reads reliably at every width down to ~320px. */
    .bq-titleblock {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------------------------------------------------------------
   Spec tables inside product descriptions (producttablegrid) have no
   responsive handling at all — a 4-column table (part number, thread,
   length, head size) will force horizontal overflow of the whole page
   on a phone otherwise. display:block lets the table itself scroll
   instead, without touching the markup in every description that has
   one.
   --------------------------------------------------------------- */
table.producttablegrid {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Thread/line-size reference tables (find-your-thread-size) -- ruled
   like the rest of the site's spec presentation, sizes in mono since
   they're data, not prose. */
table.bq-thread-table {
    border-collapse: collapse;
    width: 100%;
    margin: 4px 0 28px;
    font-size: 14px;
}

table.bq-thread-table th {
    text-align: left;
    font-family: var(--bq-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--bq-steel);
    border-bottom: 1px solid var(--bq-ink);
    padding: 6px 14px 6px 0;
}

table.bq-thread-table td {
    border-bottom: 1px solid var(--bq-rule-soft);
    padding: 8px 14px 8px 0;
}

table.bq-thread-table td:first-child {
    font-family: var(--bq-mono);
    font-weight: 500;
    color: var(--bq-ink);
}

table.bq-thread-table td:nth-child(2) {
    color: var(--bq-steel);
    font-family: var(--bq-mono);
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------
   Quality floor
   --------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--bq-ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--bq-signal);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
