/*
Theme Name: Healthy Way
Description: Child theme of Twenty Twenty-Five for askhealthyway.com.
Template: twentytwentyfive
Version: 0.1.0
Requires at least: 7.1
Requires PHP: 8.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: askhealthyway
*/

/* Header */
.ahw-header-search { flex: 1 1 260px; max-width: 420px; }
.ahw-header-search .wp-block-search__inside-wrapper { height: 40px; padding: 0; border: 1px solid var(--wp--preset--color--border-strong); border-radius: 0; background: var(--wp--preset--color--base); }
.ahw-header-search .wp-block-search__input { border: 0; border-radius: 0; padding: 0 0.75rem; color: var(--wp--preset--color--muted); }
.ahw-header-search .wp-block-search__button { margin: 0; padding: 0 0.6rem; border-radius: 0; background: transparent; color: var(--wp--preset--color--contrast); }
.ahw-topbar :is(a, button):focus-visible,
.ahw-header-main :is(a, input, button):focus-visible,
.ahw-navbar :is(a, button):focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
@media (max-width: 600px) {
	.ahw-header-search { flex-basis: 100%; max-width: 100%; }
}

/* Footer */
.ahw-footer-heading { margin-bottom: 0.5rem; }
.ahw-footer-links { list-style: none; margin: 0; padding-left: 0; }
.ahw-footer-links li { margin-bottom: 0.4rem; }
.ahw-footer a { text-decoration: none; }
.ahw-footer a:hover { text-decoration: underline; }
.ahw-footer a:focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
.ahw-footer-bottom p { margin: 0; }
.ahw-footer-bottom a:focus-visible { outline: 3px solid var(--wp--preset--color--base); outline-offset: 2px; }
@media (min-width: 782px) and (max-width: 1100px) {
	.ahw-footer .wp-block-columns { flex-wrap: wrap !important; }
	.ahw-footer .wp-block-column { flex: 1 1 30% !important; }
}

/* Shop sidebar */
/* Explicit text color so the toggle label always meets contrast. */
.ahw-cat-toggle > summary { color: var(--wp--preset--color--contrast); font-size: var(--wp--preset--font-size--medium); font-weight: 700; text-transform: uppercase; }
.ahw-cat-toggle > summary:focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
.ahw-cat-list ul { list-style: none; margin: 0.75rem 0 0; padding-left: 0; }
.ahw-cat-list li { border-top: 1px solid var(--wp--preset--color--line); }
.ahw-cat-list li a { display: block; padding: 0.45rem 0; color: var(--wp--preset--color--contrast); text-decoration: none; }
.ahw-cat-list li a:hover { color: var(--wp--preset--color--primary-dark); text-decoration: underline; }
.ahw-cat-list li a:focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
/* Sidebar stacks above the content as a collapsed toggle up to 1023px (catalog and home). */
@media (max-width: 1023px) {
	.ahw-catalog-columns { flex-wrap: wrap !important; }
	.ahw-catalog-columns > .wp-block-column { flex-basis: 100% !important; }
}
@media (min-width: 1024px) {
	.ahw-cat-toggle > summary { list-style: none; cursor: default; }
	.ahw-cat-toggle > summary::-webkit-details-marker { display: none; }
}

/* Catalog grid: 4 columns on desktop, 2 on tablet and phone */
.ahw-product-grid .wc-block-product-template { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30); }
.ahw-product-grid .wc-block-product-template > li { width: auto !important; max-width: none !important; margin: 0 !important; display: flex; flex-direction: column; }
.ahw-product-grid .wc-block-components-product-button { margin-top: auto !important; }
.ahw-product-grid .wc-block-components-product-button,
.ahw-product-grid .wc-block-components-product-button .wp-block-button__link { width: 100%; }
.ahw-catalog .wc-block-components-product-price del { color: var(--wp--preset--color--muted); }
.ahw-catalog .wc-block-components-product-price ins { color: var(--wp--preset--color--sale); font-weight: 700; text-decoration: none; }
body .wc-block-components-product-sale-badge { background: var(--wp--preset--color--sale); color: #ffffff; border: 0; border-radius: 0; font-weight: 700; text-transform: uppercase; }
@media (max-width: 1023px) {
	.ahw-product-grid .wc-block-product-template { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 781px) {
	.ahw-product-grid .wp-block-post-title { font-size: 0.875rem !important; }
}

/* Home: sidebar + hero band on top, later page sections full width.
   Post content uses display: contents so its blocks become grid items. */
.ahw-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ahw-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 4fr); gap: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40); align-items: start; }
.ahw-home-grid > .ahw-home-sidebar { grid-column: 1; grid-row: 1; margin: 0; }
.ahw-home-content { display: contents; }
.ahw-home-content > * { grid-column: 1 / -1; margin: 0 !important; }
.ahw-home-content > .ahw-home-band { grid-column: 2; grid-row: 1; }
.ahw-home-hero { margin: 0; }
.ahw-home-hero a, .ahw-home-hero img { display: block; }
.ahw-home-hero img { width: 100%; height: auto; }
.ahw-home-hero a:focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
/* Up to 1023px the sidebar stacks above the hero as a collapsed toggle. */
@media (max-width: 1023px) {
	.ahw-home-grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--wp--preset--spacing--40); }
	.ahw-home-grid > .ahw-home-sidebar,
	.ahw-home-content > .ahw-home-band { grid-column: 1; grid-row: auto; }
}

