/*
 * Damavand Storefront 0.3.5 (R14-E) — Founder review polish. Loaded after design.css,
 * elementor-layout.css, checkout-flow.css and payments.css on every dark-design front page
 * (inc/r14-polish.php). CSS only: no Elementor data in the database needs to change.
 *
 *   D1  compact product cards in the home carousels
 *   D4  notice icon in its own RTL gutter; empty notices hidden
 *   D5  dark form controls that never fall back to the browser's light defaults
 *   D6  header logo in a fixed box, same metrics on every page and when sticky
 *   D8  consistent space above «حساب کاربری من»
 */

/* ===================================================================== *
 * D1 — product carousel («پرفروش‌ترین محصولات», «فروش ویژه و تخفیف‌دار»)
 * design.css sets `.dv-card { width: auto !important }` (for the shop grid). In the carousel that let
 * the 800px placeholder picture size each card (~600px wide). Fixed column count per breakpoint:
 * 5 (≥1200px) · 4 (≥1000px) · 3 (≥690px) · 2 (phones); 220–260px wide on desktop.
 * ===================================================================== */
body.dmv-design .dmv-slider--products { --dmv-r14-gap: 16px; --dmv-r14-cols: 5; }
@media (max-width: 1199px) { body.dmv-design .dmv-slider--products { --dmv-r14-cols: 4; } }
@media (max-width: 999px) { body.dmv-design .dmv-slider--products { --dmv-r14-cols: 3; } }
@media (max-width: 689px) { body.dmv-design .dmv-slider--products { --dmv-r14-gap: 12px; --dmv-r14-cols: 2; } }

