/*
Whiteplate — Single product polish (U4 / Brand Book)
Version: 0.33.1
Scope: body.single-product only. Classic Woo/WoodMart single (Marketplace
Elementor layout 12361 drafted so this shell wins). Full-width + padding-inline.
Does NOT rebuild Elementor homepage.

0.33.1 — Tabs visible (override WD mobile hide of .tabs-layout-tabs);
         Brand Book reviews/rating/form; calmer titles; br-only textareas
         cleaned in PHP (legacy nopCommerce HTML in descriptions).
0.32.0 — WoodMart wd-grid: wrap is 12-col, summary shell --wd-col-lg:9
(empty sidebar gutter), children span 6 inside our 2-col grid → implicit
tiny tracks (~188px) + left waste. Force full-row 2-col gallery+summary.
*/

/* ---- Tokens / shell --------------------------------------------------- */
body.single-product.whiteplate-shop-surface {
	--wp-gutter-x: clamp(16px, 3vw, 40px);
	--wp-green: #687049;
	--wp-green-2: #55603c;
	--wp-orange: #FF5F23;
	--wp-orange-2: #E04E1A;
	--wp-sand: #DFDBCF;
	--wp-soil: #A1927D;
	--wp-ink: #333333;
	--wp-muted: #6B645A;
	--wp-line: #E5E0D6;
	--wp-radius: 16px;
	background: var(--wp-bg, #F7F5F0);
	color: var(--wp-ink);
}

body.single-product.whiteplate-shop-surface .wd-page-content.main-page-wrapper,
body.single-product.whiteplate-shop-surface .wd-content-area.site-content,
body.single-product.whiteplate-shop-surface .wd-content-area {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}

body.single-product.whiteplate-shop-surface .wd-content-area.site-content,
body.single-product.whiteplate-shop-surface .single-product-page {
	padding-inline: var(--wp-gutter-x);
	box-sizing: border-box;
}

body.single-product.whiteplate-shop-surface .wd-content-area.site-content .single-product-page {
	padding-inline: 0;
}

body.single-product.whiteplate-shop-surface .wd-content-area.site-content {
	padding-block: 18px 56px;
}

/* Soft card shell around the product core — full content width */
body.single-product .product-image-summary-wrap,
body.single-product .product-image-summary,
body.single-product div.product.type-product {
	max-width: none;
	width: 100%;
	margin-inline: 0;
	box-sizing: border-box;
}

body.single-product .product-image-summary-wrap,
body.single-product .wd-single-product-header,
body.single-product .woocommerce-tabs,
body.single-product .wd-single-tabs,
body.single-product .wd-accordion.wd-style-default {
	background: #fff;
	border: 1px solid var(--wp-line);
	border-radius: var(--wp-radius);
	box-shadow: 0 8px 28px rgba(51, 51, 51, 0.04);
}

body.single-product .product-image-summary-wrap {
	padding: clamp(16px, 2.5vw, 28px);
	margin-bottom: 24px;
}

/*
 * Kill WoodMart 12-col / sidebar reservation on the product shell.
 * Same class of bug as shop archive (--wd-col-lg:9 → empty gutter).
 */
body.single-product .product-image-summary-wrap.wd-grid-g,
body.single-product .product-image-summary-wrap {
	display: block;
	grid-template-columns: none;
	--wd-col-lg: 12;
	--wd-col-md: 12;
	--wd-col-sm: 12;
}

body.single-product .product-image-summary-wrap > .sidebar-container,
body.single-product .single-product-page .sidebar-container,
body.single-product.whiteplate-shop-surface .sidebar-container,
body.single-product.whiteplate-shop-surface aside.sidebar-container,
body.single-product.whiteplate-shop-surface .wd-sidebar {
	display: none !important;
}

body.single-product.whiteplate-shop-surface .wd-content-layout.content-layout-wrapper,
body.single-product.whiteplate-shop-surface .wd-content-layout {
	--wd-col-lg: 12;
	grid-template-columns: minmax(0, 1fr);
}

body.single-product.whiteplate-shop-surface .wd-content-area.site-content,
body.single-product.whiteplate-shop-surface .wd-content-area {
	--wd-col-lg: 12 !important;
	--wd-col-md: 12 !important;
	--wd-col-sm: 12 !important;
	width: 100%;
	max-width: 100%;
	grid-column: 1 / -1;
}

/* ---- Breadcrumb ------------------------------------------------------- */
body.single-product .woocommerce-breadcrumb,
body.single-product .wd-breadcrumbs {
	font-size: 13px;
	line-height: 1.7;
	color: var(--wp-muted);
	margin: 0 0 14px;
	max-width: none;
	padding-inline: 2px;
}
body.single-product .woocommerce-breadcrumb a:hover {
	color: var(--wp-green);
}

/* ---- Gallery + summary grid (RTL: gallery on the right = first track) - */
body.single-product .product-image-summary.wd-grid-col,
body.single-product .product-image-summary {
	display: grid !important;
	/* Gallery (DOM first → RTL right) slightly narrower; summary gets room */
	grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
	gap: clamp(20px, 3vw, 40px);
	align-items: start;
	width: 100% !important;
	max-width: none !important;
	--wd-col-lg: 12 !important;
	--wd-col-md: 12 !important;
	--wd-col-sm: 12 !important;
	grid-column: 1 / -1 !important;
	float: none !important;
}

body.single-product .product-image-summary-inner {
	display: contents;
}

/* Children must NOT span WoodMart 6/12 inside a 2-col grid (creates
 * implicit ~188px tracks and leaves the left half empty). */
body.single-product .product-images.wd-grid-col,
body.single-product .product-images,
body.single-product .summary.entry-summary.wd-grid-col,
body.single-product .summary.entry-summary,
body.single-product .summary,
body.single-product .entry-summary,
body.single-product .woocommerce-product-gallery {
	width: 100% !important;
	max-width: none !important;
	min-width: 0;
	float: none !important;
	--wd-col-lg: 1 !important;
	--wd-col-md: 1 !important;
	--wd-col-sm: 1 !important;
	grid-column: auto !important;
	grid-row: auto !important;
}

body.single-product .product-images,
body.single-product .woocommerce-product-gallery {
	background: #fff;
	border-radius: 12px;
	padding: 8px;
	border: 1px solid var(--wp-line);
}

body.single-product .woocommerce-product-gallery__wrapper,
body.single-product .woocommerce-product-gallery__image {
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

body.single-product .woocommerce-product-gallery__image img,
body.single-product .woocommerce-product-gallery img,
body.single-product .product-images img {
	width: 100%;
	height: auto;
	object-fit: contain;
	background: #fff;
	aspect-ratio: 1 / 1;
}

/* Logo fallback: contain on sand-tint so it doesn't look cropped */
body.single-product img.wp-img-fallback,
body.single-product .woocommerce-product-gallery img[data-wp-logo-fallback="1"],
body.single-product .wp-product-image.is-fallback img.wp-img-fallback {
	object-fit: contain !important;
	padding: 18%;
	background: linear-gradient(180deg, #fff 0%, var(--wp-sand) 140%);
	box-sizing: border-box;
}

body.single-product .flex-control-thumbs,
body.single-product .wd-gallery-thumb,
body.single-product ol.flex-control-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
	padding: 0;
	list-style: none;
}

body.single-product .flex-control-thumbs li,
body.single-product .wd-gallery-thumb img {
	border: 1px solid var(--wp-line);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

body.single-product .flex-control-thumbs li img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	padding: 4px;
	box-sizing: border-box;
}

/* ---- Summary ---------------------------------------------------------- */
body.single-product .summary.entry-summary,
body.single-product .summary-inner,
body.single-product .entry-summary {
	padding-inline: 4px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

body.single-product .product_title,
body.single-product .summary .product_title,
body.single-product h1.product_title {
	font-weight: 700;
	font-size: clamp(1.05rem, 1.35vw, 1.35rem);
	line-height: 1.5;
	color: var(--wp-ink);
	margin: 0 0 4px;
	max-width: none;
	overflow-wrap: anywhere;
	word-break: normal;
}

body.single-product .summary .price {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--wp-ink);
	margin: 4px 0 8px;
}
body.single-product .summary .price del {
	color: var(--wp-soil);
	font-weight: 500;
	font-size: 0.85em;
	margin-inline-start: 8px;
}
body.single-product .summary .price ins {
	color: var(--wp-orange);
	text-decoration: none;
}

body.single-product .woocommerce-product-details__short-description,
body.single-product .summary .woocommerce-product-details__short-description {
	color: var(--wp-muted);
	font-size: 14px;
	line-height: 1.85;
	border-top: 1px solid var(--wp-line);
	padding-top: 12px;
	margin-top: 4px;
}

/* Meta row */
body.single-product .product_meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	padding: 12px 0 0;
	margin-top: 8px;
	border-top: 1px solid var(--wp-line);
	font-size: 13px;
	color: var(--wp-muted);
}
body.single-product .product_meta .meta-label,
body.single-product .product_meta > span {
	display: inline-flex;
	gap: 6px;
	align-items: baseline;
}
body.single-product .product_meta a {
	color: var(--wp-green);
}

/* Stock */
body.single-product .stock.in-stock {
	color: var(--wp-green);
	font-weight: 700;
	font-size: 13px;
}
body.single-product .stock.out-of-stock {
	color: var(--wp-orange-2);
	font-weight: 700;
}

/* Quantity + ATC */
body.single-product form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 12px 0 4px;
}
body.single-product form.cart .quantity {
	margin: 0;
}
body.single-product form.cart .quantity .qty {
	min-width: 64px;
	min-height: 48px;
	border-radius: 12px;
	border: 1px solid var(--wp-line);
	text-align: center;
	font-weight: 700;
}
body.single-product .single_add_to_cart_button,
body.single-product form.cart .single_add_to_cart_button {
	flex: 1 1 180px;
	min-height: 48px;
	border-radius: 12px !important;
	font-weight: 800 !important;
	letter-spacing: 0;
	padding-inline: 22px !important;
	background: var(--wp-orange) !important;
	border-color: var(--wp-orange) !important;
	color: #fff !important;
}
body.single-product .single_add_to_cart_button:hover {
	background: var(--wp-orange-2) !important;
	border-color: var(--wp-orange-2) !important;
}

