/*
 * DX Single Product - front-end + editor styles
 * Matches the 22Words single product landing page (desktop + mobile).
 */

:root {
	--dxsp-pink: #ff1493;
	--dxsp-pink-deep: #f00084;
	--dxsp-card-bg: #ffffff;
	--dxsp-text: #1a1a1a;
	--dxsp-muted: #ffffff;
	--dxsp-btn: #20c0c8;
	--dxsp-btn-hover: #16a8b0;
	--dxsp-radius: 18px;
	--dxsp-card-max: 540px;
}

/* ---------- Page chrome (front-end only) ---------- */

body.dxsp-body {
	margin: 0;
	padding: 0;
	background: var(--dxsp-pink);
	color: var(--dxsp-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
		Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.dxsp-page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 16px 24px;
	box-sizing: border-box;
}

.dxsp-header {
	width: 100%;
	padding: 8px 16px 16px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.dxsp-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: #fff;
}

.dxsp-logo-img {
	height: 40px;
	width: auto;
	display: block;
}

.dxsp-logo-text {
	font-weight: 900;
	letter-spacing: 0.05em;
	font-size: 20px;
	line-height: 1;
	color: #fff;
}

.dxsp-main {
	width: 100%;
	max-width: var(--dxsp-card-max);
	flex: 1 0 auto;
}

.dxsp-footer {
	width: 100%;
	max-width: var(--dxsp-card-max);
	margin-top: 32px;
	text-align: center;
	color: #fff;
	font-size: 12px;
	line-height: 1.5;
}

.dxsp-footer a {
	color: #fff;
	text-decoration: underline;
}

.dxsp-footer .dxsp-editorial {
	margin: 0 0 8px;
}

.dxsp-footer .dxsp-copy {
	margin: 0;
}

/* ---------- The pattern (works in editor + front-end) ---------- */

.dxsp-card-wrap {
	width: 100%;
	max-width: var(--dxsp-card-max);
	margin: 0 auto !important;
}

/* Vertical spacing between stacked product cards.
 * Use multiple selectors so spacing works regardless of how WP wraps
 * blocks (entry-content, bare body, editor canvas, etc.).
 */
.dxsp-card-wrap:not(:first-child),
.dxsp-card-wrap ~ .dxsp-card-wrap,
.wp-block-group.dxsp-card-wrap + .wp-block-group.dxsp-card-wrap {
	margin-top: 40px !important;
}

@media (max-width: 540px) {
	.dxsp-card-wrap:not(:first-child),
	.dxsp-card-wrap ~ .dxsp-card-wrap,
	.wp-block-group.dxsp-card-wrap + .wp-block-group.dxsp-card-wrap {
		margin-top: 28px !important;
	}
}

.dxsp-card {
	background: var(--dxsp-card-bg);
	border-radius: var(--dxsp-radius);
	padding: 22px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
	border: 2px solid #111;
}

.dxsp-card > * + * {
	margin-top: 18px;
}

.dxsp-title {
	font-size: clamp(20px, 2.4vw, 26px);
	font-weight: 800;
	line-height: 1.25;
	color: var(--dxsp-text);
	margin: 0 0 8px;
	cursor: pointer;
}

.dxsp-image {
	margin: 0;
	cursor: pointer;
}

.dxsp-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
}

.dxsp-description {
	font-size: 16px;
	line-height: 1.55;
	color: #333;
	margin: 0;
}

.dxsp-cta {
	margin-top: 22px !important;
	display: flex;
	justify-content: center;
}

.dxsp-cta .wp-block-button {
	width: 100%;
	max-width: 320px;
}

.dxsp-button .wp-block-button__link,
.dxsp-cta .wp-block-button__link {
	background: var(--dxsp-btn) !important;
	color: #ffffff !important;
	border-radius: 999px !important;
	font-weight: 700 !important;
	letter-spacing: 0.04em;
	padding: 14px 28px !important;
	font-size: 15px;
	display: inline-block;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
	transition: background-color 0.15s ease-in-out;
	text-decoration: none;
}

.dxsp-button .wp-block-button__link:hover,
.dxsp-cta .wp-block-button__link:hover {
	background: var(--dxsp-btn-hover) !important;
}

/* ---------- Editor-only background helper ----------
 * Give the editor canvas the hot-pink page bg when editing
 * a Single Product so the WYSIWYG matches the front-end.
 */
body.post-type-single_product .editor-styles-wrapper,
body.post-type-single_product .block-editor-writing-flow,
.editor-styles-wrapper .dxsp-card-wrap {
	background: transparent;
}

body.post-type-single_product .editor-styles-wrapper {
	background-color: var(--dxsp-pink) !important;
}

body.post-type-single_product .editor-styles-wrapper .wp-block {
	color: var(--dxsp-text);
}

/* ---------- Mobile ---------- */

@media (max-width: 540px) {
	.dxsp-page {
		padding: 0 12px 16px;
	}

	.dxsp-card {
		padding: 18px;
	}

	.dxsp-title {
		font-size: 22px;
	}

	.dxsp-description {
		font-size: 15px;
	}
}
