/* =============================================================================
   Darplay Tweaks - product page (includes/product-page.php)
   ============================================================================= */

/* The template's empty third column and empty paragraph under the price. */
.single-product main .wp-block-columns > .wp-block-column:empty,
.single-product main .wp-block-columns .wp-block-post-title ~ p.wp-block-paragraph:empty {
	display: none;
}

/* Title: never break inside a word (the theme allowed it: "Личностн / о"). */
.single-product main h1.wp-block-post-title {
	word-break: normal;
	overflow-wrap: break-word; /* only a word longer than the whole line */
	hyphens: manual;
	line-height: 1.15;
	margin-bottom: 12px;
}

/* Desktop / tablet: picture and info in two equal halves. */
@media (min-width: 782px) {
	.single-product main .wp-block-columns.alignwide:has(.wp-block-woocommerce-product-image-gallery) {
		gap: 48px;
	}

	.single-product main .wp-block-columns.alignwide:has(.wp-block-woocommerce-product-image-gallery) > .wp-block-column {
		flex: 1 1 0 !important; /* the template writes flex-basis: 512px inline */
		min-width: 0;
	}

	.single-product main h1.wp-block-post-title {
		font-size: clamp(30px, 3vw, 40px) !important;
	}
}

/* Lead text and facts. */
.darplay-product-lead {
	margin: 16px 0 10px;
	font-size: 16px;
	line-height: 1.6;
	color: #3d3d3a;
}

.darplay-product-more {
	color: #518459;
	white-space: nowrap;
}

.darplay-product-facts {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 600;
	color: #2f5259;
}

/* Delivery and payment under the button. */
.darplay-product-assurances {
	margin: 20px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid #ececec;
	list-style: none;
	font-size: 14px;
	color: #5f5e5a;
}

.darplay-product-assurances li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 3px 0;
}

.darplay-product-assurances svg {
	flex: none;
	color: #5c8a6a;
}

/* "Повече за продукта ↓" lands below the sticky header. */
#darplay-product-details {
	scroll-margin-top: 90px;
}

/* Phones (columns stacked): keep "Купи" high - title, price, facts, button,
   delivery lines, and only then the lead text. */
@media (max-width: 781px) {
	.single-product main .wp-block-column:has(> .wp-block-post-title) {
		display: flex;
		flex-direction: column;
	}

	.single-product main .wp-block-column:has(> .wp-block-post-title) > .darplay-product-facts {
		order: 1;
	}

	.single-product main .wp-block-column:has(> .wp-block-post-title) > .wp-block-add-to-cart-form {
		order: 2;
	}

	.single-product main .wp-block-column:has(> .wp-block-post-title) > .darplay-product-assurances {
		order: 3;
	}

	.single-product main .wp-block-column:has(> .wp-block-post-title) > .darplay-product-lead {
		order: 4;
		margin-top: 16px;
	}
}

/* "Какво е Darplay" (shared block under the description on the 7 games). */
.darplay-about {
	margin-top: 40px;
	padding: 28px 32px;
	border-radius: 8px;
	background: #f6f8f7;
	scroll-margin-top: 90px;
}

.darplay-about > :first-child {
	margin-top: 0;
}

.darplay-about a {
	color: #518459;
}

.darplay-product-about-link {
	margin: 10px 0 0;
	font-size: 15px;
}

.darplay-product-about-link a {
	color: #518459;
}

@media (max-width: 781px) {
	.single-product main .wp-block-column:has(> .wp-block-post-title) > .darplay-product-about-link {
		order: 3;
	}

	.darplay-about {
		padding: 20px;
	}
}

/* Subtitle under the product name (0.9.5, "Подзаглавие" field in wp-admin). */
.single-product main .darplay-product-subtitle {
	margin: 4px 0 0;
	font-size: 18px;
	line-height: 1.35;
	color: #2f5259;
}

@media (max-width: 781px) {
	.single-product main .darplay-product-subtitle {
		font-size: 16px;
	}
}

/* Phones (0.11.1): tighter space around the "Начало / Игри Darplay / …" line,
   so the photo, price and "Купи" move up (24px + 24px -> 10px + 10px). */
@media (max-width: 599px) {
	.single-product .wp-block-group.woocommerce.product {
		margin-top: 10px !important;
	}

	.single-product .wc-block-breadcrumbs + .wc-block-store-notices + .wp-block-columns,
	.single-product .wc-block-breadcrumbs + .wp-block-columns {
		margin-top: 10px !important;
	}

	/* Title 36px -> 28px: long names ("Darplay Мъдростта в родителството")
	   took three lines and pushed the price off the first screen. */
	.single-product main h1.wp-block-post-title {
		font-size: 28px !important;
		line-height: 1.2;
	}
}