/* Top bar: free-shipping line centered; own row on phones */
.ahw-topbar-shipping { margin: 0; text-align: center; }
@media (max-width: 600px) {
	.ahw-topbar-shipping { order: 3; flex-basis: 100%; padding-bottom: 0.35rem; font-size: var(--wp--preset--font-size--small); }
}

/* Home sections. .ahw-bleed paints the section background to the viewport
   edges while the content stays in the 1280px column. */
.ahw-bleed { --ahw-bleed: transparent; box-shadow: 0 0 0 100vmax var(--ahw-bleed); clip-path: inset(0 -100vmax); padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); }
.ahw-bleed.has-primary-tint-background-color { --ahw-bleed: var(--wp--preset--color--primary-tint); }
.ahw-bleed.has-surface-background-color { --ahw-bleed: var(--wp--preset--color--surface); }
.ahw-bleed.has-primary-dark-background-color { --ahw-bleed: var(--wp--preset--color--primary-dark); }
.ahw-section-title { margin: 0 0 var(--wp--preset--spacing--40); font-size: var(--wp--preset--font-size--x-large); line-height: 1.25; }
.ahw-section-head { margin-bottom: var(--wp--preset--spacing--40); gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40); }
.ahw-section-head .ahw-section-title { margin-bottom: 0; }
.ahw-see-all { margin: 0; font-weight: 700; }
.ahw-see-all a { color: var(--wp--preset--color--primary-dark); text-decoration: none; }
.ahw-see-all a:hover { text-decoration: underline; }
:is(.ahw-home, .ahw-product) a:focus-visible,
:is(.ahw-home, .ahw-product) button:focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }

/* Home product cards */
:is(.ahw-home, .ahw-product) .wc-block-components-product-price del { color: var(--wp--preset--color--muted); }
:is(.ahw-home, .ahw-product) .wc-block-components-product-price ins { color: var(--wp--preset--color--sale); font-weight: 700; text-decoration: none; }
:is(.ahw-home, .ahw-product) .ahw-product-grid .wc-block-product-template > li { box-sizing: border-box; background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--line); padding: var(--wp--preset--spacing--30); box-shadow: 0 1px 2px rgba(60, 57, 54, 0.06), 0 6px 18px rgba(60, 57, 54, 0.06); }
@media (prefers-reduced-motion: no-preference) {
	:is(.ahw-home, .ahw-product) .ahw-product-grid .wc-block-product-template > li { transition: transform 0.15s ease, box-shadow 0.15s ease; }
	:is(.ahw-home, .ahw-product) .ahw-product-grid .wc-block-product-template > li:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60, 57, 54, 0.08), 0 12px 28px rgba(60, 57, 54, 0.12); }
}

