/*
 * Fošny.cz – design tokeny.
 * Sémantické proměnné (--color-*, --radius-*, --shadow-*, --motion-*) se spravují v Bricks → Proměnné.
 * Tady se na ně jen napojují proměnné Automatic.css, aby je používaly i starší třídy a utility ACSS.
 * Hodnoty za čárkou jsou záloha pro případ, že proměnná v Bricks chybí.
 */
:root {
	--primary: var(--color-brand, #2a7d00);
	--primary-hover: var(--color-brand-hover, #216300);
	--link-color: var(--color-brand, #2a7d00);
	--base: var(--color-border, #ddd7cc);
	--bg-ultra-light: var(--color-surface-alt, #f6f3ee);
	--text-dark: var(--color-text, #1b1a17);
	--text-dark-muted: var(--color-text-muted, #5c574f);
	--body-color: var(--color-text, #1b1a17);
	--success: var(--color-success, #1f7a34);
	--danger: var(--color-error, #c62839);
	--radius: var(--radius-control, 0.8rem);
	--btn-radius: var(--radius-control, 0.8rem);
}

/* ---------- Základ: text, nadpisy, odkazy, fokus ---------- */
body {
	color: var(--color-text, #1b1a17);
}
h1, h2, h3, h4, h5, h6 {
	letter-spacing: -0.01em;
	text-wrap: balance;
}
:where(.brxe-text, .brxe-text-basic, .brxe-post-content, .fosny-encyclopedia) a:not([class]) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
a, button, input, select, textarea, summary {
	transition: color var(--motion-fast, 150ms) ease, background-color var(--motion-fast, 150ms) ease, border-color var(--motion-fast, 150ms) ease, box-shadow var(--motion-fast, 150ms) ease;
}
:focus-visible {
	outline: 2px solid var(--color-brand, #2a7d00);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/*
 * Globální doladění cizího markupu (WooCommerce, stránkování, filtry, mobilní menu).
 */

/* ---------- Cena bez DPH pod cenou s DPH (přípona ceny z WooCommerce) ---------- */
.woocommerce-price-suffix {
	display: block;
	margin-top: 0.2em;
	font-size: 0.7em;
	font-weight: 400;
	line-height: 1.3;
	opacity: 0.75;
}
.woocommerce-price-suffix .woocommerce-Price-amount {
	font-weight: inherit;
}

/* ---------- Stránkování ---------- */
.brxe-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}
.brxe-pagination a.page-numbers,
.brxe-pagination span.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 0.75em;
	border: 1px solid var(--base);
	border-radius: var(--radius);
	background: var(--white);
	color: var(--text-dark);
	font-weight: 600;
	text-decoration: none;
}
.brxe-pagination a.page-numbers:hover {
	border-color: var(--primary);
	color: var(--primary);
}
.brxe-pagination span.page-numbers.current {
	border-color: var(--primary);
	background: var(--primary);
	color: var(--white);
}
.brxe-pagination span.page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ---------- Filtry e-shopu: na mobilu sbalené pod tlačítkem ---------- */
.fosny-filter-toggle {
	display: none;
}
@media (max-width: 768px) {
	.fosny-filter-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-s);
		width: 100%;
		min-height: 52px;
		padding: 0 var(--space-m);
		border: 1px solid var(--text-dark);
		border-radius: var(--radius);
		background: var(--white);
		color: var(--text-dark);
		font-size: 16px;
		font-weight: 700;
		cursor: pointer;
	}
	.fosny-filter-toggle__icon {
		transition: transform 0.2s ease;
	}
	.fosny-filter-toggle[aria-expanded="true"] .fosny-filter-toggle__icon {
		transform: rotate(180deg);
	}
	.fosny-filter-collapsible:not(.is-open) {
		display: none !important;
	}
	.fosny-filter-collapsible.is-open {
		padding: var(--space-m);
		border: 1px solid var(--base);
		border-radius: var(--radius);
		background: var(--white);
	}
	/* pole filtrů pohodlná na prst */
	.fosny-filter-collapsible input[type="search"],
	.fosny-filter-collapsible input[type="text"] {
		min-height: 48px;
		font-size: 16px;
	}
	.fosny-filter-collapsible label {
		display: flex;
		align-items: center;
		gap: var(--space-xs);
		min-height: 40px;
	}
	.fosny-filter-collapsible input[type="checkbox"] {
		width: 20px;
		height: 20px;
		accent-color: var(--primary);
	}
}

/* ---------- Mobilní menu ---------- */
.offcanvas-menu__inner {
	flex-wrap: nowrap !important;
	overflow-y: auto;
}
.offcanvas-menu__nav,
.offcanvas-menu__nav .brx-nav-nested-items {
	width: 100%;
	align-items: stretch !important;
}
.offcanvas-menu__nav .brx-nav-nested-items > li {
	width: 100%;
}
.offcanvas-menu__nav .brx-submenu-toggle button svg {
	width: 14px;
	height: 14px;
}
.offcanvas-menu__nav .brx-nav-nested-items > li {
	border-bottom: 1px solid var(--base);
}
.offcanvas-menu__nav .brx-nav-nested-items > li > a,
.offcanvas-menu__nav .brx-nav-nested-items > li > .brx-submenu-toggle {
	min-height: 52px;
}
.offcanvas-menu__nav .brx-nav-nested-items > li > a {
	display: flex;
	align-items: center;
}
.offcanvas-menu__nav .brx-submenu-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}
.offcanvas-menu__nav .brx-submenu-toggle button {
	min-width: 44px;
	min-height: 44px;
}
.offcanvas-menu__nav .brx-dropdown-content {
	padding-bottom: var(--space-s);
}

/* ---------- Blokový košík a pokladna ---------- */
.wc-block-cart__submit-container {
	padding: 0 !important;
	background: none !important;
}
.wc-block-cart .wc-block-components-button:not(.is-link),
.wc-block-checkout .wc-block-components-button:not(.is-link),
.wc-block-mini-cart__footer .wc-block-components-button:not(.is-link) {
	min-height: 52px;
	padding: 0.75em 1.5em;
	border: 0;
	border-radius: var(--btn-radius, var(--radius));
	background: var(--primary) !important;
	color: var(--white) !important;
	font-size: max(16px, var(--text-m));
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
}
.wc-block-cart .wc-block-components-button:not(.is-link):hover,
.wc-block-checkout .wc-block-components-button:not(.is-link):hover {
	background: var(--primary-hover, var(--primary)) !important;
}
.wc-block-components-quantity-selector {
	width: auto !important;
	min-width: 136px;
	min-height: 44px;
	border-radius: var(--radius);
}
.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	min-width: 44px;
	font-size: 16px;
}
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	min-width: 44px;
	font-size: 1.1rem;
}
.wc-block-checkout .wc-block-components-text-input input,
.wc-block-checkout .wc-block-components-combobox .components-combobox-control input,
.wc-block-checkout select,
.wc-block-checkout textarea {
	min-height: 52px;
	font-size: 16px !important;
}
.wc-block-components-radio-control__option,
.wc-block-components-checkbox {
	min-height: 44px;
}

/* ---------- Produkt bez ceny ---------- */
.fosny-price-request {
	font-weight: 700;
	color: var(--color-text, #1b1a17);
}

/* ---------- Blokový košík na mobilu: cena za řádek pod produktem, nic nepřetéká ---------- */
.wc-block-cart.is-mobile table.wc-block-cart-items .wc-block-cart-items__row {
	grid-template-columns: 80px minmax(0, 1fr);
}
.wc-block-cart.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product {
	grid-column: 2 / 3;
	min-width: 0;
	overflow-wrap: anywhere;
}
.wc-block-cart.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total {
	grid-column: 2 / 3;
	grid-row-start: 2;
	padding-top: 8px;
	text-align: left;
	font-weight: 700;
}

/* ---------- Prázdný košík: tlačítko ve stylu webu ---------- */
.wp-block-woocommerce-empty-cart-block .wp-block-button__link {
	min-height: 48px;
	padding: 0.75em 1.5em;
	border-radius: var(--radius-control, 0.8rem);
	background: var(--color-brand, #2a7d00);
	color: var(--white);
	font-weight: 700;
}
.wp-block-woocommerce-empty-cart-block .wp-block-button__link:hover {
	background: var(--color-brand-hover, #216300);
}
.wp-block-woocommerce-empty-cart-block .wp-block-buttons {
	margin-top: var(--space-s);
}
