/* Brimwell: only what theme.json cannot express. Colors and fonts come from presets so style variations work. */

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Logo mark before the site title */
.brw-brand .wp-block-site-title a { display: inline-flex; align-items: center; gap: 10px; }
.brw-brand .wp-block-site-title a::before {
	content: "";
	width: 36px;
	height: 36px;
	flex: none;
	border-radius: 10px;
	background:
		radial-gradient(circle at 11px 26px, var(--wp--preset--color--accent) 3px, transparent 3.5px),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Cpath d='M7 13c5-4 9 3 14 0s5-2 8-1M7 19c5-4 9 3 14 0s5-2 8-1' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"),
		var(--wp--preset--color--primary);
}

/* Header */
.brw-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.brw-header__search { flex: 1 1 280px; max-width: 520px; }
.brw-header__search .wp-block-search__input { border-radius: var(--wp--custom--radius--pill); padding: 0.6rem 1rem; }
.brw-header__search .wp-block-search__button { border-radius: var(--wp--custom--radius--pill); margin-left: 0.5rem; }
@media (max-width: 700px) {
	.brw-header .brw-tools { margin-left: auto; order: 2; }
	.brw-header .brw-brand { order: 1; }
	.brw-header__search { order: 3; flex-basis: 100%; max-width: none; }
}
.brw-notice a, .brw-dark a:not(.wp-element-button) { color: inherit; }
.brw-nav { border-top: 1px solid var(--wp--preset--color--line); }
.brw-nav .wp-block-navigation__submenu-container { border-radius: var(--wp--custom--radius--small); padding: 0.5rem; }
.brw-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { border-radius: 8px; }
.brw-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.brw-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible { background: var(--wp--preset--color--tint); }

/* Focus */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}
.brw-dark a:focus-visible, .brw-dark button:focus-visible { outline-color: var(--wp--preset--color--accent); }

/* Cards and panels */
.brw-panel { border-radius: var(--wp--custom--radius--large); }
.brw-products .wc-block-product {
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--large);
	padding: 14px;
	min-width: 0;
}
.brw-products .wc-block-components-product-image { background: var(--wp--preset--color--tint); border-radius: var(--wp--custom--radius--small); overflow: hidden; }
.brw-products .wp-block-post-title { margin: 0.75rem 0 0.25rem; }
.brw-products .wc-block-product { display: flex; flex-direction: column; align-items: stretch; }
.brw-products .wc-block-product > * { margin-block: 0 6px; }
.brw-products .wp-block-woocommerce-product-button { width: 100%; margin-top: auto; padding-top: 6px; }
.brw-products .wc-block-components-product-button__button { width: 100%; text-align: center; justify-content: center; }
.brw-products .wp-block-brimwell-compare { margin-bottom: 0; }

/* Sale prices: the old price stays quiet */
.wc-block-components-product-price del, .wp-block-woocommerce-product-price del { font-size: 0.65em; font-weight: 400; color: var(--wp--preset--color--muted); }

/* Compare bar floats above the page */
.brw-tray:not([hidden]) { position: fixed; left: 50%; transform: translateX(-50%); margin: 0; }

/* Product page */
.wp-block-woocommerce-add-to-cart-with-options { width: 100%; }
.woocommerce-product-attributes { width: 100%; }
table.shop_attributes th, table.woocommerce-product-attributes th { text-align: left; font-weight: 500; color: var(--wp--preset--color--muted); }
table.woocommerce-product-attributes td, table.woocommerce-product-attributes td p { font-style: normal; text-align: left; }
.wp-block-column.brw-panel .wp-block-brimwell-energy-badge { margin-block: 0; }

.brw-footer ul { list-style: none; padding-left: 0; }
.brw-footer li { margin-bottom: 0.4rem; }
.brw-footer a { text-decoration: none; }
.brw-footer a:hover { text-decoration: underline; }

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

