/**
 * DigiCenter — single product visual polish (UI only)
 * Loaded on product pages from woodmart-child.
 */

/* --------------------------------------------------------------------------
   1) Product title hierarchy
   -------------------------------------------------------------------------- */
body.single-product .wd-single-title .product_title,
body.single-product h1.product_title.entry-title {
	font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.625rem) !important;
	line-height: 1.45 !important;
	font-weight: 700 !important;
	color: #111111 !important;
	letter-spacing: -0.01em;
	margin-bottom: 0.35em;
}

/* --------------------------------------------------------------------------
   2) English name — flat accent, no gradient text
   -------------------------------------------------------------------------- */
body.single-product .en-name-block {
	margin-top: 4px;
	margin-bottom: 8px;
}

body.single-product .en-name-block::before {
	border-bottom-color: #e8e8e8;
}

body.single-product .en-name-text {
	color: #6b6b6b !important;
	background-image: none !important;
	-webkit-background-clip: initial !important;
	background-clip: initial !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   3) Key specs box — flatter, modern, no emoji
   -------------------------------------------------------------------------- */
body.single-product .wd-single-short-desc .woocommerce-product-details__short-description {
	background-color: #f6f7f8 !important;
	border: none !important;
	box-shadow: none !important;
	border-radius: 12px !important;
	padding: 14px 16px !important;
	font-size: 14px !important;
	line-height: 1.75 !important;
	color: #333333 !important;
	margin-bottom: 16px !important;
}

body.single-product .wd-single-short-desc .woocommerce-product-details__short-description::before {
	content: "مشخصات کلیدی" !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #555555 !important;
	margin-bottom: 8px !important;
	letter-spacing: 0;
}

body.single-product .wd-single-short-desc .woocommerce-product-details__short-description ul {
	margin: 0;
	padding-inline-start: 1.1em;
}

body.single-product .wd-single-short-desc .woocommerce-product-details__short-description li {
	margin-bottom: 6px !important;
}

/* --------------------------------------------------------------------------
   4) Buy card — unified purchase panel
   -------------------------------------------------------------------------- */
body.single-product .dc-buy-card {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
	padding: 16px 16px 14px;
	border-radius: 16px;
	background: #fafafa;
	border: 1px solid #efefef;
	box-sizing: border-box;
}

body.single-product .dc-buy-card > .wp-block-wd-container:empty,
body.single-product .dc-buy-card > .wp-block-wd-divider {
	display: none !important;
}

body.single-product .dc-buy-card .wd-single-price {
	margin: 0 0 6px !important;
}

body.single-product .dc-buy-card .wd-single-add-cart {
	margin: 0 !important;
}

body.single-product .dc-buy-card .wp-block-wd-popup {
	margin: 0 !important;
	width: 100% !important;
}

/* --------------------------------------------------------------------------
   5) Price + savings badge
   -------------------------------------------------------------------------- */
body.single-product .wd-single-price .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 10px;
	margin-bottom: 0 !important;
}

body.single-product .wd-single-price .price del {
	order: 2;
	font-size: 0.82em;
	opacity: 0.5;
	color: #777;
}

body.single-product .wd-single-price .price ins {
	order: 1;
	text-decoration: none;
	font-size: clamp(1.35rem, 1.2rem + 0.5vw, 1.55rem);
	font-weight: 700;
	color: #d4141f;
	letter-spacing: -0.01em;
}

body.single-product .wd-single-price .price ins .woocommerce-Price-currencySymbol,
body.single-product .wd-single-price .price del .woocommerce-Price-currencySymbol {
	font-size: 0.72em;
	font-weight: 500;
	opacity: 0.75;
	margin-inline-start: 2px;
}

body.single-product .wd-single-price .price .dc-price-saving {
	order: 3;
	flex: 1 0 100%;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: fit-content;
	max-width: 100%;
	margin-top: 8px;
	padding: 5px 10px;
	border-radius: 8px;
	background: #eaf7ee;
	font-size: 12.5px;
	font-weight: 500;
	color: #1a7f37;
	line-height: 1.35;
}

