/*
 * heartland-modern — WooCommerce styling layer
 * Owned by Agent B. Composes tokens/classes defined in style.css
 * (--ha-* custom properties, .ha-btn, .ha-card, .ha-section, .ha-container,
 * .ha-overline, .ha-display — see DESIGN-SYSTEM.md §1-2).
 *
 * Strategy: keep WooCommerce core stylesheets enqueued, override
 * selectively (same approach as the parity `heartland` theme).
 */

/* ── Page header band (see woocommerce.php) ─────────────────────────── */
.ha-page-header {
    background: var(--ha-ink);
    padding-block: 36px;
    border-bottom: 1px solid var(--ha-line-dark);
}
.ha-page-header__title {
    margin: 0;
    color: var(--ha-text-inv);
}
.ha-page-header__breadcrumb {
    font-size: 15px;
    color: var(--ha-text-inv-soft);
}
.ha-page-header__breadcrumb a {
    color: var(--ha-text-inv-soft);
    text-decoration: none;
}
.ha-page-header__breadcrumb a:hover {
    color: var(--ha-text-inv);
    text-decoration: underline;
}

/* Unified dark: the shop section stays on the page base (--ha-ink via
   body) so cards (--ha-paper) read as elevation, not a light band. */
.ha-section--shop {
    background: transparent;
}

/* ── Result count + ordering toolbar ─────────────────────────────────── */
.woocommerce .woocommerce-notices-wrapper {
    display: block;
}
.woocommerce .woocommerce-result-count {
    font-size: 13px;
    color: var(--ha-text-soft);
    margin: 0 0 16px;
}
.woocommerce .woocommerce-ordering {
    margin: 0 0 16px;
}
.woocommerce form.woocommerce-ordering,
.woocommerce .woocommerce-result-count {
    display: inline-block;
    vertical-align: middle;
}
.woocommerce > .woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce .woocommerce-result-count {
    float: none;
}
.ha-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}
.ha-shop-toolbar .woocommerce-result-count,
.ha-shop-toolbar .woocommerce-ordering {
    margin: 0;
}
.woocommerce .woocommerce-ordering select,
.woocommerce select.orderby {
    appearance: none;
    -webkit-appearance: none;
    background: var(--ha-paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%239AA5B1' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 10px 7px;
    border: 1px solid var(--ha-line);
    border-radius: 8px;
    color: var(--ha-text);
    font: 600 14px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    padding: 10px 36px 10px 14px;
    min-height: 44px;
}
.woocommerce .woocommerce-ordering select:focus-visible,
.woocommerce select.orderby:focus-visible {
    outline: 2px solid var(--ha-blue-bright);
    outline-offset: 2px;
}

/* ── Shop grid + product cards ───────────────────────────────────────── */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    content: none;
    display: none;
}

/* Neutralize WooCommerce core's float-era item sizing. Core sets
   width: 30.75% + float + gutter margins on li.product via selectors up
   to (0,4,2) specificity (e.g. .woocommerce ul.products.columns-3
   li.product) — inside our grid tracks that squeezed every card to
   ~110px. The attribute-selector variants below tie that specificity
   and win on source order (this sheet loads after Woo core); the grid
   gap owns all spacing. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce ul.products[class*="columns-"] li.product,
.woocommerce-page ul.products[class*="columns-"] li.product,
.woocommerce[class*="columns-"] ul.products li.product,
.woocommerce-page[class*="columns-"] ul.products li.product {
    width: 100%;
    margin: 0;
    float: none;
}

/* Card shell on the WooCommerce loop <li>. The homepage featured grid
   gets the same shell from style.css (.ha-card / .ha-product-card-wrap).
   Do NOT style .ha-product-card itself as a shell: per the markup
   contract that class is the inner card ANCHOR — shell styles on it
   would double the border/hover on the homepage grid. */