/* Home sections */
.brw-hero { align-items: stretch; }
.brw-hero__text { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.brw-hero__image { height: 100%; min-height: 420px; position: relative; margin: 0; }
.brw-hero .wp-block-image.brw-hero__image img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; object-position: 50% 22%; border-radius: var(--wp--custom--radius--large); }
.brw-promo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--wp--custom--radius--small); }
.brw-cat { position: relative; text-align: center; font-weight: 600; }
.brw-cat a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.brw-cat a::after { content: ""; position: absolute; inset: -14px; }
.brw-panel:has(.brw-cat a:hover) { box-shadow: 0 0 0 2px var(--wp--preset--color--primary); }
.brw-faq { background: var(--wp--preset--color--surface); border-radius: var(--wp--custom--radius--small); padding: 16px 20px; }
.brw-faq summary { cursor: pointer; font-weight: 600; }

/* Shop filters */
.brw-shop .wc-block-product-filters h3 { margin-top: 0; }
@media (min-width: 782px) {
	.brw-shop > .wp-block-column:first-child { flex-grow: 0; }
}

/* Installation choice on the product form */
.brw-install { margin: 0 0 var(--wp--preset--spacing--30); padding: 0; border: 0; width: 100%; }
.brw-install legend { margin-bottom: 10px; padding: 0; font-weight: 600; }
.brw-install__option { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; padding: 12px 14px; border: 1.5px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--small); cursor: pointer; }
.brw-install__option:has(input:checked) { border-color: var(--wp--preset--color--primary); box-shadow: 0 0 0 1px var(--wp--preset--color--primary); background: var(--wp--preset--color--tint); }
.brw-install__option input { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--wp--preset--color--primary); }
.brw-install__option b, .brw-install__option small { display: block; }
.brw-install__option small { color: var(--wp--preset--color--muted); line-height: 1.4; }
.brw-install__option em { margin-left: auto; font-style: normal; font-weight: 600; white-space: nowrap; }

/* Product photos are 4:3 and are never cropped on cards */
.brw-products .wc-block-components-product-image { aspect-ratio: 4 / 3; }
.brw-products .wc-block-components-product-image img { width: 100%; height: 100%; object-fit: contain; }
.brw-products .wp-block-woocommerce-product-button .wp-block-button__link { width: 100%; box-sizing: border-box; }

/* Small screens: the search field may shrink */
.brw-header__search, .brw-header__search .wp-block-search__inside-wrapper, .brw-header__search .wp-block-search__input { min-width: 0; }

/* Touch targets of at least 24 px */
.brw-nav .wp-block-navigation__submenu-icon { min-width: 24px; min-height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.woocommerce-ordering select, .wc-block-catalog-sorting select, .orderby { min-height: 40px; padding: 0 10px; border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--small); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); font: inherit; }
.woocommerce-form .show-password-input, .password-input .show-password-input { min-width: 28px; min-height: 28px; }

/* A not-yet-available add to cart button stays readable */
.wp-block-add-to-cart-with-options .wp-block-button__link.disabled,
.wp-block-woocommerce-add-to-cart-with-options .wp-block-button__link.disabled { opacity: 1; background: var(--wp--preset--color--tint); color: var(--wp--preset--color--muted); }

/* Page numbers */
.wp-block-query-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: var(--wp--custom--radius--pill); background: var(--wp--preset--color--surface); text-decoration: none; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-primary); }

/* The footer starts right where the page ends: a dark last section runs into it without a light strip */
.wp-site-blocks > footer { margin-block-start: 0; }
main.wp-block-group:not([style*="padding-bottom"]) { padding-bottom: var(--wp--preset--spacing--60); }

/* Menus follow the style variation: submenus and the phone menu panel use the palette instead of white */
.brw-nav .wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container { background-color: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); border-color: var(--wp--preset--color--line); }
.brw-nav .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.has-modal-open-background-color) { background-color: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); }

/* WooCommerce store notice ("demo store" bar): theme colors instead of WooCommerce purple */
body .woocommerce-store-notice, body p.demo_store { background-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-primary); font-family: var(--wp--preset--font-family--body); font-weight: 500; }
body .woocommerce-store-notice a, body p.demo_store a { color: inherit; font-weight: 700; }
body .woocommerce-store-notice a:focus-visible, body p.demo_store a:focus-visible { outline-color: var(--wp--preset--color--on-primary); }
