/* Gold Pricing live-price widget. RTL, adapts to the theme's font stack. */

.gp-price {
	direction: rtl;
	font-family: inherit;
	margin-top: 8px;
	margin-bottom: 8px;
	color: rgb(33, 37, 41);
}

html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price,
html[dina-dark="true"] .gp-price,
html[dina-dark="dark"] .gp-price,
html.dina-dark .gp-price,
body.dina-dark .gp-price {
	color: #fff;
}

.summary .gp-price,
.dina-price-con .gp-price,
.gp-price--single {
	margin-bottom: 32px;
	direction: rtl;
	text-align: inherit;
}

/* Single product: Maarble-style live price card. Loop/search widgets stay compact. */
.gp-price--single {
	display: block;
	width: 100%;
	max-width: 460px;
	margin-top: 12px;
	margin-bottom: 28px;
	overflow: hidden;
	color: rgb(33, 37, 41);
	background: #fff;
	border: 1px solid rgba(36, 140, 109, 0.2);
	border-radius: 14px;
}

.gp-price--single .gp-price__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	background: linear-gradient(90deg, rgba(36, 140, 109, 0.03), rgba(36, 140, 109, 0.1));
	border-bottom: 1px solid rgba(36, 140, 109, 0.12);
}

.gp-price__title {
	font-size: 15px;
	font-weight: 700;
	color: rgb(27, 91, 72);
}

.gp-price__live-dot {
	position: relative;
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: rgb(36, 140, 109);
	box-shadow: 0 0 0 3px rgba(36, 140, 109, 0.12);
}

.gp-price--live .gp-price__live-dot::after {
	position: absolute;
	inset: -5px;
	content: "";
	border: 1px solid rgba(36, 140, 109, 0.5);
	border-radius: inherit;
	animation: gp-live-pulse 1.8s ease-out infinite;
}

@keyframes gp-live-pulse {
	from { opacity: 0.8; transform: scale(0.55); }
	to { opacity: 0; transform: scale(1.35); }
}

.gp-price--single:not(.gp-price--live) .gp-price__live-dot {
	background: #929b98;
	box-shadow: 0 0 0 3px rgba(146, 155, 152, 0.14);
}

.gp-price__sr-status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.gp-price--single .gp-price__body {
	display: block;
	padding: 2px 16px;
}

.gp-price--single .gp-price__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
}

.gp-price--single .gp-price__item + .gp-price__item {
	border-top: 1px solid rgba(33, 37, 41, 0.08);
}

.gp-price--single .gp-price__label {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	color: #5c6763;
}

.gp-price--single .gp-price__label small {
	padding: 1px 6px;
	font-size: 11px;
	font-weight: 500;
	color: rgb(27, 91, 72);
	background: rgba(36, 140, 109, 0.09);
	border-radius: 999px;
}

