/**
 * Hardware archive — /product-category/hardware/
 *
 * Implements the bos-anchor-menu.html design: centered hero, sticky
 * full-bleed anchor menu with scrollspy, gold-accented section callouts,
 * and a 3-column product card grid.
 *
 * Everything is scoped under .hardware-archive (emitted by
 * woocommerce/taxonomy-product-cat-hardware.php) so nothing leaks into
 * other WooCommerce archives.
 *
 * Card rules use the deliberately verbose prefix
 * `.hardware-archive .hardware-section ul.products > li .productGrid`
 * because WooCommerce core styles like
 * `.woocommerce ul.products li.product img { width: 100% }` (0,3,3) and
 * `… li.product .price / .button` (0,4,2) would otherwise win the
 * cascade and stretch the images / restyle the price and button rows.
 */

.hardware-archive {
    --ha-gold: #fdc82f;
    --ha-gold-dark: #e0ac10;
    --ha-ink: #1c1c1c;
    --ha-line: #e2e2e2;
    --ha-muted: #555;
    --ha-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Mockup typography: the system stack renders 600/700/800/900 the
       way the design intends; the theme's webfonts don't ship those
       weights, which made the hierarchy look off. */
    font-family: var(--ha-font);
    color: var(--ha-ink);
}

/* Font hardening — theme.min.css applies PT Sans (ships 400/700 only)
   DIRECTLY to headings, buttons, inputs and prices inside archives.
   A direct declaration beats inheritance no matter the selector, which
   capped the mockup's 800/900 weights at faux-bold 700. Re-assert the
   stack on every text-bearing element in scope; this sheet loads after
   theme.min.css and the .hardware-archive prefix wins these ties. */
.hardware-archive h1,
.hardware-archive h2,
.hardware-archive h3,
.hardware-archive h4,
.hardware-archive p,
.hardware-archive a,
.hardware-archive input,
.hardware-archive button,
.hardware-archive select,
.hardware-archive textarea,
.hardware-archive .button,
.hardware-archive .added_to_cart,
.hardware-archive .price,
.hardware-archive .stock,
.hardware-archive .onsale {
    font-family: var(--ha-font);
}

/* --------------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------------ */

/*
 * The theme pins the global header (body.new--globals.header--initialized
 * header { position: fixed }) and normally pushes content down with a
 * 146px .header--anchor spacer. On WooCommerce pages that spacer only
 * existed inside the breadcrumb wrapper, which this template removes —
 * and theme.min.css alone leaves body { padding-top: 75px }, putting the
 * hero behind the 146px fixed header. Restore the theme's own offset
 * on the body: 146px (matching .header--anchor) plus visual clearance
 * below the header, per design review.
 *
 * The WooCommerce wrapper (woocommerce/global/wrapper-start.php, default
 * case) then adds .container padding-top: clamp(40px, 10%, 80px); zero it
 * so the hero sits directly under the header, as in the mockup.
 * Safe: this stylesheet only loads on the hardware category page.
 */
body.term-hardware {
    /* v2 header (s5-meganav) is 135px at top state; 40px clearance. */
    padding-top: 175px;
}

body.term-hardware .container {
    padding-top: 0;
}

.hardware-archive .hardware-hero {
    text-align: center;
    padding: 40px 24px 26px;
    scroll-margin-top: 175px;
}

.hardware-archive .hardware-hero__title {
    font-size: 50px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1px;
    color: #111;
    margin: 0 0 14px;
}

.hardware-archive .hardware-hero__intro {
    max-width: 720px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ha-muted);
}

.hardware-archive .hardware-hero__intro .term-description {
    margin: 0;
}

.hardware-archive .hardware-hero__intro .term-description p {
    margin: 0 0 12px;
}

