/**
 * Auto Car Finder — reusable UI components.
 * Prefer `--hg-color-*` / `--hg-auto-color-*` tokens from design-tokens.css.
 *
 * @package HG_Automotive
 * @since 0.1.0
 * @updated 0.40.8 Price labels: light grey chips + coloured icons
 */

.hg-auto-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.85rem;
	padding: 0.7rem 1.25rem;
	border: 1px solid transparent;
	border-radius: var(--hg-auto-radius-sm, var(--hg-auto-radius));
	font: inherit;
	font-weight: 650;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--hg-auto-transition, 160ms ease),
		color var(--hg-auto-transition, 160ms ease),
		border-color var(--hg-auto-transition, 160ms ease),
		box-shadow var(--hg-auto-transition, 160ms ease),
		transform var(--hg-auto-transition, 160ms ease);
}

.hg-auto-button--primary {
	/* A11y: white on #ff9501 is ~2.57:1; dark teal on orange is ~5.01:1 (AA). */
	background: var(--hg-color-primary);
	border-color: var(--hg-color-primary);
	color: var(--hg-color-secondary);
	font-weight: 700;
	box-shadow: 0 1px 0 rgba(var(--hg-color-card-rgb), 0.2) inset, 0 6px 16px rgba(var(--hg-color-primary-rgb), 0.28);
}

.hg-auto-button--primary:hover,
.hg-auto-button--primary:focus-visible {
	background: var(--hg-color-primary-hover);
	border-color: var(--hg-color-primary-hover);
	color: var(--hg-color-secondary);
	transform: translateY(-1px);
}

.hg-auto-button--secondary {
	background: var(--hg-color-secondary);
	border-color: var(--hg-color-secondary);
	color: var(--hg-color-on-dark);
}

.hg-auto-button--secondary:hover,
.hg-auto-button--secondary:focus-visible {
	background: var(--hg-color-secondary-hover);
	border-color: var(--hg-color-secondary-hover);
	color: var(--hg-color-on-dark);
}

.hg-auto-hero .hg-auto-button--secondary {
	background: transparent;
	border-color: rgba(var(--hg-color-card-rgb), 0.45);
	color: var(--hg-color-on-dark);
}

.hg-auto-hero .hg-auto-button--secondary:hover,
.hg-auto-hero .hg-auto-button--secondary:focus-visible {
	background: rgba(var(--hg-color-card-rgb), 0.1);
	color: var(--hg-color-on-dark);
}

.hg-auto-button--outline {
	background: var(--hg-auto-color-surface-elevated);
	border-color: var(--hg-auto-color-border);
	color: var(--hg-auto-color-ink);
}

.hg-auto-button--outline:hover,
.hg-auto-button--outline:focus-visible {
	border-color: var(--hg-auto-color-accent);
	color: var(--hg-auto-color-accent);
}

.hg-auto-card {
	background: var(--hg-auto-color-surface-elevated);
	border: 1px solid var(--hg-auto-color-border);
	border-radius: var(--hg-auto-radius);
	overflow: hidden;
	box-shadow: var(--hg-auto-shadow);
	transition: box-shadow var(--hg-auto-transition, 160ms ease), transform var(--hg-auto-transition, 160ms ease);
}

.hg-auto-card__media img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.hg-auto-card__body {
	padding: var(--hg-auto-space-4) var(--hg-auto-space-5);
}

.hg-auto-card__title {
	margin: 0 0 var(--hg-auto-space-2);
	font-family: var(--hg-auto-font-display);
	font-size: 1.15rem;
	line-height: 1.3;
	letter-spacing: -0.015em;
}

.hg-auto-card__title a {
	color: var(--hg-auto-color-ink);
	text-decoration: none;
}

.hg-auto-card__title a:hover,
.hg-auto-card__title a:focus-visible {
	color: var(--hg-auto-color-accent);
}

.hg-auto-card__meta,
.hg-auto-card__excerpt {
	margin: 0;
	color: var(--hg-auto-color-steel);
	font-size: 0.9375rem;
}

.hg-auto-entry__title {
	margin: 0 0 var(--hg-auto-space-3);
	font-family: var(--hg-auto-font-display);
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	letter-spacing: -0.02em;
}

.hg-auto-entry__meta {
	margin: 0 0 var(--hg-auto-space-5);
	color: var(--hg-auto-color-muted);
	font-size: 0.875rem;
}

.hg-auto-entry__media {
	margin: 0 0 var(--hg-auto-space-5);
}

.hg-auto-entry__content > *:first-child {
	margin-top: 0;
}

.hg-auto-alert {
	padding: var(--hg-auto-space-3) var(--hg-auto-space-4);
	border-radius: var(--hg-auto-radius-sm, var(--hg-auto-radius));
	border: 1px solid transparent;
	margin-bottom: var(--hg-auto-space-4);
}

.hg-auto-alert--info {
	background: var(--hg-color-info-bg);
	border-color: var(--hg-color-info-border);
	color: var(--hg-auto-color-info);
}

.hg-auto-alert--success {
	background: var(--hg-color-success-soft);
	border-color: var(--hg-color-success-border);
	color: var(--hg-auto-color-success);
}

.hg-auto-alert--warning {
	background: var(--hg-color-warning-soft);
	border-color: var(--hg-color-warning-border);
	color: var(--hg-auto-color-warning);
}

.hg-auto-alert--danger {
	background: var(--hg-color-error-soft);
	border-color: var(--hg-color-error-border);
	color: var(--hg-auto-color-danger);
}

