/*
 * Black Hawk Trading — shop styling.
 *
 * The Elementor kit defines Primary = #ffffff and links inherit it, so on the
 * white shop pages every product title, account-nav item and inline link was
 * invisible. Colours below come from that same kit (Text #2E2E2E, Secondary
 * #9B8771, borders #E8E8E8) so the shop matches the rest of the site.
 *
 * Everything is scoped to WooCommerce containers — the auction pages are
 * untouched. !important is used only on colour, where the kit's own rules would
 * otherwise win.
 */

:root {
	--bht-text: #2e2e2e;
	--bht-muted: #6b6b6b;
	--bht-accent: #9b8771;
	--bht-border: #e8e8e8;
	--bht-field: #f5f5f5;
	--bht-bg: #fafafa;
	--bht-radius: 4px;
}

/* ---------------------------------------------------------------------------
   1. THE ROOT BUG — links were white on white.
   --------------------------------------------------------------------------- */

.woocommerce a:not(.button):not(.wp-element-button),
.woocommerce-page a:not(.button):not(.wp-element-button),
.woocommerce-account a:not(.button),
.wc-block-components-product-name,
.wp-block-woocommerce-cart a:not(.wc-block-components-button),
.wp-block-woocommerce-checkout a:not(.wc-block-components-button) {
	color: var(--bht-text) !important;
	text-decoration: none;
}

.woocommerce a:not(.button):not(.wp-element-button):hover,
.woocommerce-page a:not(.button):not(.wp-element-button):hover,
.woocommerce-account a:not(.button):hover,
.wc-block-components-product-name:hover {
	color: var(--bht-accent) !important;
	text-decoration: underline;
}

