/* =========================================================================
   WooCommerce — brought onto the theme's tokens.
   Loaded only when WooCommerce is active (see inc/enqueue.php).
   Covers both the classic shortcode templates and the newer cart/checkout
   blocks, since a store can be running either.
   ========================================================================= */

/* ---------- buttons ---------- */

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.wc-block-components-button {
	background: var(--hnc-ink);
	color: var(--hnc-base);
	border: 1.5px solid var(--hnc-ink);
	border-radius: var(--hnc-radius);
	font-family: var(--hnc-body);
	font-size: 13.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .02em;
	line-height: 1.2;
	padding: 12px 20px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	text-shadow: none;
	transition: filter .15s ease;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.wc-block-components-button:hover {
	background: var(--hnc-ink);
	color: var(--hnc-base);
	filter: brightness(1.35);
}

.woocommerce a.button.disabled,
.woocommerce button.button:disabled,
.woocommerce input.button:disabled,
.wc-block-components-button:disabled {
	opacity: .5;
	cursor: not-allowed;
	filter: none;
}

/* The single most important button on the site gets the accent. */
.woocommerce .single_add_to_cart_button,
.woocommerce .checkout-button,
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	background: var(--hnc-accent);
	border-color: var(--hnc-accent);
	color: #fff;
}
.woocommerce .single_add_to_cart_button:hover,
.woocommerce .checkout-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover {
	background: var(--hnc-accent);
	border-color: var(--hnc-accent);
	color: #fff;
	filter: brightness(1.1);
}

/* ---------- prices ---------- */

.woocommerce .price,
.woocommerce span.amount,
.woocommerce-Price-amount,
.wc-block-components-product-price {
	color: var(--hnc-ink);
	font-weight: 700;
	font-family: var(--hnc-body);
}
.woocommerce del,
.wc-block-components-product-price del {
	color: var(--hnc-muted);
	font-weight: 400;
	opacity: .75;
	margin-right: 5px;
}
.woocommerce ins,
.wc-block-components-product-price ins {
	text-decoration: none;
	color: var(--hnc-accent);
}

/* ---------- product loop ---------- */

.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 30px 22px;
	margin: 0 0 34px;
	padding: 0;
	list-style: none;
}
/* Neutralise Woo's float/percentage column system so the grid governs. */
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none; }
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	width: 100%;
	float: none;
	margin: 0;
	clear: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: left;
}

.woocommerce ul.products li.product a img {
	margin: 0 0 10px;
	border-radius: var(--hnc-radius);
	background: var(--hnc-surface);
	aspect-ratio: 1 / 1;
	object-fit: contain;
	width: 100%;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--hnc-body);
	text-transform: none;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	padding: 0;
	margin: 0;
	color: var(--hnc-ink);
}

.woocommerce ul.products li.product .price {
	font-size: 14px;
	margin: 0;
}

.woocommerce ul.products li.product .button {
	margin-top: auto;
	align-self: flex-start;
}

.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background: var(--hnc-accent);
	color: #fff;
	font-family: var(--hnc-body);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	border-radius: var(--hnc-radius);
	min-height: 0;
	min-width: 0;
	line-height: 1;
	padding: 6px 10px;
	top: 8px;
	left: 8px;
	right: auto;
	margin: 0;
}

/* ---------- store header ---------- */

.woocommerce .woocommerce-breadcrumb {
	font-size: 13px;
	color: var(--hnc-muted);
	margin-bottom: 14px;
}
.woocommerce .woocommerce-breadcrumb a { color: var(--hnc-muted); }
.woocommerce .woocommerce-breadcrumb a:hover { color: var(--hnc-accent); }

.woocommerce .woocommerce-products-header__title,
.woocommerce .product_title {
	font-family: var(--hnc-display);
	text-transform: uppercase;
}

.woocommerce .woocommerce-result-count {
	font-size: 13.5px;
	color: var(--hnc-muted);
	margin: 0;
}
.woocommerce .woocommerce-ordering select,
.woocommerce select,
.wc-block-components-sort-select__select {
	font: inherit;
	font-size: 14px;
	padding: 9px 12px;
	min-height: 44px;
	border: 1px solid var(--hnc-line);
	border-radius: var(--hnc-radius);
	background: var(--hnc-base);
	color: var(--hnc-ink);
	max-width: 100%;
}