/* This Week's Specials: 2-4 cards, centered, no empty slots */
.ahw-specials { margin-top: var(--wp--preset--spacing--50); }
.ahw-specials .ahw-section-title { text-align: center; }
.ahw-specials-grid .wc-block-product-template { display: flex !important; flex-wrap: wrap; justify-content: center; gap: var(--wp--preset--spacing--30); }
.ahw-specials-grid .wc-block-product-template > li { flex: 1 1 200px; max-width: 320px !important; }
.ahw-special-label { margin: calc(-1 * var(--wp--preset--spacing--30)) calc(-1 * var(--wp--preset--spacing--30)) var(--wp--preset--spacing--30); padding: 0.45rem 0.75rem; color: #ffffff; font-size: var(--wp--preset--font-size--small); font-weight: 700; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; }
.ahw-special-label--focus { background: var(--wp--preset--color--primary-dark); }
.ahw-special-label--bonus { background: var(--wp--preset--color--accent-dark); }
.ahw-special-label--monthly { background: var(--wp--preset--color--contrast); }
.ahw-special-summary { color: var(--wp--preset--color--muted); text-align: center; }
.ahw-special-summary p { margin: 0 0 var(--wp--preset--spacing--20); }
@media (max-width: 600px) {
	.ahw-specials-grid .wc-block-product-template > li { flex: 0 1 calc(50% - var(--wp--preset--spacing--30) / 2); max-width: calc(50% - var(--wp--preset--spacing--30) / 2) !important; }
}

/* Visit Our Store */
.ahw-store-columns { gap: var(--wp--preset--spacing--50); align-items: center; }
.ahw-store-facts { gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40); }
.ahw-store-facts p { margin: 0; line-height: 1.6; }
.ahw-store-facts strong { display: block; color: var(--wp--preset--color--primary-dark); font-size: var(--wp--preset--font-size--small); letter-spacing: 0.06em; text-transform: uppercase; }
.ahw-store-facts a[href^="tel:"] { font-size: var(--wp--preset--font-size--large); font-weight: 700; color: var(--wp--preset--color--contrast); }
.ahw-store-buttons { margin-top: var(--wp--preset--spacing--40); }
.ahw-store-buttons .wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; }
.ahw-store-photo { margin: 0; }
.ahw-store-photo img { display: block; width: 100%; height: auto; box-shadow: 0 6px 18px rgba(60, 57, 54, 0.12); }
.ahw-map { margin-top: var(--wp--preset--spacing--50); }
.ahw-map__button,
.ahw-map iframe { display: block; width: 100%; aspect-ratio: 21 / 9; border: 1px solid var(--wp--preset--color--line); }
.ahw-map__button { display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: var(--wp--preset--color--base) repeating-linear-gradient(45deg, transparent 0 22px, var(--wp--preset--color--primary-tint) 22px 44px); color: var(--wp--preset--color--primary-dark); font: inherit; font-size: var(--wp--preset--font-size--large); font-weight: 700; cursor: pointer; }
.ahw-map__button::before { content: ""; width: 1.5em; height: 1.5em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.ahw-map__note { margin: var(--wp--preset--spacing--20) 0 0; font-size: var(--wp--preset--font-size--small); }
@media (max-width: 781px) {
	.ahw-map__button, .ahw-map iframe { aspect-ratio: 4 / 3; }
}

/* Radio band */
.ahw-radio { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--50); }
.ahw-radio-button .wp-block-button__link { font-size: var(--wp--preset--font-size--large); font-weight: 700; padding: 0.9rem 1.75rem; text-align: center; }
.ahw-radio-button .wp-block-button__link:hover { text-decoration: underline; }
.ahw-radio .wp-block-button__link:focus-visible { outline: 3px solid var(--wp--preset--color--base); outline-offset: 3px; }

/* Learn: video + recent posts */
.ahw-learn-columns { gap: var(--wp--preset--spacing--50); }
.ahw-learn .wp-block-embed { margin: 0; }
.ahw-recent-posts .wp-block-post-template { display: grid; gap: var(--wp--preset--spacing--30); margin: 0; padding: 0; list-style: none; }
.ahw-post-card { gap: var(--wp--preset--spacing--30); }
.ahw-post-card .wp-block-post-featured-image { flex: 0 0 120px; margin: 0; }
.ahw-post-card .wp-block-post-title { margin: 0 0 0.25rem; line-height: 1.35; }
.ahw-post-card .wp-block-post-title a { text-decoration: none; }
.ahw-post-card .wp-block-post-title a:hover { text-decoration: underline; }
.ahw-post-card .wp-block-post-date { color: var(--wp--preset--color--muted); }

/* "Card" block style for Group */
.is-style-ahw-card { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--line); padding: var(--wp--preset--spacing--40); box-shadow: 0 1px 2px rgba(60, 57, 54, 0.06), 0 6px 18px rgba(60, 57, 54, 0.06); }
.ahw-home-content > .ahw-bleed + .ahw-bleed { margin-top: calc(-1 * var(--wp--preset--spacing--60)) !important; }

/* Phones: keep "ADD TO CART" on one line in two-up grids; tap target stays >= 44px. */
@media (max-width: 600px) {
	:is(.ahw-home, .ahw-product) .ahw-product-grid .wc-block-product-template > li { padding: 12px; }
	.ahw-home .ahw-special-label { margin: -12px -12px 12px; }
	.ahw-product-grid .wc-block-components-product-button__button { min-height: 44px; padding: 0.5rem 0.4rem; letter-spacing: 0; white-space: nowrap; }
}