.woocommerce ul.products li.product {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ha-paper);
    border: 1px solid var(--ha-line);
    border-radius: 12px;
    box-shadow: var(--ha-shadow-sm);
    overflow: hidden;
    transition: transform 150ms ease-out, box-shadow 150ms ease-out, border-color 150ms ease-out;
}
.woocommerce ul.products li.product:hover {
    transform: translateY(-3px);
    box-shadow: var(--ha-shadow-md);
    border-color: rgba(45, 156, 255, .35);
}

.woocommerce ul.products li.product a {
    text-decoration: none;
    color: inherit;
}

/* The card link printed by inc/woocommerce.php: a normal in-flow block
   wrapping media + body. NO absolute positioning — WooCommerce core's
   default loop link closes late (after title + price), so an absolute
   "stretch link" pulled title/price out of flow and collapsed the card
   (README "KNOWN BUG at hand-off"). The anchor is itself a flex column
   that grows to fill the card, and the body grows inside it, so the
   actions row (margin-top:auto) always sits at the card bottom even on
   short-titled cards. */
.woocommerce ul.products li.product a.ha-product-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.woocommerce ul.products li.product a.ha-product-card .ha-product-card__body {
    flex: 1 1 auto;
}

/* Image well (.ha-product-card__media — same class the homepage grid
   uses; duplicated here with identical token values so the shop loop
   is styled even if the style.css block is scoped to the homepage). */
.woocommerce ul.products li.product .ha-product-card__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    background: var(--ha-paper-2);
    padding: 12px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}
.woocommerce ul.products li.product .ha-product-card__media img,
.woocommerce ul.products li.product img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
/* Sale badge (core prints it with the thumbnail, inside the media well) */
.woocommerce ul.products li.product .onsale {
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    z-index: 1;
    background: var(--ha-blue);
    color: #fff;
    font: 600 13px/1 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    padding: 6px 12px;
    border-radius: 999px;
    min-height: 0;
    min-width: 0;
    margin: 0;
}

/* Card body (.ha-product-card__body — shared with the homepage grid).
   Shop cards have an actions row below the body, so bottom padding is
   lighter here; the homepage keeps style.css's own body padding. */
.woocommerce ul.products li.product .ha-product-card__body {
    padding: 16px 20px 8px;
}
/* Actions row: the loop add-to-cart / Select options button, printed
   OUTSIDE the card anchor (see inc/woocommerce.php). */
.woocommerce ul.products li.product .ha-product-card__actions {
    padding: 12px 20px 20px;
    margin-top: auto;
}
/* Fallback for stock Woo loop markup (if another plugin restores the
   default hooks): keep title/price/button aligned with the body inset. */
.woocommerce ul.products li.product > .woocommerce-loop-product__title,
.woocommerce ul.products li.product > a:not(.ha-product-card) .woocommerce-loop-product__title {
    padding: 16px 20px 0;
}
.woocommerce ul.products li.product > .price,
.woocommerce ul.products li.product > a:not(.ha-product-card) .price {
    padding-inline: 20px;
}
.woocommerce ul.products li.product > .button,
.woocommerce ul.products li.product > a.button {
    margin: 12px 20px 20px;
    width: auto;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .ha-product-card__title {
    font: 600 16px/1.35 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ha-text);
    margin: 0 0 6px;
    /* !important beats Woo core's higher-specificity display:flow-root, which
       disables the clamp and leaves a clipped third-line sliver */
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(2 * 1.35em); /* non-WebKit fallback: clip cleanly at 2 lines */
}

.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .ha-product-card__price {
    font: 600 15px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ha-text);
    display: block;
    margin: 0 0 4px;
}
.woocommerce ul.products li.product .price del,
.woocommerce ul.products li.product .ha-product-card__price del {
    color: var(--ha-text-soft);
    text-decoration: line-through;
    font-weight: 400;
    margin-right: 6px;
    opacity: 1;
}
.woocommerce ul.products li.product .price ins,
.woocommerce ul.products li.product .ha-product-card__price ins {
    text-decoration: none;
    color: var(--ha-text);
}

