/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/*
 * Quick view uses the native Bricks Product Gallery. The current element
 * schema has no per-popup image-fit or zoom controls, so keep this fallback
 * narrowly scoped to the Board Paradise quick-view class.
 */
.bp-quick-view__gallery .woocommerce-product-gallery__image img.wp-post-image {
	object-fit: cover;
	object-position: center;
}

.bp-quick-view__gallery .woocommerce-product-gallery__image .zoomImg {
	display: none !important;
}

@media (max-width: 767px) {
	.bp-quick-view__gallery .woocommerce-product-gallery__image img.wp-post-image {
		object-fit: contain;
	}
}

/* Product detail: native Bricks/WooCommerce gallery, breadcrumb and wishlist. */
.bp-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.bp-product-detail__breadcrumbs {
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-inline: contain;
	scrollbar-width: none;
	white-space: nowrap;
}

.bp-product-detail__breadcrumbs::-webkit-scrollbar,
.bp-product-detail__gallery .flex-viewport::-webkit-scrollbar,
.bp-product-detail__gallery .woocommerce-product-gallery::-webkit-scrollbar {
	display: none;
}

.bp-product-detail__breadcrumbs .navigation {
	display: flex;
	flex-wrap: nowrap;
	width: max-content;
	min-width: 100%;
}

.bp-product-detail__gallery,
.bp-product-detail__gallery .woocommerce-product-gallery {
	position: relative;
}

.bp-product-detail__gallery .woocommerce-product-gallery__trigger {
	top: 1.2rem;
	right: 1.2rem;
	left: auto;
	z-index: 6;
}

.bp-product-detail__gallery .flex-control-nav {
	display: none !important;
}

.bp-product-detail__gallery .woocommerce-product-gallery__wrapper {
	margin: 0 !important;
}

