/**
 * MintyMake — universal single product page.
 *
 * Replaces the dead WooCommerce FlexSlider styling. Everything here is scoped to
 * the product page and loaded only on `is_product()`.
 */

/* ------------------------------------------------------------------ *
 * Layout
 * ------------------------------------------------------------------ */

.mm-product {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: 48px;
	align-items: start;
	padding: 8px 0 40px;
}

/* A product with no images uses the full width rather than a blank column. */
.mm-product--no-gallery {
	grid-template-columns: minmax(0, 1fr);
	max-width: 720px;
}

.mm-product__gallery {
	position: sticky;
	top: 24px;
	min-width: 0;
}

.mm-product__summary {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

/* Defensive: if any leftover WooCommerce gallery markup is ever rendered,
   never leave it invisible. */
.woocommerce-product-gallery {
	opacity: 1 !important;
}

/* ------------------------------------------------------------------ *
 * Gallery
 * ------------------------------------------------------------------ */

.mm-gallery {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mm-gallery__stage {
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	background: var(--mm-white, #fff);
	border: 1px solid rgba(18, 63, 47, 0.1);
	box-shadow: 0 10px 30px rgba(18, 63, 47, 0.06);
}

.mm-gallery__track {
	display: flex;
	transition: transform 350ms cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.mm-gallery__slide {
	flex: 0 0 100%;
	min-width: 0;
	margin: 0;
}

.mm-gallery__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.mm-gallery__badge {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	padding: 7px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	color: var(--mm-forest, #123f2f);
	font-family: var(--mm-sans);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	box-shadow: 0 2px 10px rgba(18, 63, 47, 0.12);
}

.mm-gallery__nav,
.mm-gallery__zoom {
	position: absolute;
	z-index: 3;
	display: grid;
	place-items: center;
	border: 1px solid rgba(18, 63, 47, 0.12);
	background: rgba(255, 255, 255, 0.95);
	color: var(--mm-forest, #123f2f);
	cursor: pointer;
	transition: background var(--mm-ease, 150ms ease), color var(--mm-ease, 150ms ease);
}

.mm-gallery__nav {
	top: 50%;
	width: 42px;
	height: 42px;
	margin-top: -21px;
	border-radius: 50%;
	box-shadow: 0 4px 16px rgba(18, 63, 47, 0.14);
}

.mm-gallery__nav--prev {
	left: 14px;
}

.mm-gallery__nav--next {
	right: 14px;
	transform: rotate(180deg);
}

.mm-gallery__nav .mm-icon,
.mm-gallery__nav svg {
	width: 18px;
	height: 18px;
}

.mm-gallery__zoom {
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border-radius: 10px;
}

.mm-gallery__nav:hover,
.mm-gallery__zoom:hover,
.mm-gallery__nav:focus-visible,
.mm-gallery__zoom:focus-visible {
	background: var(--mm-green, #18583d);
	color: #fff;
	outline: none;
}

.mm-gallery__nav:focus-visible,
.mm-gallery__zoom:focus-visible {
	box-shadow: 0 0 0 3px rgba(24, 88, 61, 0.35);
}

.mm-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mm-gallery__thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 12px;
	background: var(--mm-white, #fff);
	overflow: hidden;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity var(--mm-ease, 150ms ease), border-color var(--mm-ease, 150ms ease);
}

.mm-gallery__thumbimg {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.mm-gallery__thumb:hover,
.mm-gallery__thumb:focus-visible {
	opacity: 1;
	border-color: rgba(24, 88, 61, 0.35);
	outline: none;
}

.mm-gallery__thumb.is-active {
	opacity: 1;
	border-color: var(--mm-green, #18583d);
}

/* ------------------------------------------------------------------ *
 * Lightbox
 * ------------------------------------------------------------------ */

.mm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(10, 25, 20, 0.88);
}

.mm-lightbox[hidden] {
	display: none;
}

.mm-lightbox__img {
	max-width: min(1100px, 92vw);
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.mm-lightbox__close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
}

.mm-lightbox__close:hover,
.mm-lightbox__close:focus-visible {
	background: rgba(255, 255, 255, 0.28);
	outline: none;
}

/* ------------------------------------------------------------------ *
 * Summary / information panel
 * ------------------------------------------------------------------ */

.mm-product__cat {
	margin: 0;
	font-family: var(--mm-sans);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mm-green, #18583d);
}

.mm-product__title {
	margin: 0;
	font-family: var(--mm-serif);
	font-size: clamp(26px, 3vw, 38px);
	line-height: 1.15;
	font-weight: 600;
	color: var(--mm-forest, #123f2f);
}

.mm-product__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mm-product__excerpt {
	font-family: var(--mm-sans);
	font-size: 15.5px;
	line-height: 1.65;
	color: var(--mm-text, #17251f);
}

.mm-product__excerpt p {
	margin: 0 0 10px;
}

.mm-product__excerpt ul {
	margin: 0;
	padding-left: 20px;
}

.mm-rating {
	display: flex;
	align-items: center;
	margin: -5px 0 0;
	line-height: 1;
}

.mm-rating__stars {
	background: linear-gradient(to right, #c8912f 0 var(--mm-rating-fill), #d8d9d5 var(--mm-rating-fill) 100%);
	background-clip: text;
	-webkit-background-clip: text;
	color: transparent;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 20px;
	letter-spacing: 2px;
	-webkit-text-fill-color: transparent;
}

.mm-rating__stars--empty {
	background: none;
	color: #e0a928;
	-webkit-text-fill-color: #e0a928;
}

.mm-price {
	margin: 4px 0;
	font-family: var(--mm-serif);
	font-size: clamp(26px, 3vw, 34px);
	font-weight: 600;
	color: var(--mm-forest, #123f2f);
}

.mm-price del {
	font-size: 0.55em;
	font-weight: 400;
	opacity: 0.55;
	margin-right: 10px;
}

.mm-price ins {
	text-decoration: none;
}

.mm-buy {
	margin-top: 4px;
}

.mm-buy__row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.mm-buy__row .mm-btn {
	flex: 1 1 160px;
	justify-content: center;
	text-align: center;
	padding: 14px 22px;
	font-size: 15px;
}

.mm-digital-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 16px;
	border-radius: 12px;
	background: var(--mm-sage, #e8efdf);
	color: var(--mm-forest, #123f2f);
	font-family: var(--mm-sans);
	font-size: 13.5px;
	line-height: 1.5;
}

.mm-trust {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: center;
	max-width: var(--mm-container, 1280px);
	margin: 0;
	padding: 0 var(--mm-gutter, 24px);
	list-style: none;
}

.mm-product-trustband {
	width: 100vw;
	margin: 0 0 8px calc(50% - 50vw);
	padding: 15px 0;
	background: var(--mm-forest, #123f2f);
	color: var(--mm-white, #fff);
}

.mm-trust li {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 30px;
	padding-inline: clamp(10px, 2vw, 24px);
	border-inline-start: 1px solid rgba(255, 255, 255, 0.2);
	font-family: var(--mm-sans);
	font-size: clamp(12px, 1.1vw, 15px);
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	white-space: nowrap;
}

.mm-trust li:first-child {
	border-inline-start: 0;
}

.mm-trust .mm-icon {
	width: 21px;
	height: 21px;
	color: #fff;
	flex: 0 0 auto;
}

.mm-payrow {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	min-height: 72px;
	margin: -2px 0 0;
	padding: 0;
	font-family: var(--mm-sans);
	font-size: 14px;
	color: #17251f;
}

.mm-payrow__mark {
	display: grid;
	align-items: center;
	justify-content: center;
	flex: 1 1 84px;
	min-width: 80px;
	max-width: 116px;
	height: 72px;
	padding: 3px;
	border: 1px solid rgba(255, 255, 255, 0.88);
	border-radius: 16px;
	background: #e1e8f0;
	box-shadow: 7px 7px 15px rgba(157, 169, 185, 0.28), -5px -5px 14px rgba(255, 255, 255, 0.72);
	line-height: 1;
}

.mm-payrow__logo {
	display: block;
	width: 100%;
	max-width: 110px;
	height: 100%;
	max-height: 64px;
	margin: auto;
	object-fit: contain;
}

.mm-payrow__text {
	font-family: var(--mm-sans);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: #4b5b64;
}

.mm-description-content {
	max-width: 76ch;
	margin-inline: auto;
	color: #34453e;
	font-size: 16px;
	line-height: 1.8;
}

/* Desktop: align the wider description column with the details panel. */
@media (min-width: 1024px) {
	.mm-description-content {
		max-width: 920px;
		margin-inline: 0;
	}
}

.mm-description-content__title {
	margin: 0 0 18px;
	color: var(--mm-forest, #123f2f);
	font-family: var(--mm-serif, Georgia, serif);
	font-size: clamp(25px, 3vw, 32px);
	font-weight: 600;
	line-height: 1.2;
}

.mm-description-content > p {
	margin: 0 0 17px;
}

.mm-description-content > p:first-of-type {
	color: #263a31;
	font-size: 17px;
	line-height: 1.78;
}

.mm-description-content h2,
.mm-description-content h3,
.mm-description-content h4 {
	margin: 1.8em 0 0.55em;
	color: var(--mm-forest, #123f2f);
	font-family: var(--mm-serif, Georgia, serif);
	font-weight: 600;
	line-height: 1.3;
}

.mm-description-content h2 { font-size: clamp(21px, 2.5vw, 26px); }
.mm-description-content h3 { font-size: clamp(18px, 2vw, 21px); }
.mm-description-content h4 { font-family: var(--mm-sans); font-size: 16px; }

.mm-description-content ul,
.mm-description-content ol {
	margin: 0 0 20px;
	padding-inline-start: 1.5em;
}

.mm-description-content li {
	margin: 0 0 8px;
	padding-inline-start: 0.25em;
}

.mm-description-content ul li::marker { color: var(--mm-green, #18583d); }
.mm-description-content ol li::marker { color: var(--mm-green, #18583d); font-weight: 700; }

.mm-description-content a {
	color: var(--mm-green, #18583d);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: rgba(24, 88, 61, 0.35);
	text-underline-offset: 0.18em;
}

.mm-description-content a:hover { text-decoration-color: currentColor; }

.mm-description-content blockquote {
	margin: 22px 0;
	padding: 16px 20px;
	border-inline-start: 3px solid var(--mm-green, #18583d);
	border-radius: 0 12px 12px 0;
	background: var(--mm-sage, #e8efdf);
	color: var(--mm-forest, #123f2f);
}

.mm-description-content img {
	max-width: 100%;
	height: auto;
	border-radius: 14px;
}

.mm-description-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.mm-description-content th,
.mm-description-content td {
	padding: 10px 12px;
	border-bottom: 1px solid rgba(18, 63, 47, 0.12);
	text-align: start;
}

/* ------------------------------------------------------------------ *
 * Tabs and detail blocks
 * ------------------------------------------------------------------ */

.mm-tabs {
	margin: 48px 0 0;
}

.mm-tabs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 22px;
	padding: 0 0 14px;
	list-style: none;
	border-bottom: 1px solid rgba(18, 63, 47, 0.12);
}

.mm-tabs__btn {
	padding: 9px 18px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: rgba(23, 37, 31, 0.7);
	font-family: var(--mm-sans);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--mm-ease, 150ms ease), color var(--mm-ease, 150ms ease);
}

.mm-tabs__btn:hover {
	color: var(--mm-forest, #123f2f);
	background: rgba(24, 88, 61, 0.07);
}

.mm-tabs__btn[aria-selected="true"] {
	background: var(--mm-forest, #123f2f);
	border-color: var(--mm-forest, #123f2f);
	color: #fff;
}

.mm-tabs__btn:focus-visible {
	outline: 2px solid var(--mm-green, #18583d);
	outline-offset: 2px;
}

.mm-tabs__panel {
	font-family: var(--mm-sans);
	font-size: 15px;
	line-height: 1.7;
	color: var(--mm-text, #17251f);
}

.mm-tabs__panel[hidden] {
	display: none;
}

.mm-tabs__panel > :first-child {
	margin-top: 0;
}

.mm-details {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
	gap: 36px;
	align-items: start;
}

.mm-specs {
	width: 100%;
	border-collapse: collapse;
	border-radius: 14px;
	overflow: hidden;
	background: var(--mm-sage, #e8efdf);
	font-family: var(--mm-sans);
	font-size: 13.5px;
}

.mm-specs th,
.mm-specs td {
	padding: 12px 16px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid rgba(18, 63, 47, 0.1);
}

.mm-specs tr:last-child th,
.mm-specs tr:last-child td {
	border-bottom: 0;
}

.mm-specs th {
	font-weight: 600;
	color: var(--mm-forest, #123f2f);
	white-space: nowrap;
	width: 42%;
}

.mm-specs td {
	color: var(--mm-text, #17251f);
}

.mm-related {
	margin: 56px 0 0;
	padding-top: 36px;
	border-top: 1px solid rgba(18, 63, 47, 0.12);
}

.mm-related__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
}

.mm-related__title {
	margin: 0;
	font-family: var(--mm-serif);
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 600;
	color: var(--mm-forest, #123f2f);
}

.mm-related__more {
	font-family: var(--mm-sans);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--mm-green, #18583d);
	text-decoration: none;
}

.mm-related__more:hover {
	text-decoration: underline;
}

.mm-related__grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mm-pcard {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(18, 63, 47, 0.1);
	border-radius: 16px;
	background: var(--mm-white, #fff);
	overflow: hidden;
	transition: transform var(--mm-ease, 150ms ease), box-shadow var(--mm-ease, 150ms ease);
}

.mm-pcard:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px rgba(18, 63, 47, 0.1);
}

.mm-pcard__media {
	display: block;
	background: var(--mm-cream, #f7f5f0);
}

.mm-pcard__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.mm-pcard__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 14px 16px;
	flex: 1 1 auto;
}

.mm-pcard__title {
	margin: 0;
	font-family: var(--mm-sans);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.4;
}

.mm-pcard__title a {
	color: var(--mm-forest, #123f2f);
	text-decoration: none;
}

.mm-pcard__title a:hover {
	text-decoration: underline;
}

.mm-pcard__skill {
	margin: 0;
	font-family: var(--mm-sans);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mm-green, #18583d);
}

.mm-pcard__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 8px;
}

.mm-pcard__price {
	font-family: var(--mm-sans);
	font-size: 14px;
	font-weight: 700;
	color: var(--mm-forest, #123f2f);
}

.mm-pcard__price del {
	font-weight: 400;
	opacity: 0.5;
	margin-right: 6px;
}

.mm-pcard__cart {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--mm-sage, #e8efdf);
	color: var(--mm-forest, #123f2f);
	text-decoration: none;
	flex: 0 0 auto;
	transition: background var(--mm-ease, 150ms ease), color var(--mm-ease, 150ms ease);
}

.mm-pcard__cart:hover,
.mm-pcard__cart:focus-visible {
	background: var(--mm-forest, #123f2f);
	color: #fff;
	outline: none;
}

.mm-pcard__cart .mm-icon {
	width: 16px;
	height: 16px;
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 1100px) {
	.mm-product {
		gap: 32px;
	}

	.mm-related__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.mm-product,
	.mm-product--no-gallery {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
		max-width: none;
	}

	.mm-product__gallery {
		position: static;
		top: auto;
	}

	.mm-details {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.mm-gallery__thumbs {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
		scrollbar-width: thin;
	}

	.mm-gallery__thumbs li {
		/* Share the available width so a typical 5-image gallery fits without
		   scrolling; 44px keeps the tap target usable, and beyond ~6 images the
		   strip becomes scrollable again. */
		flex: 1 1 0;
		min-width: 44px;
		scroll-snap-align: start;
	}

	.mm-trust {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 12px;
	}

	.mm-trust li {
		flex-direction: column;
		gap: 5px;
		min-height: 58px;
		border-inline-start: 0;
		font-size: 12.5px;
		text-align: center;
		white-space: normal;
	}
}

@media (max-width: 640px) {
	.mm-gallery__stage {
		border-radius: 14px;
	}

	.mm-gallery__nav {
		width: 36px;
		height: 36px;
		margin-top: -18px;
	}

	.mm-gallery__nav--prev {
		left: 10px;
	}

	.mm-gallery__nav--next {
		right: 10px;
	}

	.mm-gallery__badge {
		top: 10px;
		left: 10px;
		padding: 6px 11px;
		font-size: 10px;
	}

	.mm-gallery__zoom {
		top: 10px;
		right: 10px;
		width: 32px;
		height: 32px;
	}

	.mm-buy__row {
		flex-direction: column;
	}

	.mm-buy__row .mm-btn {
		width: 100%;
		flex: 1 1 auto;
	}

	.mm-trust {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 12px;
		padding-inline: 14px;
	}

	.mm-product-trustband {
		margin-bottom: 0;
		padding-block: 14px;
	}

	.mm-trust li {
		flex-direction: column;
		gap: 5px;
		min-height: 58px;
		padding-inline: 8px;
		border-inline-start: 0;
		font-size: 12px;
		text-align: center;
		white-space: normal;
	}

	.mm-trust .mm-icon {
		width: 20px;
		height: 20px;
	}

	.mm-related__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.mm-tabs {
		margin-top: 34px;
	}

	.mm-tabs__list {
		gap: 6px;
		/* Wrap rather than scroll so every tab is visible without horizontal
		   movement, and nothing extends past the viewport. */
		flex-wrap: wrap;
		overflow-x: visible;
	}

	.mm-tabs__btn {
		white-space: nowrap;
		padding: 8px 14px;
		font-size: 12.5px;
	}

	.mm-specs th,
	.mm-specs td {
		padding: 10px 12px;
		font-size: 12.5px;
	}

	.mm-specs th {
		width: 46%;
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mm-gallery__track {
		transition: none;
	}

	.mm-pcard {
		transition: none;
	}
}

/*
 * The sticky Buy Now bar is fixed to the bottom of the viewport on handset and
 * tablet widths, so without extra space at the end of the document it covers the
 * last line of the footer. Scoped to single-product views; the global footer CSS
 * is untouched.
 */
@media (max-width: 820px) {
	body.single-product {
		padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
	}
}