body.single-product .wd-single-price .price .dc-price-saving__label {
	color: #2f6b3c;
	font-weight: 600;
}

body.single-product .wd-single-price .price .dc-price-saving__amount .amount,
body.single-product .wd-single-price .price .dc-price-saving__amount bdi {
	color: #1a7f37 !important;
	font-weight: 700;
}

body.single-product .wd-single-price .price .dc-price-saving__amount .woocommerce-Price-currencySymbol {
	font-size: 0.88em;
	font-weight: 500;
	opacity: 0.85;
}

/* Soften tiny %-off badges so savings amount leads */
body.single-product .product-labels .product-label.onsale.dc-sale-badge-soft {
	display: none !important;
}

/* --------------------------------------------------------------------------
   6) Low-stock chip — near price decision
   -------------------------------------------------------------------------- */
body.single-product p.stock.dc-stock-chip,
body.single-product p.stock.in-stock.dc-stock-chip {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	margin: 8px 0 12px !important;
	padding: 5px 10px !important;
	border-radius: 999px !important;
	background: #fff6e8 !important;
	border: 1px solid #f0d7a8 !important;
	box-shadow: none !important;
	color: #9a6700 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
}

body.single-product .dc-buy-card > p.stock.dc-stock-chip {
	margin: 4px 0 12px !important;
	align-self: flex-start;
}

body.single-product p.stock.dc-stock-chip::before {
	content: "" !important;
	display: inline-block !important;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #e6a317;
	flex-shrink: 0;
	animation: dc-stock-pulse 3.5s ease-in-out infinite;
}

@keyframes dc-stock-pulse {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.45;
		transform: scale(0.85);
	}
}

@media (prefers-reduced-motion: reduce) {
	body.single-product p.stock.dc-stock-chip::before {
		animation: none;
	}
}

body.single-product p.stock.dc-stock-chip span,
body.single-product p.stock.wd-style-with-bg.dc-stock-chip span {
	display: inline !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
}

body.single-product p.stock.dc-stock-chip span::before,
body.single-product p.stock.wd-style-with-bg.dc-stock-chip span::before {
	content: none !important;
	display: none !important;
}

/* --------------------------------------------------------------------------
   7) CTA hierarchy — Primary / Outline / Link
   -------------------------------------------------------------------------- */
body.single-product .single_add_to_cart_button.button.alt {
	border-radius: 12px !important;
	min-height: 48px;
	font-weight: 600 !important;
	letter-spacing: 0;
	box-shadow: none !important;
	width: 100%;
}

body.single-product a.wp-block-wd-button[href*="installment-purchase"],
body.single-product a.dc-cta-secondary {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	background-color: transparent !important;
	background-image: none !important;
	color: #d4141f !important;
	border: 1.5px solid #d4141f !important;
	border-radius: 12px !important;
	box-shadow: none !important;
	font-weight: 500 !important;
	min-height: 46px !important;
	margin-top: 8px !important;
	padding: 10px 16px !important;
	text-decoration: none !important;
	text-align: center;
}

/* Builder leftover hidden on every breakpoint — kill gap */
body.single-product a.wp-block-wd-button.wd-hide-lg.wd-hide-sm[href*="installment-purchase"],
body.single-product a.dc-cta-secondary.wd-hide-lg.wd-hide-sm {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
}

body.single-product a.wp-block-wd-button[href*="installment-purchase"]:hover,
body.single-product a.wp-block-wd-button[href*="installment-purchase"]:focus,
body.single-product a.dc-cta-secondary:hover,
body.single-product a.dc-cta-secondary:focus {
	background-color: rgba(212, 20, 31, 0.06) !important;
	color: #b01018 !important;
	border-color: #b01018 !important;
	text-decoration: none !important;
}

