/* Product detail page widgets: gallery, summary, related carousel */

/* ---------- Gallery ---------- */
/* In a column container the widget sizes to the photo's natural width, so its height
   stopped short of the scaled-up image and the thumbnails overlapped the title (mobile). */
.elementor-widget-mcp_product_gallery { width: 100%; }
.mcp-gallery {
	--mcp-thumb-w: 100px;
	--mcp-gallery-gap: 24px;
	--mcp-gallery-line: #C4C4C4;
	--mcp-gallery-active: #415364;
	--mcp-gallery-radius: 8px;
	display: flex;
	gap: var(--mcp-gallery-gap);
	align-items: flex-start;
}
.mcp-gallery-thumbs-bottom .mcp-gallery { flex-direction: column-reverse; }
.mcp-gallery__thumbs {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 0 0 var(--mcp-thumb-w);
}
.mcp-gallery-thumbs-bottom .mcp-gallery__thumbs { flex-direction: row; flex-basis: auto; }
.mcp-gallery .mcp-gallery__thumb {
	display: block;
	width: var(--mcp-thumb-w);
	aspect-ratio: 1 / 1;
	padding: 6px;
	background: #FFFFFF;
	/* Fixed grey: the PDP template sets the widget's Border Color to transparent */
	border: 1px solid #C4C4C4;
	border-radius: var(--mcp-gallery-radius);
	overflow: hidden;
	cursor: pointer;
	transition: border-color .2s;
}
/* Keep the image off the border. Beats the PDP template's Thumbnail Padding of 0, which
   Elementor prints inline in <body> as .elementor-5084 .elementor-element-… .mcp-gallery__thumb. */
body .elementor-widget-mcp_product_gallery .mcp-gallery .mcp-gallery__thumbs .mcp-gallery__thumb { padding: 6px; }
.mcp-gallery .mcp-gallery__thumb:hover,
.mcp-gallery .mcp-gallery__thumb.is-active { background: #FFFFFF; border-color: var(--mcp-gallery-active); }
.mcp-gallery .mcp-gallery__thumb img {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
	border: 0;
	box-shadow: none;
}
.mcp-gallery__main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Fixed height so every product page lines up; "Main Image Height" in the widget overrides it. */
	height: 520px;
	padding: 24px;
	background: #FFFFFF;
	border: 1px solid var(--mcp-gallery-line);
	border-radius: var(--mcp-gallery-radius);
	overflow: hidden;
}
.mcp-gallery .mcp-gallery__image {
	width: 100%;
	height: 100%;
	max-height: none;
	margin: 0;
	object-fit: contain;
	border: 0;
	box-shadow: none;
	transition: opacity .2s;
}
.mcp-gallery.is-switching .mcp-gallery__image { opacity: 0; }

/* The square Softee photos (softee-shop-img*, softee-product-*) have a 1px grey frame drawn in,
   which showed as a second border inside the gallery boxes. Size them as exact squares (cq units
   = the main box's content area) so the frame sits on the element's edge, then clip it off. */
.mcp-gallery__main { container-type: size; }
.mcp-gallery .mcp-gallery__image:is([src*="softee-shop-img"], [src*="softee-product-"]) {
	flex: 0 0 auto;
	width: min(100cqw, 100cqh);
	height: min(100cqw, 100cqh);
	clip-path: inset(3%);
}
.mcp-gallery .mcp-gallery__thumb img:is([src*="softee-shop-img"], [src*="softee-product-"]) { clip-path: inset(3%); }

/* Same grey border as the product cards, on Softee products only. The PDP template sets the
   widget's Border Color to transparent, so this one is fixed instead of using the variable.
   Other brands (Mayfield, Bellevue, Freely) show no border on the main image. */
