/* ==========================================================================
   Product page for personalizable products (templates/content-single-product.php)
   Layout only: colors, fonts and buttons come from the theme.
   ========================================================================== */

body.lpd-template .lpd-main,
.lpd-product {
	--lpd-gap: 40px;
}

.lpd-product {
	display: block;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 20px 48px;
	box-sizing: border-box;
	clear: both;
}

.lpd-product *,
.lpd-product *::before,
.lpd-product *::after {
	box-sizing: border-box;
}

.lpd-breadcrumb {
	margin: 0 0 20px;
	font-size: 0.85em;
}

.lpd-breadcrumb .woocommerce-breadcrumb {
	margin: 0;
}

/* ---------- Title (full width) + intro ---------- */

.lpd-breadcrumb {
	font-size: 0.82em;
	opacity: 0.85;
}

.lpd-head {
	margin: 0 0 14px;
}

.lpd-head .product_title {
	margin: 0;
	line-height: 1.12;
	width: 100%;
}

.lpd-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 8px 0 0;
}

/* Short description (left) and a price card (right). */
.lpd-intro {
	display: grid;
	grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr);
	grid-template-areas: "text side";
	gap: 28px 36px;
	align-items: start;
	margin: 0 0 30px;
	padding: 0 0 28px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.lpd-intro-text {
	grid-area: text;
	min-width: 0;
}

.lpd-intro-body > :first-child {
	margin-top: 0;
}

.lpd-intro-body > :last-child {
	margin-bottom: 0;
}

/* Tighter rhythm than the theme's default paragraph spacing. */
.lpd-intro-body p {
	margin: 0 0 0.7em;
	line-height: 1.5;
}

/* First lines of the description read as a lead. */
.lpd-intro-body > p:first-child {
	font-size: 1.12em;
}

/* "✓ …" lines become a tidy two-column check list. */
.lpd-intro-body ul.lpd-checks {
	list-style: none;
	margin: 0.2em 0 1em;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 28px;
}

.lpd-intro-body ul.lpd-checks li {
	position: relative;
	margin: 0;
	padding: 0 0 0 28px;
	line-height: 1.4;
}

.lpd-intro-body ul.lpd-checks li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 0.1em;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--lpd-accent, #2271b1);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

/* Price card. */
.lpd-intro-side {
	grid-area: side;
	min-width: 0;
	padding: 20px 24px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.035);
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.lpd-intro-side .price {
	display: block;
	margin: 0 0 12px;
	font-size: 2em;
	font-weight: 800;
	line-height: 1.05;
}

.lpd-intro-side .product_meta {
	display: grid;
	gap: 6px;
	padding-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	font-size: 0.9em;
}

.lpd-intro-side .product_meta:empty {
	display: none;
}

.lpd-intro-side .product_meta span {
	display: block;
	opacity: 0.9;
}

/* With the optional photo gallery: photo on the left, price then text on the right. */
.lpd-intro.has-gallery {
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	grid-template-areas:
		"gallery side"
		"gallery text";
	grid-template-rows: auto 1fr;
}

.lpd-intro-gallery {
	grid-area: gallery;
	position: relative;
	min-width: 0;
}

.lpd-intro-gallery .onsale {
	z-index: 3;
}

/* WooCommerce's default CSS floats the gallery at 48%: neutralize it. */
body .lpd-product .lpd-intro .woocommerce-product-gallery,
body .lpd-product .lpd-intro .images {
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
}

/* ---------- Customization section (full width) ---------- */

.lpd-customize {
	margin: 0 0 48px;
	scroll-margin-top: 20px;
}

.lpd-customize form.cart {
	margin: 0;
	display: block;
	width: 100%;
}

.lpd-customize .lpd-designer-root.is-inline {
	margin: 0 0 20px;
}

/* Quantity + add to cart sit right under the configurator. */
.lpd-customize .woocommerce-variation-add-to-cart,
.lpd-customize form.cart:not(.variations_form) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

.lpd-customize .woocommerce-variation-add-to-cart .lpd-designer-root,
.lpd-customize form.cart:not(.variations_form) .lpd-designer-root {
	flex: 0 0 100%;
}

.lpd-customize .single_variation_wrap .woocommerce-variation {
	margin: 0 0 12px;
}

.lpd-customize .single_add_to_cart_button {
	min-height: 48px;
	padding-left: 32px;
	padding-right: 32px;
	font-weight: 700;
}

.lpd-customize .quantity .qty {
	min-height: 48px;
}

/* ---------- Tabs and related products ---------- */

.lpd-details {
	margin: 0 0 40px;
}

.lpd-product .related,
.lpd-product .upsells {
	clear: both;
	margin-top: 40px;
}

/* ---------- Phones / tablets ---------- */

@media (max-width: 860px) {
	/* Phones: price first, then the description, then the photo if shown. */
	.lpd-intro,
	.lpd-intro.has-gallery {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"gallery"
			"side"
			"text";
		grid-template-rows: auto;
		gap: 16px;
		margin-bottom: 24px;
	}

	.lpd-intro:not(.has-gallery) {
		grid-template-areas:
			"side"
			"text";
	}

	.lpd-intro-side {
		padding: 14px 16px;
	}

	.lpd-intro-side .price {
		font-size: 1.7em;
		margin-bottom: 8px;
	}

	.lpd-intro {
		padding-bottom: 18px;
	}

	.lpd-intro-body ul.lpd-checks {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
	}

	.lpd-product {
		padding: 14px 14px 40px;
	}

	.lpd-customize .single_add_to_cart_button {
		flex: 1 1 auto;
	}
}

/* ---------- Gallery (WooCommerce hides it until its script has run) ---------- */

.lpd-product .woocommerce-product-gallery {
	opacity: 1 !important;
	position: relative;
}

.lpd-product .woocommerce-product-gallery__wrapper {
	margin: 0;
}

.lpd-product .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: auto;
}

.lpd-product .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 8px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.lpd-product .flex-control-thumbs img {
	cursor: pointer;
	opacity: 0.6;
}

.lpd-product .flex-control-thumbs img.flex-active,
.lpd-product .flex-control-thumbs img:hover {
	opacity: 1;
}

.lpd-product .woocommerce-product-gallery__trigger {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
}


/* ---------- Related / upsell cards ---------- */

.lpd-related {
	margin: 0 0 40px;
}

.lpd-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.lpd-card a {
	display: block;
	text-decoration: none;
	color: inherit;
}

.lpd-card img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.lpd-card-title {
	display: block;
	margin-top: 8px;
	font-weight: 600;
}

.lpd-card-price {
	display: block;
	opacity: 0.85;
}

@media (max-width: 860px) {
	.lpd-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Description, details, reviews ---------- */

.lpd-details > div {
	margin: 0 0 32px;
}

.lpd-details h2,
.lpd-reviews h2,
.lpd-related h2 {
	margin: 0 0 14px;
	font-size: 1.4em;
}

.lpd-reviews {
	margin: 0 0 40px;
}

/* ---------- Phones: fold a long short-description ---------- */

.lpd-intro-body.is-folded {
	max-height: 8.5em;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 55%, transparent);
	mask-image: linear-gradient(#000 55%, transparent);
}

.lpd-intro-toggle {
	margin: 6px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--lpd-accent, #2271b1);
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.lpd-intro-toggle[hidden] {
	display: none;
}

.lpd-notices:empty {
	display: none;
}

.lpd-notices {
	margin: 0 0 16px;
}