body.single-product a.wp-block-wd-button.btn-style-default.btn-color-black,
body.single-product a.dc-cta-tertiary {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: auto;
	max-width: 100%;
	background-color: transparent !important;
	background-image: none !important;
	color: #666666 !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-weight: 500 !important;
	font-size: 13px !important;
	min-height: 0;
	margin: 0 !important;
	padding: 4px 0 !important;
	text-decoration: none !important;
}

body.single-product a.wp-block-wd-button.btn-style-default.btn-color-black:hover,
body.single-product a.wp-block-wd-button.btn-style-default.btn-color-black:focus,
body.single-product a.dc-cta-tertiary:hover,
body.single-product a.dc-cta-tertiary:focus {
	background-color: transparent !important;
	color: #111111 !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

body.single-product a.dc-cta-tertiary .wd-svg-icon,
body.single-product a.wp-block-wd-button.btn-color-black .wd-svg-icon {
	width: 16px;
	height: 16px;
	opacity: 0.7;
}

body.single-product a.wp-block-wd-button.btn-style-link[href*="installment-purchase"],
body.single-product a.wp-block-wd-button.btn-style-link.btn-color-black {
	font-weight: 500 !important;
	opacity: 0.9;
}

body.single-product form.cart {
	margin-bottom: 0;
}

body.single-product .wd-single-add-cart .wd-divider,
body.single-product .wp-block-wd-divider {
	opacity: 0.4;
	margin-block: 2px !important;
}

/* --------------------------------------------------------------------------
   8) Trust grid — 2 columns × 2 rows
   -------------------------------------------------------------------------- */
body.single-product .dc-trust-chips {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 12px;
	width: 100%;
	margin: 14px 0 0;
	padding: 12px 0 4px;
	border-top: 1px solid #ebebeb;
}

body.single-product .dc-trust-chip {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	min-width: 0;
	text-align: start;
	padding: 2px 0;
	border-radius: 0;
	background: transparent;
	color: #555;
	position: relative;
}

body.single-product .dc-trust-chip:not(:last-child)::after {
	content: none;
	display: none;
}

body.single-product .dc-trust-chip__icon {
	display: block;
	width: 14px;
	height: 14px;
	color: #d4141f;
	flex-shrink: 0;
	opacity: 0.9;
}

body.single-product .dc-trust-chip__label {
	font-size: 12px;
	font-weight: 500;
	line-height: 1.35;
	color: #555;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   9) Footer row — corporate + wishlist/compare
   -------------------------------------------------------------------------- */
body.single-product .dc-buy-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	width: 100%;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #ebebeb;
}

body.single-product .dc-buy-footer .wp-block-wd-popup,
body.single-product .dc-buy-footer a.dc-cta-tertiary {
	flex: 1 1 auto;
	min-width: 0;
}

body.single-product .dc-buy-actions {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: 0 0 auto;
	margin: 0 !important;
}

body.single-product .dc-buy-actions .wd-single-action-btn {
	margin: 0 !important;
}

body.single-product .dc-buy-actions .wd-action-btn a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 8px;
	border-radius: 8px;
	color: #555 !important;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}

body.single-product .dc-buy-actions .wd-action-btn a:hover,
body.single-product .dc-buy-actions .wd-action-btn a:focus {
	background: #f0f0f0;
	color: #111 !important;
}

body.single-product .dc-buy-actions .wd-action-text {
	font-size: 12px !important;
}

/* --------------------------------------------------------------------------
   10) Product labels — pill shape instead of heavy circles
   -------------------------------------------------------------------------- */
body.single-product .product-labels .product-label.wd-shape-round-sm {
	border-radius: 6px !important;
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	padding: 4px 8px !important;
	font-size: 11px !important;
	line-height: 1.3 !important;
	font-weight: 600 !important;
}

body.single-product .product-labels.labels-rounded-sm {
	gap: 6px;
}

/* --------------------------------------------------------------------------
   11) Sticky buy bar — mobile (brand red)
   -------------------------------------------------------------------------- */
.dc-sticky-buy {
	display: none;
}

@media (max-width: 768px) {
	body.single-product .wd-single-title .product_title,
	body.single-product h1.product_title.entry-title {
		font-size: 1.25rem !important;
		line-height: 1.5 !important;
	}

	body.single-product .dc-buy-card {
		padding: 14px 12px 12px;
		border-radius: 14px;
	}

	body.single-product a.wp-block-wd-button.btn-style-default.btn-color-primary[href*="installment-purchase"],
	body.single-product a.dc-cta-secondary {
		margin-top: 8px !important;
		margin-bottom: 0 !important;
		width: 100%;
	}

	body.single-product a.dc-cta-tertiary,
	body.single-product .dc-buy-footer a.dc-cta-tertiary,
	body.single-product a.wp-block-wd-button.btn-style-default.btn-color-black {
		margin-top: 0 !important;
		margin-bottom: 0 !important;
		width: auto;
	}

	body.single-product .single_add_to_cart_button.button.alt {
		width: 100%;
		margin-bottom: 0;
	}

	body.single-product .en-name-text {
		font-size: 12px !important;
	}

	body.single-product .dc-trust-chips {
		margin-top: 12px;
		padding-top: 10px;
		gap: 8px 10px;
	}

	body.single-product .dc-trust-chip {
		padding: 2px 0;
	}

	body.single-product .dc-trust-chip__label {
		font-size: 11px;
	}

	body.single-product .dc-trust-chip__icon {
		width: 13px;
		height: 13px;
	}

	body.single-product .wd-single-price .price ins {
		font-size: 1.35rem;
	}

	body.single-product .dc-buy-footer {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	body.single-product .dc-buy-footer .wp-block-wd-popup,
	body.single-product .dc-buy-footer a.dc-cta-tertiary {
		justify-content: flex-start;
	}

	body.single-product .dc-buy-actions {
		justify-content: flex-start;
		width: 100%;
		padding-top: 2px;
	}

	body.single-product p.stock.dc-stock-chip,
	body.single-product p.stock.in-stock.dc-stock-chip {
		font-size: 11.5px !important;
	}

	.dc-sticky-buy {
		display: block;
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 10050;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
		background: rgba(255, 255, 255, 0.96);
		border-top: 1px solid #e8e8e8;
		box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		transform: translateY(110%);
		opacity: 0;
		pointer-events: none;
		transition: transform 0.22s ease, opacity 0.22s ease;
	}

	.dc-sticky-buy.is-visible {
		transform: translateY(0);
		opacity: 1;
		pointer-events: auto;
	}

	.dc-sticky-buy__inner {
		display: flex;
		align-items: center;
		gap: 12px;
		max-width: 720px;
		margin: 0 auto;
	}

	.dc-sticky-buy__price {
		flex: 1 1 auto;
		min-width: 0;
		font-size: 14px;
		font-weight: 700;
		color: #d4141f;
		line-height: 1.35;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.dc-sticky-buy__cta {
		flex: 0 0 auto;
		appearance: none;
		border: none;
		border-radius: 12px;
		min-height: 44px;
		padding: 0 16px;
		background: #d4141f;
		color: #fff;
		font: inherit;
		font-size: 13px;
		font-weight: 600;
		cursor: pointer;
	}

	.dc-sticky-buy__cta:hover,
	.dc-sticky-buy__cta:focus {
		background: #b01018;
		outline: none;
	}

	body.single-product.dc-sticky-buy-open {
		padding-bottom: calc(78px + var(--dc-sticky-buy-offset, 0px));
	}

	body.wd-toolbar-on .dc-sticky-buy,
	body:has(.wd-toolbar) .dc-sticky-buy {
		bottom: var(--dc-sticky-buy-offset, 55px);
	}
}
