/* BTLLC UX polish — P1 improvements
 * Loaded globally on the frontend. Scoped to avoid clobbering theme styles.
 */

/* ────────────────────────────────────────────────────────────────────
 * 1) Sticky header on mobile so search / cart / hamburger stay reachable
 * ──────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	#masthead,
	.site-header,
	header#masthead,
	header.site-header {
		position: sticky;
		top: 0;
		z-index: 100;
		background: #fff;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	}
}

/* ────────────────────────────────────────────────────────────────────
 * 2) 16px minimum on form controls so iOS Safari doesn't auto-zoom
 *    when an input gains focus.
 * ──────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	input[type="text"],
	input[type="email"],
	input[type="search"],
	input[type="password"],
	input[type="tel"],
	input[type="number"],
	input[type="url"],
	select,
	textarea {
		font-size: 16px !important;
	}
}

/* ────────────────────────────────────────────────────────────────────
 * 3) 44×44 minimum tap targets on mobile (Apple HIG / Material guidance).
 *    Focused on the elements most users actually tap.
 * ──────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	/* Filter checkboxes */
	.widget input[type="checkbox"] + label,
	.woocommerce-widget-layered-nav-list a,
	.woocommerce-widget-layered-nav-list__item,
	.shop-sidebar input[type="checkbox"] + label {
		min-height: 44px;
		display: flex;
		align-items: center;
		padding: 6px 0;
	}

	/* Pagination arrows */
	.woocommerce-pagination .page-numbers,
	.agni-woocommerce-pagination a,
	.agni-woocommerce-pagination .page-numbers {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0 8px;
	}

	/* Footer social icons */
	.site-footer__social a,
	.social-links a {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Top utility nav links (call/email/Sell to Us) */
	.site-header__top-bar a,
	.top-bar a,
	.header-top-bar a {
		min-height: 40px;
		display: inline-flex;
		align-items: center;
	}
}

/* ────────────────────────────────────────────────────────────────────
 * 4) Cart "Proceed to Checkout" — primary CTA, not a thin link.
 *    Targets WC Block Cart's submit container and the legacy link.
 * ──────────────────────────────────────────────────────────────────── */