.hardware-archive .hardware-hero__intro .term-description p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
 * Sticky anchor menu — full-bleed black bar
 *
 * The template lives inside the WooCommerce content wrapper
 * (#primary/.site-main), which is width-constrained. The negative
 * margin trick expands the bar to the full viewport width while keeping
 * it position: sticky.
 * ------------------------------------------------------------------------ */

.hardware-archive .anchor-nav {
    position: sticky;
    /* Compact fixed header (~51px) slides in on up-scroll; keep the bar
     * below it instead of sliding underneath (z-40 vs header z-102). */
    /* v2 scrolled header is 87px. */
    top: 87px;
    z-index: 40;
    background: #111;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

body.admin-bar .hardware-archive .anchor-nav {
    top: calc(87px + 32px);
}

.hardware-archive .anchor-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 12px;
}

.hardware-archive .anchor-inner::-webkit-scrollbar {
    display: none;
}

.hardware-archive .anchor-link {
    flex: 0 0 auto;
    color: #cfcfcf;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    padding: 15px;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.hardware-archive .anchor-link:hover,
.hardware-archive .anchor-link:focus {
    color: #fff;
}

.hardware-archive .anchor-link.is-active {
    color: var(--ha-gold);
    border-bottom-color: var(--ha-gold);
}

/* --------------------------------------------------------------------------
 * Notices (keep inside the page gutters)
 * ------------------------------------------------------------------------ */

.hardware-archive .woocommerce-notices-wrapper {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 40px 0;
}

/* --------------------------------------------------------------------------
 * Sections
 * ------------------------------------------------------------------------ */

.hardware-archive .hardware-section {
    padding: 52px 0 10px;
    border-bottom: 1px solid var(--ha-line);
    /* 51px compact header + 51px sticky anchor bar + breathing room */
    scroll-margin-top: 146px;
}

.hardware-archive .hardware-section:last-of-type {
    border-bottom: 0;
}

.hardware-archive .callout {
    max-width: 760px;
    margin: 0 auto 34px;
    padding: 0 20px;
    text-align: center;
}

.hardware-archive .callout__bar {
    display: block;
    width: 44px;
    height: 3px;
    margin: 0 auto 16px;
    background: var(--ha-gold);
}

.hardware-archive .hardware-section__title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    color: #111;
    margin: 0 0 12px;
}

.hardware-archive .hardware-section__description {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ha-muted);
    margin: 0;
}

.hardware-archive .hardware-section__description p {
    margin: 0 0 8px;
}

.hardware-archive .hardware-section__description p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
 * Product grid (WooCommerce ul.products becomes the mockup's 3-col .row)
 * ------------------------------------------------------------------------ */

.hardware-archive ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 40px 44px;
    list-style: none;
    clear: none;
}

/* Kill the float/clear clearfix the legacy grid system adds. */
.hardware-archive ul.products::before,
.hardware-archive ul.products::after {
    display: none;
}

/* Neutralize legacy .grid__item / .three-twelfths / .palm-one-whole widths. */
.hardware-archive ul.products > li {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    clear: none !important;
}

/* --------------------------------------------------------------------------
 * Product card (mockup .p-card)
 *
 * Strong prefix (0,4,x+) on every part so WooCommerce core archive CSS
 * (images stretched to width:100%, price/button restyling) is beaten.
 * ------------------------------------------------------------------------ */

.hardware-archive .hardware-section ul.products > li .productGrid {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    background: #fff;
    border-radius: 6px;
    padding: 28px 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* The loop link (opened by woocommerce_before_shop_loop_item) wraps
   title, accent, image, and price. */
.hardware-archive .hardware-section ul.products > li .productGrid > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 auto;
    width: 100%;
    text-decoration: none;
}

.hardware-archive .hardware-section ul.products > li .productGrid h4,
.hardware-archive .hardware-section ul.products > li .productGrid .woocommerce-loop-product__title {
    font-family: var(--ha-font);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: #1a1a1a;
    min-height: 48px;
    text-align: center;
    margin: 0 0 16px;
    padding: 0;
}

/* Legacy .yellow_line becomes the mockup's gold .accent divider. */
.hardware-archive .hardware-section ul.products > li .productGrid .yellow_line {
    width: 52%;
    height: 2px;
    min-height: 0;
    background: var(--ha-gold);
    box-shadow: none;
    margin: 0 auto 18px;
}

/* Fixed 130px image row (mockup .p-img) so every card's price and qty
   land on the same baseline regardless of artwork aspect ratio. */
.hardware-archive .hardware-section ul.products > li .productGrid img {
    width: auto;
    max-width: 100%;
    height: 130px;
    object-fit: contain;
    margin: 0 auto 20px;
}

/* Sale flash: centered inline gold chip instead of the absolutely
   positioned corner badge. */
.hardware-archive .hardware-section ul.products > li .productGrid .onsale {
    position: static;
    display: inline-block;
    float: none;
    margin: 0 auto 8px;
    padding: 2px 11px;
    min-width: 0;
    min-height: 0;
    line-height: 1.5;
    font-family: var(--ha-font);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 11px;
    background: var(--ha-gold);
    border: 0;
    color: #111;
}

