/*
 * Single-product page styles — loaded only on is_product() || is_front_page().
 *
 * Layout skeleton: gallery on the left, summary on the right, full-width
 * description below. Plugins paint inside .pm-product__gallery and
 * .pm-product__summary via WooCommerce hooks.
 */

/* ---- Storefront overrides ---- */

/*
 * Storefront caps `.col-full` at ~1063px and adds `margin-left/right: 2.6em`
 * below ~1064px and `1.4em` below 568px. Widen to 1300px so the two 570px
 * columns fit (570 + 570 + 60 gap + 40 section padding = 1240px, with 60px
 * of slack for justify-content: center on wider viewports), and force
 * `margin: 0 auto !important` so the responsive margin rules don't add an
 * extra ~42px gutter on top of our 20px section padding at small viewports.
 * 570px mirrors sew-nc.com's `elementor-col-50` inside a 1140px Hello
 * Elementor frame.
 */
.single-product .col-full {
	max-width: 1300px !important;
	margin: 0 auto !important;
	padding: 0 !important;
}

/*
 * Storefront's default `.site-main { padding-top: 4.24em }` (~68px) stacks
 * on top of our 50px section padding. Zero it out so the section padding
 * lands as authored.
 */
.single-product .site-main {
	padding-top: 0;
}

.single-product .pm-product.product::before,
.single-product .pm-product.product::after {
	content: none;
	display: none;
}

.single-product .pm-product.product {
	overflow: visible;
}

/*
 * Storefront ships `.storefront-full-width-content.single-product div.product
 * .summary { width: 56% !important; float: right; margin-bottom: 3.706em }` —
 * specificity (0,4,1) plus !important on width. Our previous (0,3,0) selector
 * lost, leaving the summary floated right at 56% of the grid track (the
 * 378px column the inspector showed). Match Storefront's chain and override
 * width/float/margin with !important. Once Plugin C lands its own templates
 * we can revisit — but this is the durable child-theme fix.
 */
.storefront-full-width-content.single-product div.product .summary,
.single-product div.product.pm-product .summary {
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

/* ---- Product layout grid ---- */

/*
 * Two 570px columns, vertically centered, with 50px top/bottom and 20px
 * side padding. `minmax(0, 570px)` lets the tracks shrink below 570 when
 * the viewport is narrower than ~1240px; `justify-content: center` keeps
 * them centered when the viewport is wider.
 */
.single-product .pm-product {
	display: grid;
	grid-template-columns: minmax(0, 570px) minmax(0, 570px);
	gap: 60px;
	margin: 0 auto;
	padding: 50px 20px;
	justify-content: center;
	align-items: center;
	font-family: var(--pm-font-sans);
	color: var(--pm-color-ink);
}

.pm-product__gallery {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

.pm-product__summary {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/*
 * Default WP/Woo styles add `margin-bottom` to `<h1>`, `<p class="price">`,
 * `.woocommerce-product-details__short-description`, `.cart`, etc. Flex
 * containers don't collapse those margins into the `gap`, so the column
 * ends up with 30+ px of dead space between every block (the hatched gaps
 * the inspector showed). Zero margins on every direct child; let the 16px
 * flex `gap` above be the only spacing source.
 */
.pm-product__summary > * {
	margin: 0;
}

.pm-product__summary .product_title {
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--pm-color-ink);
}

.pm-product__summary .price {
	font-size: 22px;
	font-weight: 600;
	color: var(--pm-color-ink);
}

.pm-product__summary .woocommerce-product-details__short-description {
	font-size: 15px;
	line-height: 1.6;
	color: var(--pm-color-ink);
}

.pm-product__details {
	grid-column: 1 / -1;
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--pm-color-border);
}

.pm-product__description {
	max-width: 760px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--pm-color-ink);
}

.pm-product__description p {
	margin: 0 0 16px;
}

/* ---- Multi-product grid (front page with 2+ managed products) ---- */

.pm-product-grid {
	max-width: 1200px;
	margin: 48px auto;
	padding: 0 24px;
	font-family: var(--pm-font-sans);
	color: var(--pm-color-ink);
}

.pm-product-grid__title {
	font-size: 32px;
	font-weight: 700;
	text-align: center;
	margin: 0 0 40px;
}

.pm-product-grid__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 32px;
}

.pm-product-grid__card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--pm-color-border);
	border-radius: var(--pm-radius-md);
	overflow: hidden;
	text-decoration: none;
	color: var(--pm-color-ink);
	box-shadow: var(--pm-shadow-sm);
	transition: box-shadow 0.2s ease;
}

.pm-product-grid__card:hover {
	box-shadow: var(--pm-shadow-md);
}

.pm-product-grid__image {
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--pm-color-surface);
}

.pm-product-grid__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pm-product-grid__name {
	font-size: 18px;
	font-weight: 600;
	margin: 16px 16px 4px;
}

.pm-product-grid__price {
	font-size: 16px;
	color: var(--pm-color-muted);
	margin: 0 16px 16px;
}

/* Mobile (375px floor) */
@media (max-width: 768px) {
	.single-product .col-full {
		padding: 0 !important;
	}

	.single-product .pm-product {
		grid-template-columns: 1fr;
		gap: 24px;
		padding: 24px 16px;
	}

	.pm-product__gallery {
		padding: 0;
	}

	.pm-product__summary .product_title {
		font-size: 24px;
	}

	.pm-product__details {
		margin-top: 24px;
		padding-top: 24px;
	}
}

/* ============================================================
   Product Overview section
   Mirrors sew-nc reference: heading + divider + 50/50 grid.
   Left = Features + Additional Details. Right = quote calculator.
   ============================================================ */

.pm-overview {
	width: 100%;
	background: var(--pm-color-surface);
	padding: 56px 20px 64px;
	font-family: var(--pm-font-sans);
	color: var(--pm-color-ink);
}

.pm-overview__inner {
	max-width: 1240px;
	margin: 0 auto;
}

.pm-overview__header {
	margin-bottom: 32px;
}

.pm-overview__heading {
	margin: 0;
	font-size: 36px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--pm-color-ink);
}

.pm-overview__divider {
	display: block;
	width: 48px;
	height: 2px;
	margin-top: 12px;
	background: var(--pm-color-ink);
}

.pm-overview__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 64px;
	align-items: start;
}

.pm-overview__col--info {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.pm-overview__block-title {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 600;
	color: var(--pm-color-ink);
	text-transform: none;
}

.pm-overview__features-body {
	font-size: 15px;
	line-height: 1.6;
	color: var(--pm-color-ink);
}

.pm-overview__features-body p {
	margin: 0 0 12px;
}

.pm-overview__features-body p:last-child {
	margin-bottom: 0;
}

.pm-overview__details-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 15px;
	color: var(--pm-color-ink);
}

.pm-overview__detail-label {
	font-weight: 600;
	margin-right: 6px;
}

.pm-overview__detail-value {
	color: var(--pm-color-muted);
}

@media (max-width: 768px) {
	.pm-overview {
		padding: 36px 16px 40px;
	}
	.pm-overview__heading {
		font-size: 28px;
	}
	.pm-overview__grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.pm-overview__header {
		margin-bottom: 20px;
	}
}

/* Belt-and-suspenders for WC's PhotoSwipe dialog. The PHP-side
   remove_action() in storefront-overrides.php is the primary fix; this CSS
   guards against a stale OPCache that could reintroduce the hidden 55px gap
   under the footer. PhotoSwipe scripts are dequeued on managed products so
   the lightbox can't actually open here. */
#photoswipe-fullscreen-dialog,
.pswp[aria-hidden="true"] {
	display: none !important;
}
