/**
 * Brand pages responsive fixes (Mayfield, Bellevue, Softee, Freely, Softee Products)
 * Astra Child Theme
 *
 * Printed after the Customizer "Additional CSS" (see functions.php), so it can
 * override both that and Elementor's per-element responsive settings.
 *
 * Classes added in Elementor (Advanced > CSS Classes):
 *   .brand-switcher - top logo row (Mayfield / Bellevue / Softee / Freely)
 *   .brand-hero     - hero inner container that holds the background image
 *   .products-hero  - Softee Products banner (container with the Group-229.jpg background)
 *   .products-hero-image - empty right-hand container inside .products-hero
 * Existing classes reused: .mayfield-banner, .mayfield-feature, .mayfield-help-sec,
 *   .softee-about-sec
 */

/* ---------- Freely page (4934): Avenir Next LT Pro ---------- */
/* Files live in fonts/avenir/. Only font-family changes; sizes and weights stay as set in Elementor. */
@font-face {
	font-family: "Avenir Next LT Pro";
	src: url("fonts/avenir/AvenirNextLTPro-Regular.woff2") format("woff2"),
		url("fonts/avenir/AvenirNextLTPro-Regular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Avenir Next LT Pro";
	src: url("fonts/avenir/AvenirNextLTPro-It.woff2") format("woff2"),
		url("fonts/avenir/AvenirNextLTPro-It.woff") format("woff");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Avenir Next LT Pro";
	src: url("fonts/avenir/AvenirNextLTPro-Medium.woff2") format("woff2"),
		url("fonts/avenir/AvenirNextLTPro-Medium.woff") format("woff");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Avenir Next LT Pro";
	src: url("fonts/avenir/AvenirNextLTPro-Demi.woff2") format("woff2"),
		url("fonts/avenir/AvenirNextLTPro-Demi.woff") format("woff");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Avenir Next LT Pro";
	src: url("fonts/avenir/AvenirNextLTPro-DemiIt.woff2") format("woff2"),
		url("fonts/avenir/AvenirNextLTPro-DemiIt.woff") format("woff");
	font-weight: 600;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Avenir Next LT Pro";
	src: url("fonts/avenir/AvenirNextLTPro-Bold.woff2") format("woff2"),
		url("fonts/avenir/AvenirNextLTPro-Bold.woff") format("woff");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Avenir Next LT Pro";
	src: url("fonts/avenir/AvenirNextLTPro-BoldIt.woff2") format("woff2"),
		url("fonts/avenir/AvenirNextLTPro-BoldIt.woff") format("woff");
	font-weight: 700;
	font-style: italic;
	font-display: swap;
}

/* Every text element on the page; icon fonts (<i>, Font Awesome, eicons) are left alone */
.elementor-4934,
.elementor-4934 *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]):not([class*="eicon"]) {
	font-family: "Avenir Next LT Pro", "Avenir Next", Avenir, sans-serif !important;
}

/* ---------- Product grid images (Royal Addons) - border on Softee products only ---------- */
.mayfield-list .wpr-grid-media-wrap {
	border-radius: 8px;
	overflow: hidden;
	background: #FFFFFF;
	/* Square boxes so every card lines up, whatever the photo's shape */
	aspect-ratio: 1 / 1;
}

.mayfield-list .product_cat-softee .wpr-grid-media-wrap {
	border: 1px solid #C4C4C4;
}

.mayfield-list .wpr-grid-media-wrap .wpr-grid-image-wrap {
	height: 100%;
}

.mayfield-list .wpr-grid-media-wrap img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* These photos have a 1px frame drawn in - zoom slightly so the box clips it
   and only the border above shows */
.mayfield-list .wpr-grid-media-wrap img:is([src*="softee-shop-img"], [src*="softee-product-"]) {
	transform: scale(1.02);
}

/* No slide/fade when "View Archived Collections" (Load More) adds products. The grid is
   laid out with CSS grid, but the plugin's Isotope script still gives every item a
   translate3d() offset and animates it over 0.4s, so the cards flew in from the side
   and looked stretched. Items also start at opacity 0 until the script fades them in. */
.mayfield-list .wpr-grid .wpr-grid-item {
	transform: none !important;
	opacity: 1 !important;
}

.mayfield-list .wpr-grid .wpr-grid-item,
.mayfield-list .wpr-grid .wpr-grid-item-inner,
.mayfield-list .wpr-grid .wpr-grid-media-wrap,
.mayfield-list .wpr-grid .wpr-grid-media-wrap img {
	transition: none !important;
	animation: none !important;
}

/* ---------- Product grid "Load More" (Royal Addons) - match theme buttons ---------- */
/* .mayfield-feature .wpr-grid-pagination .wpr-load-more-btn {
	background-color: transparent !important;
	color: #415364 !important;
	border: 1px solid #415364 !important;
	border-radius: 3px;
	padding: 12px 32px !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background-color .2s ease, color .2s ease;
}

.mayfield-feature .wpr-grid-pagination .wpr-load-more-btn:hover,
.mayfield-feature .wpr-grid-pagination .wpr-load-more-btn:focus-visible {
	background-color: #415364 !important;
	color: #FFFFFF !important;
} */

