/* Single product: gallery, add-to-cart form, swatches, summary boxes, accordions. */

/* Gallery: fixed-height frames (aspect-ratio inside a Swiper sizes circularly). */
.tk-gallery { --tk-gallery-h: calc((100vw - 2 * var(--site-gutter) - var(--wp--preset--spacing--columns-wide)) / 2); }
@media (min-width: 1440px) { .tk-gallery { --tk-gallery-h: 610px; } }
@media (max-width: 767px) { .tk-gallery { --tk-gallery-h: calc((100vw - 2 * var(--site-gutter)) * .77); } }

.tk-gallery__stage { position: relative; }
.tk-gallery__main { overflow: hidden; }
.tk-gallery__frame {
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--tk-gallery-h);
	padding: 0 35px;
	background: var(--wp--preset--color--background);
}
.tk-gallery__frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.tk-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	margin-top: -25px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--border-subtle);
	border-radius: 50%;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
	cursor: pointer;
	transition: border-color .2s;
}
.tk-gallery__arrow:hover { border-color: var(--wp--preset--color--accent); }
.tk-gallery__arrow svg { width: 16px; height: 16px; }
.tk-gallery__prev { left: -25px; }
.tk-gallery__next { right: -25px; }
@media (max-width: 767px) {
	.tk-gallery__prev { left: 0; }
	.tk-gallery__next { right: 0; }
}
.tk-gallery__arrow.swiper-button-disabled { opacity: .35; cursor: default; }

.tk-gallery__thumbs { position: relative; margin-top: 10px; }
.tk-gallery__thumbs .swiper-slide { cursor: pointer; }
.tk-gallery__thumbs img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: contain;
	border: 1px solid transparent;
	opacity: .5;
	transition: opacity .2s, border-color .2s;
}
.tk-gallery__thumbs :is(.swiper-slide-thumb-active, .swiper-slide:hover) img { opacity: 1; }
.tk-gallery__thumbs .swiper-slide-thumb-active img { border-color: var(--wp--preset--color--border); }
.tk-gallery__thumbs-arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 30px;
	margin-top: -15px;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
	cursor: pointer;
}
.tk-gallery__thumbs-arrow svg { width: 14px; height: 14px; }
.tk-gallery__thumbs-prev { left: 0; }
.tk-gallery__thumbs-next { right: 0; }
.tk-gallery__thumbs-arrow.swiper-button-disabled,
.tk-gallery__thumbs-arrow.swiper-button-lock { display: none; }

@media (min-width: 768px) {
	.tk-product__gallery {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--scroll-offset, 139px) + 15px);
	}
}

/* Summary */
.tk-breadcrumb .woocommerce-breadcrumb a { color: inherit; }
.tk-product__brand img { max-width: 100%; }
.tk-product__phone p { margin: 0; }
.tk-product__phone a { color: var(--wp--preset--color--accent); }
.tk-product__stock {
	border: 1px solid var(--wp--preset--color--success-light);
	background: var(--wp--preset--color--background);
}
.tk-product__stock:is(.nomon-stock--backorder, .nomon-stock--out) { border-color: transparent; }

/* Add-to-cart form */
.tk-product__cart form.cart { gap: 20px 10px; }
.tk-product__cart :is(form.cart, .woocommerce-variation-add-to-cart) > .single_add_to_cart_button { flex: 1 0 100%; }
.tk-product__cart .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 10px;
}
.tk-product__cart .woocommerce-variation-add-to-cart > :not(.quantity):not(.single_add_to_cart_button) { flex: 1 0 100%; }
.tk-product__cart form.cart .quantity {
	flex: 0 0 auto;
	align-self: flex-start;
	height: 33px;
}
.tk-product__cart form.cart .quantity:not(.nomon-qty--ready) { height: auto; }
.tk-product__cart .nomon-qty-btn svg { opacity: .75; }
.tk-product__cart .nomon-qty-value { width: 43px; min-width: 0; font-size: var(--wp--preset--font-size--body); }
.tk-product__cart .single_add_to_cart_button {
	width: 100%;
	padding: 19.5px 15px;
	border: 2px solid var(--wp--preset--color--pink);
	border-radius: var(--radius-control, 5px);
	background: var(--wp--preset--color--pink);
	color: var(--wp--preset--color--background);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.tk-product__cart .single_add_to_cart_button:is(:hover, :focus-visible):not(.disabled) {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--pink);
}
.tk-product__cart .single_add_to_cart_button.disabled { opacity: .6; cursor: not-allowed; }

