/* =========================================================
   KD product detail layout 1.5.6
   Same horizontal edges as the site column (1440 / gutters).
   Left gallery and right buy box start on the same line.
   No stretched blank row between the description and the specs.
   ========================================================= */

:root {
	--kd-green: #246b50;
	--kd-green-dark: #194f3b;
	--kd-text: #1d332b;
	--kd-muted: #5c6d64;
	--kd-border: #dfe8e2;
	--kd-line: #d3dfd8;
	--kd-soft: #f5f9f6;
	--kd-shell: min(1440px, calc(100vw - 48px));
}

body.single-product .kd-product-top.wp-block-columns,
body.single-product main .kd-product-details,
body.single-product main .wp-block-shortcode:has(.kd-product-details) {
	box-sizing: border-box !important;
	width: var(--kd-shell) !important;
	max-width: var(--kd-shell) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	position: relative !important;
	left: auto !important;
	right: auto !important;
	float: none !important;
	transform: none !important;
}

body.single-product .wp-block-shortcode:has(.kd-product-details) > .kd-product-details {
	width: 100% !important;
	max-width: 100% !important;
}

/* Upper row: image and information. Each column is only as tall as its content. */
body.single-product .kd-product-top.wp-block-columns {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
	align-items: start !important;
	justify-content: stretch !important;
	gap: clamp(28px, 3.2vw, 48px) !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding: 0 !important;
}

body.single-product .kd-product-top > .wp-block-column {
	box-sizing: border-box !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	align-self: start !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	flex-basis: auto !important;
	flex-grow: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	height: auto !important;
}

body.single-product .kd-product-top .wp-block-woocommerce-product-image-gallery,
body.single-product .kd-product-top .woocommerce-product-gallery {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

/* The zoom layer is a 1600px absolute image. Clip it so phones
   cannot grow a blank band under the thumbnails. */
body.single-product .kd-product-top .woocommerce-product-gallery__image {
	overflow: hidden;
}

body.single-product .kd-product-top .woocommerce-product-gallery img.zoomImg {
	max-width: none;
	pointer-events: none;
}

body.single-product .kd-product-top .woocommerce-product-gallery__wrapper,
body.single-product .kd-product-top .woocommerce-product-gallery__image,
body.single-product .kd-product-top .woocommerce-product-gallery__image a {
	display: block;
	max-width: 100%;
}

body.single-product .kd-product-top .wp-block-woocommerce-product-image-gallery img,
body.single-product .kd-product-top .woocommerce-product-gallery img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	border-radius: 12px;
}

body.single-product .kd-product-top .flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 14px 0 0 !important;
	padding: 0 !important;
	list-style: none;
}

body.single-product .kd-product-top .flex-control-thumbs li {
	float: none !important;
	width: 74px !important;
	margin: 0 !important;
	list-style: none;
}

body.single-product .kd-product-top .flex-control-thumbs img {
	width: 100% !important;
	border-radius: 8px;
}

/* Quote panel follows the specs. Do not push it, or the info block, downward. */
body.single-product .kd-product-top > .wp-block-column:nth-child(2) > .wp-block-woocommerce-product-meta,
body.single-product .kd-product-top > .wp-block-column:nth-child(2) > .wp-block-html:has(.kd-product-quick-cta) {
	display: flex !important;
	flex-direction: column !important;
	margin-top: 12px !important;
	padding-top: 0 !important;
	border-top: 0 !important;
}

body.single-product .kd-product-top .wp-block-woocommerce-product-meta > .wp-block-group,
body.single-product .kd-product-top .product_meta,
body.single-product .kd-product-top .wp-block-post-terms {
	display: none !important;
}