.bp-product-detail__gallery .woocommerce-product-gallery__image {
	margin: 0 !important;
	background: rgba(0, 0, 0, 0.035);
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.bp-product-detail__gallery .woocommerce-product-gallery__image > a {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
}

.bp-product-detail__gallery .woocommerce-product-gallery__image img:not(.zoomImg) {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.bp-product-gallery-nav {
	position: absolute;
	top: 50%;
	left: 1.2rem;
	z-index: 5;
	display: flex;
	width: 45px;
	transform: translateY(-50%);
	flex-direction: column;
	gap: 0.8rem;
	pointer-events: none;
}

.bp-product-gallery-nav__track {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.bp-product-gallery-nav__item {
	position: relative;
	width: 45px;
	height: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	pointer-events: auto;
	transition: height 180ms ease;
}

.bp-product-gallery-nav__item::before {
	content: '';
	position: absolute;
	left: 0;
	top: calc(50% - 1px);
	width: 45px;
	height: 2px;
	background: rgba(0, 0, 0, 0.3);
	transition: opacity 140ms ease;
}

.bp-product-gallery-nav__item[aria-current="true"]::before {
	background: #000;
}

.bp-product-gallery-nav__item:focus-visible {
	outline: 2px solid var(--secondary);
	outline-offset: 2px;
}

.bp-product-gallery-nav__thumbnail {
	position: absolute;
	left: 0;
	top: 50%;
	width: 45px;
	height: 45px;
	max-width: none;
	border: 1px solid var(--ink);
	background: var(--surface);
	object-fit: contain;
	opacity: 0;
	transform-origin: left center;
	transform: translateY(-50%) scale(1, 0.044444);
	transition: transform 180ms ease, opacity 140ms ease;
	pointer-events: none;
}

@media (min-width: 992px) {
	.bp-product-gallery-nav__item[aria-current="true"],
	.bp-product-gallery-nav__item:focus-visible { height: 53px; z-index: 1; }
	.bp-product-gallery-nav__item[aria-current="true"]::before,
	.bp-product-gallery-nav__item:focus-visible::before { opacity: 0; }
	.bp-product-gallery-nav__item[aria-current="true"] .bp-product-gallery-nav__thumbnail,
	.bp-product-gallery-nav__item:focus-visible .bp-product-gallery-nav__thumbnail {
		opacity: 1;
		transform: translateY(-50%) scale(1);
	}
}

@media (min-width: 992px) and (hover: hover) and (pointer: fine) {
	/* Only the active preview opens a gap; all other marks stay compact. */
	.bp-product-gallery-nav__item:hover { height: 53px; z-index: 2; }
	.bp-product-gallery-nav__item:hover::before { opacity: 0; }
	.bp-product-gallery-nav__item:hover .bp-product-gallery-nav__thumbnail {
		opacity: 1;
		transform: translateY(-50%) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bp-product-gallery-nav__item,
	.bp-product-gallery-nav__item::before,
	.bp-product-gallery-nav__thumbnail { transition: none; }
}

.bp-product-gallery-nav__counter {
	position: absolute;
	right: 1.2rem;
	bottom: 1.2rem;
	z-index: 5;
	display: inline-flex;
	min-width: 3.8rem;
	height: 2.4rem;
	align-items: center;
	justify-content: center;
	background: var(--surface);
	color: var(--ink);
	font-size: var(--text-xs);
	font-weight: 600;
	line-height: 1;
}

.bp-product-detail__cart .bricks-variation-swatches li[aria-disabled="true"],
.bp-product-detail__cart .bricks-variation-swatches li.disabled {
	position: relative;
	background: rgba(0, 0, 0, 0.035) !important;
	color: var(--muted) !important;
	cursor: not-allowed !important;
	opacity: 0.42 !important;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
	text-decoration-color: currentColor;
}

.bp-product-detail__cart table.variations th.label label {
	color: var(--ink);
}

.bp-product-detail__cart .bricks-variation-swatches li:not([aria-disabled="true"]):focus-visible {
	outline: 2px solid var(--secondary);
	outline-offset: 2px;
}

.bp-wishlist,
.bp-wishlist__button {
	width: 100%;
	height: 100%;
}

.bp-wishlist__button {
	display: grid;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	place-items: center;
	cursor: pointer;
	transition: background-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}

.bp-wishlist__button svg {
	width: 2rem;
	height: 2rem;
	fill: transparent;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.6;
}

.bp-wishlist__button:hover,
.bp-wishlist__button[aria-pressed="true"] {
	background: transparent;
	color: var(--ink);
}

.bp-wishlist__button:hover { opacity: 0.7; }

.bp-wishlist__button[aria-pressed="true"] svg {
	fill: currentColor;
}

.bp-wishlist__button:focus-visible {
	outline: 2px solid var(--secondary);
	outline-offset: 3px;
}

.bp-wishlist__button[aria-busy="true"] {
	cursor: wait;
	opacity: 0.55;
}

.bp-wishlist-dialog {
	width: min(42rem, calc(100vw - 2.4rem));
	max-width: none;
	padding: 0;
	border: 1px solid var(--ink);
	background: var(--surface);
	color: var(--ink);
}

.bp-wishlist-dialog::backdrop {
	background: rgba(0, 0, 0, 0.62);
}

.bp-wishlist-dialog__panel {
	position: relative;
	display: flex;
	padding: 3.2rem;
	flex-direction: column;
	gap: 1.6rem;
}

.bp-wishlist-dialog__panel h2,
.bp-wishlist-dialog__panel p {
	margin: 0;
}

.bp-wishlist-dialog__panel h2 {
	padding-right: 3rem;
	font-size: var(--text-xl);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1;
}

.bp-wishlist-dialog__panel p {
	font-size: var(--text-s);
	line-height: 1.55;
}

.bp-wishlist-dialog__close {
	position: absolute;
	top: 0;
	right: 0;
	display: grid;
	width: 4.8rem;
	height: 4.8rem;
	padding: 0;
	border: 0;
	border-left: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	font-size: 2.4rem;
	line-height: 1;
	place-items: center;
	cursor: pointer;
}

.bp-wishlist-dialog__login {
	display: inline-flex;
	min-height: 4.8rem;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	padding: 0 2rem;
	background: var(--secondary);
	color: var(--ink);
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

.bp-wishlist-dialog__close:focus-visible,
.bp-wishlist-dialog__login:focus-visible {
	outline: 2px solid var(--secondary);
	outline-offset: 3px;
}

@media (min-width: 992px) {
	.bp-product-detail__gallery .flex-viewport,
	.bp-product-detail__gallery .woocommerce-product-gallery:not(:has(.flex-viewport)) {
		height: 100% !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		/* Small wheel deltas must accumulate instead of snapping back to the
		 * same image. At either end, let scrolling continue on the page. */
		overscroll-behavior-y: auto;
		scroll-snap-type: none;
		scrollbar-width: none;
	}

	.bp-product-detail__gallery .woocommerce-product-gallery__wrapper {
		display: block !important;
		width: 100% !important;
		height: auto !important;
		transition: none !important;
		transform: none !important;
	}

	.bp-product-detail__gallery .woocommerce-product-gallery__image {
		float: none !important;
		width: 100% !important;
		aspect-ratio: 1 / 1;
	}
}

@media (max-width: 991px) {
	.bp-product-detail__gallery .woocommerce-product-gallery {
		height: auto !important;
		padding-bottom: 0;
	}

	/* Let WooCommerce's existing touch slider own horizontal transforms.
	 * The scroll-snap fallback is only for a gallery without that slider. */
	.bp-product-detail__gallery .flex-viewport {
		height: auto !important;
		aspect-ratio: 1 / 1;
		overflow: hidden !important;
		touch-action: pan-y pinch-zoom;
		cursor: grab;
	}

	.bp-product-detail__gallery .flex-viewport:active { cursor: grabbing; }

	.bp-product-detail__gallery .zoomImg {
		display: none !important;
		pointer-events: none;
	}

	.bp-product-detail__gallery .woocommerce-product-gallery:not(:has(.flex-viewport)) {
		overflow-x: auto !important;
		overflow-y: hidden !important;
		overscroll-behavior-inline: contain;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.bp-product-detail__gallery:not(.bp-product-gallery--native-slider) .woocommerce-product-gallery__wrapper {
		display: flex !important;
		width: calc(var(--bp-gallery-count, 1) * 100%) !important;
		flex-wrap: nowrap;
	}

	.bp-product-detail__gallery .woocommerce-product-gallery__image {
		aspect-ratio: 1 / 1;
	}

	.bp-product-detail__gallery:not(.bp-product-gallery--native-slider) .woocommerce-product-gallery__image {
		width: calc(100% / var(--bp-gallery-count, 1)) !important;
		min-width: 0;
		aspect-ratio: 1 / 1;
		flex: 0 0 calc(100% / var(--bp-gallery-count, 1));
	}

	.bp-product-gallery-nav {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		height: 44px;
		transform: none;
		flex-direction: row;
		align-items: center;
		gap: 0;
	}

	.bp-product-gallery-nav__track {
		flex: 1;
		flex-direction: row;
		gap: 2px;
	}

	.bp-product-gallery-nav__item {
		width: auto;
		height: 44px;
		flex: 1;
	}

	/* Visible 3px marks overlay the photo; the full 44px buttons remain tappable. */
  .bp-product-gallery-nav__item::before {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 3px;
	}
	.bp-product-gallery-nav__thumbnail { display: none; }

	.bp-product-gallery-nav__counter {
		display: none;
	}
}

@media (max-width: 478px) {
	.bp-wishlist-dialog__panel {
		padding: 2.4rem 2rem;
	}
}

/* Cart Blocks are outside the Bricks element tree; keep their controls square. */
.woocommerce-cart .wp-block-woocommerce-cart .wc-block-components-quantity-selector,
.woocommerce-cart .wp-block-woocommerce-cart .wc-block-components-quantity-selector__button,
.woocommerce-cart .wp-block-woocommerce-cart .wc-block-components-skeleton__element {
	border-radius: 0;
}

/*
 * Shared native Bricks/Choices brand filter. The outer Bricks dropdown owns
 * disclosure; search and results form one embedded multiselect panel.
 */
.bp-brand-combobox {
	position: relative;
	z-index: 1;
	display: flex;
	width: 100%;
	height: auto !important;
	min-width: 0;
	min-height: 0 !important;
	max-height: 100%;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	flex-direction: column;
}

.bp-brand-combobox .bricks-choices {
	--choices-width: 100%;
	--choices-font-size: 1.4rem;
	--choices-keyline-color: var(--line);
	--choices-bg-color: var(--surface);
	--choices-bg-color-dropdown: var(--surface);
	--choices-brx-text-color: var(--ink);
	--choices-brx-highlighted-text-color: var(--ink);
	--choices-highlighted-color: color-mix(in srgb, var(--secondary) 22%, var(--surface));
	--choices-z-index: 1000;
	display: flex;
	width: 100%;
	min-width: 0;
	min-height: 0;
	max-height: 100%;
	margin: 0;
	overflow: visible;
	flex: 1 1 auto;
	flex-direction: column;
	font-family: inherit;
}

.bp-brand-combobox .bricks-choices.is-open {
	z-index: 2;
}

.bp-brand-combobox .bricks-choices__inner {
	display: flex;
	min-height: 4.8rem;
	align-items: center;
	align-content: flex-start;
	flex-wrap: wrap;
	padding: .55rem 3.8rem .55rem 1.2rem;
	border: 1px solid var(--line);
	border-radius: 0;
	background: var(--surface);
	color: var(--ink);
	font-family: inherit;
	font-size: 1.4rem;
	font-weight: 500;
	flex: 0 0 auto;
	line-height: 1.2;
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.bp-brand-combobox .bricks-choices:hover .bricks-choices__inner {
	border-color: var(--ink);
}

.bp-brand-combobox .bricks-choices.is-focused .bricks-choices__inner,
.bp-brand-combobox .bricks-choices.is-open .bricks-choices__inner {
	border-color: var(--ink);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--secondary) 65%, transparent);
}

.bp-brand-combobox .bricks-choices[data-type*="select-multiple"]::after {
	position: absolute;
	top: 2.4rem;
	right: 1.4rem;
	width: .8rem;
	height: .8rem;
	border-right: 1.5px solid var(--ink);
	border-bottom: 1.5px solid var(--ink);
	content: "";
	pointer-events: none;
	transform: translateY(-50%) rotate(45deg);
	transition: transform var(--transition-fast);
}

.bp-brand-combobox .bricks-choices[data-type*="select-multiple"].is-open::after {
	transform: translateY(-50%) rotate(225deg);
}

.bp-brand-combobox .bricks-choices__list--multiple {
	display: flex;
	order: 2;
	width: 100%;
	min-width: 0;
	flex: 1 1 100%;
	flex-wrap: wrap;
	align-items: center;
	gap: .4rem;
}

.bp-brand-combobox .bricks-choices__list--multiple:not(:empty) {
	margin-top: .4rem;
}

.bp-brand-combobox .bricks-choices__list--multiple .bricks-choices__item {
	display: inline-flex;
	min-height: 3.2rem;
	align-items: center;
	margin: 0;
	padding: .48rem .72rem;
	border: 0;
	border-radius: 0;
	background: var(--ink);
	color: var(--surface);
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.2;
	word-break: normal;
}

.bp-brand-combobox .bricks-choices__list--multiple .bricks-choices__button {
	flex: 0 0 auto;
}

.bp-brand-combobox .bricks-choices__input--cloned {
	display: inline-block;
	order: 1;
	flex: 1 1 100%;
	width: 100% !important;
	min-width: 100% !important;
	height: 3.4rem !important;
	min-height: 3.4rem !important;
	align-self: center;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--ink);
	font-family: inherit;
	font-size: 1.4rem;
	font-weight: 500;
	line-height: 3.4rem !important;
}

.bp-brand-combobox .bricks-choices__input--cloned:focus,
.bp-brand-combobox .bricks-choices__input--cloned:focus-visible {
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
}

.bp-brand-combobox .bricks-choices__list--dropdown,
.bp-brand-combobox .bricks-choices__list[aria-expanded] {
	position: static !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	z-index: auto;
	width: 100% !important;
	min-height: 0;
	margin: -1px 0 0;
	border: 1px solid var(--ink);
	border-top-color: var(--line);
	border-radius: 0;
	background: var(--surface);
	box-shadow: none;
	color: var(--ink);
	transform: none !important;
	word-break: normal;
}

.bp-brand-combobox .bricks-choices__list--dropdown.is-active,
.bp-brand-combobox .bricks-choices__list[aria-expanded].is-active {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

.bp-brand-combobox .bricks-choices__list--dropdown > .bricks-choices__list,
.bp-brand-combobox .bricks-choices__list[aria-expanded] > .bricks-choices__list {
	max-height: min(36rem, calc(60vh - 12rem));
	min-height: 0;
	overflow-y: auto;
	flex: 1 1 auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
}

.bp-brand-combobox .bricks-choices__item--choice {
	display: flex;
	min-height: 4.6rem;
	align-items: center;
	padding: 1rem 1.2rem;
	border-bottom: 1px solid var(--line);
	font-size: 1.4rem;
	line-height: 1.35;
	transition: background-color var(--transition-fast), color var(--transition-fast);
	word-break: normal;
}

.bp-brand-combobox .bricks-choices__item--choice:last-child {
	border-bottom: 0;
}

.bp-brand-combobox .bricks-choices__item--choice.is-highlighted,
.bp-brand-combobox .bricks-choices__item--choice.is-selected {
	background: color-mix(in srgb, var(--secondary) 22%, var(--surface));
	color: var(--ink);
}

.bp-brand-combobox .bricks-choices__item--disabled {
	background: var(--surface);
	color: var(--muted);
	opacity: .52;
}

/* Keep the embedded results inside the shared Bricks submenu. */
body.bricks-is-frontend .bp-filter-dropdown > .bp-filter-panel:has(.bp-brand-combobox) {
	padding: 0;
	border: 0;
}

@media (max-width: 991px) {
	body.bricks-is-frontend .bp-filter-dropdown > .bp-filter-panel:has(.bp-brand-combobox) {
		padding: 1.6rem;
	}
}

.bp-filter-panel:has(.bp-brand-combobox),
.bp-filter-panel__body:has(.bp-brand-combobox),
.bp-filter-panel__scroll:has(.bp-brand-combobox) {
	overflow: hidden !important;
}

.bp-filter-panel__scroll:has(.bp-brand-combobox) {
	display: flex !important;
	min-height: 0;
	max-height: 100%;
	flex: 1 1 auto;
	flex-direction: column;
}

/* Size-guide summary uses taxonomy data inside native Bricks elements. */
.bp-size-guide-summary__brand-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: left center;
}

.bp-size-guide-summary__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

@media (max-width: 767px) {
	.bp-brand-combobox .bricks-choices__inner,
	.bp-brand-combobox .bricks-choices__input--cloned {
		font-size: 16px;
	}

	.bp-brand-combobox .bricks-choices__list--dropdown > .bricks-choices__list,
	.bp-brand-combobox .bricks-choices__list[aria-expanded] > .bricks-choices__list {
		max-height: calc(100dvh - 20rem);
	}
}

/* Keep WPML's translated destinations and full accessible names; shorten only the visible labels. */
.bp-header-language-switcher .wpml-ls-native,
.bp-mobile-language-switcher .wpml-ls-native {
	font-size: 0;
}

.bp-header-language-switcher .wpml-ls-display,
.bp-mobile-language-switcher .wpml-ls-display {
	display: none;
}

.bp-header-language-switcher .wpml-ls-native::after,
.bp-mobile-language-switcher .wpml-ls-native::after {
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.bp-header-language-switcher .wpml-ls-item-sk .wpml-ls-native::after,
.bp-mobile-language-switcher .wpml-ls-item-sk .wpml-ls-native::after {
	content: "SK";
}

.bp-header-language-switcher .wpml-ls-item-cs .wpml-ls-native::after,
.bp-mobile-language-switcher .wpml-ls-item-cs .wpml-ls-native::after {
	content: "CZ";
}

.bp-header-language-switcher .wpml-ls-item + .wpml-ls-item .wpml-ls-link::before,
.bp-mobile-language-switcher .wpml-ls-item + .wpml-ls-item .wpml-ls-link::before {
	content: "/";
	display: inline-block;
	font-size: 1.4rem;
	margin-right: 0.6rem;
}

/* Keep the requested full wordmark legible on narrow phones. */
@media (max-width: 434px) {
	.bp-site-header__inner {
		grid-template-columns: minmax(0, 1fr) !important;
		grid-template-rows: 26px 44px !important;
		height: auto !important;
		padding: 6px 12px !important;
	}

	.bp-site-header__inner > .bp-brand {
		grid-column: 1;
		grid-row: 1;
		justify-self: center;
		width: 220px !important;
	}

	.bp-site-header__inner .bp-site-header__logo {
		width: 220px !important;
		max-width: 220px !important;
	}

	.bp-site-header__inner > .bp-site-header__actions {
		grid-column: 1;
		grid-row: 2;
		justify-self: center;
	}
}