.hg-auto-empty-state {
	text-align: center;
	padding: clamp(2.5rem, 6vw, 4rem) var(--hg-auto-space-5);
	background: var(--hg-auto-color-surface-elevated);
	border: 1px dashed var(--hg-auto-color-border-strong, var(--hg-auto-color-border));
	border-radius: var(--hg-auto-radius-lg, var(--hg-auto-radius));
}

.hg-auto-empty-state__title {
	margin: 0 0 var(--hg-auto-space-3);
	font-family: var(--hg-auto-font-display);
	font-size: 1.35rem;
}

.hg-auto-empty-state__text {
	margin: 0 auto var(--hg-auto-space-5);
	max-width: 36ch;
	color: var(--hg-auto-color-steel);
}

/* Header / drawer menus only — footer uses .hg-auto-footer-menu (theme-layout.css). */
.hg-auto-menu {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hg-auto-space-2) var(--hg-auto-space-4);
	list-style: none;
	margin: 0;
	padding: 0;
}

.hg-auto-menu a {
	color: var(--hg-auto-color-ink);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
}

.hg-auto-menu a:hover,
.hg-auto-menu a:focus-visible {
	color: var(--hg-auto-color-accent);
}

.hg-auto-nav--primary {
	display: none;
}

.hg-auto-nav-toggle {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 2.85rem;
	height: 2.85rem;
	padding: 0.65rem;
	border: 1px solid var(--hg-auto-color-border);
	border-radius: var(--hg-auto-radius-sm, var(--hg-auto-radius));
	background: var(--hg-auto-color-surface-elevated);
	cursor: pointer;
}

.hg-auto-nav-toggle__bar {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--hg-auto-color-ink);
}

.hg-auto-nav--mobile {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--hg-auto-color-surface-elevated);
	border-bottom: 1px solid var(--hg-auto-color-border);
	padding: var(--hg-auto-space-4);
	box-shadow: var(--hg-auto-shadow);
}

.hg-auto-menu--mobile {
	flex-direction: column;
	align-items: flex-start;
}

/* Forms — spacing, grouping, help text */
.hg-auto-field,
.hg-dash-field,
.hg-auto-search__field,
.hg-seller-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin: 0 0 var(--hg-auto-space-4);
}

.hg-auto-field-group,
.hg-dash-fieldset,
.hg-seller-fieldset {
	margin: 0 0 var(--hg-auto-space-5);
	padding: var(--hg-auto-space-5);
	border: 1px solid var(--hg-auto-color-border);
	border-radius: var(--hg-auto-radius);
	background: var(--hg-auto-color-surface-elevated);
}

.hg-auto-field-group > legend,
.hg-dash-fieldset > legend,
.hg-seller-fieldset > legend {
	padding: 0 var(--hg-auto-space-2);
	font-family: var(--hg-auto-font-display);
	font-size: 1.05rem;
	font-weight: 700;
}

.hg-auto-field__hint,
.hg-dash-field__hint,
.hg-auto-search__hint,
.description,
.hg-admin-page .description {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--hg-auto-color-muted);
	font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
	width: 100%;
	max-width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--hg-auto-color-border);
	border-radius: var(--hg-auto-radius-sm, var(--hg-auto-radius));
	background: var(--hg-auto-color-surface-elevated);
	color: var(--hg-auto-color-ink);
	font: inherit;
	transition: border-color var(--hg-auto-transition, 160ms ease), box-shadow var(--hg-auto-transition, 160ms ease);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	border-color: var(--hg-auto-color-accent);
	box-shadow: var(--hg-auto-focus);
}

label {
	display: inline-block;
	margin-bottom: var(--hg-auto-space-2);
	font-weight: 600;
}

.search-form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: var(--hg-auto-space-2);
	max-width: 32rem;
	margin-bottom: var(--hg-auto-space-5);
}

.search-form .search-submit {
	background: var(--hg-color-primary);
	color: var(--hg-color-secondary);
	border: 0;
	border-radius: var(--hg-auto-radius-sm, var(--hg-auto-radius));
	padding: 0.7rem 1rem;
	font-weight: 700;
	cursor: pointer;
}

.hg-auto-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.4;
	background: var(--hg-auto-color-accent-soft);
	color: var(--hg-auto-color-accent);
}

/* Tiny price labels under listing price (max two). Neutral chip + coloured icon. */
.hg-auto-price-labels {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem;
}

.hg-auto-price-label {
	display: inline-flex;
	align-items: center;
	gap: 0.28rem;
	padding: 0.14rem 0.42rem 0.14rem 0.32rem;
	border-radius: 0.25rem;
	font-size: 0.6875rem;
	font-weight: 650;
	line-height: 1.25;
	letter-spacing: 0.01em;
	color: var(--hg-auto-color-steel, #3a4656);
	background: #eef1f4;
}

.hg-auto-price-label__icon {
	flex-shrink: 0;
	width: 0.75rem;
	height: 0.75rem;
	display: block;
}

.hg-auto-price-label__text {
	min-width: 0;
}

.hg-auto-price-label--fair_price .hg-auto-price-label__icon {
	color: #0f766e;
}

.hg-auto-price-label--great_price .hg-auto-price-label__icon {
	color: #b45309;
}

.hg-auto-price-label--discounted .hg-auto-price-label__icon {
	color: #c2410c;
}

.hg-auto-price-label--negotiable .hg-auto-price-label__icon {
	color: #1d4ed8;
}

.hg-auto-comments {
	margin-top: var(--hg-auto-space-7);
	padding-top: var(--hg-auto-space-6);
	border-top: 1px solid var(--hg-auto-color-border);
}