/* Single product */
/* Breadcrumbs (Yoast SEO block; same trail as the BreadcrumbList schema) */
.yoast-breadcrumbs { margin: 0 0 var(--wp--preset--spacing--40); font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.yoast-breadcrumbs a { color: var(--wp--preset--color--primary-dark); }
.yoast-breadcrumbs a:focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
.ahw-product-columns { margin-bottom: var(--wp--preset--spacing--60); }
.ahw-product-buybox .ahw-special-label { display: inline-block; margin: 0 0 var(--wp--preset--spacing--30); }
.ahw-product-title { margin-top: 0; line-height: 1.25; }
.ahw-product-buybox .wc-block-components-product-price { margin-block: var(--wp--preset--spacing--30); font-weight: 700; }
.ahw-product-summary { color: var(--wp--preset--color--contrast); }
.ahw-product-cart form.cart { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--wp--preset--spacing--30); margin: var(--wp--preset--spacing--40) 0; }
.ahw-product-cart form.cart::before,
.ahw-product-cart form.cart::after { display: none !important; } /* WooCommerce clearfix; would take a flex gap */
.ahw-product-cart .quantity { margin: 0; }
.ahw-product-cart .quantity .qty { min-height: 48px; width: 5rem; font-size: var(--wp--preset--font-size--large); text-align: center; }
.ahw-product-cart .single_add_to_cart_button { min-height: 48px; padding-inline: var(--wp--preset--spacing--50); font-weight: 700; text-transform: uppercase; }
.ahw-product-meta { gap: 0.35rem; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.ahw-product-meta a { color: var(--wp--preset--color--primary-dark); }
.ahw-product-section { margin-top: var(--wp--preset--spacing--60); }
.ahw-product-description { border-top: 1px solid var(--wp--preset--color--line); padding-top: var(--wp--preset--spacing--50); }
.ahw-fda-disclaimer { margin-top: var(--wp--preset--spacing--40); padding: var(--wp--preset--spacing--30); background: var(--wp--preset--color--surface); border-left: 4px solid var(--wp--preset--color--primary-dark); font-size: var(--wp--preset--font-size--small); font-weight: 700; }

/* Up to 1023px: gallery above the buy box; image capped and centered on tablets. */
@media (max-width: 1023px) {
	.ahw-product-columns { flex-wrap: wrap !important; }
	.ahw-product-columns > .wp-block-column { flex-basis: 100% !important; }
	.ahw-product-gallery { max-width: 480px; margin-inline: auto !important; }
}
@media (max-width: 600px) {
	.ahw-product-cart form.cart .single_add_to_cart_button { flex: 1 1 auto; }
}

/* Gallery sale badge matches the red square SALE badge on cards */
.ahw-product .ahw-product-gallery span.onsale { top: 0.5rem; left: 0.5rem; right: auto; min-width: 0; min-height: 0; margin: 0; padding: 0.3rem 0.65rem; border-radius: 0; background: var(--wp--preset--color--sale); color: #ffffff; font-size: var(--wp--preset--font-size--small); font-weight: 700; line-height: 1.4; text-transform: uppercase; }

/* Supplement Facts (section output by the Healthy Way Site mu-plugin) */
/* Full-width rule like Description; content left-aligned at 800px. */
.ahw-supplement-facts { max-width: none !important; border-top: 1px solid var(--wp--preset--color--line); padding-top: var(--wp--preset--spacing--50); }
.ahw-supplement-facts > * { max-width: 800px; margin-left: 0; margin-right: auto; }
.ahw-supplement-facts__content { overflow-x: auto; }
.ahw-supplement-facts__content table { width: 100%; border-collapse: collapse; border: 2px solid var(--wp--preset--color--contrast); font-size: var(--wp--preset--font-size--small); }
.ahw-supplement-facts__content caption { padding: 0.5rem 0; font-weight: 700; text-align: left; }
.ahw-supplement-facts__content th,
.ahw-supplement-facts__content td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--wp--preset--color--line); text-align: left; vertical-align: top; }
.ahw-supplement-facts__content thead th { border-bottom: 4px solid var(--wp--preset--color--contrast); }
.ahw-supplement-facts__content td:not(:first-child),
.ahw-supplement-facts__content th:not(:first-child) { text-align: right; }
.ahw-supplement-facts__content td:not(:first-child) { white-space: nowrap; }
@media (max-width: 600px) {
	.ahw-supplement-facts__content th,
	.ahw-supplement-facts__content td { padding: 0.4rem 0.35rem; }
}