/* ---------- Small desktop (1025px - 1200px) ---------- */
@media (min-width: 1025px) and (max-width: 1200px) {
	/* Brand switcher: fixed 268px side padding shrank the logos to ~100px */
	.brand-switcher {
		padding-left: 15% !important;
		padding-right: 15% !important;
	}

	/* Freely hero: text overlaps the clips, add a soft left shade behind it */
	.elementor-4934 .brand-hero {
		position: relative;
		isolation: isolate;
	}

	.elementor-4934 .brand-hero::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: -1;
		background: linear-gradient(90deg, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, .2) 45%, rgba(0, 0, 0, 0) 65%);
		pointer-events: none;
	}

	/* Freely banner (dev element IDs): 100px desktop side padding squeezed the banner,
	   and the centred cover image cut the pink clip off on the right */
	.elementor-4934 .elementor-element.elementor-element-5f3645f {
		--padding-left: 20px;
		--padding-right: 20px;
	}

	.elementor-4934 .elementor-element.elementor-element-51fbfd8:not(.elementor-motion-effects-element-type-background) {
		background-position: center right;
	}

	/* Product detail template (5084, dev element IDs): 100px desktop side padding -> 20px.
	   "You May Also Like" gets 30px so the carousel arrows (offset -24px) stay on screen.
	   body prefix: Elementor also prints this template's CSS inline in <body>, after this file. */
	body .elementor-5084 .elementor-element.elementor-element-6363a61,
	body .elementor-5084 .elementor-element.elementor-element-bbe8b36,
	body .elementor-5084 .elementor-element.elementor-element-7cc7a85 {
		--padding-left: 20px;
		--padding-right: 20px;
	}

	body .elementor-5084 .elementor-element.elementor-element-f926ed9 {
		--padding-left: 30px;
		--padding-right: 30px;
	}

	/* Freely ingredient cards: 30px card padding + 0 right padding in the accordion
	   panels pushed text into the right border and split long names mid-word */
	.elementor-4934 .elementor-element-915d984,
	.elementor-4934 .elementor-element-00539b2,
	.elementor-4934 .elementor-element-97ab05b {
		--padding-left: 20px;
		--padding-right: 20px;
	}

	.elementor-4934 .e-n-accordion-item > [role="region"] {
		--padding-right: 12px;
	}

	.elementor-4934 .e-n-accordion-item .elementor-widget-text-editor {
		overflow-wrap: break-word;
		hyphens: auto;
	}

	/* Footer intro text: use the full column instead of ~130px */
	.footer-inner-sec > .footer-grid:first-child > .elementor-widget-text-editor {
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Softee Products: hero + collection had 100px side padding (rest of the
	   page uses 20px), squeezing the 4 product cards to ~190px */
	.elementor-5042 .elementor-element-9639f81,
	.elementor-5042 .elementor-element-b05b24c {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}

	/* Softee "Follow our journey" tiles: square, so the graphics aren't cropped */
	.softee-list > .e-con,
	.elementor-2009 .elementor-element-2e59122 > .e-con {
		height: auto !important;
		min-height: 0 !important;
		aspect-ratio: 1 / 1;
	}
}

/* ---------- Large tablet (881px - 1024px) ---------- */
@media (min-width: 881px) and (max-width: 1024px) {
	/* Product grid: 4 per row instead of 2 oversized cards */
	.mayfield-list .wpr-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
		gap: 30px 20px !important;
	}
}

/* ---------- Tablet (768px - 1024px) ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
	/* Softee "About": show the whole photo instead of a cropped strip */
	.softee-about-sec > .e-con:first-child {
		background-size: contain !important;
		background-position: center !important;
		background-color: #FFFFFF;
	}

	/* Softee "Follow our journey" gallery: 5 across, images fill their cells */
	.softee-gallery .gallery {
		display: grid !important;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 12px;
	}

	.softee-gallery .gallery-item {
		width: auto !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.softee-gallery .gallery-item img {
		width: 100% !important;
		height: auto !important;
	}

	.softee-gallery .gallery br {
		display: none;
	}
}

/* ---------- Tablet (1024px and below) ---------- */
@media (max-width: 1024px) {
	/* Even out section spacing (Elementor values differ per page, up to 130px) */
	.mayfield-feature > .e-con-inner {
		padding-top: 50px !important;
		padding-bottom: 50px !important;
	}

	.mayfield-feature > .e-con-inner > .elementor-element:first-child {
		margin-top: 0 !important;
	}
}