/* Hide noisy Marketplace leftover widgets if any still render */
body.single-product .wd-single-fbt,
body.single-product .wd-countdown-timer,
body.single-product .wd-single-product-extra,
body.single-product .wd-product-brands-links + .wd-product-brands-links {
	margin-top: 8px;
}

/* Share */
body.single-product .wd-social-icons,
body.single-product .product-share {
	margin-top: 10px;
}
body.single-product .wd-social-icons .wd-label,
body.single-product .product_meta .meta-label {
	font-weight: 700;
	color: var(--wp-ink);
}

/* ---- Tabs / accordion -------------------------------------------------
 * WoodMart (tabs layout) hides .tabs-layout-tabs entirely under 1024px —
 * that removes description + reviews on tablet/phone. Keep the shell, swap
 * nav ↔ accordion by breakpoint instead.
 * --------------------------------------------------------------------- */
body.single-product .woocommerce-tabs,
body.single-product .woocommerce-tabs.tabs-layout-tabs,
body.single-product .wd-single-tabs,
body.single-product .product-tabs-wrapper .woocommerce-tabs {
	display: block !important;
	margin: 0 0 28px;
	max-width: none;
	overflow: visible;
	background: #fff;
	border: 1px solid var(--wp-line);
	border-radius: var(--wp-radius);
	box-shadow: 0 8px 28px rgba(51, 51, 51, 0.04);
}

