/*
 * Make-Up Show — single product page: gallery, buy box, swatches,
 * quantity, tabs, related products. Loaded on product pages only.
 *
 * Author: Bilal Yasin — https://bilalyasindev.com
 */

/* =========================================================
   LAYOUT
   ========================================================= */
.ms-product {
	display: grid;
	gap: 3rem;
	padding-top: 3rem;
	padding-bottom: 7rem; /* room for the fixed "add to cart" bar on mobile */
}

@media (min-width: 1024px) {
	.ms-product {
		grid-template-columns: repeat(2, 1fr);
		padding-bottom: 3rem;
	}
}

.ms-product :where(fieldset) {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.ms-product legend {
	padding: 0;
}

/* Notices (added to cart, errors) */
.ms-product-notices .woocommerce-notices-wrapper:not(:empty) {
	padding-top: 2rem;
}

.ms-product-notices .woocommerce-message,
.ms-product-notices .woocommerce-info,
.ms-product-notices .woocommerce-error {
	margin: 0;
}

/* =========================================================
   GALLERY
   ========================================================= */
.ms-gallery__main {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--ms-ink);
}

.ms-gallery__main img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ms-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.75rem;
	margin-top: 0.75rem;
}

.ms-gallery__thumb {
	display: block;
	aspect-ratio: 1 / 1;
	padding: 0;
	overflow: hidden;
	background: none;
	border: 2px solid transparent;
	cursor: pointer;
}

.ms-gallery__thumb[aria-current="true"] {
	border-color: var(--ms-fuchsia);
}

.ms-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* =========================================================
   BUY BOX
   ========================================================= */
.ms-product__summary > .ms-eyebrow {
	margin: 0;
}

.ms-product__title {
	margin: 0.5rem 0 0;
	font-family: var(--ms-font-serif);
	font-weight: 400;
	font-size: 1.875rem;
	line-height: 2.25rem;
}

.ms-product__sku {
	margin: 0.25rem 0 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 0.75rem;
	line-height: 1rem;
	color: var(--ms-text-muted);
}

.ms-product__price {
	margin: 1.25rem 0 0;
	font-size: 1.5rem;
	line-height: 2rem;
	font-weight: 600;
}

.ms-product__price small,
.ms-product__price .woocommerce-price-suffix {
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 400;
	color: var(--ms-text-muted);
}

.ms-product__price del {
	margin-right: 0.25rem;
	font-size: 1.125rem;
	font-weight: 400;
	color: var(--ms-text-muted);
}

.ms-product__price ins {
	text-decoration: none;
	color: var(--ms-fuchsia);
}

.ms-product__status {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1rem;
	font-size: 0.875rem;
	line-height: 1.4286; /* relative, so the badge keeps its own height */
}

.ms-tag--success {
	color: #007e46;
	background: #d2f6dd;
}

.ms-product__short {
	margin-top: 1.25rem;
	font-size: 0.875rem;
	line-height: 1.625;
	color: var(--ms-text-muted);
}

/* Variation attribute (swatches or text options) */
.ms-option {
	margin-top: 2rem;
}

.ms-option__title {
	display: block;
	margin-bottom: 0.75rem;
	color: var(--ms-ink);
}

.ms-option__current {
	text-transform: none;
	letter-spacing: normal;
	color: var(--ms-text-muted);
}

.ms-option__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.ms-option__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.ms-swatch {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 2px solid var(--ms-border);
	border-radius: 50%;
	cursor: pointer;
}

.ms-swatch__color {
	display: block;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
}

.ms-option__input:checked + .ms-swatch {
	border-color: var(--ms-ink);
}

.ms-option__input:focus-visible + .ms-swatch,
.ms-option__input:focus-visible + .ms-pill {
	outline: 2px solid var(--ms-fuchsia);
	outline-offset: 2px;
}

.ms-option__input:disabled + .ms-swatch,
.ms-option__input:disabled + .ms-pill {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Text option (attributes without a colour) */
.ms-pill {
	display: flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0 1rem;
	font-size: 0.8rem;
	border: 1px solid var(--ms-border);
	cursor: pointer;
}

.ms-option__input:checked + .ms-pill {
	border-color: var(--ms-ink);
	box-shadow: inset 0 0 0 1px var(--ms-ink);
}

/* Quantity stepper */
.ms-product__qty-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
}

/* Add to cart: fixed bar on mobile, inline on desktop */
.ms-product__buy {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 30;
	padding: 0.75rem;
	background: var(--ms-white);
	border-top: 1px solid var(--ms-border);
}

.ms-product__buy .ms-btn {
	width: 100%;
}

@media (min-width: 1024px) {
	.ms-product__buy {
		position: static;
		margin-top: 1.5rem;
		padding: 0;
		border: 0;
	}
}

/* =========================================================
   TABS
   ========================================================= */
.ms-tabs {
	margin-top: 2.5rem;
}

.ms-tabs__list {
	display: flex;
	align-items: center;
	width: 100%;
	height: 2.25rem;
	color: var(--ms-text-muted);
}

.ms-tabs__tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.25rem 0.75rem;
	font: inherit;
	font-size: 0.75rem;
	line-height: 1rem;
	font-weight: 500;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
	color: inherit;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	cursor: pointer;
}

.ms-tabs__tab[aria-selected="true"] {
	color: var(--ms-ink);
	border-bottom-color: var(--ms-fuchsia);
}

.ms-tabs__panel {
	margin-top: 0.5rem;
	padding-top: 1rem;
	font-size: 0.875rem;
	line-height: 1.625;
	color: var(--ms-text-muted);
}

.ms-tabs__panel > * {
	margin: 0;
}

.ms-tabs__panel > * + * {
	margin-top: 0.75rem;
}

.ms-tabs__panel a {
	color: var(--ms-fuchsia);
	text-decoration: underline;
}

/* =========================================================
   RELATED PRODUCTS
   ========================================================= */
.ms-related .ms-products {
	margin-top: 2rem;
}

@media (min-width: 768px) {
	.ms-related .ms-products {
		grid-template-columns: repeat(4, 1fr);
	}
}
