/*
Theme Name:   Miniture Child
Theme URI:    https://mebeles.lv
Description:  Child theme for Miniture — site-specific customizations.
Author:       Mebeles
Template:     miniture
Version:      1.0.1
Text Domain:  miniture-child
*/

/**
 * Material swatch hover preview.
 * Shows a larger fabric image above the swatch on hover.
 */
.woocommerce div.product form.variations_form table.variations td.value {
	overflow: visible;
}

.woo-variation-swatches [data-attribute_name="attribute_pa_material"] {
	overflow: visible;
}

.woo-variation-swatches [data-attribute_name="attribute_pa_material"] .variable-item {
	position: relative;
	overflow: visible;
}

.woo-variation-swatches [data-attribute_name="attribute_pa_material"] .variable-item .variable-item-contents {
	position: relative;
	overflow: visible;
}

.woo-variation-swatches [data-attribute_name="attribute_pa_material"] .variable-item .variable-item-contents::after {
	content: none;
}

.woo-variation-swatches [data-attribute_name="attribute_pa_material"] .variable-item:hover {
	z-index: 20;
}

.woo-variation-swatches [data-attribute_name="attribute_pa_material"] .variable-item .variable-item-image {
	transition: box-shadow 0.15s ease;
}

.woo-variation-swatches [data-attribute_name="attribute_pa_material"] .variable-item:hover .variable-item-contents::after,
.woo-variation-swatches [data-attribute_name="attribute_pa_material"] .variable-item:focus-visible .variable-item-contents::after {
	content: "";
	position: absolute;
	bottom: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%);
	width: 220px;
	height: 220px;
	max-width: min(280px, 50vw);
	max-height: min(280px, 50vh);
	background-color: #fff;
	background-image: var(--material-preview);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	padding: 8px;
	border: 1px solid #d9d9d9;
	border-radius: 4px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	z-index: 21;
	pointer-events: none;
}

/* Prefer image preview over the default text tooltip. */
.woo-variation-swatches.wvs-tooltip [data-attribute_name="attribute_pa_material"] .variable-item[data-wvstooltip]:hover::before,
.woo-variation-swatches.wvs-tooltip [data-attribute_name="attribute_pa_material"] .variable-item[data-wvstooltip]:hover::after {
	display: none;
}

/**
 * Material swatch groups on the product page.
 */
.miniture-material-swatches {
	width: 100%;
}

.miniture-material-swatches .miniture-material-group__label {
	margin: 0 0 0.625rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--site-heading-color, #111);
}

.miniture-material-swatches .variable-items-wrapper + .miniture-material-group__label {
	padding-top: 1rem;
	margin-top: 0.75rem;
	border-top: 1px solid var(--site-border-color, #e5e5e5);
}

.miniture-material-swatches .variable-items-wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	margin: 0;
	padding: 0;
}

/**
 * Light color swatches need a visible edge on white backgrounds.
 */
.woo-variation-swatches [data-attribute_name="attribute_pa_color"] .color-variable-item-white .variable-item-span-color,
.woo-variation-swatches [data-attribute_name="attribute_pa_color"] .color-variable-item-white-ivory .variable-item-span-color {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/**
 * Selected variation price replaces the top price interval.
 */
.woocommerce .product .price .miniture-product-price .woocommerce-Price-amount,
.woocommerce .product .price .miniture-product-price .woocommerce-Price-amount.amount {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.woocommerce .product .price .miniture-product-price ins {
	text-decoration: none;
}

/* WC 10.7 marks range amounts as aria-hidden; keep them visible for sighted users. */
.woocommerce .product .price .miniture-product-price [aria-hidden="true"] {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	clip-path: none;
}

.variations_form.miniture-top-price-synced .single_variation .woocommerce-variation-price {
	display: none;
}

/**
 * Uniform shop/catalog product thumbnail aspect ratio.
 * Source images vary widely (e.g. 452×452 vs 302×700); constrain the grid cell.
 */
ul.products:not(.product-list-display) .product .product-item .product-item__thumbnail {
	overflow: hidden;
}

ul.products:not(.product-list-display) .product .product-item .product-item__thumbnail-placeholder {
	aspect-ratio: 1 / 1;
	width: 100%;
	position: relative;
	overflow: hidden;
}

ul.products:not(.product-list-display) .product .product-item .product-item__thumbnail-placeholder a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
}

ul.products:not(.product-list-display) .product .product-item .product-item__thumbnail-placeholder a img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
	object-position: center;
}

/**
 * Single product page: cap main gallery image height (tall imports e.g. 302×1600).
 */
.single-product .kitify-product-images .woocommerce-product-gallery .flex-viewport {
	max-height: 700px !important;
	height: 700px !important;
}

.single-product .kitify-product-images .woocommerce-product-gallery .flex-viewport .woocommerce-product-gallery__image {
	float: left;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 700px;
	margin: 0;
	box-sizing: border-box;
}

.single-product .kitify-product-images .woocommerce-product-gallery .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 700px;
}

.single-product .kitify-product-images .woocommerce-product-gallery .woocommerce-product-gallery__image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.single-product .kitify-product-images .woocommerce-product-gallery .woocommerce-product-gallery__image img {
	max-height: 700px !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	object-fit: contain;
	margin: 0 auto;
}

/**
 * Single product gallery thumb strip: fixed cells for uncropped thumb images.
 */
.single-product .kitify-product-images .woocommerce-product-gallery .flex-control-thumbs li {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.single-product .kitify-product-images .woocommerce-product-gallery .flex-control-thumbs li img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain;
	object-position: center;
}