body.single-product .product-tabs-wrapper,
body.single-product .product-tabs-inner {
	max-width: none;
	width: 100%;
	padding-inline: 0;
}

body.single-product .woocommerce-tabs .wd-nav-tabs-wrapper,
body.single-product .woocommerce-tabs .wd-nav-wrapper {
	display: block;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--wp-line);
	background: #faf9f6;
	text-align: start !important;
}

body.single-product .woocommerce-tabs ul.tabs,
body.single-product .woocommerce-tabs ul.wd-nav-tabs,
body.single-product .woocommerce-tabs ul.wc-tabs {
	display: flex !important;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: flex-start !important;
	gap: 0;
	margin: 0;
	padding: 0 8px;
	list-style: none;
	border: 0;
	background: transparent;
}

body.single-product .woocommerce-tabs ul.tabs li,
body.single-product .woocommerce-tabs ul.wd-nav-tabs > li {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	float: none;
}

body.single-product .woocommerce-tabs ul.tabs li a,
body.single-product .woocommerce-tabs ul.wd-nav-tabs > li > a.wd-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 14px 16px !important;
	min-height: 48px;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.4;
	color: var(--wp-muted) !important;
	border: 0 !important;
	border-bottom: 2px solid transparent !important;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

body.single-product .woocommerce-tabs ul.tabs li a .nav-link-text,
body.single-product .woocommerce-tabs .wd-tabs-title {
	position: static !important;
	color: inherit;
}

body.single-product .woocommerce-tabs ul.tabs li a .nav-link-text::after,
body.single-product .woocommerce-tabs ul.wd-nav-tabs > li > a .nav-link-text::after {
	display: none !important;
	content: none !important;
}