/* Variations: label row above the swatches, WooCommerce's select kept for state. */
.tk-product__cart table.variations { width: 100%; margin: 0; border-collapse: collapse; }
.tk-product__cart table.variations :is(tbody, tr, th, td) { display: block; padding: 0; border: 0; background: none; text-align: left; }
.tk-product__cart table.variations tr + tr { margin-top: 20px; }
.tk-product__cart table.variations th {
	margin-bottom: 10px;
	font-size: var(--wp--preset--font-size--body-s);
	font-weight: 400;
}
.tk-product__cart table.variations label { font-weight: 400; }
.tk-swatch-chosen { font-weight: 500; }
.tk-product__cart table.variations select {
	max-width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--radius-control, 5px);
	background: var(--wp--preset--color--background);
	font: inherit;
}
.tk-product__cart table.variations select.tk-swatches-select {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.tk-product__cart .reset_variations,
.tk-product__cart .woocommerce-variation-price,
.tk-product__cart .woocommerce-variation-description { display: none !important; }
.tk-product__cart .woocommerce-variation-availability { font-size: var(--wp--preset--font-size--caption); }
.tk-product__cart .woocommerce-variation-availability p { margin: 0; }

.tk-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tk-swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--radius-control, 5px);
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
	font-family: inherit;
	cursor: pointer;
	transition: border-color .2s, background-color .2s, color .2s;
}
.tk-swatch--text {
	min-height: 40px;
	padding: 5px 15px;
	font-size: var(--wp--preset--font-size--body-s);
	font-weight: 500;
	line-height: 1.3;
	text-transform: uppercase;
}
.tk-swatch--image { width: 85px; height: 85px; overflow: hidden; }
.tk-swatch--image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tk-swatch:hover:not(:disabled) { border-color: var(--wp--preset--color--accent); }
.tk-swatch[aria-checked="true"] { border: 2px solid var(--wp--preset--color--accent); }
.tk-swatch--text[aria-checked="true"] { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--background); }
.tk-swatch:disabled { opacity: .35; cursor: not-allowed; }

/* Accordions */
.tk-accordion__summary::-webkit-details-marker { display: none; }
.tk-accordion__summary { border-bottom: 1px solid var(--wp--preset--color--border-subtle); }
.tk-accordion[open] .tk-accordion__icon { transform: rotate(180deg); }
.tk-accordion__panel > :first-child { margin-top: 0; }
.tk-accordion__panel > :last-child { margin-bottom: 0; }
.tk-accordion__panel :is(p, ul, ol) { margin-block: 0 15px; }
.tk-accordion__panel :is(img, iframe, video, figure, embed, object) { max-width: 100%; }
.tk-accordion__panel :is(img, video) { height: auto; }
.tk-accordion__panel a { color: var(--wp--preset--color--accent); }

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

/* Product builder (plugin output; colours come from the plugin options, not from here). */
.nmnwcpo-product-builder-wrapper { font-family: inherit; }
.nmnwcpo-product-builder-title {
	font-family: var(--wp--preset--font-family--poppins);
	font-weight: 400;
	line-height: 1.4;
}
.nmnwcpo-product-builder-wrapper .nmnwcpo-content-area { min-width: 0; overflow-wrap: anywhere; }
/* Legacy rows show no "n varastossa" line; out-of-stock and backorder lines stay. */
.nmnwcpo-product-builder-wrapper [class*="-stock"]:has(> .nmnwcpo-stock-wrapper > .in-stock) { display: none; }
.nmnwcpo-modal { z-index: var(--z-modal) !important; font-family: inherit; }
.nmnwcpo-modal :is(h2, h3) { margin: 0; font-weight: 600; }
/* The whole description shows as on legacy; the modal itself scrolls when it is taller than the screen. */
.nmnwcpo-modal .nmnwcpo-product-description { max-height: none; overflow: visible; }
.nmnwcpo-modal .nmnwcpo-product-description p { margin-top: 0; }
/* Colours come from the plugin option (`nmnwcpb_modal_button_color`); the theme only sets the shape. */
.nmnwcpo-modal .nmnwcpo-modal-body a.view-product {
	display: block;
	padding: 18px 15px;
	border-radius: var(--radius-control, 5px);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 500;
	line-height: 1.7;
	text-align: center;
	text-decoration: none;
}
