/*
 * Autonameh Car Prices — scoped frontend styles.
 *
 * Uses the Autonameh / Elementor global tokens where they exist
 * (--e-global-color-*) and falls back to the same values so the component
 * adapts automatically when the brand palette changes.
 * Nothing global is restyled: every rule is scoped under .acp.
 */

.acp {
	--acp-line: #dce5f0;
	--acp-soft: #f8fafc;
	--acp-ink: var(--e-global-color-text, #172033);
	--acp-muted: var(--e-global-color-8ce998e, #657084);
	--acp-primary: var(--e-global-color-primary, #1078f0);
	--acp-secondary: var(--e-global-color-secondary, #0b56b3);
	--acp-blue-soft: var(--e-global-color-2935dfe, #eaf4ff);
	--acp-accent: var(--e-global-color-accent, #f8b810);
	--acp-warn: var(--e-global-color-3a88e29, #a66300);
	--acp-green: #167857;
	--acp-red: #b4232f;

	box-sizing: border-box;
	width: var(--acp-width, 100%);
	max-width: var(--acp-max-width, 100%);
	min-height: var(--acp-min-height, auto);
	font-family: Vazirmatn, Estedad, sans-serif;
	color: var(--acp-ink);
	line-height: 1.8;
	overflow-wrap: anywhere;
}

.acp *,
.acp *::before,
.acp *::after {
	box-sizing: border-box;
}

.acp-align-stretch {
	margin-inline: 0;
}

.acp-align-center {
	margin-inline: auto;
}

.acp-align-start {
	margin-inline: 0 auto;
}

.acp-align-end {
	margin-inline: auto 0;
}

/* ---- Shared card shell ---- */

.acp--card,
.acp--box {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--acp-line);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgb(23 32 51 / 4%);
}

.acp--box {
	padding: clamp(17px, 3vw, 30px);
	gap: 14px;
}

.acp--card {
	padding: 0;
}

.acp__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.acp__name {
	margin: 0;
	font-family: Estedad, Vazirmatn, sans-serif;
	font-size: clamp(17px, 2.4vw, 22px);
	line-height: 1.5;
	font-weight: 800;
}

.acp__name a {
	color: var(--acp-ink);
	text-decoration: none;
}

.acp__name a:hover,
.acp__name a:focus-visible {
	color: var(--acp-secondary);
	text-decoration: underline;
}

.acp__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: clamp(15px, 2.5vw, 22px);
	min-width: 0;
}

.acp__media {
	display: block;
	background: var(--acp-blue-soft);
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.acp__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.acp__image--placeholder {
	display: grid;
	place-items: center;
	color: var(--acp-secondary);
	font-size: 44px;
	font-weight: 800;
	background: linear-gradient(135deg, var(--acp-blue-soft), #d9e8f8);
}

/* ---- Prices ---- */

.acp__prices {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
}

.acp__primary,
.acp__reference {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.acp__reference {
	padding-inline-start: 14px;
	border-inline-start: 1px solid var(--acp-line);
}

.acp__label {
	color: var(--acp-muted);
	font-size: 12px;
	font-weight: 600;
}

.acp__amount {
	color: var(--acp-ink);
	font-family: Estedad, Vazirmatn, sans-serif;
	font-size: clamp(20px, 3.4vw, 30px);
	font-weight: 800;
	line-height: 1.35;
}

.acp__reference strong {
	color: var(--acp-secondary);
	font-size: clamp(15px, 2.2vw, 19px);
	font-weight: 800;
}

.acp__range {
	margin: 0;
	color: var(--acp-muted);
	font-size: 13px;
}

.acp__note {
	margin: 0;
	color: var(--acp-muted);
	font-size: 14px;
}

/* ---- Zero-kilometre (new car) price ---- */

.acp__new {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	margin: 0;
	padding: 8px 12px;
	background: var(--acp-soft);
	border: 1px solid var(--acp-line);
	border-radius: 10px;
}

.acp__new-value {
	color: var(--acp-secondary);
	font-size: 15px;
	font-weight: 800;
}

/* ---- Stats ---- */

.acp__stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.acp__stats li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding: 11px 14px;
	background: var(--acp-soft);
	border: 1px solid var(--acp-line);
	border-radius: 12px;
}

.acp__stats span {
	color: var(--acp-muted);
	font-size: 12px;
}

.acp__stats strong {
	color: var(--acp-ink);
	font-size: 15px;
	font-weight: 800;
}

@media (min-width: 560px) {
	.acp__stats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---- Chips / meta ---- */

.acp__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.acp__chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 12px;
	border: 1px solid var(--acp-line);
	border-radius: 999px;
	background: #fff;
	color: var(--acp-ink);
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.acp__chip.is-muted {
	color: var(--acp-muted);
	font-weight: 600;
}

.acp__chip.is-high {
	color: var(--acp-green);
	background: #e9f7f1;
	border-color: #bfe7d2;
}

.acp__chip.is-medium {
	color: var(--acp-warn);
	background: var(--e-global-color-99fea5a, #fff6dc);
	border-color: #eedb95;
}

.acp__chip.is-low {
	color: var(--acp-warn);
	background: #fff6dc;
	border-color: #eedb95;
}

.acp__chip.is-none {
	color: var(--acp-muted);
}

.acp__chip.is-reference,
.acp__chip.is-override {
	color: var(--acp-secondary);
	background: var(--acp-blue-soft);
	border-color: #cbdced;
}

.acp__chip.is-up {
	color: var(--acp-red);
}

.acp__chip.is-down {
	color: var(--acp-green);
}

/* ---- Year selector ---- */

.acp__years {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-width: 0;
}

.acp .acp__year {
	min-height: 38px;
	padding: 5px 14px;
	border: 1px solid var(--acp-line);
	border-radius: 10px;
	background: var(--acp-soft);
	color: var(--acp-secondary);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}

.acp .acp__year:hover,
.acp .acp__year:focus-visible {
	border-color: var(--acp-primary);
	background: var(--acp-blue-soft);
	color: var(--acp-secondary);
}

.acp .acp__year.is-active {
	color: #fff;
	background: var(--acp-primary);
	border-color: var(--acp-primary);
}

/* ---- CTA ---- */

.acp__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin-top: 4px;
	padding: 9px 22px;
	color: #fff;
	background: var(--acp-primary);
	border: 1px solid var(--acp-primary);
	border-radius: 10px;
	font-weight: 800;
	text-align: center;
	text-decoration: none;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease;
}

.acp__cta:hover,
.acp__cta:focus-visible {
	color: #fff;
	background: var(--acp-secondary);
	border-color: var(--acp-secondary);
	text-decoration: none;
}

/* ---- Chart ---- */

.acp__chart-wrap {
	position: relative;
	width: 100%;
	height: var(--acp-chart-h-mobile, 230px);
	margin-top: 6px;
}

@media (min-width: 768px) {
	.acp__chart-wrap {
		height: var(--acp-chart-h-tablet, 260px);
	}
}

@media (min-width: 1024px) {
	.acp__chart-wrap {
		height: var(--acp-chart-h-desktop, 300px);
	}
}

.acp__chart {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

.acp__chart-empty {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	margin: 0;
	padding: 16px;
	color: var(--acp-muted);
	text-align: center;
	font-size: 13px;
}

.acp__chart-empty[hidden] {
	display: none;
}

/* ---- Source + disclaimer ---- */

.acp__source {
	margin: 0;
	color: var(--acp-muted);
	font-size: 11px;
}

.acp__disclaimer {
	margin: 0;
	padding-top: 12px;
	border-top: 1px solid var(--acp-line);
	color: var(--acp-muted);
	font-size: 12px;
	line-height: 1.9;
}

.acp--card .acp__disclaimer {
	padding: 12px clamp(15px, 2.5vw, 22px) clamp(15px, 2.5vw, 22px);
	margin: 0;
}

/* ---- Numeric ---- */

.acp--numeric {
	display: inline-block;
	max-width: 100%;
	font-weight: 700;
}

.acp__numeric-value {
	color: var(--acp-ink);
}

.acp--numeric .acp__disclaimer {
	display: block;
	margin-top: 4px;
	padding-top: 4px;
	border-top: 0;
	font-weight: 400;
}

/* ---- Empty / not found ---- */

.acp__empty {
	color: var(--acp-muted);
	font-size: 13px;
}

/* ---- Placeholder (editor / builder preview) ---- */

.acp--placeholder {
	display: grid;
	place-items: center;
	min-height: 120px;
	padding: 20px;
	background: var(--acp-soft, #f8fafc);
	border: 1px dashed #c9d7e6;
	border-radius: 14px;
}

.acp--placeholder .acp__empty {
	color: var(--acp-muted, #657084);
	font-size: 13px;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.acp__cta {
		transition: none;
	}
}

/* ---- Hero price block (car page top) ---- */

.acp--hero {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: clamp(16px, 3vw, 26px);
	background: #fff;
	border: 1px solid var(--acp-line);
	border-radius: 14px;
	box-shadow: 0 1px 2px rgb(23 32 51 / 4%);
}

.acp--hero .acp__label {
	color: var(--acp-muted);
	font-size: 13px;
}

.acp--hero .acp__amount {
	font-family: Estedad, Vazirmatn, sans-serif;
	font-size: clamp(18px, 2.6vw, 24px);
	font-weight: 800;
	color: var(--acp-ink);
}

.acp--hero .acp__new {
	align-self: flex-start;
	padding: 0;
	background: transparent;
	border: 0;
}

.acp--hero .acp__chart-wrap {
	height: 150px;
	min-height: 0;
	margin: 4px 0;
}

.acp--hero .acp__year-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.acp .acp__year-label {
	color: var(--acp-muted);
	font-size: 12px;
}

.acp .acp__year-select {
	appearance: none;
	width: 100%;
	max-width: 260px;
	min-height: 46px;
	padding: 8px 14px;
	padding-inline-end: 42px;
	border: 1px solid var(--acp-line);
	border-radius: 10px;
	background-color: var(--acp-soft);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230b56b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	background-size: 16px 16px;
	color: var(--acp-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.acp .acp__year-select:focus-visible {
	outline: 2px solid var(--acp-primary);
	outline-offset: 2px;
}

.acp--hero .acp__chart-wrap:has(.acp__chart-empty:not([hidden])) {
	height: auto;
	min-height: 68px;
}

.acp--hero .acp__chart-wrap:has(.acp__chart-empty:not([hidden])) .acp__chart {
	display: none;
}

.acp--hero .acp__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	min-height: 48px;
	padding: 8px 20px;
	border-radius: 10px;
	background: var(--acp-primary);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
}

.acp--hero .acp__cta:hover,
.acp--hero .acp__cta:focus-visible {
	background: var(--acp-secondary);
	color: #fff;
	text-decoration: none;
}

.acp--hero .acp__chip {
	align-self: flex-start;
	color: var(--acp-muted);
	font-size: 11px;
}