/* Dealer pricing plugin output: tolerant styling, tint pill, don't hide
   unknown markup. Selectors match heartland-dealer-pricing.php spans. */
.woocommerce .price .ha-price-retail,
.woocommerce .price .ha-price-dealer,
.woocommerce .price .dealer-price-label {
    display: inline-block;
    white-space: nowrap;
}
.woocommerce .price .ha-price-retail,
.woocommerce .price .ha-price-dealer {
    margin: 2px 8px 2px 0;
    font-size: 13px;
}
.woocommerce .price .ha-price-dealer { margin-right: 0; }
/* Shape normalization only — background/color intentionally NOT set
   here: the pills keep their own solid backgrounds (see the post-audit
   WCAG block near EOF, which darkens the plugin's inline greens/ambers)
   with the plugin's inline white text — fine on dark. */
.woocommerce .price .dealer-price-label {
    font: 600 11px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    margin-right: 6px !important;
}

/* "Multiple options" note (contract class .ha-product-card__multiple;
   style.css may define it too — identical values, no conflict) */
.woocommerce ul.products li.product .ha-product-card__multiple {
    display: block;
    font-size: 13px;
    color: var(--ha-text-soft);
    margin: 0 0 4px;
}

/* Loop add-to-cart / "Select options" — small secondary button, full width */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.add_to_cart_button,
.woocommerce ul.products li.product a.button.product_type_variable {
    display: block;
    width: 100%;
    text-align: center;
    background: transparent;
    border: 1.5px solid var(--ha-line);
    color: var(--ha-text);
    font: 600 14px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    padding: 10px 16px;
    border-radius: 6px;
    transition: border-color 150ms ease-out, color 150ms ease-out;
    min-height: 44px;
    box-sizing: border-box;
}
.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product a.add_to_cart_button:hover {
    border-color: var(--ha-blue-bright);
    color: var(--ha-blue-bright);
    background: transparent;
}
.woocommerce ul.products li.product .added_to_cart {
    display: block;
    text-align: center;
    font-size: 13px;
    margin-top: 8px;
    color: var(--ha-text-soft);
}

/* Star ratings */
.woocommerce .star-rating {
    color: var(--ha-star);
    font-size: 14px;
}
.woocommerce .star-rating::before {
    /* empty-star track: --ha-line (.08 white) is invisible on dark —
       use a slightly stronger hairline white */
    color: rgba(255, 255, 255, .18);
}
.woocommerce .star-rating span::before {
    color: var(--ha-star);
}
.woocommerce ul.products li.product .star-rating {
    margin: 0 0 6px;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination {
    margin-top: 32px;
    text-align: center;
}
.woocommerce nav.woocommerce-pagination ul {
    border: 0;
    display: inline-flex;
    gap: 6px;
}
.woocommerce nav.woocommerce-pagination ul li {
    border: 0;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0 8px;
    border: 1px solid var(--ha-line);
    border-radius: 8px;
    color: var(--ha-text);
    font: 600 14px/1 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.woocommerce nav.woocommerce-pagination ul li a:hover {
    border-color: var(--ha-blue-bright);
    color: var(--ha-blue-bright);
}
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--ha-blue);
    border-color: var(--ha-blue);
    color: #fff;
}

/* ── Single product page ─────────────────────────────────────────────── */
.woocommerce div.product {
    position: relative;
    color: var(--ha-text);
    display: grid;
    grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
    gap: 0 48px; /* rows separated by explicit compact margins below */
    align-items: start;
}
/* Neutralize WooCommerce core's float layout: core CSS floats and
   width-limits the gallery (float:left, ~48%) and summary (float:right,
   ~48%) — inside our grid columns that crushed both to a fraction of
   their track (measured live: gallery 277px, summary 233px on a 1112px
   container). Own the layout fully. */
