/**
 * Tekton — single product page (Customizer-driven).
 */

/* Gallery hidden — summary full width */
body.tekton-single-product-no-gallery .woocommerce div.product {
	grid-template-columns: 1fr !important;
}

/* Content width */
body.tekton-single-product-width-narrow .site-content .container {
	max-width: 960px;
}

body.tekton-single-product-width-wide .site-content .container {
	max-width: 1280px;
}

body.tekton-single-product-width-full .site-content .container {
	max-width: 100%;
	padding-left: clamp(16px, 3vw, 32px);
	padding-right: clamp(16px, 3vw, 32px);
}

/* Main product grid */
body.tekton-single-product .woocommerce div.product {
	display: grid;
	grid-template-columns: var(--tekton-product-gallery-width, 48%) var(--tekton-product-summary-width, 52%);
	gap: var(--tekton-product-grid-gap, 2.5rem);
	align-items: start;
	width: 100%;
	margin-bottom: 2.5rem;
}

body.tekton-single-product-layout-gallery-right .woocommerce div.product {
	grid-template-columns: var(--tekton-product-summary-width, 52%) var(--tekton-product-gallery-width, 48%);
}

body.tekton-single-product-layout-gallery-right .woocommerce div.product .woocommerce-product-gallery {
	order: 2;
}

body.tekton-single-product-layout-gallery-right .woocommerce div.product .summary {
	order: 1;
}

body.tekton-single-product-layout-stacked .woocommerce div.product,
body.tekton-single-product-layout-wide-gallery .woocommerce div.product {
	grid-template-columns: 1fr;
}

body.tekton-single-product-layout-wide-gallery .woocommerce div.product .woocommerce-product-gallery {
	width: 100%;
	max-width: 100%;
}

/* Summary spacing & typography */
body.tekton-single-product .woocommerce div.product .summary {
	display: flex;
	flex-direction: column;
	gap: var(--tekton-product-summary-gap, 24px);
}

body.tekton-single-product .woocommerce div.product .product_title {
	font-size: var(--tekton-product-title-size, 32px);
	line-height: 1.2;
	margin: 0;
}

body.tekton-single-product .woocommerce div.product p.price,
body.tekton-single-product .woocommerce div.product span.price {
	font-size: var(--tekton-product-price-size, 22px);
	margin: 0;
}

body.tekton-single-product .woocommerce div.product .woocommerce-product-rating {
	margin: 0;
}

body.tekton-single-product .woocommerce div.product .woocommerce-product-details__short-description {
	margin: 0;
}

body.tekton-single-product .woocommerce div.product form.cart {
	margin: 0;
}

body.tekton-single-product .woocommerce div.product .product_meta {
	margin: 0;
	font-size: 0.9rem;
}

/* Sticky summary (desktop) */
@media (min-width: 960px) {
	body.tekton-single-product-summary-sticky .woocommerce div.product .summary {
		position: sticky;
		top: calc(var(--tekton-header-offset-desktop, 80px) + 24px);
		align-self: start;
		max-height: calc(100vh - var(--tekton-header-offset-desktop, 80px) - 48px);
		overflow-y: auto;
	}
}

/* Hide quantity */
body.tekton-single-product-hide-quantity .woocommerce div.product form.cart .quantity {
	display: none !important;
}

/* Full-width add to cart */
body.tekton-single-product-btn-full .woocommerce div.product form.cart .button,
body.tekton-single-product-btn-full .woocommerce div.product form.cart button[type="submit"] {
	width: 100%;
	text-align: center;
	justify-content: center;
}

/* Tabs: accordion style */
body.tekton-single-product-tabs-accordion .woocommerce div.product .woocommerce-tabs ul.tabs {
	display: none !important;
}

body.tekton-single-product-tabs-accordion .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel,
body.tekton-single-product-tabs-accordion .woocommerce div.product .woocommerce-tabs .panel {
	display: block !important;
	visibility: visible !important;
	height: auto !important;
	overflow: visible !important;
	opacity: 1 !important;
	border: 1px solid var(--border-color, #e2e8f0);
	border-radius: 8px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 1rem;
}


/* Related & upsells */
body.tekton-single-product .woocommerce .related.products,
body.tekton-single-product .woocommerce .up-sells.upsells {
	margin-top: 2.5rem;
	clear: both;
}

body.tekton-single-product .woocommerce .related.products > h2,
body.tekton-single-product .woocommerce .up-sells.upsells > h2 {
	font-size: 1.35rem;
	margin-bottom: 1.25rem;
}

/* Mobile: always stacked */
@media (max-width: 959px) {
	body.tekton-single-product .woocommerce div.product {
		grid-template-columns: 1fr !important;
		gap: 1.5rem;
	}

	body.tekton-single-product-layout-gallery-right .woocommerce div.product .woocommerce-product-gallery,
	body.tekton-single-product-layout-gallery-right .woocommerce div.product .summary {
		order: unset;
	}

	body.tekton-single-product-summary-sticky .woocommerce div.product .summary {
		position: static;
		max-height: none;
		overflow: visible;
	}
}