.mcp-gallery.is-softee .mcp-gallery__main { border-color: #C4C4C4; }
.mcp-gallery:not(.is-softee) .mcp-gallery__main { border-width: 0; }

/* Tall product photos with a lot of white space baked in: enlarge them so the product
   itself fills ~85% of the box height (the box clips the extra white). Each family has
   the product in the same spot, so one rule fits all of them.
   Charcoal range (1000x1778): product spans 15%-79% of the height. */
.mcp-gallery .mcp-gallery__image:is([src*="Char_Shampoo"]:not([src*="DuoShot"]), [src*="Char_Conditioner"]) {
	flex: 0 0 auto;
	width: auto;
	max-width: none;
	height: 133%;
	max-height: none;
	transform: translateY(3%);
}
/* Hair, Body & Scalp Oil tubes (300x533): product spans 27%-79% of the height */
.mcp-gallery .mcp-gallery__image:is(
	[src*="/BrazMango."], [src*="/BrazMango-"], [src*="/HydOlive."], [src*="/HydOlive-"],
	[src*="/TeaTreeEuc."], [src*="/TeaTreeEuc-"], [src*="/CocoParadise."], [src*="/CocoParadise-"],
	[src*="/ShimArgan."], [src*="/ShimArgan-"], [src*="/SoothSheaButter."], [src*="/SoothSheaButter-"],
	[src*="/HoneyLav."], [src*="/HoneyLav-"]
) {
	flex: 0 0 auto;
	width: auto;
	max-width: none;
	height: 163%;
	max-height: none;
	transform: translateY(-3%);
}

@media (max-width: 1024px) {
	.mcp-gallery__main { height: 480px; }
}

@media (max-width: 767px) {
	.mcp-gallery { flex-direction: column-reverse; }
	.mcp-gallery__thumbs { flex-direction: row; flex-basis: auto; overflow-x: auto; }
	.mcp-gallery .mcp-gallery__thumb { width: 72px; flex: 0 0 72px; }
	.mcp-gallery__main { width: 100%; height: 400px; }
}

/* ---------- Summary ---------- */
.mcp-summary {
	--mcp-summary-box: #C4C4C4;
	--mcp-summary-accent: #415364;
	font-family: "Inter", sans-serif;
	color: #000000;
}
.mcp-summary .mcp-summary__title {
	margin: 0 0 18px;
	font-family: "Lora", serif;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.25;
	color: #000000;
}
.mcp-summary .mcp-summary__text {
	font-size: 15px;
	line-height: 1.75;
	color: #222222;
}
.mcp-summary .mcp-summary__text p { margin: 0 0 12px; }
.mcp-summary .mcp-summary__text p:last-child { margin-bottom: 0; }
.mcp-summary .mcp-summary__divider {
	margin: 24px 0;
	border: 0;
	border-top: 1px solid #D9D9D9;
	background: none;
	height: 0;
}
.mcp-summary__block { margin-top: 24px; }
.mcp-summary__divider + .mcp-summary__block { margin-top: 0; }
.mcp-summary .mcp-summary__label {
	margin: 0 0 10px;
	font-family: "Inter", sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: #000000;
}
.mcp-summary .mcp-summary__sds {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: "Inter", sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: #000000;
	text-decoration: underline;
}
.mcp-summary .mcp-summary__sds:hover { opacity: .7; }
.mcp-summary__sizes {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.mcp-summary__size {
	margin: 0;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 500;
	color: var(--mcp-summary-accent);
	border: 1px solid var(--mcp-summary-accent);
	border-radius: 4px;
}
.mcp-summary__retailers {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}
.mcp-summary .mcp-summary__retailer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 40px;
	padding: 6px 10px;
	font-family: inherit;
	font-size: 13px;
	color: #222222;
	background: #FFFFFF;
	border: 1px solid var(--mcp-summary-box);
	border-radius: 4px;
	text-decoration: none;
	transition: border-color .2s;
}
.mcp-summary a.mcp-summary__retailer:hover,
.mcp-summary .mcp-summary__more-btn:hover,
.mcp-summary .mcp-summary__more-btn[aria-expanded="true"] { color: #222222; background: #FFFFFF; border-color: var(--mcp-summary-accent); }
.mcp-summary .mcp-summary__retailer img {
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	object-fit: contain;
	border: 0;
	box-shadow: none;
}
.mcp-summary__more { position: relative; }
.mcp-summary .mcp-summary__more-btn { width: 100%; cursor: pointer; white-space: nowrap; }
.mcp-summary__more-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 20;
	display: grid;
	gap: 8px;
	width: max(100%, 180px);
	padding: 8px;
	background: #FFFFFF;
	border: 1px solid #D9D9D9;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(11, 21, 37, .1);
}
.mcp-summary__more-panel[hidden] { display: none; }
.mcp-summary .mcp-summary__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 230px;
	margin-top: 32px;
	padding: 14px 32px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: #FFFFFF;
	background: #415364;
	border-radius: 3px;
	text-decoration: none;
	transition: background-color .2s;
}
.mcp-summary .mcp-summary__button:hover { color: #FFFFFF; background: #243246; }
.mcp-summary .mcp-summary__button svg { transition: transform .2s; }
.mcp-summary .mcp-summary__button:hover svg { transform: translateX(4px); }

@media (max-width: 767px) {
	.mcp-summary .mcp-summary__title { font-size: 28px; }
	.mcp-summary__retailers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mcp-summary .mcp-summary__button { width: 100%; }
}

/* ---------- Related carousel ---------- */
.mcp-carousel {
	--mcp-carousel-per-view: 4;
	--mcp-carousel-gap: 24px;
	position: relative;
}
.mcp-carousel__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--mcp-carousel-per-view) - 1) * var(--mcp-carousel-gap)) / var(--mcp-carousel-per-view));
	gap: var(--mcp-carousel-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	outline: none;
}
.mcp-carousel__track::-webkit-scrollbar { display: none; }
.mcp-carousel__track > .mcp-pc-card { scroll-snap-align: start; }
/* "View Product" arrow is 24px here (the shared card markup renders it at 16px for the collection grid) */
.mcp-carousel .mcp-pc-card__link svg { width: 24px; height: 24px; flex-shrink: 0; }
.mcp-carousel .mcp-carousel__arrow {
	position: absolute;
	top: var(--mcp-carousel-arrow-top, 38%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	color: #243246;
	background: #FFFFFF;
	border: 1px solid #C4C4C4;
	border-radius: 50%;
	box-shadow: 0 4px 14px rgba(11, 21, 37, .08);
	transform: translateY(-50%);
	cursor: pointer;
	transition: opacity .2s, border-color .2s;
}
.mcp-carousel .mcp-carousel__arrow:hover { color: #243246; background: #FFFFFF; border-color: #415364; }
.mcp-carousel .mcp-carousel__arrow:disabled { opacity: .4; cursor: default; pointer-events: none; }
.mcp-carousel .mcp-carousel__arrow[hidden] { display: none; }
.mcp-carousel__arrow--prev { left: -24px; }
.mcp-carousel__arrow--next { right: -24px; }

@media (max-width: 1024px) {
	.mcp-carousel { --mcp-carousel-per-view: 2; }
	.mcp-carousel__arrow--prev { left: -8px; }
	.mcp-carousel__arrow--next { right: -8px; }
}
@media (max-width: 767px) {
	.mcp-carousel { --mcp-carousel-per-view: 1; }
	.mcp-carousel__track { grid-auto-columns: 82%; }
}

/* ---------- PDP wrapper ----------
 * Astra's WooCommerce CSS adds h2 { margin-bottom: .7em } on shop pages; Elementor headings
 * manage their own spacing, so match the brand pages. */
.mcp-pdp .elementor-widget-heading .elementor-heading-title,
.mcp-pdp .elementor-widget-e-heading :is(h1, h2, h3, h4, h5, h6) {
	margin-bottom: 0;
}