.woocommerce div.product div.images,
.woocommerce div.product .woocommerce-product-gallery,
.woocommerce div.product div.summary,
.woocommerce div.product div.summary.entry-summary {
    float: none;
    width: 100%;
    margin: 0;
}
.woocommerce div.product div.images,
.woocommerce div.product .woocommerce-product-gallery {
    grid-column: 1;
}
.woocommerce div.product div.summary {
    grid-column: 2;
}
/* Single-product sale badge: core prints span.onsale as a direct child
   of div.product and positions it absolutely — restyle to match cards. */
.woocommerce div.product > span.onsale {
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    z-index: 2;
    background: var(--ha-blue);
    color: #fff;
    font: 600 13px/1 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    padding: 6px 12px;
    border-radius: 999px;
    min-height: 0;
    min-width: 0;
    margin: 0;
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper,
.woocommerce div.product div.images .flex-viewport {
    background: var(--ha-paper-2);
    border-radius: 12px;
    overflow: hidden;
}
.woocommerce div.product div.images .woocommerce-product-gallery__image {
    background: var(--ha-paper-2);
}
/* Gallery zoom trigger: WordPress's emoji script converts its magnifier
   glyph into a broken 1px img.emoji (observed live). Hide the trigger
   entirely — the lightbox still opens by clicking the image itself. */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    display: none;
}
.woocommerce div.product div.images img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
.woocommerce div.product div.images .flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}
.woocommerce div.product div.images .flex-control-thumbs li {
    width: calc(25% - 6px);
}
.woocommerce div.product div.images .flex-control-thumbs img {
    border-radius: 8px;
    border: 1px solid var(--ha-line);
    background: var(--ha-paper-2);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    cursor: pointer;
    opacity: 1;
    transition: border-color 150ms ease-out;
}
.woocommerce div.product div.images .flex-control-thumbs img.flex-active,
.woocommerce div.product div.images .flex-control-thumbs img:hover {
    border-color: var(--ha-blue-bright);
}

.woocommerce div.product .product_title,
.woocommerce div.product .product_title.entry-title {
    font: 700 28px/1.25 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ha-text);
    margin: 0 0 12px;
}
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    font: 600 24px/1.3 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ha-blue-bright);
    margin: 0 0 16px;
    display: block;
}
.woocommerce div.product p.price del {
    color: var(--ha-text-soft);
    font-weight: 400;
    font-size: 18px;
    margin-right: 8px;
}
.woocommerce div.product p.price ins {
    text-decoration: none;
    color: var(--ha-blue-bright);
}
/* Dealer price block on single product page: tint pill, always visible */
.woocommerce div.product p.price .dealer-price-label,
.woocommerce div.product p.price .ha-price-retail,
.woocommerce div.product p.price .ha-price-dealer {
    font-size: 13px;
    vertical-align: middle;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    font-size: 16px;
    line-height: 1.65;
    color: var(--ha-text-soft);
    margin: 0 0 20px;
}

.woocommerce div.product .heartland-airgun-specs span {
    display: inline-block !important;
    background: var(--ha-paper-2) !important;
    color: var(--ha-text-soft) !important;
    border: 1px solid var(--ha-line);
    padding: 3px 10px !important;
    border-radius: 999px !important;
    font: 500 13px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
}
.woocommerce div.product .heartland-airgun-specs strong {
    color: var(--ha-text);
}

/* Variation selects + quantity, styled like standard form inputs */
.woocommerce div.product form.cart {
    margin: 0 0 24px;
}
/* Stack each variation row: label as a block ABOVE its full-width
   select (the default side-by-side table cells squeezed the label
   against the 100%-width select — observed live on the "Combo" row). */