/* Result count + ordering sit on one row, and stack cleanly when tight. */
.woocommerce .woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce .woocommerce-result-count { display: block; float: none; }
.woocommerce .woocommerce-ordering { float: none; margin: 0; }

.woocommerce-products-header + .woocommerce-notices-wrapper,
.woocommerce .storefront-sorting { margin-bottom: 18px; }

/* ---------- single product ---------- */

.woocommerce div.product { display: block; }
.woocommerce div.product div.images,
.woocommerce div.product div.summary {
	float: none;
	width: 100%;
	margin: 0 0 26px;
}

@media (min-width: 781px) {
	.woocommerce div.product {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 34px;
		align-items: start;
	}
	.woocommerce div.product div.images,
	.woocommerce div.product div.summary { margin-bottom: 0; }
	.woocommerce div.product .woocommerce-tabs,
	.woocommerce div.product .related,
	.woocommerce div.product .upsells { grid-column: 1 / -1; }
}

.woocommerce div.product div.images img { border-radius: var(--hnc-radius); }

.woocommerce div.product form.cart { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.woocommerce div.product form.cart div.quantity { margin: 0; float: none; }
.woocommerce .quantity input.qty,
.wc-block-components-quantity-selector input {
	width: 72px;
	min-height: 44px;
	padding: 10px;
	font: inherit;
	text-align: center;
	border: 1.5px solid var(--hnc-line);
	border-radius: var(--hnc-radius);
	background: var(--hnc-base);
	color: var(--hnc-ink);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
	padding: 0;
	margin: 0 0 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	border-bottom: 1px solid var(--hnc-line);
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before { content: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: none;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { content: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 11px 14px;
	font-weight: 700;
	font-size: 13.5px;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: var(--hnc-muted);
	border-bottom: 2px solid transparent;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
	color: var(--hnc-ink);
	border-bottom-color: var(--hnc-accent);
}

/* ---------- tables (cart, order details, my account) ---------- */

.woocommerce table.shop_table,
.woocommerce table.shop_attributes {
	border: 1px solid var(--hnc-line);
	border-radius: var(--hnc-radius);
	border-collapse: collapse;
	width: 100%;
	font-size: 14.5px;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	border-color: var(--hnc-line);
	padding: 13px 14px;
	vertical-align: middle;
}
.woocommerce table.shop_table thead th {
	font-family: var(--hnc-body);
	font-size: 11.5px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--hnc-muted);
	background: var(--hnc-surface);
	font-weight: 700;
}
.woocommerce table.shop_table td.product-name a { font-weight: 700; }
.woocommerce table.shop_table img { width: 56px; border-radius: var(--hnc-radius); }

/* Any table that still can't fit scrolls in its own box, never the page. */
.woocommerce .woocommerce-order-details,
.woocommerce .woocommerce-customer-details,
.woocommerce .woocommerce-MyAccount-content .woocommerce-orders-table__wrapper { overflow-x: auto; }

/* ---------- cart totals / checkout ---------- */

.woocommerce .cart-collaterals,
.woocommerce-page .cart-collaterals { width: 100%; }
.woocommerce .cart-collaterals .cart_totals,
.woocommerce-page .cart-collaterals .cart_totals { float: none; width: 100%; }
.woocommerce .cart_totals h2,
.woocommerce-checkout h3 {
	font-family: var(--hnc-display);
	text-transform: uppercase;
	font-size: 20px;
}

.woocommerce form.checkout_coupon,
.woocommerce form.login,
.woocommerce form.register {
	border: 1.5px solid var(--hnc-line);
	border-radius: var(--hnc-radius);
	padding: 20px;
}

.woocommerce #customer_details { display: grid; gap: 8px; }
@media (min-width: 781px) {
	.woocommerce #customer_details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
}
.woocommerce #customer_details .col-1,
.woocommerce #customer_details .col-2 { float: none; width: 100%; }

.woocommerce form .form-row { padding: 0; margin: 0 0 15px; }
.woocommerce form .form-row label { font-size: 13px; font-weight: 700; margin-bottom: 5px; display: block; }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-input-wrapper input,
.wc-block-components-text-input input {
	width: 100%;
	padding: 11px 12px;
	min-height: 44px;
	font: inherit;
	font-size: 15px;
	border: 1px solid var(--hnc-line);
	border-radius: var(--hnc-radius);
	background: var(--hnc-base);
	color: var(--hnc-ink);
}
.woocommerce form .form-row.woocommerce-invalid input.input-text { border-color: #d63638; }

/* Woo's two-up rows collapse under ~560px so labels stop truncating. */
@media (max-width: 560px) {
	.woocommerce form .form-row-first,
	.woocommerce form .form-row-last { width: 100%; float: none; margin-right: 0; }
}

#add_payment_method #payment,
.woocommerce-cart #payment,
.woocommerce-checkout #payment {
	background: var(--hnc-surface);
	border-radius: var(--hnc-radius);
}
.woocommerce-checkout #payment ul.payment_methods { border-bottom-color: var(--hnc-line); }
.woocommerce-checkout #payment div.payment_box { background: var(--hnc-base); border-radius: var(--hnc-radius); }
.woocommerce-checkout #payment div.payment_box::before { border-bottom-color: var(--hnc-base); }

/* ---------- notices ---------- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	border-top: 0;
	border-left: 4px solid var(--hnc-accent);
	background: var(--hnc-surface);
	color: var(--hnc-ink);
	border-radius: var(--hnc-radius);
	font-size: 14.5px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 14px 16px;
}
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before { content: none; }
.woocommerce-error { border-left-color: #d63638; }
.woocommerce-message .button,
.woocommerce-info .button { margin-left: auto; }

/* ---------- my account ---------- */

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content { float: none; width: 100%; }
.woocommerce-account .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0 0 26px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	border-bottom: 1px solid var(--hnc-line);
}
.woocommerce-account .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 11px 13px;
	font-size: 13.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: var(--hnc-muted);
	border-bottom: 2px solid transparent;
}
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
	color: var(--hnc-ink);
	border-bottom-color: var(--hnc-accent);
}