/* ===== Cart, checkout, mini-cart (WooCommerce blocks) ===== */
.wc-block-cart,
.wc-block-checkout,
.wc-block-mini-cart__drawer { font-size: 1rem; }
.wc-block-cart :is(a, button, input, select, textarea):focus-visible,
.wc-block-checkout :is(a, button, input, select, textarea):focus-visible,
.wc-block-mini-cart__drawer :is(a, button, input):focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
.wc-block-components-product-name { font-size: 1rem; font-weight: 700; color: var(--wp--preset--color--primary-dark); }
.wc-block-components-product-metadata { color: var(--wp--preset--color--muted); }
.wc-block-cart-items th,
.wc-block-cart .wc-block-cart__totals-title { font-size: var(--wp--preset--font-size--small); font-weight: 700; letter-spacing: 0.04em; }

/* 44px tap targets: quantity, remove, checkboxes, coupon toggle */
.wc-block-components-quantity-selector { width: auto !important; min-height: 44px; border: 1px solid var(--wp--preset--color--border-strong) !important; border-radius: 0 !important; }
.wc-block-components-quantity-selector::after { border-color: var(--wp--preset--color--border-strong) !important; opacity: 1 !important; border-radius: 0 !important; }
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__input { min-width: 48px; }
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__input { min-height: 44px; font-size: 1rem; }
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button { min-width: 44px; min-height: 44px; font-size: 1.25rem; }
.wc-block-cart-item__remove-link,
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link { min-width: 44px; min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; }
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] { width: 24px; height: 24px; min-width: 24px; border-radius: 0; }
.wc-block-components-checkbox label { min-height: 44px; align-items: center; font-size: 1rem !important; }
.wc-block-components-checkbox__label,
.wc-block-components-radio-control__label,
.wc-block-components-radio-control__secondary-label,
.wc-block-components-address-form__address_2-toggle { font-size: 1rem !important; }
.wc-block-components-panel__button { display: flex !important; align-items: center; min-height: 44px; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); text-decoration: underline; text-underline-offset: 3px; }
.wc-block-components-panel__button { padding-right: 0 !important; }
.wc-block-components-panel__button > svg { position: static !important; order: 2; margin-left: auto; transform: none !important; }
.wc-block-components-radio-control__option { border-radius: 0 !important; }

/* Labels always visible above fields (not floating inside the box) */
.wc-block-components-text-input label,
.wc-block-components-text-input.is-active label,
.wc-blocks-components-select .wc-blocks-components-select__label {
	position: static !important; transform: none !important; display: block; max-width: none; margin: 0 0 0.35rem; padding: 0;
	font-size: 1rem !important; line-height: 1.4; color: var(--wp--preset--color--contrast); white-space: normal; overflow: visible;
}
.wc-block-components-text-input input,
.wc-block-components-text-input.is-active input,
.wc-block-components-textarea,
.wc-blocks-components-select .wc-blocks-components-select__select {
	min-height: 48px; height: auto; padding: 0.7rem 0.75rem !important; border-radius: 0 !important; font-size: 1rem;
}
.wc-blocks-components-select .wc-blocks-components-select__container { height: auto; }
.wc-blocks-components-select .wc-blocks-components-select__expand { top: auto; bottom: 12px; transform: none; }
.wc-block-components-text-input input::placeholder { color: transparent; }
/* The label follows the input in the markup; show it first. */
.wc-block-components-text-input { display: flex; flex-direction: column; }
.wc-block-components-text-input > label { order: -1; }

/* Buttons: green, square, 48px */
.wc-block-cart .wc-block-components-button:not(.is-link):not(.wc-block-components-panel__button),
.wc-block-checkout .wc-block-components-button:not(.is-link):not(.wc-block-components-panel__button),
.wc-block-mini-cart__footer-actions .wc-block-components-button { min-height: 48px; border-radius: 0; font-weight: 700; text-transform: uppercase; }