.woocommerce div.product form.cart table.variations,
.woocommerce div.product form.cart table.variations tbody,
.woocommerce div.product form.cart table.variations tr,
.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations td {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    text-align: left;
}
.woocommerce div.product form.cart table.variations {
    margin: 0 0 16px;
}
.woocommerce div.product form.cart table.variations tr {
    margin: 0 0 16px;
}
.woocommerce div.product form.cart .variations label {
    font: 600 14px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ha-text);
    display: block;
    margin-bottom: 8px;
}
.woocommerce div.product form.cart .variations select {
    width: 100%;
    min-height: 44px;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--ha-line);
    border-radius: 8px;
    background: var(--ha-paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%239AA5B1' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 10px 7px;
    appearance: none;
    -webkit-appearance: none;
    color: var(--ha-text);
    font: 500 15px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.woocommerce div.product form.cart .variations select:focus-visible,
.woocommerce div.product form.cart .variations select:focus {
    outline: none;
    border-color: var(--ha-blue-bright);
    box-shadow: 0 0 0 3px rgba(45, 156, 255, .25);
}
.woocommerce div.product form.cart .reset_variations {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ha-text-soft);
}

.woocommerce div.product form.cart div.quantity {
    display: inline-flex;
    margin: 0 12px 0 0;
    vertical-align: middle;
}
.woocommerce div.product form.cart .qty {
    width: 72px;
    min-height: 44px;
    text-align: center;
    background: var(--ha-paper-2);
    border: 1px solid var(--ha-line);
    border-radius: 8px;
    color: var(--ha-text);
    font: 600 15px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    padding: 10px;
}
.woocommerce div.product form.cart .qty:focus-visible {
    outline: none;
    border-color: var(--ha-blue-bright);
    box-shadow: 0 0 0 3px rgba(45, 156, 255, .25);
}

.woocommerce div.product form.cart .button,
.woocommerce div.product form.cart .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    background: var(--ha-blue);
    color: #fff;
    font: 600 16px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    padding: 14px 28px;
    border-radius: 6px;
    border: 0;
    transition: background-color 150ms ease-out, transform 150ms ease-out, box-shadow 150ms ease-out;
}
.woocommerce div.product form.cart .button:hover,
.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background: var(--ha-blue-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--ha-shadow-sm);
}
.woocommerce div.product form.cart .button.disabled,
.woocommerce div.product form.cart .button:disabled,
.woocommerce div.product form.cart .button.wc-variation-selection-needed {
    background: var(--ha-line);
    color: var(--ha-text-soft);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Meta: SKU / categories / tags */
.woocommerce div.product .product_meta {
    font-size: 13px;
    color: var(--ha-text-soft);
    border-top: 1px solid var(--ha-line);
    margin-top: 24px;
    padding-top: 16px;
}
.woocommerce div.product .product_meta > span {
    display: block;
    margin-bottom: 4px;
}
.woocommerce div.product .product_meta a {
    color: var(--ha-text-soft);
    text-decoration: underline;
}
.woocommerce div.product .product_meta a:hover {
    color: var(--ha-blue-bright);
}

/* Tabs — underline style */
.woocommerce div.product .woocommerce-tabs {
    grid-column: 1 / -1;
    margin-top: 40px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex;
    gap: 32px;
    border: 0;
    border-bottom: 1px solid var(--ha-line);
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    border: 0;
    background: none;
    margin: 0;
    padding: 0 0 12px;
    position: relative;
}
.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 a {
    color: var(--ha-text-soft);
    font: 600 15px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    text-decoration: none;
    padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--ha-text);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active::after {
    display: block;
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--ha-blue-bright);
}
.woocommerce div.product .woocommerce-tabs .panel {
    color: var(--ha-text-soft);
    font-size: 16px;
    line-height: 1.65;
    max-width: 760px;
}
.woocommerce div.product .woocommerce-tabs .panel h2 {
    font-size: 22px;
    color: var(--ha-text);
}

/* Related products / up-sells: full-width rows below the two columns,
   same cards as the shop grid. Heading = overline + H3 (spec §6): the
   overline label is a decorative ::before; the h2 itself is styled at
   the 28px H3 scale. */
.woocommerce div.product .related.products,
.woocommerce div.product .up-sells {
    grid-column: 1 / -1;
    margin-top: 48px;
}
.woocommerce div.product .related.products > h2,
.woocommerce div.product .up-sells > h2 {
    font: 600 28px/1.3 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ha-text);
    margin: 0 0 24px;
}
.woocommerce div.product .related.products > h2::before,
.woocommerce div.product .up-sells > h2::before {
    content: 'The Lineup';
    display: block;
    font: 600 13px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--ha-blue-bright);
    margin-bottom: 8px;
}