@media (min-width: 861px) {
	.woocommerce-account .woocommerce-MyAccount-navigation { width: 24%; float: left; }
	.woocommerce-account .woocommerce-MyAccount-content { width: 72%; float: right; }
	.woocommerce-account .woocommerce-MyAccount-navigation ul {
		flex-direction: column;
		gap: 0;
		border-bottom: 0;
	}
	.woocommerce-account .woocommerce-MyAccount-navigation li a {
		border-bottom: 1px solid var(--hnc-line);
		border-left: 2px solid transparent;
	}
	.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
		border-left-color: var(--hnc-accent);
		border-bottom-color: var(--hnc-line);
	}
}

/* ---------- pagination ---------- */

.woocommerce nav.woocommerce-pagination ul {
	border: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.woocommerce nav.woocommerce-pagination ul li { border: 0; margin: 0; overflow: visible; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	display: grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 10px;
	border: 1px solid var(--hnc-line);
	border-radius: var(--hnc-radius);
	font-size: 13.5px;
	font-weight: 700;
	color: var(--hnc-ink);
}
.woocommerce nav.woocommerce-pagination ul li span.current {
	background: var(--hnc-ink);
	border-color: var(--hnc-ink);
	color: var(--hnc-base);
}

/* ---------- block product grids ----------
   "New in store", Related Products and any Products block use wc-block-grid
   markup, which shares nothing with ul.products and needs styling of its own. */

/* Woo ships `.wc-block-grid.has-N-columns .wc-block-grid__products{display:block}`
   for every column count inside its own small-screen media query. That is an exact
   specificity tie with anything reasonable the theme can write, so the winner would
   come down to stylesheet print order — which varies with how block styles are
   loaded. !important on this single declaration is the deterministic fix; the rest
   of the grid is set normally below. */
.wc-block-grid .wc-block-grid__products,
ul.wc-block-grid__products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 28px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
}
.wc-block-grid__products::before,
.wc-block-grid__products::after { content: none; }

.wc-block-grid .wc-block-grid__products > li.wc-block-grid__product,
ul.wc-block-grid__products > li.wc-block-grid__product {
	width: 100%;
	max-width: none;
	flex-basis: auto;
	float: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: left;
}

.wc-block-grid__product-link { text-decoration: none; color: inherit; display: block; }

.wc-block-grid__product-image {
	margin: 0 0 10px;
	display: block;
}
.wc-block-grid__product-image img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: var(--hnc-surface);
	border-radius: var(--hnc-radius);
	margin: 0;
}

.wc-block-grid__product-title {
	font-family: var(--hnc-body);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--hnc-ink);
	text-transform: none;
	text-decoration: none;
	margin: 0;
	padding: 0;
}

