/* Global base styles. Design tokens live in Bricks (palette + global variables), not here.
   Only things Bricks cannot express well, or fixes for Bricks output, belong in this file. */

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Long compound words (German) must not overflow on mobile */
h1, h2, h3, h4, h5, h6 {
	hyphens: auto;
	-webkit-hyphens: auto;
	hyphenate-limit-chars: 10 4 4;
	overflow-wrap: break-word;
	text-wrap: balance;
}

p, li {
	overflow-wrap: break-word;
	text-wrap: pretty;
}

a {
	text-underline-offset: .18em;
}

:focus-visible {
	outline: 3px solid var(--focus-color, currentColor);
	outline-offset: 3px;
}

img {
	height: auto;
}

/* Sticky header without covering content (Bricks' own sticky uses position: fixed) */
#brx-header {
	position: sticky;
	top: 0;
	z-index: 999;
}

.admin-bar #brx-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Bricks sets `.class.brxe-… { align-items: initial }` on grid elements, which drops
   place-items:center from an HTML/CSS import. Restore per class with raised specificity:
   .my-icon.my-icon.my-icon { align-items: center; } */

/* Single product: upsells + related use WooCommerce's native loop markup. Match the shop
   archive cards (grey card, 3:2 image, 16px title, navy button). */
.brxe-product-upsells > section > h2,
.brxe-product-related > section > h2,
.brxe-product-upsells > h2,
.brxe-product-related > h2 {
	font-size: clamp(22px, 2.2vw, 28px);
	line-height: 1.25;
	margin: 48px 0 20px;
}
.brxe-product-upsells ul.products,
.brxe-product-related ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.brxe-product-upsells ul.products::before,
.brxe-product-upsells ul.products::after,
.brxe-product-related ul.products::before,
.brxe-product-related ul.products::after { content: none; }
.brxe-product-upsells li.product,
.brxe-product-related li.product {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: auto !important;
	margin: 0 !important;
	padding: 0 16px 16px;
	background: var(--surface, #f3f5f8);
	border: 1px solid var(--line, #e3e8ee);
	border-radius: 6px;
	overflow: hidden;
	font-size: 13px;
	color: #5b6675;
}
.brxe-product-upsells li.product a.woocommerce-LoopProduct-link,
.brxe-product-related li.product a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 -16px;
	color: inherit;
	text-decoration: none;
}
.brxe-product-upsells li.product img,
.brxe-product-related li.product img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	margin: 0 0 6px;
}
.brxe-product-upsells .woocommerce-loop-product__title,
.brxe-product-related .woocommerce-loop-product__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--navy, #0f2342);
	padding: 0 16px;
	margin: 0;
}
.brxe-product-upsells li.product .price,
.brxe-product-related li.product .price {
	font-size: 16px;
	font-weight: 700;
	color: var(--navy, #0f2342);
	padding: 0 16px;
}
.brxe-product-upsells li.product p,
.brxe-product-related li.product p { margin: 0; }
.brxe-product-upsells li.product .button,
.brxe-product-related li.product .button {
	align-self: flex-start;
	margin-top: 8px;
}

/* Product description tab: long-form text, calmer headings than page headings */
.brxe-product-tabs .woocommerce-Tabs-panel h2 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.25; margin: 0 0 12px; }
.brxe-product-tabs .woocommerce-Tabs-panel h3 { font-size: 18px; line-height: 1.3; margin: 24px 0 8px; }
.brxe-product-tabs .woocommerce-Tabs-panel { max-width: 860px; }
.brxe-product-tabs .woocommerce-Tabs-panel ul,
.brxe-product-tabs .woocommerce-Tabs-panel ol { padding-left: 1.25em; }
.brxe-product-upsells,
.brxe-product-related { width: 100%; }
.brxe-product-upsells li.product p.wc-gzd-additional-info,
.brxe-product-related li.product p.wc-gzd-additional-info { padding: 0; margin: 0 !important; line-height: 1.4; }