/* ── Cart / checkout / account ───────────────────────────────────────── */
.woocommerce table.shop_table {
    border: 0;
    border-collapse: collapse;
    width: 100%;
    color: var(--ha-text);
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    border: 0;
    border-bottom: 1px solid var(--ha-line);
    padding: 16px 12px;
}
.woocommerce table.shop_table th {
    color: var(--ha-text-soft);
    font: 600 13px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.woocommerce table.shop_table tr:last-child td {
    border-bottom: 0;
}

.woocommerce td.product-quantity div.quantity,
.woocommerce div.quantity {
    display: inline-flex;
}
.woocommerce td.product-quantity .qty,
.woocommerce div.quantity .qty {
    height: 40px;
    min-height: 40px;
    width: 64px;
    background: var(--ha-paper-2);
    border: 1px solid var(--ha-line);
    border-radius: 8px;
    text-align: center;
    color: var(--ha-text);
}

.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-checkout .order-total,
.woocommerce-page .cart_totals {
    background: var(--ha-paper);
    border: 1px solid var(--ha-line);
    border-radius: 12px;
    box-shadow: var(--ha-shadow-sm);
    padding: 24px;
}
.woocommerce-cart .cart-collaterals .cart_totals h2 {
    font-size: 20px;
    color: var(--ha-text);
    margin: 0 0 16px;
}
.woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
    width: 100%;
}

.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #payment #place_order, .woocommerce-page #payment #place_order,
.woocommerce .checkout-button,
.woocommerce a.checkout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ha-blue);
    color: #fff;
    font: 600 15px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    padding: 12px 24px;
    border-radius: 6px;
    border: 0;
    text-decoration: none;
    transition: background-color 150ms ease-out, transform 150ms ease-out, box-shadow 150ms ease-out;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.woocommerce #payment #place_order:hover {
    background: var(--ha-blue-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--ha-shadow-sm);
}
.woocommerce a.button.alt, .woocommerce #payment #place_order,
.woocommerce-page #payment #place_order {
    font-size: 16px;
    padding: 14px 28px;
}
.woocommerce a.button.ha-btn--secondary,
.woocommerce a.remove {
    background: transparent;
    color: var(--ha-error);
}

.woocommerce form .form-row label {
    font: 600 14px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ha-text);
    margin-bottom: 6px;
    display: block;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row .select2-selection {
    min-height: 44px;
    border: 1px solid var(--ha-line);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--ha-text);
    background: var(--ha-paper-2);
    font: 500 15px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.woocommerce form .form-row input.input-text:focus-visible,
.woocommerce form .form-row textarea:focus-visible,
.woocommerce form .form-row select:focus-visible,
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    outline: none;
    border-color: var(--ha-blue-bright);
    box-shadow: 0 0 0 3px rgba(45, 156, 255, .25);
}

.woocommerce-checkout #payment {
    background: var(--ha-paper-2);
    border: 1px solid var(--ha-line);
    border-radius: 12px;
    color: var(--ha-text);
}
.woocommerce-checkout #payment div.payment_box {
    background: var(--ha-paper);
    border: 1px solid var(--ha-line);
    border-radius: 8px;
    color: var(--ha-text);
}
.woocommerce-checkout #payment div.payment_box::before {
    border-bottom-color: var(--ha-paper);
}

/* Account nav — left list, active item blue tint */
.woocommerce-account .woocommerce-MyAccount-navigation {
    border: 1px solid var(--ha-line);
    border-radius: 12px;
    overflow: hidden;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.woocommerce-account .woocommerce-MyAccount-navigation li {
    border-bottom: 1px solid var(--ha-line);
}
.woocommerce-account .woocommerce-MyAccount-navigation li:last-child {
    border-bottom: 0;
}
.woocommerce-account .woocommerce-MyAccount-navigation a {
    display: block;
    padding: 12px 16px;
    color: var(--ha-text);
    font: 600 14px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    text-decoration: none;
}
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
    background: var(--ha-blue-tint);
    color: var(--ha-blue-bright);
}
.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
    background: var(--ha-paper-2);
}