/* The product li is a flex column; Woo centres these children as flex items, so
   text-align alone does nothing until they stretch to the full column width. */
.wc-block-grid .wc-block-grid__product-price,
.wc-block-grid .wc-block-grid__product-title,
.wc-block-grid .wc-block-grid__product-link {
	align-self: stretch;
	width: 100%;
	text-align: left;
	justify-content: flex-start;
}
.wc-block-grid__product-price {
	font-size: 14px;
	font-weight: 700;
	color: var(--hnc-ink);
	margin: 0;
}
.wc-block-grid__product-price del { color: var(--hnc-muted); font-weight: 400; }
.wc-block-grid__product-price ins { text-decoration: none; color: var(--hnc-accent); }

.wc-block-grid .wc-block-grid__product-add-to-cart {
	margin-top: auto;
	padding-top: 4px;
	text-align: left;
	width: 100%;
	display: block;
}
.wc-block-grid .wc-block-grid__product-add-to-cart .wp-block-button__link,
.wc-block-grid__product-add-to-cart .wp-block-button__link {
	background: var(--hnc-ink);
	color: var(--hnc-base);
	border: 1.5px solid var(--hnc-ink);
	border-radius: var(--hnc-radius);
	font-family: var(--hnc-body);
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .02em;
	padding: 11px 16px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	width: 100%;
}
.wc-block-grid__product-add-to-cart .wp-block-button__link:hover {
	color: var(--hnc-base);
	filter: brightness(1.35);
}

@media (max-width: 640px) {
	.wc-block-grid .wc-block-grid__products,
	ul.wc-block-grid__products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 14px;
	}
	.wc-block-grid__product-title { font-size: 13.5px; }
	.wc-block-grid__product-add-to-cart .wp-block-button__link { font-size: 11.5px; padding: 11px 10px; }
}

/* ---------- cart/checkout blocks ---------- */

.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout { max-width: 100%; }
.wc-block-components-title,
.wc-block-cart__empty-cart__title {
	font-family: var(--hnc-display);
	text-transform: uppercase;
}
.wc-block-components-product-name { font-weight: 700; text-decoration: none; }
.wc-block-cart-items__row { border-color: var(--hnc-line); }

/* ---------- narrow screens ---------- */

@media (max-width: 640px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 14px;
	}
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 13.5px; }
	.woocommerce ul.products li.product .button {
		width: 100%;
		padding: 11px 12px;
		font-size: 12px;
	}

	/* Cart table becomes stacked cards — a 6-column table cannot work here. */
	.woocommerce table.shop_table_responsive,
	.woocommerce-page table.shop_table_responsive { border: 0; }
	.woocommerce table.shop_table_responsive thead,
	.woocommerce-page table.shop_table_responsive thead { display: none; }
	.woocommerce table.shop_table_responsive tr,
	.woocommerce-page table.shop_table_responsive tr {
		display: block;
		border: 1px solid var(--hnc-line);
		border-radius: var(--hnc-radius);
		margin-bottom: 12px;
		padding: 4px 0;
	}
	.woocommerce table.shop_table_responsive tr td,
	.woocommerce-page table.shop_table_responsive tr td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 14px;
		border: 0;
		border-bottom: 1px solid var(--hnc-line);
		padding: 10px 14px;
		text-align: right;
	}
	.woocommerce table.shop_table_responsive tr td:last-child,
	.woocommerce-page table.shop_table_responsive tr td:last-child { border-bottom: 0; }
	.woocommerce table.shop_table_responsive tr td::before,
	.woocommerce-page table.shop_table_responsive tr td::before {
		content: attr(data-title) ": ";
		font-size: 11.5px;
		letter-spacing: .07em;
		text-transform: uppercase;
		color: var(--hnc-muted);
		font-weight: 700;
		text-align: left;
	}
	.woocommerce table.shop_table_responsive tr td.product-remove::before { content: none; }
	.woocommerce table.shop_table_responsive tr td.product-thumbnail { display: none; }

	.woocommerce .actions .coupon { display: flex; gap: 8px; flex-wrap: wrap; }
	.woocommerce .actions .coupon input.input-text { flex: 1; min-width: 140px; }
	.woocommerce .actions .button { width: 100%; }
	.woocommerce #coupon_code { width: auto; }
}
