/*
 * Product detail refinements for the approved v0.6 layout.
 * The template also uses native block styles for its basic presentation.
 * Loaded on product pages by functions.php, after the shared storefront styles.
 */
.single-product .kotto-product-page,
.single-product .kotto-product-header {
	--kotto-paper: #f8f7f3;
	--kotto-white: #fffefb;
	--kotto-ink: #1d2925;
	--kotto-forest: #163c32;
	--kotto-gold: #94794c;
	--kotto-line: #dcdcd5;
	--kotto-soft: #eeede8;
	--kotto-muted: #6b716b;
	--kotto-serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
	--kotto-sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
	box-sizing: border-box;
	background: var(--kotto-paper);
	color: var(--kotto-ink);
	font-family: var(--kotto-sans);
	letter-spacing: 0.02em;
}

.single-product .kotto-product-page *,
.single-product .kotto-product-header * {
	box-sizing: border-box;
}

.single-product .kotto-product-page a,
.single-product .kotto-product-header a {
	color: var(--kotto-forest);
	text-underline-offset: 0.2em;
}

.single-product .kotto-product-header .wp-block-site-title a,
.single-product .kotto-product-page .kotto-product-related .wp-block-post-title a {
	text-decoration: none;
}

.single-product .kotto-product-page :is(a, button, input, select, textarea):focus-visible,
.single-product .kotto-product-header a:focus-visible {
	outline: 2px solid var(--kotto-gold);
	outline-offset: 3px;
}

.single-product .kotto-product-page .woocommerce-breadcrumb {
	margin: 0 0 1.875rem;
	color: var(--kotto-muted);
	font-size: 0.6875rem;
}

.single-product .kotto-product-page .kotto-product-main > .wp-block-column {
	min-width: 0;
}

.single-product .kotto-product-page .kotto-product-gallery .woocommerce-product-gallery {
	float: none;
	width: 100%;
	margin: 0;
}

.single-product .kotto-product-page .kotto-product-gallery .woocommerce-product-gallery__wrapper {
	margin: 0;
	background: var(--kotto-soft);
}

.single-product .kotto-product-page .kotto-product-gallery .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: auto;
}

.single-product .kotto-product-page .kotto-product-gallery .flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0.875rem 0 0;
	padding: 0;
	list-style: none;
}

.single-product .kotto-product-page .kotto-product-gallery .flex-control-thumbs li {
	float: none;
	width: 4.5625rem;
	margin: 0;
}

.single-product .kotto-product-page .kotto-product-gallery .flex-control-thumbs img {
	display: block;
	width: 100%;
	height: 4.5625rem;
	border: 1px solid var(--kotto-line);
	background: var(--kotto-white);
	object-fit: contain;
	opacity: 1;
}

.single-product .kotto-product-page .kotto-product-gallery .flex-control-thumbs img.flex-active {
	border-color: var(--kotto-gold);
	opacity: 1;
}

.single-product .kotto-product-page .kotto-product-overview .wp-block-post-title {
	overflow-wrap: anywhere;
}

.single-product .kotto-product-page .kotto-product-overview .kotto-product-title--long {
	word-break: normal;
	line-break: strict;
	text-wrap: balance;
}

.single-product .kotto-product-page .kotto-product-overview .wp-block-post-excerpt p {
	margin: 0;
}

.single-product .kotto-product-page .kotto-product-purchase .price {
	color: var(--kotto-forest);
	font-size: 1.375rem;
	font-weight: 500;
}

.single-product .kotto-product-page .kotto-product-purchase .stock {
	margin: 0.75rem 0;
	color: var(--kotto-forest);
	font-size: 0.75rem;
}

.single-product .kotto-product-page .kotto-product-purchase .out-of-stock {
	color: var(--kotto-muted);
}

.single-product .kotto-product-page .kotto-product-purchase form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 1rem 0 0;
}

.single-product .kotto-product-page .kotto-product-purchase form.variations_form,
.single-product .kotto-product-page .kotto-product-purchase form.grouped_form {
	display: block;
}

.single-product .kotto-product-page .kotto-product-purchase .quantity {
	float: none;
	margin: 0;
}

.single-product .kotto-product-page .kotto-product-purchase .quantity .qty {
	min-height: 2.875rem;
	border: 1px solid var(--kotto-line);
	background: var(--kotto-white);
	color: var(--kotto-ink);
}

.single-product .kotto-product-page .kotto-product-purchase .single_add_to_cart_button {
	min-height: 2.875rem;
	margin: 0;
	padding: 0.8125rem 1.25rem;
	border: 1px solid var(--kotto-forest);
	border-radius: 0;
	background: var(--kotto-forest);
	box-shadow: none;
	color: var(--kotto-white);
	font-family: var(--kotto-sans);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.5;
}

.single-product .kotto-product-page .kotto-product-purchase .single_add_to_cart_button:hover {
	background: #244f42;
	color: var(--kotto-white);
}

.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs {
	display: flex;
	gap: 1.875rem;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	border-bottom: 1px solid var(--kotto-line);
	list-style: none;
}

.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs::before,
.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs li::before,
.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs li {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 1rem 0;
	border-bottom: 2px solid transparent;
	color: var(--kotto-muted);
	font-size: 0.8125rem;
	font-weight: 400;
	text-decoration: none;
}

.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs li.active a {
	border-bottom-color: var(--kotto-forest);
	color: var(--kotto-forest);
	font-weight: 600;
}