/* Dealer minimum order notice (heartland-dealer-pricing plugin) — tolerant
   override of its inline styles, mapped onto the info/warning notice look. */
.woocommerce .dealer-minimum-notice {
    background: var(--ha-blue-tint) !important;
    border: 1px solid var(--ha-line) !important;
    border-radius: 8px !important;
    color: var(--ha-text) !important;
    padding: 12px 16px !important;
}
.woocommerce .dealer-minimum-notice strong {
    color: var(--ha-text);
}

/* ── Notices ──────────────────────────────────────────────────────────── */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error,
.woocommerce-noreviews,
.woocommerce ul.woocommerce-error,
.woocommerce-mini-cart__empty-message {
    background: var(--ha-blue-tint);
    color: var(--ha-blue-bright);
    border: 0;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 15px;
    list-style: none;
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.woocommerce-message {
    background: rgba(61, 204, 122, .12);
    color: var(--ha-success);
}
.woocommerce-error {
    background: rgba(255, 122, 128, .12);
    color: var(--ha-error);
}
.woocommerce-info::before,
.woocommerce-message::before,
.woocommerce-error::before {
    display: none;
}
.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-info .button {
    margin-left: auto;
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .woocommerce ul.products li.product,
    .woocommerce ul.products li.product .button,
    .woocommerce div.product form.cart .button,
    .woocommerce div.product form.cart .single_add_to_cart_button,
    .woocommerce a.button,
    .woocommerce button.button,
    .woocommerce input.button {
        transition: none !important;
    }
    .woocommerce ul.products li.product:hover,
    .woocommerce div.product form.cart .button:hover,
    .woocommerce div.product form.cart .single_add_to_cart_button:hover,
    .woocommerce a.button:hover,
    .woocommerce button.button:hover {
        transform: none !important;
    }
}

/* ── Responsive: 3 / 2 / 1 columns ───────────────────────────────────── */
@media (max-width: 1160px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .woocommerce div.product {
        grid-template-columns: 1fr;
        gap: 24px; /* single column: gallery and summary now need a row gap */
    }
    .woocommerce div.product div.images,
    .woocommerce div.product .woocommerce-product-gallery,
    .woocommerce div.product div.summary {
        grid-column: 1;
    }
    .woocommerce div.product .woocommerce-tabs {
        margin-top: 16px; /* + 24px row gap = 40px separation */
    }
    .woocommerce div.product .related.products,
    .woocommerce div.product .up-sells {
        margin-top: 24px; /* + 24px row gap = 48px separation */
    }
}
@media (max-width: 640px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr;
    }
    .woocommerce div.product div.images .flex-control-thumbs li {
        width: calc(33.333% - 6px);
    }
    .ha-shop-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .woocommerce div.product form.cart div.quantity {
        margin-bottom: 12px;
        display: flex;
    }
}

/* ── Post-audit fixes (WCAG AA pass 2026-07-06) ─────────────────────── */
/* Dealer-pricing plugin pills use inline styles (white 11px text on
   #b58900 amber = 3.2:1, #28a745 green = 3.1:1). Darken backgrounds to
   meet 4.5:1; !important is required to beat the inline styles. */
.dealer-price-label { background: #6E7781 !important; }           /* RETAIL: 4.6:1 */
span.dealer-price-label[style*="#28a745"] { background: #1B7437 !important; } /* DEALER */
span.dealer-price-label[style*="#b58900"] { background: #8A6A00 !important; } /* NO DEALER PRICE */

/* Cross-sell / block-rendered product links (e.g. empty-cart "New in
   store") fall outside the classic-loop hooks — kill underlines there. */
.woocommerce ul.products li.product a,
.wc-block-grid__product a {
    text-decoration: none;
}
