/* Native WooCommerce actions, kept visible without duplicate basket fragments. */
body.hc-theme {
	/* A desktop scrollbar must not push a 320px viewport beyond its content width. */
	min-width: 0;
}

.hc-theme.single-product .hero-section {
	padding: 0 0 18px;
	background: transparent;
}

.hc-theme.single-product .entry-header {
	padding: 0;
}

.hc-theme.single-product .ct-breadcrumbs {
	color: #465b6b;
}

.hc-theme.single-product .ct-breadcrumbs a {
	color: var(--hc-navy);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hc-theme.single-product .woocommerce-product-attributes {
	width: 100%;
	table-layout: fixed;
}

.hc-theme.single-product .woocommerce-product-attributes th,
.hc-theme.single-product .woocommerce-product-attributes td {
	overflow-wrap: anywhere;
	padding: 12px 10px;
	font-size: 12px;
	line-height: 1.55;
	text-align: left;
}

.hc-theme.single-product .woocommerce-product-attributes th {
	width: 44%;
}

.hc-theme.single-product .woocommerce-tabs ul.tabs li a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

/* Outrank the parent theme's more specific active-tab colour selector. */
.hc-theme.single-product div.product .woocommerce-tabs ul.tabs li.active a {
	color: var(--hc-signal);
}

.hc-theme .hc-header-actions > a {
	min-height: 44px;
}

.hc-theme .hc-site-header a:focus-visible,
.hc-theme .hc-site-header button:focus-visible,
.hc-theme .hc-site-header summary:focus-visible {
	outline: 3px solid var(--hc-navy);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px #fff;
}

/* Keep the sole account action labelled on narrow desktop screens too. */
@media (min-width: 981px) and (max-width: 1120px) {
	.hc-theme .hc-header-actions .hc-account-action span {
		display: block;
	}
}

@media (max-width: 980px) {
	.hc-theme .hc-header-main {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "brand menu" "search search" "actions actions";
		gap: 8px;
		padding-block: 10px;
	}

	.hc-theme .hc-brand {
		grid-area: brand;
		justify-self: start;
		min-height: 44px;
		min-width: 0;
		margin-right: 0;
	}

	.hc-theme .hc-mobile-menu {
		grid-area: menu;
		display: block;
	}

	.hc-theme .hc-mobile-menu > summary {
		width: 44px;
		height: 44px;
	}

	.hc-theme .hc-mobile-menu > nav {
		z-index: 60;
		max-height: calc(100vh - 160px);
		max-height: calc(100dvh - 160px);
		overscroll-behavior: contain;
	}

	.hc-theme .hc-mobile-menu nav a {
		min-height: 44px;
		display: flex;
		align-items: center;
	}

	.hc-theme .hc-category-nav {
		display: none;
	}

	.hc-theme .hc-header-search {
		grid-area: search;
		width: 100%;
		min-width: 0;
		order: initial;
		padding: 4px;
	}

	.hc-theme .hc-header-search input[type="search"] {
		height: 44px;
		font-size: 16px;
	}

	.hc-theme .hc-header-search button {
		min-width: 64px;
		height: 44px;
		padding-inline: 12px;
	}

	.hc-theme .hc-header-actions {
		grid-area: actions;
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 6px;
		min-width: 0;
	}

	.hc-theme .hc-header-actions > a {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 5px;
		min-width: 0;
		min-height: 44px;
		height: auto;
		padding: 7px 6px;
		border: 1px solid var(--hc-line);
		font-size: 11px;
		line-height: 1.3;
	}

	.hc-theme .hc-header-actions > .hc-checkout-action {
		border-color: transparent;
	}

	.hc-theme .hc-header-actions .hc-account-action span,
	.hc-theme .hc-header-actions .hc-basket-action span {
		display: block;
		min-width: 0;
	}

	.hc-theme .hc-header-actions .hc-account-action small,
	.hc-theme .hc-header-actions .hc-basket-action small {
		display: none;
	}

	.hc-theme .hc-header-actions .hc-icon {
		width: 16px;
		height: 16px;
	}

	.hc-theme .hc-header-actions .hc-basket-count {
		flex: 0 0 auto;
		height: auto;
		min-height: 20px;
		padding-inline: 4px;
	}
}

/* Keep text labels readable even on narrow phones; icons are supplementary. */
@media (max-width: 360px) {
	.hc-theme .hc-header-actions .hc-icon {
		display: none;
	}
}

/* WordPress uses a taller admin bar at this breakpoint. */
@media (min-width: 681px) and (max-width: 782px) {
	.admin-bar.hc-theme .hc-site-header {
		top: 46px;
	}
}

/* The native cart block's four-column minimum is wider than a small phone. */
@media (max-width: 600px) {
	.hc-theme.woocommerce-cart .wc-block-cart table.wc-block-cart-items {
		width: 100%;
		table-layout: fixed;
	}

	.hc-theme.woocommerce-cart .wc-block-cart .wc-block-cart-items__row {
		grid-template-columns: 48px minmax(0, 1fr);
		column-gap: 12px;
		row-gap: 12px;
	}

	/* Outrank WooCommerce's table/row cell placement loaded after this file. */
	.hc-theme.woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
		grid-column: 1;
		grid-row: 1;
		width: 48px;
		padding: 0;
	}

	.hc-theme.woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product {
		grid-column: 2;
		grid-row: 1;
		min-width: 0;
		width: auto;
		overflow-wrap: anywhere;
	}

	.hc-theme.woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total {
		grid-column: 1 / -1;
		grid-row: 2;
		min-width: 0;
		width: auto;
		justify-content: flex-end;
		padding-top: 8px;
		border-top: 1px solid var(--hc-line);
	}

	.hc-theme.woocommerce-cart .wc-block-cart-item__quantity {
		flex-wrap: wrap;
		gap: 8px;
	}

	.hc-theme.woocommerce-cart .wc-block-components-quantity-selector {
		width: 132px;
		max-width: 100%;
		min-height: 44px;
		flex: 0 0 auto;
	}

	.hc-theme.woocommerce-cart .wc-block-components-quantity-selector__button {
		min-width: 44px;
		min-height: 44px;
	}

	.hc-theme.woocommerce-cart .wc-block-cart-item__remove-link {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* At this width WordPress scrolls its admin bar away with the page. */
	.admin-bar.hc-theme .hc-site-header {
		top: 0;
	}
}

/* Mobile checkout: keep optional support controls clear of payment fields.
 * Existing buttons remain in their footer containers with visibility and actions intact.
 */
@media (max-width: 767px) {
	body.hc-theme.woocommerce-checkout:not(.woocommerce-order-received):not(.woocommerce-order-pay) #hc-tawk-starter #hc-tawk-open {
		position: static;
		right: auto;
		bottom: auto;
		box-shadow: none;
	}

	body.hc-theme.woocommerce-checkout:not(.woocommerce-order-received):not(.woocommerce-order-pay) #cmplz-manage-consent .cmplz-manage-consent {
		position: static !important;
		left: auto !important;
		right: auto !important;
		bottom: auto !important;
		transform: none !important;
		margin: 16px;
		max-width: calc(100% - 32px);
	}
}
