/* Blueprint local overrides: reproduce reference runtime state without the original JS bundle. */

/* Homepage "Every product is designed for every body" flexible area:
   the saved reference DOM carries the desktop inline flex-basis (49.4286%) on the image and
   text blocks; the theme's own JS rewrites it to 100% below 768px. Reproduce that with CSS. */
@media (max-width: 767.98px) {
  .homepage__designed-for-body--custom .flexible-area-image,
  .homepage__designed-for-body--custom .flexible-area-image + .flexible-area-group {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .homepage__designed-for-body--custom .flexible-area-image {
    padding-bottom: 0 !important;
  }
}

/* Homepage benefit grid: bottom "Add to Cart $price" bar is visible on desktop in the reference. */
@media (min-width: 1024px) {
  .homepage__shop-by-benefit--custom .card-product .card-info.bottom_atc {
    display: block !important;
  }
  .homepage__shop-by-benefit--custom .card-product .card-info.bottom_atc > button {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    color: #f6f4ec;
    background-color: #1d2c4e;
  }
  .homepage__shop-by-benefit--custom .card-product .card-info.bottom_atc .card-product-cta {
    width: 100%;
    justify-content: space-between;
  }
}

/* ------------------------------------------------------------------
   Captured content pages (theme/sections/pages/*): keep the Shopify
   "choose options" drawer overlay closed — it is JS-toggled on the
   reference site and would otherwise cover the product grid.
   ------------------------------------------------------------------ */
[id^="choose-options-"] {
	display: none !important;
}

/* Reference About page reveals each snapshot section on scroll (the
   reference JS adds the state; we do the same from bp-pages.js). */
.about-bryan .snapshot-section.bp-revealed .left img,
.about-bryan .snapshot-section.bp-revealed .right {
	opacity: 1;
	transform: translateY(0);
}

/* --- Quiz flow layout (authored stand-in, see assets/js/bp-quiz.js) --- */
.new-customer-quiz__quiz-container {
	max-width: 760px;
	margin: 0 auto;
	padding: 72px 20px 96px;
}
.new-customer-quiz__option-group {
	display: grid;
	gap: 12px;
	margin-top: 8px;
}
.new-customer-quiz__radio-option {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	border-radius: 100px;
	background: #fff;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.new-customer-quiz__radio-option:hover {
	background: #eceae1;
}
.new-customer-quiz__radio-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.new-customer-quiz__quiz-container .new-customer-quiz__cta {
	min-width: 180px;
}
.new-customer-quiz__results,
.new-customer-quiz__okendo-results-header {
	text-align: center;
}

/* About page: stack the snapshot rows on mobile (reference behaviour).
   The captured section ships an inline <style> that pins the reversed rows
   to row, so this needs a more specific selector. */
@media (max-width: 767.98px) {
	body .about-bryan .snapshot-section,
	body .about-bryan .snapshot-section.reversed-section {
		flex-direction: column !important;
		gap: 2rem;
	}
}

/* The original theme fades product images in via JS adding `.active`; we render static
   markup, so force the end state or the image stays invisible (e.g. Macadamia Protein Bar card). */
.animate_transition_image {
	opacity: 1 !important;
}

/* Footer country/currency selector: keep the native select (no fake market switching)
   but make both the closed control and the OS popup readable on the navy footer. */
.footer .footer__currency-select,
select.footer__currency-select {
	background: transparent !important;
	color: #f6f4ec !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 22px 0 0 !important;
	font-size: 0.8125rem !important;
	line-height: 1.4 !important;
}
select.footer__currency-select option {
	background: #ffffff !important;
	color: #111c35 !important;
}
select.footer__currency-select option:checked {
	background: #e9ecf3 !important;
	color: #111c35 !important;
}
.footer .footer__currency-select-wrap svg,
.footer__currency-arrow {
	pointer-events: none;
}

/* Footer country/currency listbox (replaces the unreadable native select popup). */
/* Keep the native select in the layout flow (so the footer row wraps exactly like the
   reference) but hide it visually; the custom listbox is laid over it. */
select.footer__currency-select.bp-market__native {
	visibility: hidden !important;
	pointer-events: none !important;
}
select.footer__currency-select.bp-market__native + .footer__currency-arrow {
	display: none !important;
}
.bp-market {
	position: relative;
	display: inline-flex;
	align-items: center;
}
.bp-market__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border: 0;
	padding: 0;
	color: #f6f4ec;
	font-family: var(--font-body-family, 'DM Sans'), serif;
	font-size: 0.8125rem;
	line-height: 1.4;
	cursor: pointer;
}
.bp-market__button:focus-visible {
	outline: 2px solid #f6f4ec;
	outline-offset: 3px;
	border-radius: 2px;
}
.bp-market__chevron {
	flex: none;
	transition: transform 0.2s ease;
}
.bp-market.is-open .bp-market__chevron {
	transform: rotate(180deg);
}
.bp-market__list {
	position: absolute;
	bottom: calc(100% + 10px);
	right: 0;
	z-index: 60;
	min-width: 260px;
	max-height: 280px;
	overflow-y: auto;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #111c35;
	border: 1px solid rgba(246, 244, 236, 0.18);
	border-radius: 12px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.bp-market__option {
	padding: 9px 12px;
	border-radius: 8px;
	color: #f6f4ec;
	font-size: 0.8125rem;
	line-height: 1.3;
	cursor: pointer;
	white-space: nowrap;
}
.bp-market__option:hover,
.bp-market__option:focus-visible,
.bp-market__option[aria-selected='true'] {
	background: rgba(246, 244, 236, 0.14);
	outline: none;
}
@media (max-width: 767.98px) {
	.bp-market__list {
		left: 0;
		right: auto;
		min-width: 240px;
		max-height: 220px;
	}
}

/* Overlay the custom listbox on top of the (layout-preserving) native select. */
.footer__currency-select-wrap {
	position: relative;
}
.bp-market {
	position: absolute;
	left: 0;
	bottom: 0;
	display: inline-flex;
	align-items: center;
	height: 100%;
}

/* --- Mobile: make the product carousels swipeable (native scroll + snap) ---
   The original theme drives these rows with Splide; we render them statically,
   so on touch viewports the track clipped the overflowing slides with no way to
   reach them. Turning the track into a scroll container restores the reference
   behaviour (2-up, swipeable) without changing the desktop layout.
   Scoped to .splide.collection (product rows) so the testimonial carousel and
   other splide instances keep their own layout. */
@media (max-width: 1439.98px) {
	.splide.collection .splide__track,
	.splide.bp-row-scroll .splide__track {
		overflow-x: auto !important;
		overflow-y: hidden !important;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		overscroll-behavior-x: contain;
	}
	.splide.collection .splide__track::-webkit-scrollbar,
	.splide.bp-row-scroll .splide__track::-webkit-scrollbar {
		display: none;
	}
	.splide.collection .splide__track > .splide__list,
	.splide.bp-row-scroll .splide__track > .splide__list {
		width: max-content;
		transform: none !important;
	}
	.splide.collection .splide__track > .splide__list > .splide__slide,
	.splide.bp-row-scroll .splide__track > .splide__list > .splide__slide {
		scroll-snap-align: start;
	}
}

/* Search results: use the reference 16px page gutter on small screens so the
   collection grid can fit two cards per row (reference: 2-up at 390). */
@media (max-width: 767.98px) {
	.theme-template-search .x-pgw.page-width {
		padding-left: 1rem;
		padding-right: 1rem;
	}
	.theme-template-search .collection-grid {
		padding-left: 0;
		padding-right: 0;
	}
}

/* Product carousel arrows: the reference shows 40px round arrows on hover when
   the row overflows (tablet/desktop narrow). Our markup ships the buttons, so
   give them size, position and hover behaviour, and keep them out of the way. */
@media (min-width: 1024px) {
	.splide.collection .splide__arrows {
		position: absolute;
		inset: 0;
		display: block;
		pointer-events: none;
		z-index: 5;
	}
	.splide.collection .splide__arrow {
		position: absolute;
		top: 40%;
		width: 2.75rem;
		height: 2.75rem;
		margin-top: -1.375rem;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0.75rem;
		border-radius: 999px;
		background: #f6f4ec;
		color: #111c35;
		border: 1px solid #e1e3e1;
		box-shadow: 0 2px 8px rgba(17, 28, 53, 0.12);
		opacity: 0;
		pointer-events: auto;
		transition: opacity 0.2s ease, background 0.2s ease;
		cursor: pointer;
	}
	.splide.collection:hover .splide__arrow,
	.splide.collection .splide__arrow:focus-visible {
		opacity: 1;
	}
	.splide.collection .splide__arrow:hover {
		background: #fff;
	}
	.splide.collection .splide__arrow--prev { left: 0.5rem; }
	.splide.collection .splide__arrow--next { right: 0.5rem; }
	.splide.collection .splide__arrow svg {
		width: 20px;
		height: 20px;
	}
	.splide.collection .splide__arrow:disabled {
		opacity: 0;
		pointer-events: none;
	}
	.splide.collection:not(.bp-carousel--overflow) .splide__arrows {
		display: none;
	}
	.splide.collection .splide__track.bp-carousel--dragging {
		cursor: grabbing;
		scroll-snap-type: none;
	}
}

@media (max-width: 1023.98px) {
	.splide.collection .splide__arrows {
		display: none;
	}
}

/* PDP ingredient rail: swipe horizontally on touch viewports. */
@media (max-width: 1023.98px) {
	.product-ingredients__carousel {
		overflow-x: auto !important;
		overflow-y: hidden !important;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}
	.product-ingredients__carousel::-webkit-scrollbar {
		display: none;
	}
	.product-ingredients__carousel .swiper-slide {
		scroll-snap-align: start;
	}
}

/* Splide ships an empty placeholder slide; hide it so a 5-up row does not
   report phantom overflow on wide screens. */
.splide.collection .splide__list > .splide__slide:not([data-bp-product]) {
	display: none;
}

/* Long URLs / email addresses in imported policy + article copy must not push
   the mobile layout wider than the viewport. */
main a,
main strong,
main code {
	overflow-wrap: anywhere;
}

/* About page: captured desktop markup carries fixed column widths and desktop
   side margins; normalise them on phones so nothing spills past the viewport. */
@media (max-width: 767.98px) {
	.about-bryan .snapshot-section,
	.about-bryan .snapshot-section.reversed-section {
		flex-direction: column !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 0 3rem 0 !important;
		padding: 0 1.25rem !important;
		box-sizing: border-box;
	}
	.about-bryan .snapshot-section .left,
	.about-bryan .snapshot-section .right {
		width: 100% !important;
		max-width: 100% !important;
		flex: 1 1 auto !important;
	}
	.about-bryan .snapshot-section img {
		width: 100% !important;
		max-width: 100% !important;
		height: auto;
	}
}

/* Long editorial tables (blog protocol tables, policy tables) scroll on phones
   instead of stretching the page wider than the viewport. */
@media (max-width: 767.98px) {
	main table {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}

/* Let horizontal swipes reach the JS handler on the testimonials carousel
   while vertical page scrolling still works. */
.homepage__testimonials--custom .splide {
	touch-action: pan-y;
}

/* The COA cards used a Shopify CDN texture behind the product photo; that file
   is not part of the export, so fall back to the section background instead of
   requesting a remote (now missing) URL. */
.coa__grid .block > div {
	background-image: none !important;
	background-color: #f6f4ec;
}