body.single-product .kd-product-top .wp-block-post-title,
body.single-product .kd-product-top .product_title {
	margin: 0 0 8px !important;
	color: var(--kd-text);
	font-size: clamp(28px, 2.5vw, 38px);
	font-weight: 650;
	line-height: 1.2;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

body.single-product .kd-product-code {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	margin: 0 0 8px !important;
	color: var(--kd-text);
	font-size: 15px;
	line-height: 1.4;
}

body.single-product .kd-product-code__label {
	color: var(--kd-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body.single-product .kd-product-code__value {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

body.single-product .kd-product-top .kd-product-description,
body.single-product .kd-product-top .wp-block-post-excerpt,
body.single-product .kd-product-top .woocommerce-product-details__short-description {
	margin: 0 !important;
	margin-bottom: 4px !important;
	margin-block-end: 4px !important;
	color: var(--kd-muted);
	font-size: 15px;
	line-height: 1.55;
}

body.single-product .kd-product-description p,
body.single-product .kd-product-top .wp-block-post-excerpt p {
	margin: 0 0 8px;
}

body.single-product .kd-product-description p:last-child,
body.single-product .kd-product-top .wp-block-post-excerpt p:last-child {
	margin-bottom: 0;
}

body.single-product .kd-product-top .wp-block-woocommerce-product-price:empty,
body.single-product .kd-product-top .wc-block-components-product-price:empty {
	display: none !important;
}

body.single-product .kd-product-top .kd-product-info,
body.single-product .kd-product-top .wp-block-shortcode:has(.kd-product-info) {
	margin-top: 0 !important;
	margin-block-start: 0 !important;
}

body.single-product .kd-product-info,
body.single-product .kd-product-specs {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	margin: 0 0 8px !important;
	padding: 0;
	color: var(--kd-text);
}

body.single-product .kd-product-specs {
	margin-bottom: 0 !important;
}

body.single-product .kd-panel-title {
	margin: 0 0 6px !important;
	color: var(--kd-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

body.single-product .kd-product-info__copy {
	margin: 0 0 10px;
	color: var(--kd-muted);
	font-size: 14px;
	line-height: 1.65;
}

body.single-product .kd-product-info__copy p {
	margin: 0 0 8px;
}

body.single-product .kd-product-info__copy p:last-child {
	margin-bottom: 0;
}

body.single-product .kd-info-card {
	overflow: hidden;
	border: 1px solid var(--kd-border);
	border-radius: 8px;
	background: var(--kd-soft);
}

body.single-product .kd-info-row--wide {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 12px;
	margin: 0;
	padding: 8px 12px;
	border-bottom: 1px solid var(--kd-border);
}

body.single-product .kd-info-card > .kd-info-row--wide:last-child {
	border-bottom: 0;
}

body.single-product .kd-info-metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.single-product .kd-info-metric {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
	margin: 0;
	padding: 3px 10px;
	border-left: 1px solid var(--kd-border);
}

body.single-product .kd-info-metric:first-child {
	border-left: 0;
}

body.single-product .kd-info-label {
	color: var(--kd-muted);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
}

body.single-product .kd-info-metrics .kd-info-label,
body.single-product .kd-info-metrics .kd-info-value {
	line-height: 1.2;
}

body.single-product .kd-info-value {
	color: var(--kd-text);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

body.single-product .kd-spec-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: stretch;
	gap: 6px;
	margin: 0;
}

body.single-product .kd-spec-row {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 3px;
	min-width: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 6px 8px;
	border: 1px solid var(--kd-border);
	border-radius: 8px;
	background: var(--kd-soft);
}

body.single-product .kd-spec-row dt {
	margin: 0;
	color: var(--kd-muted);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.35;
}

body.single-product .kd-spec-row dd {
	min-width: 0;
	margin: 0;
	color: var(--kd-text);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

/* Quote panel sits on the bottom edge of the right column. */
body.single-product .kd-product-top .kd-product-quick-cta {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 10px 12px !important;
	border: 1px solid var(--kd-border);
	border-radius: 10px;
	background: var(--kd-soft);
}

body.single-product .kd-product-top .kd-product-quick-cta > p:first-child {
	margin: 0 0 6px !important;
	color: var(--kd-muted);
	font-size: 13px;
	line-height: 1.55;
}

body.single-product .kd-quote-button {
	display: flex;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 11px 16px;
	border: 1px solid var(--kd-green);
	border-radius: 6px;
	background: var(--kd-green);
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	text-decoration: none !important;
	cursor: pointer;
}

body.single-product .kd-quote-button:hover,
body.single-product .kd-quote-button:focus {
	border-color: var(--kd-green-dark);
	background: var(--kd-green-dark);
	color: #ffffff !important;
}

body.single-product .kd-product-top .kd-product-cta-note {
	margin: 8px 0 0 !important;
	color: var(--kd-muted);
	font-size: 12px;
	line-height: 1.5;
}

/* Lower details: same left/right edges, air, then the rule, then the title. */
body.single-product main .kd-product-details {
	margin-top: clamp(56px, 6vw, 80px) !important;
	margin-bottom: clamp(48px, 6vw, 80px) !important;
	padding: 28px 0 0 !important;
	border-top: 1px solid var(--kd-line) !important;
	color: var(--kd-text);
	font-size: 15px;
	line-height: 1.7;
}

body.single-product .kd-details-header {
	max-width: 760px;
	margin: 0 0 28px;
}

body.single-product .kd-details-kicker {
	margin: 0 0 8px;
	color: var(--kd-green);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

body.single-product .kd-details-title {
	margin: 0 0 10px !important;
	color: var(--kd-text) !important;
	font-size: clamp(32px, 3vw, 42px) !important;
	font-weight: 700 !important;
	line-height: 1.15 !important;
	letter-spacing: -0.025em;
}

body.single-product .kd-details-lead {
	margin: 0;
	color: var(--kd-muted);
	font-size: 16px;
	line-height: 1.6;
}

body.single-product .kd-detail-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: stretch;
	gap: 20px;
	margin: 0 0 20px;
}

body.single-product .kd-detail-section {
	box-sizing: border-box;
	min-width: 0;
	margin: 0 0 20px;
	padding: clamp(20px, 2.4vw, 28px);
	border: 1px solid var(--kd-border);
	border-radius: 12px;
	background: #ffffff;
	overflow-wrap: anywhere;
}

body.single-product .kd-detail-grid .kd-detail-section {
	height: 100%;
	margin: 0;
}

body.single-product .kd-detail-section h3 {
	margin: 0 0 12px;
	color: var(--kd-text);
	font-size: clamp(20px, 1.8vw, 24px);
	font-weight: 700;
	line-height: 1.3;
}

body.single-product .kd-detail-copy {
	color: var(--kd-muted);
	line-height: 1.75;
}

body.single-product .kd-detail-copy p {
	margin: 0 0 10px;
}

body.single-product .kd-detail-copy p:last-child {
	margin-bottom: 0;
}

body.single-product .kd-detail-copy ul,
body.single-product .kd-detail-copy ol {
	margin: 8px 0 0;
	padding-left: 20px;
}

body.single-product .kd-detail-copy li {
	margin: 0 0 8px;
}

body.single-product .kd-faq-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

body.single-product .kd-faq-item {
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--kd-border);
	border-radius: 9px;
	background: #ffffff;
}

body.single-product .kd-faq-item summary {
	position: relative;
	padding: 14px 28px 14px 0;
	color: var(--kd-text);
	font-size: 14px;
	font-weight: 650;
	line-height: 1.5;
	cursor: pointer;
	list-style: none;
}

body.single-product .kd-faq-item summary::-webkit-details-marker {
	display: none;
}

body.single-product .kd-faq-item summary::after {
	content: "+";
	position: absolute;
	top: 50%;
	right: 0;
	color: var(--kd-green);
	font-size: 22px;
	font-weight: 400;
	transform: translateY(-50%);
}

body.single-product .kd-faq-item[open] summary::after {
	content: "−";
}

body.single-product .kd-faq-answer {
	padding: 0 0 14px;
	color: var(--kd-muted);
	font-size: 13px;
	line-height: 1.7;
}

body.single-product .kd-faq-answer p {
	margin: 0;
}

body.single-product .kd-detail-section.kd-inquiry-section {
	margin-top: 8px;
	padding: clamp(24px, 3vw, 40px);
	border-color: #d3e3d9;
	background: var(--kd-soft);
}

body.single-product .kd-inquiry-content {
	max-width: 720px;
	margin: 0 auto;
	text-align: center;
}

body.single-product .kd-inquiry-content h3 {
	margin-bottom: 8px;
}

body.single-product .kd-inquiry-content > p {
	max-width: 640px;
	margin: 0 auto 16px;
	color: var(--kd-muted);
}

body.single-product .kd-inquiry-section .kd-quote-button {
	display: inline-flex;
	width: auto;
	min-width: min(100%, 280px);
	padding: 12px 22px;
}

body.single-product .kd-inquiry-email {
	margin: 12px 0 0 !important;
	font-size: 13px;
}

body.single-product .kd-inquiry-email a {
	color: var(--kd-green);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* The template's 50px top padding is the gap under the breadcrumb. */
body.single-product main.wp-block-group.has-global-padding {
	padding-top: 16px !important;
}

@media (max-width: 860px) {
	body.single-product .kd-product-top.wp-block-columns {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 16px !important;
	}

	body.single-product .kd-spec-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body.single-product .kd-product-top > .wp-block-column:nth-child(2) > .wp-block-woocommerce-product-meta,
	body.single-product .kd-product-top > .wp-block-column:nth-child(2) > .wp-block-html:has(.kd-product-quick-cta) {
		margin-top: 12px !important;
	}

	body.single-product .kd-detail-grid,
	body.single-product .kd-faq-list {
		grid-template-columns: minmax(0, 1fr);
	}

	body.single-product .kd-product-top .wp-block-post-title,
	body.single-product .kd-product-top .product_title {
		font-size: 30px;
	}
}

@media (max-width: 767px) {
	:root {
		--kd-shell: calc(100vw - 32px);
	}

	body.single-product main.wp-block-group.has-global-padding {
		padding-top: 8px !important;
	}

	body.single-product main .kd-product-details {
		margin-top: 28px !important;
		padding-top: 18px !important;
	}

	body.single-product .kd-details-title {
		font-size: 30px !important;
	}

	body.single-product .kd-details-header {
		margin-bottom: 20px;
	}

	body.single-product .kd-detail-section {
		padding: 18px;
	}

	body.single-product .kd-inquiry-section .kd-quote-button {
		width: 100%;
		min-width: 0;
	}
}

@media (max-width: 420px) {
	body.single-product .kd-info-metric {
		padding: 3px 8px;
	}

	body.single-product .kd-info-value {
		font-size: 13px;
	}

	body.single-product .kd-product-top .wp-block-post-title,
	body.single-product .kd-product-top .product_title {
		font-size: 26px;
	}

	body.single-product .kd-product-top .flex-control-thumbs li {
		width: 64px !important;
	}
}