.single-product .kotto-product-page .kotto-product-information .woocommerce-Tabs-panel {
	margin: 0;
	padding: 2.1875rem 0;
	font-size: 0.875rem;
	line-height: 2.1;
	overflow-wrap: anywhere;
}

.single-product .kotto-product-page .kotto-product-information .woocommerce-Tabs-panel h2 {
	margin: 0 0 1rem;
	font-family: var(--kotto-serif);
	font-size: 1.8125rem;
	font-weight: 500;
	line-height: 1.65;
}

.single-product .kotto-product-page .kotto-product-information table.shop_attributes {
	width: 100%;
	border-collapse: collapse;
	border-top: 1px solid var(--kotto-line);
	font-size: 0.75rem;
	line-height: 1.7;
}

.single-product .kotto-product-page .kotto-product-information table.shop_attributes th,
.single-product .kotto-product-page .kotto-product-information table.shop_attributes td {
	padding: 0.75rem 0;
	border: 0;
	border-bottom: 1px solid var(--kotto-line);
	background: transparent;
	font-style: normal;
	text-align: left;
	vertical-align: top;
	overflow-wrap: anywhere;
}

.single-product .kotto-product-page .kotto-product-information table.shop_attributes th {
	width: 9rem;
	padding-right: 1.125rem;
	color: var(--kotto-muted);
	font-weight: 400;
}

.single-product .kotto-product-page .kotto-product-information table.shop_attributes td p {
	margin: 0;
	padding: 0;
}

.single-product .kotto-product-page .kotto-product-related .wc-block-product-template {
	gap: 1.375rem;
}

.single-product .kotto-product-page .kotto-product-related .wc-block-product {
	min-width: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.single-product .kotto-product-page .kotto-product-related .wc-block-components-product-image img {
	background: var(--kotto-soft);
	object-fit: contain;
}

.single-product .kotto-product-page .kotto-product-related .wp-block-post-title {
	overflow-wrap: anywhere;
}

@media (max-width: 781px) {
	.single-product .kotto-product-page .kotto-product-main {
		gap: 1.8125rem;
	}

	.single-product .kotto-product-page .kotto-product-gallery .flex-control-thumbs li {
		width: 4.125rem;
	}

	.single-product .kotto-product-page .kotto-product-gallery .flex-control-thumbs img {
		height: 4.125rem;
	}

	.single-product .kotto-product-page .kotto-product-information .woocommerce-tabs ul.tabs {
		gap: 1.25rem;
	}

	.single-product .kotto-product-page .kotto-product-information .woocommerce-Tabs-panel {
		padding-top: 1.75rem;
	}

	.single-product .kotto-product-page .kotto-product-information table.shop_attributes th {
		width: 36%;
	}

	.single-product .kotto-product-page .kotto-product-related .wc-block-product-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.625rem 0.75rem;
	}
}

/* Use CSS for fluid gaps: WordPress sanitizes clamp() out of blockGap values. */
.single-product .kotto-product-page .kotto-product-main {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr);
	gap: clamp(1.875rem, 5vw, 4.125rem);
	align-items: start;
}
.single-product .kotto-product-page .kotto-product-gallery .wp-block-woocommerce-product-image-gallery {
	width: 100%;
	max-width: none;
}
.single-product .kotto-product-page .kotto-product-main .kotto-product-gallery .flex-control-thumbs li {
	width: 73px;
}
.single-product .kotto-product-page .kotto-product-facts {
	margin: 28px 0;
	border-top: 1px solid var(--kotto-line);
}
.single-product .kotto-product-page .kotto-product-facts > div {
	display: grid;
	grid-template-columns: 125px minmax(0, 1fr);
	gap: 18px;
	padding: 12px 0;
	border-bottom: 1px solid var(--kotto-line);
	font-size: 12px;
	line-height: 1.7;
}
.single-product .kotto-product-page .kotto-product-facts dt { color: var(--kotto-muted); }
.single-product .kotto-product-page .kotto-product-facts dd { margin: 0; overflow-wrap: anywhere; }
.single-product .kotto-product-page .kotto-product-context { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; margin-top: 18px; }
.single-product .kotto-product-page .kotto-product-context .kotto-text-link { font-size: 12px; }
.single-product .kotto-product-page .kotto-product-data-note { margin: 14px 0 0; color: var(--kotto-muted); font-size: 12px; line-height: 1.8; }
.single-product .kotto-product-page .kotto-related-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.single-product .kotto-product-page .kotto-related-heading .kotto-section-title { margin-bottom: 0; }
.single-product .kotto-product-page .kotto-related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.single-product .kotto-product-page .kotto-empty-related { color: var(--kotto-muted); font-size: 13px; }
@media (max-width: 781px) {
	.single-product .kotto-product-page .kotto-product-main { grid-template-columns: minmax(0, 1fr); gap: 29px; }
	.single-product .kotto-product-page .kotto-product-main .kotto-product-gallery .flex-control-thumbs li { width: 66px; }
	.single-product .kotto-product-page .kotto-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
	.single-product .kotto-product-page .kotto-product-facts > div { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
	.single-product .kotto-product-page .kotto-related-heading { align-items: start; flex-direction: column; }
}
@media (max-width:359px) {
	.single-product .kotto-product-page .kotto-related-grid { grid-template-columns: minmax(0,1fr); }
}