body.dmv-design .dmv-slider--products { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
body.dmv-design .dmv-slider--products .dmv-slider__track { gap: var(--dmv-r14-gap); width: 100%; min-width: 0; box-sizing: border-box; }
body.dmv-design .dmv-slider--products .dmv-slider__track > li.dv-card {
	flex: 0 0 auto;
	width: calc((100% - (var(--dmv-r14-cols) - 1) * var(--dmv-r14-gap)) / var(--dmv-r14-cols)) !important;
	max-width: 260px !important; min-width: 0;
	border-radius: 14px;
}
/* Square image area, at most 200px tall; the picture is contained, never cropped or stretched. */
body.dmv-design .dmv-slider--products .dv-card__media {
	display: flex; align-items: center; justify-content: center;
	aspect-ratio: 1 / 1; max-height: 200px; width: 100%; padding: 10px; box-sizing: border-box;
	background: #111214; overflow: hidden;
}
body.dmv-design .dmv-slider--products .dv-card__media picture,
body.dmv-design .dmv-slider--products .dv-card__media .dmv-pic { display: flex; width: 100%; height: 100%; }
body.dmv-design .dmv-slider--products .dv-card__media img {
	width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%; object-fit: contain !important;
}
/* Small status badge (e.g. «موجود در برخی مشخصات»), never wider than the card. */
body.dmv-design .dmv-slider--products .dv-card .dv-badge {
	top: 8px; inset-inline-start: 8px; inset-inline-end: auto; width: auto; max-width: calc(100% - 16px);
	min-height: 22px; padding: 1px 8px; font-size: 11px; font-weight: 700; line-height: 1.7;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block;
}
body.dmv-design .dmv-slider--products .dv-card__body { gap: 6px; padding: 10px 12px 12px; }
/* Name: two lines at most. */
body.dmv-design .dmv-slider--products .dv-card__title { font-size: 14px !important; font-weight: 700; line-height: 1.6; }
body.dmv-design .dmv-slider--products .dv-card__title a {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
	min-height: 3.2em; word-break: break-word;
}
body.dmv-design .dmv-slider--products .dv-card__price { font-size: 13px; line-height: 1.7; margin: 0; padding: 0; }
body.dmv-design .dmv-slider--products .dv-card__from { color: var(--dmv-text, #E8E8EA); font-weight: 700; }
body.dmv-design .dmv-slider--products .dv-card__from .amount { color: var(--dmv-white, #FFFFFF); }
body.dmv-design .dmv-slider--products .dv-price-inquiry { font-size: 12.5px; }
/* The whole card is the link (title ::after overlay); the button is dropped to keep the card compact. */
body.dmv-design .dmv-slider--products .dv-card__cta { display: none !important; }
@media (max-width: 689px) {
	body.dmv-design .dmv-slider--products .dv-card__media { padding: 8px; }
	body.dmv-design .dmv-slider--products .dv-card__title { font-size: 13px !important; }
}

/* ===================================================================== *
 * D4 — WooCommerce notices: icon in its own gutter at the start (right in RTL)
 * Blocksy draws the icon at inset-inline-start 20px but its phone padding is a physical
 * `padding-left: 46px`, and payments.css (thank-you) reset the padding to 14px 18px — both put the
 * bell over the first letters («مت» of «متشکریم»).
 * ===================================================================== */
body.dmv-design :is(.woocommerce-info, .woocommerce-message, .woocommerce-error, .woocommerce-thankyou-order-received) {
	position: relative;
	padding-block: 14px !important;
	padding-inline-start: 52px !important;
	padding-inline-end: 18px !important;
	min-height: 54px; box-sizing: border-box; line-height: 1.8; text-align: start;
}
body.dmv-design :is(.woocommerce-info, .woocommerce-message, .woocommerce-error, .woocommerce-thankyou-order-received)::before {
	position: absolute; top: 18px !important; inset-inline-start: 18px !important; inset-inline-end: auto !important;
	margin: 0 !important;
	width: 18px; height: 18px; font-size: 18px; line-height: 18px; --theme-icon-size: 18px;
}
@media (max-width: 479.98px) {
	body.dmv-design :is(.woocommerce-info, .woocommerce-message, .woocommerce-error, .woocommerce-thankyou-order-received) {
		padding-block: 12px !important; padding-inline-start: 44px !important; padding-inline-end: 14px !important; font-size: 14px;
	}
	body.dmv-design :is(.woocommerce-info, .woocommerce-message, .woocommerce-error, .woocommerce-thankyou-order-received)::before {
		top: 16px !important; inset-inline-start: 14px !important; width: 16px; height: 16px; font-size: 16px; line-height: 16px; --theme-icon-size: 16px;
	}
}
/* Error lists: the bullets live inside the same gutter rule. */
body.dmv-design ul.woocommerce-error { list-style: none; margin-inline: 0; }
body.dmv-design ul.woocommerce-error li { margin: 0; padding: 0; }
/* Safety net (the server no longer prints them — inc/r14-polish.php): never show an empty box. */
body.dmv-design :is(.woocommerce-info, .woocommerce-message, .woocommerce-error):empty,
body.dmv-design .woocommerce-notices-wrapper:empty,
body.dmv-design .dmv-pay__notices:empty { display: none !important; }

/* ===================================================================== *
 * D5 — form controls (Windows Chrome/Edge render native parts light unless told otherwise)
 * Contrast on #121417: text #E8E8EA ≈ 15.6:1, placeholder #8E949B ≈ 6.0:1, border #646A73 ≈ 3.4:1 (AA non-text).
 * `:not(.dmv-r14-x)` lifts the base rule to design.css's weight so it wins by load order; component fields with
 * their own, more specific look (header search, LWP sign-in) keep it.
 * ===================================================================== */
:root:has(body.dmv-design) { color-scheme: dark; }
body.dmv-design {
	color-scheme: dark;
	--dmv-field-bg: #121417;
	--dmv-field-bg-focus: #16191D;
	--dmv-field-text: #E8E8EA;
	--dmv-field-border: #646A73;
	--dmv-field-placeholder: #8E949B;
	--theme-form-field-background-initial-color: var(--dmv-field-bg);
	--theme-form-field-background-focus-color: var(--dmv-field-bg-focus);
	--theme-form-field-border-initial-color: var(--dmv-field-border);
	--theme-form-text-initial-color: var(--dmv-field-text);
	--theme-form-text-focus-color: #FFFFFF;
}
body.dmv-design :is(
	input:where(:not([type]), [type="text"], [type="search"], [type="tel"], [type="email"], [type="number"], [type="password"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]),
	select, textarea
):not(.dmv-r14-x) {
	background-color: var(--dmv-field-bg);
	color: var(--dmv-field-text);
	border-color: var(--dmv-field-border);
	border-style: solid;
	color-scheme: dark;
	-webkit-text-fill-color: currentColor;
	caret-color: #C89B6B;
}
body.dmv-design :is(
	input:where(:not([type]), [type="text"], [type="search"], [type="tel"], [type="email"], [type="number"], [type="password"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]),
	select, textarea
):not(.dmv-r14-x):focus {
	background-color: var(--dmv-field-bg-focus);
	color: #FFFFFF;
	border-color: #C89B6B;
}
body.dmv-design :is(input, select, textarea):disabled,
body.dmv-design :is(input, textarea)[readonly] {
	background-color: #1A1D21; color: #A9AEB5; -webkit-text-fill-color: #A9AEB5; border-color: #33373D; opacity: 1; cursor: not-allowed;
}
body.dmv-design :is(input, textarea)::placeholder { color: var(--dmv-field-placeholder); -webkit-text-fill-color: var(--dmv-field-placeholder); opacity: 1; }
/* The drop-down list of a <select> is drawn by the OS on Windows: give every option its own colours. */
body.dmv-design select option,
body.dmv-design select optgroup { background-color: #1A1D21; color: #E8E8EA; }
body.dmv-design select option:checked { background-color: #3A2F22; color: #FFFFFF; }
body.dmv-design select option:disabled { color: #7D838B; }
body.dmv-design select optgroup { font-weight: 700; color: #C89B6B; }
/* R14 integration: design.css / payments.css use the `background` shorthand and Blocksy sets `appearance: none`, so the
   «ثبت واریز» selects (روش، حساب، روز / ماه / سال) had no drop-down arrow and read as text fields. Chevron at the end. */
body.dmv-design .dmv-pay select:not([multiple]):not([size]) {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A9AEB5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-size: 12px 8px; background-position: left 12px center;
	padding-inline-end: 32px; appearance: none; -webkit-appearance: none;
}
body.dmv-design .dmv-pay select:not([multiple]):not([size]):dir(ltr) { background-position: right 12px center; }
/* Autofill: Chrome paints its own light background — cover it with an inset shadow. */
body.dmv-design :is(input, textarea, select):-webkit-autofill,
body.dmv-design :is(input, textarea, select):-webkit-autofill:hover,
body.dmv-design :is(input, textarea, select):-webkit-autofill:focus {
	-webkit-text-fill-color: #E8E8EA !important;
	caret-color: #C89B6B;
	-webkit-box-shadow: 0 0 0 1000px var(--dmv-field-bg) inset !important;
	box-shadow: 0 0 0 1000px var(--dmv-field-bg) inset !important;
	transition: background-color 600000s 0s, color 600000s 0s;
}
body.dmv-design :is(input, textarea, select):autofill {
	box-shadow: 0 0 0 1000px var(--dmv-field-bg) inset !important;
	-webkit-text-fill-color: #E8E8EA !important;
}
/* File input («تصویر یا PDF رسید»): dark field + gold-outline button that matches the site buttons. */
body.dmv-design input[type="file"] {
	width: 100%; max-width: 100%; box-sizing: border-box; padding: 6px; min-height: 48px;
	background-color: var(--dmv-field-bg); color: #C9CCD1; border: 1px dashed var(--dmv-field-border); border-radius: 12px;
	font: inherit; font-size: 13.5px; color-scheme: dark; cursor: pointer;
}
body.dmv-design input[type="file"]:focus-visible { outline: 2px solid rgba(200, 155, 107, .6); outline-offset: 2px; border-color: #C89B6B; }
body.dmv-design input[type="file"]::file-selector-button {
	margin-inline-end: 12px; padding: 8px 16px; min-height: 34px; border-radius: 999px; cursor: pointer;
	background: rgba(200, 155, 107, .14); color: #F1E3D2; border: 1px solid rgba(200, 155, 107, .6);
	font: inherit; font-size: 13.5px; font-weight: 700; transition: background-color .2s, color .2s;
}
body.dmv-design input[type="file"]:hover::file-selector-button { background: #C89B6B; color: #0B0B0D; }
body.dmv-design input[type="file"]::-webkit-file-upload-button {
	margin-inline-end: 12px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
	background: rgba(200, 155, 107, .14); color: #F1E3D2; border: 1px solid rgba(200, 155, 107, .6); font: inherit; font-weight: 700;
}
/* Checkboxes / radios keep the native control but in the brand colour. */
body.dmv-design :is(input[type="checkbox"], input[type="radio"]) { accent-color: #C89B6B; color-scheme: dark; }
/* Select2 / selectWoo (country & state fields on checkout and my-account). */
body.dmv-design .select2-container--default .select2-selection--single,
body.dmv-design .select2-container--default .select2-selection--multiple { background-color: var(--dmv-field-bg); border-color: var(--dmv-field-border); }
body.dmv-design .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--dmv-field-text); }
body.dmv-design .select2-dropdown { background-color: #1A1D21; color: #E8E8EA; border-color: var(--dmv-field-border); }
body.dmv-design .select2-container--default .select2-search--dropdown .select2-search__field { background-color: var(--dmv-field-bg); color: var(--dmv-field-text); border-color: var(--dmv-field-border); }
body.dmv-design .select2-container--default .select2-results__option--highlighted[aria-selected],
body.dmv-design .select2-container--default .select2-results__option--highlighted[data-selected] { background-color: #3A2F22; color: #FFFFFF; }
body.dmv-design .select2-container--default .select2-results__option[aria-selected="true"],
body.dmv-design .select2-container--default .select2-results__option[data-selected="true"] { background-color: #23262B; color: #FFFFFF; }
/* LWP phone field country list (intl-tel-input). */
body.dmv-design .iti__country-list { background-color: #1A1D21; color: #E8E8EA; border-color: var(--dmv-field-border); }
body.dmv-design .iti__country.iti__highlight { background-color: #3A2F22; }
body.dmv-design .iti__dial-code { color: #A9AEB5; }
/* R14 integration: the sign-in / checkout phone field forces `padding: 0 16px !important` (elementor-layout.css,
   checkout-flow.css), which also beat intl-tel-input's own left padding — the flag (60px) covered the first digits
   of the placeholder and of the typed number. Keep the text clear of the flag box. */
body.dmv-design form.ajax-auth .iti input:not([type="hidden"]) { padding-left: 72px !important; }
/* Windows high-contrast / forced colours: let the system colours win. */
@media (forced-colors: active) {
	body.dmv-design :is(input, select, textarea, option) { forced-color-adjust: auto; }
}

/* ===================================================================== *
 * D6 — header logo
 * Choice: the logo sits in a fixed box ALIGNED TO THE TOP ROW (logo · search · account), vertically
 * centred in it; the menu row runs full width under it. Spanning both rows would squeeze the menu row
 * between 1000–1280px. Same box on every page and in the sticky/scrolled state (no shrink):
 *   ≥1000px: 72px tall (104px wide) · 690–999px: 56px · phones: 40px.
 * Row 1 has a fixed height, so the logo's position never depends on the page or the scroll state.
 * ===================================================================== */
body.dmv-design { --dmv-r14-logo-h: 72px; --dmv-r14-row1-h: 88px; }
@media (max-width: 999px) { body.dmv-design { --dmv-r14-logo-h: 56px; --dmv-r14-row1-h: 72px; } }
@media (max-width: 689px) { body.dmv-design { --dmv-r14-logo-h: 40px; --dmv-r14-row1-h: 56px; } }

/* R14 integration: Blocksy's `.ct-elementor-default-template .e-con > .e-con-inner { width: var(--theme-container-width) }`
   (≈90%) reached the header on every non-Elementor page (product, cart, checkout, account) but not on the home page, so
   the logo sat 25px (desktop) / 7px (phone) further in there. The header rows always use Elementor's own box. */
body.dmv-design .dmv-hdr .e-con > .e-con-inner { width: 100%; }
body.dmv-design .dmv-hdr .dmv-hdr__row1.e-con,
body.dmv-design.dmv-layout.dmv-scrolled .dmv-hdr .dmv-hdr__row1.e-con {
	--padding-top: 8px; --padding-bottom: 8px; --min-height: var(--dmv-r14-row1-h);
	min-height: var(--dmv-r14-row1-h);
}
body.dmv-design .dmv-hdr .dmv-hdr__row1 > .e-con-inner,
body.dmv-design .dmv-hdr .dmv-hdr__row1:not(:has(> .e-con-inner)) { align-items: center !important; min-height: calc(var(--dmv-r14-row1-h) - 16px); }
body.dmv-design .dmv-hdr .dmv-hdr__logo {
	flex: 0 0 auto !important; align-self: center !important; display: flex; align-items: center;
	height: var(--dmv-r14-logo-h); margin: 0 !important; padding: 0 !important;
}
body.dmv-design .dmv-hdr .dmv-hdr__logo > .elementor-widget-container { display: flex; align-items: center; height: 100%; margin: 0; padding: 0; }
body.dmv-design .dmv-hdr .dmv-logo,
body.dmv-design .dmv-hdr .dmv-logo a { display: flex; align-items: center; height: var(--dmv-r14-logo-h); line-height: 0; }
body.dmv-design .dmv-hdr .dmv-logo img,
body.dmv-design.dmv-layout.dmv-scrolled .dmv-hdr .dmv-logo img {
	display: block; height: var(--dmv-r14-logo-h) !important; width: auto !important;
	min-width: 0 !important; max-width: none !important; aspect-ratio: 2760 / 1914; object-fit: contain; transition: none;
}
/* Row 2 (category button · links · language/cart): fixed height too. */
@media (min-width: 690px) {
	body.dmv-design .dmv-hdr .dmv-hdr__row2.e-con { --padding-top: 0px; --padding-bottom: 10px; }
	body.dmv-design .dmv-hdr .dmv-hdr__row2 > .e-con-inner,
	body.dmv-design .dmv-hdr .dmv-hdr__row2:not(:has(> .e-con-inner)) { align-items: center !important; min-height: 48px; }
}
/* Phones: logo at the start (right), cart/menu at the end, search on its own line below. */
@media (max-width: 689px) {
	body.dmv-design .dmv-hdr .dmv-hdr__row1 > .e-con-inner,
	body.dmv-design .dmv-hdr .dmv-hdr__row1:not(:has(> .e-con-inner)) { min-height: 0; }
	body.dmv-design .dmv-hdr .dmv-hdr__logo { order: 1; }
	body.dmv-design .dmv-hdr .dmv-hdr__tools-m { order: 2; margin-inline-start: auto; align-self: center !important; }
}

/* ===================================================================== *
 * D8 — signed-in account pages: one fixed space above «حساب کاربری من» on every tab
 * ===================================================================== */
body.dmv-design.dmv-account:not(.dmv-auth) #main > [data-vertical-spacing] { padding-top: 32px; }
body.dmv-design.dmv-account:not(.dmv-auth) .hero-section { padding-top: 0 !important; margin-top: 0 !important; --margin-bottom: 24px; margin-bottom: 24px; }
body.dmv-design.dmv-account:not(.dmv-auth) .hero-section .page-title { margin: 0; }
body.dmv-design.dmv-account:not(.dmv-auth) .woocommerce-MyAccount-content > :first-child { margin-top: 0; }
@media (max-width: 689px) {
	body.dmv-design.dmv-account:not(.dmv-auth) #main > [data-vertical-spacing] { padding-top: 20px; }
	body.dmv-design.dmv-account:not(.dmv-auth) .hero-section { --margin-bottom: 16px; margin-bottom: 16px; }
}