/* ---------- Mobile (767px and below) ---------- */
@media (max-width: 767px) {
	/* Brand switcher: 2 x 2 logo grid instead of a tall single column.
	   .main-brandname is the same row as built on the dev site (logos one level deeper). */
	.brand-switcher,
	.main-brandname.e-parent {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}

	.brand-switcher > .e-con-inner,
	.main-brandname > .e-con-inner > .main-brandname {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px !important;
		padding-top: 15px;
		padding-bottom: 15px;
	}

	.brand-switcher > .e-con-inner > .e-con,
	.main-brandname > .e-con-inner > .main-brandname > .e-con {
		width: auto !important;
		min-width: 0 !important;
		min-height: 64px;
		padding: 8px !important;
		margin: 0 !important;
		justify-content: center !important;
		align-items: center !important;
	}

	.brand-switcher .elementor-widget-image,
	.brand-switcher .elementor-widget-image a,
	.main-brandname .elementor-widget-image,
	.main-brandname .elementor-widget-image a {
		width: 100%;
		text-align: center;
	}

	.brand-switcher .elementor-widget-image img,
	.main-brandname .elementor-widget-image img {
		width: auto !important;
		max-width: 100% !important;
		max-height: 46px;
		object-fit: contain;
	}

	/* Hero: overlay so white text stays readable over the photo */
	.brand-hero {
		position: relative;
		isolation: isolate;
	}

	.brand-hero::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: -1;
		background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .35) 100%);
		pointer-events: none;
	}

	/* Hero label tag: light on the dark overlay, wraps cleanly */
	.brand-hero > .elementor-widget-heading:first-child .elementor-heading-title {
		color: #FFFFFF !important;
		border-color: rgba(255, 255, 255, .6) !important;
		line-height: 1.4 !important;
	}

	/* Mayfield: show the candle instead of the plain left edge of the photo */
	.elementor-2005 .brand-hero {
		background-position: 68% center !important;
	}

	.mayfield-feature > .e-con-inner {
		padding-top: 40px !important;
		padding-bottom: 40px !important;
	}

	/* Section label tags (e.g. "ABOUT MAYFIELD CONSUMER PRODUCTS") wrap cleanly */
	.mayfield-feature .elementor-widget-heading:first-child .elementor-heading-title,
	.mayfield-help-sec .elementor-widget-heading:first-child .elementor-heading-title {
		line-height: 1.4 !important;
	}

	/* Softee "About" block: no empty space around the image / below the text */
	.softee-about-sec > .e-con:first-child {
		min-height: 0 !important;
		aspect-ratio: 1 / 1;
	}

	.softee-about-sec > .e-con:last-child {
		padding: 30px 20px !important;
	}

	/* Softee "Follow our journey" (mobile-only stack): the image widgets had a
	   fixed 305px mobile width, leaving an empty strip on the right above ~345px */
	.elementor-2009 .elementor-element-db43ba5 > .elementor-widget-image,
	.elementor-2009 .elementor-element-db43ba5 > .elementor-widget-image a,
	.elementor-2009 .elementor-element-db43ba5 > .elementor-widget-image img {
		display: block;
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Contact block: even top spacing, full-width intro text */
	.mayfield-help-sec > .e-con-inner > .e-con:first-child {
		padding-top: 40px !important;
	}

	.mayfield-help-sec > .e-con-inner > .e-con:first-child > .elementor-element:first-child {
		margin-top: 0 !important;
	}

	.mayfield-help-sec .elementor-widget-text-editor {
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Contact form: line up with the intro text (column had 10px side padding) */
	.mayfield-help-sec > .e-con-inner > .e-con:last-child {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	/* Product grid: one per row, first 4 only - the button below reveals the rest
	   (js/brand-grid-toggle.js). Only when the section has that button. */
	.mayfield-feature:has(.elementor-widget-button) .mayfield-list:not(.is-expanded) .wpr-grid-item:nth-child(n+5) {
		display: none !important;
	}

	/* Without an explicit width the flex column sized the grid widget shorter
	   than its content, so the last product spilled over (and captured taps on)
	   the button below */
	.mayfield-list {
		width: 100% !important;
	}

	/* Size the grid to its rows - a fixed height (e.g. 3381px in Additional CSS)
	   stretches every row and leaves big gaps between products */
	.mayfield-list .wpr-grid {
		height: auto !important;
	}

	/* Button below the grid: centred, full width, clear of the last row */
	.mayfield-feature .elementor-widget-button {
		width: 100% !important;
		margin-top: 30px !important;
	}

	.mayfield-feature .elementor-widget-button .elementor-button {
		display: flex;
		justify-content: center;
		width: 100%;
	}

	/* Footer legal links: even spacing either side of the divider */
	#footer-main {
		column-gap: 0 !important;
	}
}

/* ---------- Softee Products hero (Group-229.jpg background) ----------
 * The photo is a 1240 x 271 strip with the products in its right 45%; "cover" on a
 * taller box zoomed in on the middle and cut them off. Size it by width instead so the
 * whole product group stays in view. */
@media (max-width: 1024px) {
	/* Products fill the right half, beside the text */
	.products-hero {
		background-size: 110% auto !important;
		/* -10px hides the white rounded corner baked into the photo's top-right */
		background-position: right -10px bottom !important;
	}
}

@media (max-width: 767px) {
	/* Text stacks on top; the products sit full width underneath it */
	.products-hero {
		background-size: 221% auto !important;
	}

	.products-hero > .products-hero-image {
		min-height: calc((100vw - 40px) * 0.483);
	}
}