body.single-product .woocommerce-tabs ul.tabs li.active a,
body.single-product .woocommerce-tabs ul.tabs li a:hover,
body.single-product .woocommerce-tabs ul.wd-nav-tabs > li.active > a,
body.single-product .woocommerce-tabs ul.wd-nav-tabs > li:hover > a,
body.single-product .wd-accordion-title.wd-active,
body.single-product .wd-accordion-title:hover {
	color: var(--wp-ink) !important;
	border-bottom-color: var(--wp-green) !important;
}

body.single-product .woocommerce-tabs .panel,
body.single-product .woocommerce-Tabs-panel {
	padding: clamp(16px, 2.5vw, 28px);
	line-height: 1.85;
	color: var(--wp-ink);
	font-size: 14.5px;
}

/* Description body: kill migrated 26pt / huge headings */
body.single-product .woocommerce-Tabs-panel--description :is(h1, h2, h3, h4),
body.single-product .woocommerce-Tabs-panel--description [style*="font-size"] {
	font-size: 1rem !important;
	line-height: 1.75 !important;
	font-weight: 600;
	color: var(--wp-ink);
	margin: 0.6em 0 0.4em;
}
body.single-product .woocommerce-Tabs-panel--description p {
	font-size: 14.5px;
	line-height: 1.85;
	color: var(--wp-ink);
}

/* Desktop: tabs nav on, accordion chrome off */
@media (min-width: 1025px) {
	body.single-product .tabs-layout-tabs > .wd-accordion-item > .wd-accordion-title {
		display: none !important;
	}
	body.single-product .tabs-layout-tabs > .wd-nav-tabs-wrapper {
		display: block !important;
	}
}

/* Tablet/phone: keep shell; accordion titles; hide top nav */
@media (max-width: 1024px) {
	body.single-product .woocommerce-tabs.tabs-layout-tabs {
		display: block !important;
	}
	body.single-product .tabs-layout-tabs > .wd-nav-tabs-wrapper {
		display: none !important;
	}
	body.single-product .tabs-layout-tabs > .wd-accordion-item > .wd-accordion-title {
		display: flex !important;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 14px 16px !important;
		min-height: 48px;
		font-weight: 700 !important;
		font-size: 14.5px !important;
		color: var(--wp-ink);
		border-bottom: 1px solid var(--wp-line);
		background: #faf9f6;
		cursor: pointer;
	}
	body.single-product .tabs-layout-tabs > .wd-accordion-item .woocommerce-Tabs-panel {
		display: none;
	}
	body.single-product .tabs-layout-tabs > .wd-accordion-item .woocommerce-Tabs-panel.wd-active,
	body.single-product .tabs-layout-tabs > .wd-accordion-item .wd-accordion-title.wd-active + .woocommerce-Tabs-panel {
		display: block !important;
	}
}

body.single-product .wd-accordion-title {
	padding: 14px 18px !important;
	min-height: 48px;
	font-weight: 700 !important;
	font-size: 14.5px !important;
}
body.single-product .wd-accordion-content {
	padding: 4px 18px 18px !important;
	line-height: 1.9;
}

/* ---- Reviews / rating / comment form (Brand Book) -------------------- */
body.single-product .woocommerce-Reviews,
body.single-product .wd-single-reviews,
body.single-product #reviews {
	color: var(--wp-ink);
}

body.single-product .wd-rating-summary-wrap,
body.single-product .wd-rating-summary {
	background: linear-gradient(180deg, #fff 0%, #faf9f6 100%);
	border: 1px solid var(--wp-line);
	border-radius: 14px;
	padding: 16px 18px;
	margin-bottom: 20px;
}

body.single-product .wd-rating-summary-main {
	font-size: 1.75rem !important;
	font-weight: 800;
	color: var(--wp-green);
	line-height: 1.2;
}

body.single-product .wd-rating-summary-total,
body.single-product .wd-rating-summary-heading {
	font-size: 13px;
	color: var(--wp-muted);
}

body.single-product .wd-rating-summary-item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	margin: 6px 0;
}

body.single-product .wd-rating-progress-bar .progress-area {
	background: var(--wp-sand);
	border-radius: 999px;
	overflow: hidden;
	height: 8px;
}

body.single-product .wd-rating-progress-bar .progress-bar {
	background: var(--wp-green) !important;
	border-radius: 999px;
	height: 100%;
}

body.single-product .woocommerce-Reviews-title,
body.single-product .wd-reviews-heading .woocommerce-Reviews-title,
body.single-product #reply-title,
body.single-product .comment-reply-title {
	font-size: 1.05rem !important;
	font-weight: 700 !important;
	line-height: 1.5;
	color: var(--wp-ink);
	margin: 0 0 12px;
}

