/**
 * AminH Price Range — the price line of a product card.
 *
 * Where the price sits, how the currency is drawn, and one invisible row taken
 * out. No number is formatted here, and no colour or weight is overridden.
 */

/*
 * 1) The blank band above the price.
 *
 * Woodmart stretches every card of a carousel to the height of the tallest slide
 * (`.wd-products[class*="wd-stretch-cont"] .wd-product { height: 100% }`) and then
 * pins the price block to the bottom of the card with `margin-top: auto`, so the
 * whole height difference piles up as empty space between the title and the price.
 *
 * On this shop one card per carousel keeps its add-to-cart button visible — 36px
 * of button plus the 12px card gap — which pushed the price of every *other* card
 * 48px down. Measured on the live homepage: the title-to-price distance was 12px
 * on that one card and 48.4px on its neighbours.
 *
 * Product titles are clamped to a single line here (`title-line-one` on the
 * products wrapper), so the price does not need the auto margin to stay level with
 * its neighbours: with the margin dropped, all 23 cards of the homepage sit at
 * exactly 12px and the leftover height goes to the bottom of the card, where the
 * (hidden) add-to-cart row already lives.
 *
 * One class more specific than the theme's own rule, so stylesheet load order —
 * which LiteSpeed's CSS combining is free to change — cannot decide the outcome.
 */
.wd-loop-builder-off[class*="wd-stretch-cont"] .wd-product .product-element-bottom :is( .price, .wrap-price, .product-rating-price ) {
	margin-top: 0;
}

/*
 * 2) «تومان» as the toman sign, the way Digikala sets it — a small stacked mark
 * instead of the word, so the price line takes less room on a narrow card.
 *
 * The word stays in the markup (screen readers, copy-paste, TM EPO's rebuilt
 * price at priority 999999 all keep working); it is pushed out of a fixed box
 * and the box is painted with the sign as a mask over `currentColor`, so the
 * sign takes the price's own colour on every card. `em`, so it follows the size
 * the theme gives the price on each breakpoint. Every card price — not only the
 * ranges this plugin rewrites — otherwise a simple product's card would spell
 * its currency out next to a variable product's sign.
 *
 * Behind @supports: a browser without CSS masks would paint the box as a solid
 * square, so it keeps the plain word instead.
 */