/* Discounts in sale red */
.wc-block-components-product-price__value.is-discounted,
.wc-block-components-totals-discount .wc-block-components-totals-item__value { color: var(--wp--preset--color--sale); font-weight: 700; }
.wc-block-components-product-price__regular { color: var(--wp--preset--color--muted); }
.wc-block-components-sale-badge { border: 0 !important; border-radius: 0 !important; background: var(--wp--preset--color--sale) !important; color: #ffffff !important; font-weight: 700; }

/* Up to 1023px: one column; checkout shows the order summary above the form */
@media (max-width: 1023px) {
	.wc-block-components-sidebar-layout.is-large,
	.wc-block-components-sidebar-layout.is-medium { flex-direction: column; }
	.wc-block-components-sidebar-layout:is(.is-large, .is-medium) > .wc-block-components-main,
	.wc-block-components-sidebar-layout:is(.is-large, .is-medium) > .wc-block-components-sidebar { width: 100% !important; padding-left: 0 !important; padding-right: 0 !important; }
	.wc-block-checkout:is(.is-large, .is-medium) > .wc-block-checkout__sidebar { order: -1; position: static; margin-bottom: var(--wp--preset--spacing--50); }
}

/* Checkout header */
.ahw-checkout-header-info { gap: 0.15rem; text-align: right; }
.ahw-checkout-header-info p { margin: 0; }
.ahw-checkout-secure { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--wp--preset--color--primary-dark); }
.ahw-checkout-secure::before { content: ""; width: 1em; height: 1em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7a5 5 0 0 0-10 0v2H5v13h14V9zm-8-2a3 3 0 0 1 6 0v2H9zm4 10.7V19h-2v-1.3a2 2 0 1 1 2 0z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7a5 5 0 0 0-10 0v2H5v13h14V9zm-8-2a3 3 0 0 1 6 0v2H9zm4 10.7V19h-2v-1.3a2 2 0 1 1 2 0z'/%3E%3C/svg%3E") center / contain no-repeat; }
.ahw-checkout-help a { font-weight: 700; color: var(--wp--preset--color--contrast); }
@media (max-width: 600px) {
	.ahw-checkout-header .wp-block-site-logo img { width: 150px !important; }
	.ahw-checkout-header-info { font-size: var(--wp--preset--font-size--small); }
}

/* Mini-cart drawer */
.wc-block-mini-cart__drawer .wc-block-mini-cart__title { font-size: var(--wp--preset--font-size--x-large); font-weight: 700; }
.wc-block-mini-cart__footer { border-top: 1px solid var(--wp--preset--color--line); }
.wc-block-mini-cart__footer-actions { gap: var(--wp--preset--spacing--20); }
.wc-block-mini-cart__footer-actions { display: flex !important; flex-direction: column; }
.wc-block-mini-cart__footer-actions .wc-block-components-button { box-sizing: border-box; flex: 0 0 auto; width: 100%; }
@media (max-width: 600px) {
	.wc-block-mini-cart__drawer .wc-block-cart-items__row { grid-template-columns: 56px minmax(0, 1fr) auto !important; }
	.wc-block-mini-cart__drawer .wc-block-cart-item__image { grid-column: 1 !important; }
	.wc-block-mini-cart__drawer .wc-block-cart-item__product { grid-column: 2 !important; min-width: 0; }
	.wc-block-mini-cart__drawer .wc-block-cart-item__total { grid-column: 3 !important; }
}
.wc-block-mini-cart__footer-cart.wc-block-components-button { border: 2px solid var(--wp--preset--color--primary-dark) !important; background: var(--wp--preset--color--base) !important; color: var(--wp--preset--color--primary-dark) !important; }
.wc-block-mini-cart__footer-checkout.wc-block-components-button { border: 2px solid var(--wp--preset--color--primary-dark) !important; background: var(--wp--preset--color--primary-dark) !important; color: #ffffff !important; }

/* ===== My Account ===== */
/* WooCommerce caps these at 1000px on block themes; use the full 1280px column. */
.ahw-account .ahw-account-title,
.ahw-account .woocommerce { max-width: none !important; margin-inline: 0 !important; padding-inline: 0 !important; }
.ahw-account-title { margin-top: 0; }
.ahw-account .woocommerce { font-size: 1rem; }
.ahw-account :is(a, button, input):focus-visible { outline: 3px solid var(--wp--preset--color--contrast); outline-offset: 2px; }
.ahw-account .woocommerce form .input-text { min-height: 48px; padding: 0.7rem 0.75rem; border-radius: 0; font-size: 1rem; }
.ahw-account .woocommerce form label { font-size: 1rem; }
.ahw-account .woocommerce .button { min-height: 48px; border-radius: 0; font-weight: 700; text-transform: uppercase; }
.ahw-account .woocommerce-form-login { max-width: 640px; border-radius: 0 !important; }
.ahw-account .woocommerce form input[type="checkbox"] { width: 24px; height: 24px; margin: 0 0.5rem 0 0; vertical-align: middle; accent-color: var(--wp--preset--color--primary-dark); }
.ahw-account .woocommerce-form-login__rememberme { display: inline-flex !important; align-items: center; min-height: 48px; }
.ahw-account .woocommerce-LostPassword { margin-top: var(--wp--preset--spacing--30); }
.ahw-account .woocommerce-LostPassword a { display: inline-block; padding: 0.6rem 0; font-size: 1.0625rem; font-weight: 700; color: var(--wp--preset--color--primary-dark); }
/* Logged in: menu beside the content, stacked up to 1023px */
.ahw-account .woocommerce:has(> .woocommerce-MyAccount-navigation) { display: grid; grid-template-columns: minmax(200px, 25%) minmax(0, 1fr); gap: var(--wp--preset--spacing--50); }
.ahw-account .woocommerce-MyAccount-navigation,
.ahw-account .woocommerce-MyAccount-content { float: none !important; width: auto !important; }
.ahw-account .woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; list-style: none; border: 1px solid var(--wp--preset--color--line); }
.ahw-account .woocommerce-MyAccount-navigation li { margin: 0; padding: 0; }
.ahw-account .woocommerce-MyAccount-navigation li + li { border-top: 1px solid var(--wp--preset--color--line); }
.ahw-account .woocommerce-MyAccount-navigation a { box-sizing: border-box; display: flex; align-items: center; min-height: 48px; padding: 0.5rem 1rem; color: var(--wp--preset--color--contrast); text-decoration: none; }
.ahw-account .woocommerce-MyAccount-navigation a:hover { background: var(--wp--preset--color--surface); text-decoration: underline; }
.ahw-account .woocommerce-MyAccount-navigation .is-active a { background: var(--wp--preset--color--primary-tint); box-shadow: inset 4px 0 0 var(--wp--preset--color--primary-dark); font-weight: 700; }
.ahw-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation { grid-column: 1; grid-row: 1; }
.ahw-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content { grid-column: 2; grid-row: 1; }
.ahw-account .woocommerce-MyAccount-content > :first-child { margin-top: 0; }
@media (max-width: 1023px) {
	.ahw-account .woocommerce:has(> .woocommerce-MyAccount-navigation) { grid-template-columns: minmax(0, 1fr); }
	.ahw-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > :is(.woocommerce-MyAccount-navigation, .woocommerce-MyAccount-content) { grid-column: 1; grid-row: auto; }
}

/* ===== Accessibility fixes ===== */
/* Closed mini-cart drawer: hide it completely so its links leave the Tab order
   (WooCommerce only slides it off-screen). The delay keeps the slide-out. */
.wc-block-components-drawer__screen-overlay--is-hidden { visibility: hidden; transition: visibility 0s linear 0.3s; }
@media (prefers-reduced-motion: reduce) {
	.wc-block-components-drawer__screen-overlay--is-hidden { transition: none; }
}
/* Show-password toggle: 44px target */
.ahw-account .woocommerce form .show-password-input { top: 50%; right: 2px; width: 44px; height: 44px; margin: 0; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; }
/* Cart at 320px (400% zoom): no sideways scrolling */
@media (max-width: 400px) {
	.wc-block-cart .wc-block-cart-items__row { grid-template-columns: 56px minmax(0, 1fr) auto !important; }
	.wc-block-cart .wc-block-cart-item__image { grid-column: 1 !important; }
	.wc-block-cart .wc-block-cart-item__product { grid-column: 2 !important; min-width: 0; }
	.wc-block-cart .wc-block-cart-item__total { grid-column: 3 !important; }
	.wc-block-cart .wc-block-cart-item__quantity { flex-wrap: wrap; }
	.wc-block-cart table.wc-block-cart-items { table-layout: fixed; width: 100%; }
}

/* SRP price display (markup from the Healthy Way Site plugin): Retail struck, Discount in sale red, You save */
.ahw-srp-price { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; line-height: 1.4; }
.has-text-align-center .ahw-srp-price,
.wc-block-components-product-price.has-text-align-center .ahw-srp-price { align-items: center; }
.ahw-srp-price__label { font-weight: 400; color: var(--wp--preset--color--muted); }
.ahw-srp-price__retail del { color: var(--wp--preset--color--muted); }
.ahw-srp-price__discount ins { color: var(--wp--preset--color--sale); font-weight: 700; text-decoration: none; }
.ahw-srp-price__save { color: var(--wp--preset--color--sale); font-weight: 700; font-size: 0.9em; }

/* ADP tier table: header text #6d6d6d on #efefef is 4.49:1 (AA needs 4.5); use the muted token (#545454) */
.wdp_bulk_table_content table.wdp_pricing_table thead td { color: var(--wp--preset--color--muted) !important; }

/* Email Sign Up page: Mailchimp form (markup in the page; script loaded by askhealthyway_enqueue_mailchimp) */
#mc_embed_signup { max-width: 32rem; margin-block: var(--wp--preset--spacing--40); }
#mc_embed_signup .indicates-required { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); margin: 0 0 var(--wp--preset--spacing--30); }
#mc_embed_signup .asterisk { color: var(--wp--preset--color--sale); }
#mc_embed_signup .mc-field-group { margin-bottom: var(--wp--preset--spacing--30); }
#mc_embed_signup label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
#mc_embed_signup input[type="email"],
#mc_embed_signup input[type="text"] { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; font: inherit; color: var(--wp--preset--color--contrast); background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border-strong); border-radius: 4px; }
#mc_embed_signup input[type="email"]:focus-visible,
#mc_embed_signup input[type="text"]:focus-visible { outline: 2px solid var(--wp--preset--color--primary-dark); outline-offset: 2px; }
#mc_embed_signup input.mce_inline_error { border-color: var(--wp--preset--color--sale); }
#mc_embed_signup div.mce_inline_error { color: var(--wp--preset--color--sale); font-weight: 700; margin-top: 0.35rem; }
#mc_embed_signup #mc-embedded-subscribe { min-height: 44px; cursor: pointer; }
#mc_embed_signup .response { margin: var(--wp--preset--spacing--30) 0; padding: 0.75rem 1rem; border-radius: 4px; font-weight: 700; }
#mc_embed_signup #mce-error-response { color: var(--wp--preset--color--sale); border: 1px solid var(--wp--preset--color--sale); }
#mc_embed_signup #mce-success-response { color: var(--wp--preset--color--primary-dark); border: 1px solid var(--wp--preset--color--primary-dark); }

/* Pages: floated images (alignleft/alignright) line up with the content column. Core's constrained layout
   puts them at the full-width edge, so a left photo sat ~270px left of the page title on wide screens. */
.wp-block-post-content.is-layout-constrained > .alignleft { margin-inline-start: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)); }
.wp-block-post-content.is-layout-constrained > .alignright { margin-inline-end: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)); }