/* Keyboard users need to see where they are. */
.woocommerce a:focus-visible,
.woocommerce-page a:focus-visible,
.woocommerce button:focus-visible,
.woocommerce input:focus-visible,
.woocommerce select:focus-visible {
	outline: 2px solid var(--bht-accent);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   2. Page container — the theme gives WooCommerce templates no wrapper, so
      content sat flush against the viewport edge.
   --------------------------------------------------------------------------- */

.woocommerce-page:not(.elementor-page) main,
.woocommerce-page:not(.elementor-page) .woocommerce > .woocommerce-notices-wrapper,
.single-product main,
.woocommerce-account main {
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 32px);
	padding-block: clamp(24px, 4vw, 48px);
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
   3. Product grid
   --------------------------------------------------------------------------- */

/* WooCommerce ships clearfix pseudo-elements on the list. Under CSS Grid they
   become grid ITEMS, which left an empty cell at the start of the first row and
   pushed the last product onto a row of its own. */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after,
.woocommerce .products ul::before,
.woocommerce .products ul::after {
	display: none !important;
	content: none !important;
}

.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: clamp(16px, 2.5vw, 28px);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Override WooCommerce's float/percentage-width grid. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--bht-border);
	border-radius: var(--bht-radius);
	padding: 14px;
	background: #fff;
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.woocommerce ul.products li.product:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.woocommerce ul.products li.product a img {
	margin-bottom: 12px;
	border-radius: var(--bht-radius);
	background: var(--bht-bg);
	aspect-ratio: 1 / 1;
	object-fit: contain;
}

/* The product title — the headline symptom of the white-link bug. */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.wc-block-grid__product-title {
	color: var(--bht-text) !important;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	margin: 0 0 8px;
	padding: 0;
	/* Keep cards aligned when titles run to different lengths. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Price — was a washed-out olive inherited from the kit. */
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.wc-block-grid__product-price {
	color: var(--bht-text) !important;
	font-weight: 700;
	font-size: 1rem;
	margin: 0 0 10px;
}

.woocommerce div.product p.price {
	font-size: 1.4rem;
}

.woocommerce ul.products li.product .price del,
.woocommerce div.product p.price del {
	color: var(--bht-muted) !important;
	font-weight: 400;
	margin-right: 6px;
}

.woocommerce ul.products li.product .price ins,
.woocommerce div.product p.price ins {
	text-decoration: none;
	font-weight: 700;
}

/* Push the button to the bottom so cards line up. */
.woocommerce ul.products li.product .button {
	margin-top: auto;
}

.woocommerce ul.products li.product .star-rating {
	margin-bottom: 8px;
	color: var(--bht-accent);
}

/* ---------------------------------------------------------------------------
   4. Buttons — the loop buttons were grey-on-grey, the single-product button
      was WooCommerce's default purple. Both now use the site's own colours.
   --------------------------------------------------------------------------- */

.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,
.woocommerce .single_add_to_cart_button,
.wc-block-components-button:not(.is-link) {
	background: var(--bht-text) !important;
	color: #fff !important;
	border: 1px solid var(--bht-text) !important;
	border-radius: var(--bht-radius);
	padding: 11px 20px;
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1.2;
	text-transform: none;
	transition: background 0.18s ease, border-color 0.18s 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,
.woocommerce .single_add_to_cart_button:hover,
.wc-block-components-button:not(.is-link):hover {
	background: var(--bht-accent) !important;
	border-color: var(--bht-accent) !important;
	color: #fff !important;
}

.woocommerce a.button.added_to_cart {
	display: inline-block;
	margin-top: 8px;
	background: transparent !important;
	color: var(--bht-text) !important;
	border-color: var(--bht-border) !important;
}

.woocommerce button.button:disabled,
.woocommerce button.button.disabled {
	background: var(--bht-border) !important;
	border-color: var(--bht-border) !important;
	color: var(--bht-muted) !important;
}

/* ---------------------------------------------------------------------------
   5. Single product
   --------------------------------------------------------------------------- */

.woocommerce div.product .product_title {
	color: var(--bht-text) !important;
	font-weight: 700;
	margin-bottom: 12px;
}

.woocommerce div.product .stock.in-stock {
	color: #2f7a43 !important;
	font-weight: 600;
}

.woocommerce div.product .stock.out-of-stock {
	color: #b3261e !important;
	font-weight: 600;
}

.woocommerce div.product .woocommerce-product-details__short-description,
.woocommerce div.product .product_meta {
	color: var(--bht-text);
}

.woocommerce div.product .product_meta {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--bht-border);
	font-size: 0.85rem;
	color: var(--bht-muted);
}

.woocommerce div.product form.cart {
	margin-block: 18px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.woocommerce .quantity .qty {
	width: 76px;
	padding: 10px;
	border: 1px solid var(--bht-border);
	border-radius: var(--bht-radius);
	background: #fff;
	color: var(--bht-text);
	text-align: center;
}

/* Product tabs */
.woocommerce div.product .woocommerce-tabs ul.tabs {
	padding: 0;
	margin: 0 0 -1px;
	border-bottom: 1px solid var(--bht-border);
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

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

.woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--bht-radius) var(--bht-radius) 0 0;
	margin: 0;
	padding: 0;
}

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

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 11px 18px;
	color: var(--bht-muted) !important;
	font-weight: 600;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
	background: #fff;
	border-color: var(--bht-border);
	border-bottom-color: #fff;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
	color: var(--bht-text) !important;
}

.woocommerce div.product .woocommerce-tabs .panel {
	border: 1px solid var(--bht-border);
	border-top: none;
	padding: 22px;
	margin-bottom: 32px;
}

.woocommerce span.onsale {
	background: var(--bht-accent) !important;
	color: #fff !important;
	border-radius: 999px;
	padding: 6px 12px;
	min-height: 0;
	min-width: 0;
	line-height: 1.2;
	font-weight: 600;
}

/* ---------------------------------------------------------------------------
   6. Forms, tables, notices
   --------------------------------------------------------------------------- */

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-ordering select,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="password"],
.woocommerce input[type="number"],
.woocommerce textarea,
.woocommerce select {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--bht-border);
	border-radius: var(--bht-radius);
	background: #fff;
	color: var(--bht-text);
	font-size: 0.95rem;
	box-sizing: border-box;
}

.woocommerce-ordering select {
	width: auto;
	min-width: 200px;
}

.woocommerce form .form-row label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--bht-text);
	font-size: 0.9rem;
}

.woocommerce form .form-row {
	margin-bottom: 16px;
	padding: 0;
}

.woocommerce table.shop_table,
.woocommerce table.shop_attributes {
	border: 1px solid var(--bht-border);
	border-collapse: collapse;
	border-radius: var(--bht-radius);
	width: 100%;
	color: var(--bht-text);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	border-bottom: 1px solid var(--bht-border);
	padding: 12px 14px;
	color: var(--bht-text);
}

.woocommerce table.shop_table th {
	background: var(--bht-bg);
	font-weight: 700;
	text-align: left;
}

.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
	border-top: none;
	border-left: 4px solid var(--bht-accent);
	background: var(--bht-bg);
	color: var(--bht-text);
	border-radius: var(--bht-radius);
	padding: 14px 18px;
	margin-bottom: 22px;
	list-style: none;
}