.gp-price--single .gp-price__value,
.gp-price--single .gp-price__rate-value {
	display: inline-flex;
	align-items: baseline;
	flex: 0 0 auto;
	gap: 4px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.gp-price--single .gp-price__rate-value {
	font-size: 16px;
	font-weight: 700;
}

.gp-price--single .gp-price__rate-amount {
	color: rgb(36, 140, 109);
	transition: background-color 0.2s ease-out;
}

.gp-price--single .gp-price__rate-value .gp-price__currency {
	font-size: 13px;
}

/* Empty-state contact CTA — same slot, typography, and teal as card prices. */
.gp-price--contact .gp-price__row {
	justify-content: center;
	align-items: baseline;
}

.gp-price--card.gp-price--contact {
	margin-top: 4px;
	text-align: inherit;
}

.gp-price--card .gp-price__contact {
	display: inline-block;
	margin: 0;
	padding: 0;
	color: rgb(36, 140, 109);
	font: inherit;
	line-height: inherit;
	font-weight: inherit;
	font-size: inherit;
	text-align: center;
	text-decoration: none;
}

.gp-price--card .gp-price__contact:hover,
.gp-price--card .gp-price__contact:focus {
	color: rgb(27, 91, 72);
}

.gp-price--card .gp-price__contact:focus-visible {
	outline: 2px solid rgb(36, 140, 109);
	outline-offset: 2px;
	border-radius: 2px;
}

.gp-price--single .gp-price__contact {
	display: inline-block;
	margin-top: 8px;
	font-size: 16px;
	font-weight: 600;
	color: rgb(36, 140, 109);
	text-decoration: none;
}

.gp-price--single .gp-price__contact:hover,
.gp-price--single .gp-price__contact:focus {
	color: rgb(27, 91, 72);
	text-decoration: underline;
}

.gp-price--single.gp-price--contact {
	display: block;
	max-width: none;
	margin-top: 8px;
	margin-bottom: 32px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.gp-price--single.gp-price--contact .gp-price__row {
	justify-content: flex-start;
}

/* Shown instead of a price when a product lacks the attributes to calculate one. */
.gp-price-na {
	direction: rtl;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 32px;
	margin-top: 8px;
}

.gp-price__row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.gp-price__value {
	font-variant-numeric: tabular-nums;
	font-size: 22px;
	font-weight: 700;
	min-width: 8ch;
	line-height: 1.4;
	transition: background-color 0.2s ease-out;
}

ul.products {
	align-items: stretch;
}

ul.products li.product {
	height: 100%;
}

li.product:has( .gp-price--card ) .dina-product-price:not( :has( .gp-price--card ) ),
li.product:has( .gp-price--card ) .dina-free-price,
li.product:has( .gp-price--card ) .dina-call-price,
.dina-product:has( .gp-price--card ) .dina-product-price:not( :has( .gp-price--card ) ),
.dina-product:has( .gp-price--card ) .dina-free-price,
.dina-product:has( .gp-price--card ) .dina-call-price,
.dina-product-item:has( .gp-price--card ) .dina-product-price:not( :has( .gp-price--card ) ),
.dina-product-item:has( .gp-price--card ) .dina-free-price,
.dina-product-item:has( .gp-price--card ) .dina-call-price,
.gp-price--card + .dina-product-price,
.gp-price--card + .dina-free-price,
.gp-price--card + .dina-call-price,
.gp-price--card + p.price,
.gp-price--card + span.price,
.dina-product-price:has( .gp-price--card ) > a,
.dina-product-price:has( .gp-price--card ) > .dina-call-price,
p.price:has( .gp-price--card ) > a:not( .gp-price ),
span.price:has( .gp-price--card ) > a:not( .gp-price ) {
	display: none !important;
}

/* --- Card bottom alignment: price + "تماس بگیرید" share same baseline --- */
li.product,
.dina-product,
.dina-product-item,
.dina-product-box {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.dina-product-detail,
li.product .dina-product-detail,
.dina-product-box .dina-product-detail {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

/* One shared footer row — same baseline for price + "تماس بگیرید" */
.dina-product-detail > .dina-product-price,
.dina-product-detail > .dina-free-price,
.dina-product-box .dina-product-price,
li.product .dina-product-price,
li.product .dina-free-price,
.dina-product .dina-product-price,
.dina-product-item .dina-product-price {
	margin-top: auto;
	margin-bottom: 0;
	padding-top: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	box-sizing: border-box;
	line-height: 1.3;
}

/* Pull "تماس بگیرید" up — no extra link margin below title */
.dina-product-detail > .dina-product-price a,
.dina-product-detail > .dina-free-price a,
.dina-product-box .dina-product-price a,
li.product .dina-product-price a,
li.product .dina-free-price a,
.dina-product .dina-product-price a,
.dina-product-item .dina-product-price a {
	margin: 0;
	padding: 0;
	line-height: inherit;
	font: inherit;
	color: inherit;
}

/* Legacy: widget sat as sibling before slot — still pin to bottom until JS restacks */
.dina-product-detail > .gp-price--card,
.dina-product-box > .gp-price--card,
li.product > .gp-price--card {
	margin-top: auto;
	margin-bottom: 0;
	padding-bottom: 20px;
}

/* Compact card/loop variant — inherit dinakala "تماس بگیرید" typography */
.dina-product-price .gp-price--card,
.dina-free-price .gp-price--card {
	color: inherit;
	font: inherit;
	line-height: inherit;
}

.gp-price--card {
	display: block;
	margin-top: 0;
	margin-bottom: 0;
	padding-bottom: 0;
	direction: rtl;
	text-align: center;
	width: 100%;
	color: inherit;
	font: inherit;
	line-height: inherit;
}

.gp-price--card .gp-price__row {
	justify-content: center;
	align-items: baseline;
}

.gp-price--card .gp-price__value {
	font: inherit;
	line-height: inherit;
	min-width: 0;
	min-height: 0;
	font-weight: inherit;
}

/* "پربازدید"/"تصادفی" sidebar widgets (dina-product_widget): hide contact CTA, keep layout */
.dina-product_widget .gp-price--contact,
.dina-product_widget .gp-price__contact {
	display: none;
}

/* Sidebar product-list widgets (recent/random/related — standard WC + Dina): price own line, RTL, below title. */
.product_list_widget .gp-price--card,
.dina-product_widget .gp-price--card {
	display: block;
	text-align: right;
	direction: rtl;
}

/* Don't let the widget link's :hover color cascade onto the price. */
.product_list_widget a:hover .gp-price--card,
.product_list_widget a:hover .gp-price--card .gp-price__currency,
.dina-product_widget a:hover .gp-price--card,
.dina-product_widget a:hover .gp-price--card .gp-price__currency {
	color: rgb(33, 37, 41);
}

.product_list_widget .gp-price--card .gp-price__row,
.dina-product_widget .gp-price--card .gp-price__row {
	justify-content: flex-start;
}

/* Search / live-search rows: RTL, start-aligned (right in Persian), not centered. */
.autocomplete-suggestion .gp-price--card,
.dina-search-item .gp-price--card,
.dina-ajax-search-item .gp-price--card,
.dina-ajax-sresult .gp-price--card,
[class*="ajax-search"] .gp-price--card,
[class*="search-result"] .gp-price--card,
.dina-live-search .gp-price--card {
	display: block;
	clear: both;
	width: 100%;
	text-align: right;
	direction: rtl;
}

.autocomplete-suggestion .gp-price--card .gp-price__row,
.dina-search-item .gp-price--card .gp-price__row,
.dina-ajax-search-item .gp-price--card .gp-price__row,
.dina-ajax-sresult .gp-price--card .gp-price__row,
[class*="ajax-search"] .gp-price--card .gp-price__row,
[class*="search-result"] .gp-price--card .gp-price__row,
.dina-live-search .gp-price--card .gp-price__row {
	justify-content: flex-start;
}

/* Single product keeps green price; cards inherit theme "تماس بگیرید" look */
.gp-price--single .gp-price__amount {
	color: rgb(36, 140, 109);
}

.gp-price:not(.gp-price--card) .gp-price__amount {
	color: rgb(36, 140, 109);
}

.gp-price--card .gp-price__amount {
	color: rgb(36, 140, 109);
	font: inherit;
	line-height: inherit;
	font-weight: inherit;
	font-size: inherit;
}

.gp-price--card .gp-price__currency {
	color: inherit;
	font: inherit;
	line-height: inherit;
	font-weight: inherit;
	font-size: inherit;
}

.gp-price:not(.gp-price--card) .gp-price__currency {
	color: inherit;
	font-size: 18px;
}

/* Must beat .gp-price .gp-price__currency (same 2-class specificity, later in file). */
.gp-price.gp-price--card .gp-price__currency {
	font-size: inherit;
	font-weight: inherit;
}

/* Light — dark text (single product only; cards inherit slot color). */
html:not([dina-dark]) .gp-price--single .gp-price__currency,
html[dina-dark="false"] .gp-price--single .gp-price__currency,
html[dina-dark="light"] .gp-price--single .gp-price__currency {
	color: rgb(33, 37, 41);
}

/* Dark — white text (single product only). */
html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price--single .gp-price__currency,
html[dina-dark="true"] .gp-price--single .gp-price__currency,
html[dina-dark="dark"] .gp-price--single .gp-price__currency,
html.dina-dark .gp-price--single .gp-price__currency,
body.dina-dark .gp-price--single .gp-price__currency {
	color: #fff;
}

.gp-price__amount.gp-price__value--flash,
.gp-price__rate-amount.gp-price__value--flash {
	background-color: rgba(16, 163, 74, 0.15);
}

@media (prefers-reduced-motion: reduce) {
	.gp-price__value {
		transition: none;
	}
	.gp-price__rate-amount,
	.gp-price__amount.gp-price__value--flash,
	.gp-price__rate-amount.gp-price__value--flash {
		transition: none;
		background-color: transparent;
	}
	.gp-price--live .gp-price__live-dot::after {
		animation: none;
		opacity: 0;
	}
}

/* Loading state — shown when no rate is available yet at render time (§7.2 skeleton).
   Gold-toned shimmer sweeps in the RTL reading direction (right → left). */
.gp-price__value--loading {
	display: inline-block;
	width: 9ch;
	height: 1em;
	border-radius: 4px;
	background-image: linear-gradient(
		90deg,
		rgba(184, 134, 11, 0.14) 25%,
		rgba(212, 175, 55, 0.38) 50%,
		rgba(184, 134, 11, 0.14) 75%
	);
	background-size: 200% 100%;
	background-position: 200% 0;
	animation: gp-shimmer 1.5s ease-in-out infinite;
	vertical-align: middle;
}

@keyframes gp-shimmer {
	to { background-position: -200% 0; }
}

.gp-price .gp-price__value--unavailable {
	color: #999;
	font-weight: 400;
}

html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price--single,
html[dina-dark="true"] .gp-price--single,
html[dina-dark="dark"] .gp-price--single,
html.dina-dark .gp-price--single,
body.dina-dark .gp-price--single {
	color: #fff;
	background: #171d1b;
	border-color: rgba(87, 190, 158, 0.28);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price--single .gp-price__header,
html[dina-dark="true"] .gp-price--single .gp-price__header,
html[dina-dark="dark"] .gp-price--single .gp-price__header,
html.dina-dark .gp-price--single .gp-price__header,
body.dina-dark .gp-price--single .gp-price__header {
	background: rgba(36, 140, 109, 0.14);
	border-bottom-color: rgba(87, 190, 158, 0.2);
}

html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price--single .gp-price__title,
html[dina-dark="true"] .gp-price--single .gp-price__title,
html[dina-dark="dark"] .gp-price--single .gp-price__title,
html.dina-dark .gp-price--single .gp-price__title,
body.dina-dark .gp-price--single .gp-price__title,
html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price--single .gp-price__label small,
html[dina-dark="true"] .gp-price--single .gp-price__label small,
html[dina-dark="dark"] .gp-price--single .gp-price__label small,
html.dina-dark .gp-price--single .gp-price__label small,
body.dina-dark .gp-price--single .gp-price__label small {
	color: #83d5bc;
}

html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price--single .gp-price__label,
html[dina-dark="true"] .gp-price--single .gp-price__label,
html[dina-dark="dark"] .gp-price--single .gp-price__label,
html.dina-dark .gp-price--single .gp-price__label,
body.dina-dark .gp-price--single .gp-price__label {
	color: #c7cfcc;
}

html[dina-dark]:not([dina-dark="false"]):not([dina-dark="light"]) .gp-price--single .gp-price__item + .gp-price__item,
html[dina-dark="true"] .gp-price--single .gp-price__item + .gp-price__item,
html[dina-dark="dark"] .gp-price--single .gp-price__item + .gp-price__item,
html.dina-dark .gp-price--single .gp-price__item + .gp-price__item,
body.dina-dark .gp-price--single .gp-price__item + .gp-price__item {
	border-top-color: rgba(255, 255, 255, 0.1);
}

/* Skeleton/placeholder → real number transition. */
.gp-price__value--reveal {
	animation: gp-reveal 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gp-reveal {
	from { opacity: 0; transform: translateY(2px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.gp-price__value--loading {
		animation: none;
		background-image: none;
		background-color: rgba(212, 175, 55, 0.22);
	}
	.gp-price__value--reveal {
		animation: none;
	}
}

@media (max-width: 480px) {
	.gp-price--single {
		max-width: none;
		border-radius: 12px;
	}
	.gp-price--single .gp-price__header,
	.gp-price--single .gp-price__body {
		padding-right: 13px;
		padding-left: 13px;
	}
	.gp-price--single .gp-price__item {
		gap: 10px;
	}
	.gp-price--single .gp-price__value {
		font-size: 20px;
	}
	.gp-price--single .gp-price__rate-value {
		font-size: 15px;
	}
}