.hardware-archive .hardware-section ul.products > li .productGrid .price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    min-height: 26px;
    font-family: var(--ha-font);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: #222;
    margin: 0 0 16px;
}

.hardware-archive .hardware-section ul.products > li .productGrid .price del {
    opacity: 0.5;
    font-size: 0.85em;
}

/* --------------------------------------------------------------------------
 * Quantity stepper (QIB plugin / WC .quantity) — 32px circles on a
 * fixed row so the steppers line up across cards.
 * ------------------------------------------------------------------------ */

.hardware-archive .hardware-section ul.products > li .productGrid .quantity,
.hardware-archive .hardware-section ul.products > li .productGrid .qib-button-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 32px;
    margin: 0 0 18px;
}

.hardware-archive .hardware-section ul.products > li .productGrid .quantity input[type="number"],
.hardware-archive .hardware-section ul.products > li .productGrid .qib-button-wrapper input[type="number"] {
    font-family: var(--ha-font);
    width: 52px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--ha-line);
    border-radius: 4px;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.hardware-archive .hardware-section ul.products > li .productGrid .quantity input[type="number"]::-webkit-outer-spin-button,
.hardware-archive .hardware-section ul.products > li .productGrid .quantity input[type="number"]::-webkit-inner-spin-button,
.hardware-archive .hardware-section ul.products > li .productGrid .qib-button-wrapper input[type="number"]::-webkit-outer-spin-button,
.hardware-archive .hardware-section ul.products > li .productGrid .qib-button-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hardware-archive .hardware-section ul.products > li .productGrid .quantity button,
.hardware-archive .hardware-section ul.products > li .productGrid .qib-button-wrapper button,
.hardware-archive .hardware-section ul.products > li .productGrid .qib-button-wrapper .qib-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid #cfcfcf;
    border-radius: 50%;
    background: #fff;
    color: #555;
    font-family: var(--ha-font);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-shadow: none;
}

/* --------------------------------------------------------------------------
 * Add to cart — full-width gold pill (mockup .p-cart), pinned to the
 * card bottom.
 * ------------------------------------------------------------------------ */

.hardware-archive .hardware-section ul.products > li .productGrid .button,
.hardware-archive .hardware-section ul.products > li .productGrid .added_to_cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    background: var(--ha-gold);
    color: #111;
    border: 0;
    border-radius: 22px;
    box-shadow: none;
    text-shadow: none;
    font-family: var(--ha-font);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    padding: 12px 0;
    margin-top: auto;
    cursor: pointer;
    transition: background 0.15s ease;
}

.hardware-archive .hardware-section ul.products > li .productGrid .button:hover,
.hardware-archive .hardware-section ul.products > li .productGrid .button:focus,
.hardware-archive .hardware-section ul.products > li .productGrid .added_to_cart:hover,
.hardware-archive .hardware-section ul.products > li .productGrid .added_to_cart:focus {
    background: var(--ha-gold-dark);
    color: #111;
}

/* Out-of-stock notice rendered in place of the button
   (see woo-custom-functions.php add_to_cart_link filter). */
.hardware-archive .hardware-section ul.products > li .productGrid .stock,
.hardware-archive .hardware-section ul.products > li .productGrid .out-of-stock {
    font-family: var(--ha-font);
    font-size: 14px;
    font-weight: 500;
    font-style: italic;
    color: #a5a5a5;
    margin: auto 0 10px;
}

/* --------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------ */

@media (max-width: 900px) {
    .hardware-archive ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 20px 36px;
    }

    .hardware-archive .woocommerce-notices-wrapper {
        padding: 12px 20px 0;
    }
}

@media (max-width: 560px) {
    .hardware-archive .hardware-hero {
        padding: 36px 16px 32px;
    }

    .hardware-archive .hardware-hero__title {
        font-size: 34px;
        letter-spacing: -0.5px;
    }

    .hardware-archive .hardware-section {
        padding: 40px 0 6px;
    }

    .hardware-archive .hardware-section__title {
        font-size: 24px;
    }

    .hardware-archive ul.products {
        grid-template-columns: 1fr;
        padding: 0 16px 32px;
    }

    .hardware-archive .callout {
        margin-bottom: 28px;
    }

    .hardware-archive .hardware-section ul.products > li .productGrid {
        padding: 24px 16px;
    }
}