body.single-product .comment-form,
body.single-product #review_form_wrapper,
body.single-product #respond {
	background: #fff;
	border: 1px solid var(--wp-line);
	border-radius: 14px;
	padding: 16px 18px 18px;
	margin-top: 12px;
}

body.single-product .comment-form label,
body.single-product .comment-form-rating label {
	font-size: 13px;
	font-weight: 700;
	color: var(--wp-ink);
	margin-bottom: 6px;
}

body.single-product .comment-form input[type="text"],
body.single-product .comment-form input[type="email"],
body.single-product .comment-form textarea,
body.single-product #comment,
body.single-product textarea.review-text {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--wp-line) !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: var(--wp-ink) !important;
	padding: 12px 14px !important;
	font-size: 14px !important;
	line-height: 1.7;
	min-height: 48px;
	box-shadow: none !important;
}

body.single-product .comment-form textarea,
body.single-product #comment,
body.single-product textarea.review-text {
	min-height: 120px;
	resize: vertical;
}

body.single-product .comment-form textarea::placeholder,
body.single-product #comment::placeholder {
	color: var(--wp-soil);
	opacity: 0.9;
}

body.single-product .comment-form .form-submit input#submit,
body.single-product .comment-form .submit {
	background: var(--wp-orange) !important;
	border-color: var(--wp-orange) !important;
	color: #fff !important;
	border-radius: 12px !important;
	font-weight: 800 !important;
	min-height: 44px;
	padding: 10px 20px !important;
	cursor: pointer;
}

body.single-product .comment-form .form-submit input#submit:hover {
	background: var(--wp-orange-2) !important;
	border-color: var(--wp-orange-2) !important;
}

body.single-product .star-rating,
body.single-product .comment-form-rating .stars a {
	color: var(--wp-orange);
}

body.single-product .commentlist .comment_container,
body.single-product .wd-review-list .wd-review-item {
	border: 1px solid var(--wp-line);
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 12px;
	background: #fff;
}

/* ---- Related / upsells ------------------------------------------------ */
body.single-product .related.products,
body.single-product .up-sells.products,
body.single-product .wd-products-with-title {
	max-width: none;
	margin: 40px 0 12px;
	padding: 8px 0 0;
}

body.single-product .related.products > h2,
body.single-product .up-sells.products > h2,
body.single-product .wd-el-title.title,
body.single-product .related.products .title,
body.single-product .up-sells .title {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--wp-ink);
	margin-bottom: 16px;
	position: relative;
	padding-bottom: 10px;
}
body.single-product .related.products > h2::after,
body.single-product .up-sells.products > h2::after,
body.single-product .wd-el-title.title::after {
	content: "";
	display: block;
	width: 40px;
	height: 3px;
	margin-top: 8px;
	border-radius: 2px;
	background: var(--wp-orange);
}

body.single-product ul.products {
	gap: 14px;
}

/* Sale badge Brand Book */
body.single-product span.onsale,
body.single-product .product-labels .onsale {
	background: var(--wp-orange) !important;
	border-radius: 999px;
	font-weight: 800;
}

/* ---- Mobile / tablet -------------------------------------------------- */
@media (max-width: 1024px) {
	body.single-product .product-image-summary.wd-grid-col,
	body.single-product .product-image-summary {
		grid-template-columns: 1fr;
		gap: 18px;
	}
}

@media (max-width: 767px) {
	body.single-product.whiteplate-shop-surface {
		--wp-gutter-x: clamp(12px, 4vw, 20px);
	}
	body.single-product.whiteplate-shop-surface .wd-content-area.site-content {
		padding-block: 12px 40px;
	}
	body.single-product .product-image-summary-wrap {
		padding: 12px;
		border-radius: 14px;
	}
	body.single-product form.cart {
		flex-direction: column;
		align-items: stretch;
	}
	body.single-product .single_add_to_cart_button {
		width: 100%;
	}
	body.single-product .woocommerce-tabs ul.tabs,
	body.single-product .woocommerce-tabs ul.wd-nav-tabs {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
	}
	body.single-product .woocommerce-tabs ul.tabs li a {
		white-space: nowrap;
	}
	body.single-product .product_title,
	body.single-product h1.product_title {
		font-size: 1.1rem;
	}
	body.single-product .wd-rating-summary-main {
		font-size: 1.45rem !important;
	}
}

/* Kill leftover English Marketplace demo blocks if builder still leaks */
body.single-product .elementor-12361 .wd-countdown-timer,
body.single-product .black-friday,
body.single-product [class*="black-friday"] {
	display: none !important;
}
