.lppr-messages {
	display: grid;
	gap: 8px;
	margin: 12px 0 16px;
	width: 100%;
}

.single-product .summary .woocommerce-product-details__short-description + .lppr-messages,
.single-product .summary .lppr-messages--after-short-description {
	margin-top: 12px;
	margin-bottom: 14px;
}

.lppr-message {
	padding: 12px 14px;
	border: 1px solid var(--lppr-message-border, #f2c9a4);
	border-radius: 6px;
	background: var(--lppr-message-bg, #fff8f1);
	color: var(--lppr-message-text, #3c2a1d);
	font-size: 14px;
	line-height: 1.6;
}

.lppr-message__title {
	display: block;
	margin-bottom: 2px;
	color: var(--lppr-message-title, #a03d00);
	font-weight: 700;
}

.lppr-message__text p,
.lppr-message__detail-content p {
	margin: 0 0 6px;
}

.lppr-message__text p:last-child,
.lppr-message__detail-content p:last-child {
	margin-bottom: 0;
}

.lppr-message__details {
	margin-top: 4px;
}

.lppr-message__details summary {
	display: inline-block;
	cursor: pointer;
	color: var(--lppr-message-link, #8a3600);
	font-weight: 600;
}

.lppr-message a {
	color: var(--lppr-message-link, #8a3600);
}

.lppr-message__details summary::-webkit-details-marker {
	display: none;
}

.lppr-message__details[open] summary {
	margin-bottom: 6px;
}

.lppr-gift-messages {
	display: grid;
	gap: 4px;
	box-sizing: border-box;
	color: #333;
	font-size: 14px;
	letter-spacing: 0;
	line-height: 1.6;
}

.single-product div.product .lppr-gift-messages--desktop {
	width: 100%;
	margin: 14px 0 0;
	padding: 10px 0;
	background: #ffffff;
}

.lppr-gift-messages--mobile {
	display: none;
}

.lppr-gift-messages__title {
	position: relative;
	margin: 0 0 4px;
	padding-left: 9px;
	color: #4f7f22;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.6;
}

.lppr-gift-messages__title::before {
	position: absolute;
	top: 0.18em;
	bottom: 0.2em;
	left: 0;
	width: 3px;
	border-radius: 999px;
	background: #d73886;
	content: "";
}

.lppr-gift-message {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 8px;
	align-items: start;
	padding: 2px 0;
}

.lppr-gift-message__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 22px;
	padding: 1px 8px;
	border-radius: 2px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.6;
	white-space: nowrap;
}

.lppr-gift-message__badge--gift {
	background: #fff0f2;
	color: #bd3b42;
}

.lppr-gift-message__badge--order {
	background: #fff3e8;
	color: #b65b19;
}

.lppr-gift-message__badge--register {
	background: #eaf4ff;
	color: #2e6faa;
}

.lppr-gift-message__badge--limited {
	background: #e8f6ef;
	color: #1f7a4d;
}

.lppr-gift-message__badge--bonus {
	background: #f1e9ff;
	color: #6f3bb2;
}

.lppr-gift-message__body {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
	min-width: 0;
}

.lppr-gift-message__text {
	min-width: 0;
	flex: 0 1 auto;
}

.lppr-gift-message__text p,
.lppr-gift-message__detail-content p {
	margin: 0;
}

.lppr-gift-message__text p:last-child,
.lppr-gift-message__detail-content p:last-child {
	margin-bottom: 0;
}

.lppr-gift-message__details {
	flex: 0 1 auto;
	margin: 0;
}

.lppr-gift-message__details summary,
.lppr-gift-message__link {
	color: #2e74c9;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.6;
	text-decoration: none;
	cursor: pointer;
}

.lppr-gift-message__details summary::-webkit-details-marker {
	display: none;
}

.lppr-gift-message__details[open] summary {
	margin-bottom: 4px;
}

.lppr-banners {
	display: grid;
	gap: 12px;
	margin: 22px 0;
	clear: both;
	float: none;
	width: 100%;
	max-width: 100%;
	flex: 0 0 100%;
	grid-column: 1 / -1;
	align-self: stretch;
	box-sizing: border-box;
}

.lppr-banners--before-description {
	margin: 22px 0;
}

.lppr-banners--after-description {
	margin: 22px 0 28px;
}

.lppr-banner,
.lppr-banner__link,
.lppr-banner picture,
.lppr-banner img {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.lppr-banner {
	overflow: hidden;
	border-radius: 6px;
	background: #f6f6f6;
}

.lppr-banner img {
	width: 100% !important;
	height: auto !important;
	max-width: 100% !important;
}

.single-product div.product .lppr-banners {
	clear: both;
	float: none;
	width: 100%;
	max-width: 100%;
	flex-basis: 100%;
	grid-column: 1 / -1;
}

.single-product div.product .lppr-banners--after-description {
	margin-top: 18px;
	margin-bottom: 26px;
}

@media (min-width: 922px) {
	.single-product div.product .summary .lppr-gift-messages--mobile {
		display: none;
	}
}

@media (max-width: 921px) {
	.single-product div.product .lppr-gift-messages--desktop {
		display: none;
	}

	.single-product div.product .summary .lppr-gift-messages--mobile {
		display: grid;
		width: 100%;
		margin: 12px 0 16px;
		padding: 8px 0 6px;
		background: #ffffff;
		font-size: 14px;
	}

	.lppr-gift-message {
		grid-template-columns: max-content minmax(0, 1fr);
		gap: 8px;
		padding: 2px 0;
	}

	.lppr-gift-message__badge {
		min-height: 22px;
		font-size: 13px;
	}

	/* v1.8.3：行動版滿額贈是掛在 woocommerce_short_description 內，會被主題規則
	   .woocommerce-product-details__short-description :last-child { margin-bottom: 1em }
	   撐開每個元素下緣，造成每筆活動間距比桌機大很多（且原本的歸零規則權重輸給主題）。
	   以下用足夠權重把內部多餘下邊距歸零，讓間距完全由本區塊的 grid gap(4px) + padding(2px) 控制，
	   視覺比照桌機版。桌機版不在短描述內、不受影響，故不需也不會被本段更動。 */
	.single-product div.product .summary .lppr-gift-messages.lppr-gift-messages--mobile .lppr-gift-message,
	.single-product div.product .summary .lppr-gift-messages.lppr-gift-messages--mobile .lppr-gift-message :last-child {
		margin-bottom: 0;
	}
}

@media (max-width: 767px) {
	.lppr-message {
		padding: 10px 12px;
		font-size: 13px;
	}

	.lppr-banners {
		margin: 16px 0;
	}

	.single-product div.product .summary .lppr-gift-messages--mobile {
		margin-top: 10px;
		padding: 8px 0 6px;
		font-size: 14px;
	}

	.lppr-gift-messages__title {
		font-size: 14px;
	}

	.lppr-gift-message {
		grid-template-columns: max-content minmax(0, 1fr);
		gap: 8px;
	}
}