.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-info::before,
.woocommerce .woocommerce-error::before {
	display: none;
}

.woocommerce .woocommerce-error {
	border-left-color: #b3261e;
}

.woocommerce .woocommerce-message .button,
.woocommerce .woocommerce-info .button {
	float: right;
	margin-left: 12px;
}

/* Result count + sorting sit on one line. */
.woocommerce .woocommerce-result-count {
	color: var(--bht-muted);
	margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
   7. My Account — the navigation was five invisible bullets.
   --------------------------------------------------------------------------- */

.woocommerce-account .woocommerce-MyAccount-navigation {
	width: 24%;
	float: left;
	margin-bottom: 32px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--bht-border);
	border-radius: var(--bht-radius);
	overflow: hidden;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
	margin: 0;
	border-bottom: 1px solid var(--bht-border);
	/* The theme puts bullets on list items; they sat outside the nav box. */
	list-style: none !important;
	padding-left: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li::marker,
.woocommerce-account .woocommerce-MyAccount-navigation li::before {
	content: none !important;
	display: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation li:last-child {
	border-bottom: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 12px 16px;
	color: var(--bht-text) !important;
	font-weight: 500;
	text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
	background: var(--bht-bg);
	text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
	background: var(--bht-text);
	color: #fff !important;
}

.woocommerce-account .woocommerce-MyAccount-content {
	width: 72%;
	float: right;
	color: var(--bht-text);
}

.woocommerce-account .woocommerce-MyAccount-content::after {
	content: "";
	display: table;
	clear: both;
}

/* The login / register columns. */
.woocommerce .col2-set .col-1,
.woocommerce .col2-set .col-2 {
	box-sizing: border-box;
}

.woocommerce form.login,
.woocommerce form.register {
	border: 1px solid var(--bht-border);
	border-radius: var(--bht-radius);
	padding: 22px;
	margin: 0 0 24px;
}

/* ---------------------------------------------------------------------------
   8. Reviews — the comment form labels were rendering out of order.
   --------------------------------------------------------------------------- */

.woocommerce #reviews #comments ol.commentlist {
	list-style: none;
	padding: 0;
	margin: 0 0 24px;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text {
	border: 1px solid var(--bht-border);
	border-radius: var(--bht-radius);
	padding: 18px;
	margin-left: 70px;
	color: var(--bht-text);
}

.woocommerce #review_form #respond .comment-form-comment,
.woocommerce #review_form #respond .comment-form-rating,
.woocommerce #review_form #respond p {
	display: block;
	margin-bottom: 14px;
}

.woocommerce #review_form #respond label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--bht-text);
}

.woocommerce #review_form #respond textarea {
	width: 100%;
	min-height: 130px;
	box-sizing: border-box;
}

.woocommerce #reviews h2,
.woocommerce .related h2,
.woocommerce .upsells h2,
.woocommerce .cross-sells h2 {
	color: var(--bht-text);
	margin-bottom: 18px;
}

/* ---------------------------------------------------------------------------
   9. Cart / Checkout blocks — the newer block markup needs its own hooks.
   --------------------------------------------------------------------------- */

.wc-block-components-product-name,
.wc-block-components-product-metadata,
.wc-block-components-totals-item__label,
.wc-block-components-totals-item__value,
.wc-block-cart-item__wrap,
.wp-block-woocommerce-cart .wc-block-components-title,
.wp-block-woocommerce-checkout .wc-block-components-title {
	color: var(--bht-text) !important;
}

.wc-block-components-button:not(.is-link) {
	border-radius: var(--bht-radius) !important;
}

/* ---------------------------------------------------------------------------
   10. Small screens
   --------------------------------------------------------------------------- */

@media (max-width: 768px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.woocommerce-account .woocommerce-MyAccount-navigation,
	.woocommerce-account .woocommerce-MyAccount-content {
		width: 100%;
		float: none;
	}

	.woocommerce div.product form.cart {
		width: 100%;
	}

	.woocommerce div.product form.cart .button {
		flex: 1;
	}
}

/* ---------------------------------------------------------------------------
   11. Tidy-up — the theme's blog post navigation ("Previous: … / Next: …")
       renders on single products, where it means nothing to a shopper.
   --------------------------------------------------------------------------- */

.single-product .post-navigation,
.single-product .nav-links,
.single-product .post-nav-links {
	display: none;
}

/* The description panel needs breathing room under its heading. */
.woocommerce div.product .woocommerce-Tabs-panel > h2:first-child {
	margin-top: 0;
	font-size: 1.3rem;
}