.wc-block-cart__submit-container .wc-block-cart__submit-button,
.wc-block-cart__submit-container a,
.wc-proceed-to-checkout a.checkout-button,
a.checkout-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 14px 24px;
	/* UX 4.2b: unified to the reserved brand-gold accent (was black #1a1a1a) so
	   the Proceed-to-Checkout CTA matches the other primary commerce buttons. */
	background: var(--cartify_cta_accent, #d4af37) !important;
	color: var(--cartify_cta_accent_text, #1a1a2e) !important;
	border: none !important;
	border-radius: 6px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: 0.02em;
	text-decoration: none !important;
	text-transform: none;
	text-align: center;
	cursor: pointer;
	transition: background 150ms ease, transform 80ms ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wc-block-cart__submit-container .wc-block-cart__submit-button:hover,
.wc-block-cart__submit-container a:hover,
.wc-proceed-to-checkout a.checkout-button:hover,
a.checkout-button:hover {
	background: var(--cartify_cta_accent_hover, #c8a028) !important;
	color: var(--cartify_cta_accent_text, #1a1a2e) !important;
}

.wc-block-cart__submit-container .wc-block-cart__submit-button:active,
.wc-block-cart__submit-container a:active {
	transform: translateY(1px);
}

/* "Go to Shopping Cart" secondary link sits below the primary button */
.wc-block-cart__submit-container .wc-block-cart__submit-button + a,
.wc-block-cart__submit-container .wc-block-cart__submit-button + p a {
	background: transparent !important;
	color: #555 !important;
	font-weight: 500 !important;
	min-height: auto;
	padding: 8px;
	box-shadow: none;
	text-decoration: underline !important;
}

/* ────────────────────────────────────────────────────────────────────
 * 5) Shop loop card — keep only the first category tag visible above the
 *    title. The PHP filter limits it to 1, this CSS hides any stragglers
 *    that come from other plugins/contexts.
 * ──────────────────────────────────────────────────────────────────── */
.products .woocommerce-loop-product__category {
	font-size: 11px;
	color: #888;
	line-height: 1.3;
	margin-bottom: 4px;
	max-height: 1.3em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.products .woocommerce-loop-product__category a {
	color: inherit;
	text-decoration: none;
}

.products .woocommerce-loop-product__category a:hover {
	text-decoration: underline;
}

/* Hide all-but-first inline category links if PHP filter didn't catch them */
.products .woocommerce-loop-product__category > a ~ a,
.products .woocommerce-loop-product__category > span ~ span {
	display: none !important;
}

/* ────────────────────────────────────────────────────────────────────
 * 6) Shop loop add-to-cart — clean filled button, same on desktop + mobile.
 *    Always visible (theme's hover-reveal is invisible on touch devices).
 * ──────────────────────────────────────────────────────────────────── */

/* Neutralize the parent wrapper's negative side margins so the button sits
 * INSIDE the card boundary instead of bleeding past it. */
.products .product-buttons,
.products.has-display-style-1a .product-buttons,
.products.has-grid-layout.has-display-style-1a .product-buttons {
	transform: none !important;
	opacity: 1 !important;
	visibility: visible !important;
	position: static !important;
	margin: 12px 0 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: stretch;
}

.products .product-buttons .agni-add-to-cart {
	width: 100%;
	display: block;
	margin: 0;
}

.products .product-buttons .agni-add-to-cart .add_to_cart_button,
.products .product-buttons .agni-add-to-cart .single_add_to_cart_button,
.products .product-buttons .agni-add-to-cart .product_type_simple {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 38px;
	padding: 8px 14px;
	/* UX 4.2b: unified to the reserved brand-gold primary-CTA accent (was black
	   #1a1a1a) so the card Add-to-Cart matches the PDP/hero/sell/hover CTAs. */
	background: var(--cartify_cta_accent, #d4af37) !important;
	color: var(--cartify_cta_accent_text, #1a1a2e) !important;
	border: 1px solid var(--cartify_cta_accent, #d4af37) !important;
	border-radius: 4px !important;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: background 120ms ease;
	white-space: nowrap;
}

.products .product-buttons .agni-add-to-cart .add_to_cart_button:hover,
.products .product-buttons .agni-add-to-cart .single_add_to_cart_button:hover,
.products .product-buttons .agni-add-to-cart .product_type_simple:hover,
.products .product-buttons .agni-add-to-cart .add_to_cart_button:focus-visible,
.products .product-buttons .agni-add-to-cart .single_add_to_cart_button:focus-visible {
	background: var(--cartify_cta_accent_hover, #c8a028) !important;
	color: var(--cartify_cta_accent_text, #1a1a2e) !important;
	outline: none;
}

/* Loading state */
.products .product-buttons .agni-add-to-cart .add_to_cart_button.loading {
	color: transparent !important;
	pointer-events: none;
	position: relative;
}

.products .product-buttons .agni-add-to-cart .add_to_cart_button.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid var(--cartify_cta_accent_text, #1a1a2e);
	border-top-color: transparent;
	border-radius: 50%;
	animation: btllc-spin 0.7s linear infinite;
}

.products .product-buttons .agni-add-to-cart .added_to_cart {
	color: #1f7a35 !important;
	font-size: 11px;
	margin-top: 2px;
	text-align: center;
	text-decoration: underline !important;
	background: transparent !important;
	min-height: 0;
	padding: 0;
	letter-spacing: 0;
	text-transform: none;
}

/* Hide qty stepper on cards — keep them focused on one action */
.products .product-buttons .agni-update-cart,
.products .product-buttons .agni-product-qty-container,
.products .product-buttons .qty-minus,
.products .product-buttons .qty-plus,
.products .product-buttons input.qty {
	display: none !important;
}

.products .product-buttons .added {
	display: none;
}

/* Hide quickview / compare from card */
.products .product-buttons .agni-quickview,
.products .product-buttons .agni-add-to-compare {
	display: none;
}

@keyframes btllc-spin {
	to { transform: rotate(360deg); }
}