@supports (mask-size: contain) or (-webkit-mask-size: contain) {
	.wd-product .price .woocommerce-Price-currencySymbol {
		display: inline-block;
		font-size: 1em; /* the theme sets the word at 0.9em; the sign is sized off the digits */
		width: 1.3em;
		height: 1.3em;
		vertical-align: -0.3em;
		overflow: hidden;
		white-space: nowrap;
		text-indent: 200%;
		background-color: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='%23000'%3E%3Cpath fill-rule='evenodd' d='M3.057 1.742L3.821 1l.78.75-.776.741-.768-.749zm3.23 2.48c0 .622-.16 1.111-.478 1.467-.201.221-.462.39-.783.505a3.251 3.251 0 01-1.083.163h-.555c-.421 0-.801-.074-1.139-.223a2.045 2.045 0 01-.9-.738A2.238 2.238 0 011 4.148c0-.059.001-.117.004-.176.03-.55.204-1.158.525-1.827l1.095.484c-.257.532-.397 1-.419 1.403-.002.04-.004.08-.004.12 0 .252.055.458.166.618a.887.887 0 00.5.354c.085.028.178.048.278.06.079.01.16.014.243.014h.555c.458 0 .769-.081.933-.244.14-.139.21-.383.21-.731V2.02h1.2v2.202zm5.433 3.184l-.72-.7.709-.706.735.707-.724.7zm-2.856.308c.542 0 .973.19 1.293.569.297.346.445.777.445 1.293v.364h.18v-.004h.41c.221 0 .377-.028.467-.084.093-.055.14-.14.14-.258v-.069c.004-.243.017-1.044 0-1.115L13 8.05v1.574a1.4 1.4 0 01-.287.863c-.306.405-.804.607-1.495.607h-.627c-.061.733-.434 1.257-1.117 1.573-.267.122-.58.21-.937.265a5.845 5.845 0 01-.914.067v-1.159c.612 0 1.072-.082 1.38-.247.25-.132.376-.298.376-.499h-.515c-.436 0-.807-.113-1.113-.339-.367-.273-.55-.667-.55-1.18 0-.488.122-.901.367-1.24.296-.415.728-.622 1.296-.622zm.533 2.226v-.364c0-.217-.048-.389-.143-.516a.464.464 0 00-.39-.187.478.478 0 00-.396.187.705.705 0 00-.136.449.65.65 0 00.003.067c.008.125.066.22.177.283.093.054.21.08.352.08h.533zM9.5 6.707l.72.7.724-.7L10.209 6l-.709.707zm-6.694 4.888h.03c.433-.01.745-.106.937-.29.024.012.065.035.12.068l.074.039.081.042c.135.073.261.133.379.18.345.146.67.22.977.22a1.216 1.216 0 00.87-.34c.3-.285.449-.714.449-1.286a2.19 2.19 0 00-.335-1.145c-.299-.457-.732-.685-1.3-.685-.502 0-.916.192-1.242.575-.113.132-.21.284-.294.456-.032.062-.06.125-.084.191a.504.504 0 00-.03.078 1.67 1.67 0 00-.022.06c-.103.309-.171.485-.205.53-.072.09-.214.14-.427.147-.123-.005-.209-.03-.256-.076-.057-.054-.085-.153-.085-.297V7l-1.201-.5v3.562c0 .261.048.496.143.703.071.158.168.296.29.413.123.118.266.211.43.28.198.084.42.13.665.136v.001h.036zm2.752-1.014a.778.778 0 00.044-.353.868.868 0 00-.165-.47c-.1-.134-.217-.201-.35-.201-.18 0-.33.103-.447.31-.042.071-.08.158-.114.262a2.434 2.434 0 00-.04.12l-.015.053-.015.046c.142.118.323.216.544.293.18.062.325.092.433.092.044 0 .086-.05.125-.152z' clip-rule='evenodd'%3E%3C/path%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='%23000'%3E%3Cpath fill-rule='evenodd' d='M3.057 1.742L3.821 1l.78.75-.776.741-.768-.749zm3.23 2.48c0 .622-.16 1.111-.478 1.467-.201.221-.462.39-.783.505a3.251 3.251 0 01-1.083.163h-.555c-.421 0-.801-.074-1.139-.223a2.045 2.045 0 01-.9-.738A2.238 2.238 0 011 4.148c0-.059.001-.117.004-.176.03-.55.204-1.158.525-1.827l1.095.484c-.257.532-.397 1-.419 1.403-.002.04-.004.08-.004.12 0 .252.055.458.166.618a.887.887 0 00.5.354c.085.028.178.048.278.06.079.01.16.014.243.014h.555c.458 0 .769-.081.933-.244.14-.139.21-.383.21-.731V2.02h1.2v2.202zm5.433 3.184l-.72-.7.709-.706.735.707-.724.7zm-2.856.308c.542 0 .973.19 1.293.569.297.346.445.777.445 1.293v.364h.18v-.004h.41c.221 0 .377-.028.467-.084.093-.055.14-.14.14-.258v-.069c.004-.243.017-1.044 0-1.115L13 8.05v1.574a1.4 1.4 0 01-.287.863c-.306.405-.804.607-1.495.607h-.627c-.061.733-.434 1.257-1.117 1.573-.267.122-.58.21-.937.265a5.845 5.845 0 01-.914.067v-1.159c.612 0 1.072-.082 1.38-.247.25-.132.376-.298.376-.499h-.515c-.436 0-.807-.113-1.113-.339-.367-.273-.55-.667-.55-1.18 0-.488.122-.901.367-1.24.296-.415.728-.622 1.296-.622zm.533 2.226v-.364c0-.217-.048-.389-.143-.516a.464.464 0 00-.39-.187.478.478 0 00-.396.187.705.705 0 00-.136.449.65.65 0 00.003.067c.008.125.066.22.177.283.093.054.21.08.352.08h.533zM9.5 6.707l.72.7.724-.7L10.209 6l-.709.707zm-6.694 4.888h.03c.433-.01.745-.106.937-.29.024.012.065.035.12.068l.074.039.081.042c.135.073.261.133.379.18.345.146.67.22.977.22a1.216 1.216 0 00.87-.34c.3-.285.449-.714.449-1.286a2.19 2.19 0 00-.335-1.145c-.299-.457-.732-.685-1.3-.685-.502 0-.916.192-1.242.575-.113.132-.21.284-.294.456-.032.062-.06.125-.084.191a.504.504 0 00-.03.078 1.67 1.67 0 00-.022.06c-.103.309-.171.485-.205.53-.072.09-.214.14-.427.147-.123-.005-.209-.03-.256-.076-.057-.054-.085-.153-.085-.297V7l-1.201-.5v3.562c0 .261.048.496.143.703.071.158.168.296.29.413.123.118.266.211.43.28.198.084.42.13.665.136v.001h.036zm2.752-1.014a.778.778 0 00.044-.353.868.868 0 00-.165-.47c-.1-.134-.217-.201-.35-.201-.18 0-.33.103-.447.31-.042.071-.08.158-.114.262a2.434 2.434 0 00-.04.12l-.015.053-.015.046c.142.118.323.216.544.293.18.062.325.092.433.092.044 0 .086-.05.125-.152z' clip-rule='evenodd'%3E%3C/path%3E%3C/svg%3E") center / contain no-repeat;
	}
}

/*
 * 3) The blank row between the second title and the price.
 *
 * Every card prints the product's accord number as a SKU row («Accord: 1011»),
 * and the site's custom CSS hides it by colouring the text transparent
 * (`.wd-label, .wd-sku { color: #33333300 }`). Transparent text still takes its
 * line, so each card carried an invisible ~24px row there — measured on the live
 * shop at 390px: 32px from the second title to the price, 10px with the row gone.
 * The row is never meant to be read on a card, so it is taken out of the layout.
 */
.wd-product .wd-product-sku {
	display: none;
}

/*
 * 4) Keep the price inside the card on desktop once that row is gone.
 *
 * Above 1024px the theme's "buttons on hover" card hides its footer row under
 * the card's bottom edge (`.product-element-bottom { margin-bottom:
 * calc(var(--wd-trans-h) * -1) }`, 12px gap + 36px button) and slides it up on
 * hover. This site hides the add-to-cart button, so the footer is 0px tall, and
 * the invisible accord row from (3) was what filled those 48px. Without it the
 * negative margin swallowed the bottom of the price — measured on the live
 * homepage at 1440px: the price ran 13px past the card's clip edge, 32px at
 * 1536px and up. Giving the footer the height the theme already reserves for it
 * puts every price back inside the card; on hover the card lifts as it always
 * did. Desktop only, where that margin applies.
 */
@media (min-width: 1025px) {
	.wd-product.wd-hover-buttons-on-hover .wd-product-footer {
		min-height: calc(var(--wd-trans-h) - var(--wd-prod-gap));
	}
}