/* Ninja Forms (Contact Us): fields match the site's form fields (44px targets, 3:1 borders); the submit button
   gets the theme's button class through the field's "element_class" setting. */
.nf-form-cont .nf-field-label label { font-weight: 700; }
.nf-form-cont .ninja-forms-req-symbol, .nf-form-cont .nf-form-fields-required .ninja-forms-req-symbol { color: var(--wp--preset--color--sale); }
.nf-form-cont input.ninja-forms-field:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
.nf-form-cont textarea.ninja-forms-field { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; font: inherit; color: var(--wp--preset--color--contrast); background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border-strong); border-radius: 4px; }
.nf-form-cont input.ninja-forms-field:focus-visible, .nf-form-cont textarea.ninja-forms-field:focus-visible { outline: 2px solid var(--wp--preset--color--primary-dark); outline-offset: 2px; }
.nf-form-cont .nf-error .ninja-forms-field { border-color: var(--wp--preset--color--sale); }
.nf-form-cont .nf-error-msg { color: var(--wp--preset--color--sale); font-weight: 700; }
.nf-form-cont input[type="submit"].wp-element-button { min-height: 44px; cursor: pointer; }
.nf-form-cont input[type="submit"].wp-element-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Blog listing and tag archives: image + text cards (templates/home.html, archive.html) */
.ahw-post-list > li + li { border-top: 1px solid var(--wp--preset--color--line); padding-top: var(--wp--preset--spacing--50); }
.ahw-post-card { flex-wrap: nowrap; }
.ahw-post-card__image { flex: 0 0 240px; margin: 0; }
.ahw-post-card__text { flex: 1 1 auto; min-width: 0; }
.ahw-post-card__text .wp-block-post-title { margin: 0; }
@media (max-width: 600px) {
	.ahw-post-card { flex-wrap: wrap; }
	.ahw-post-card__image { flex-basis: 100%; width: 100% !important; }
}
.ahw-byline p { margin: 0; }
