/*
 * GWM Showroom finish layer (Claude, review #23): one button system, tabular figures, one form-field spec.
 * Loaded after every theme stylesheet. Colours and hover motion are left to the theme (motion-22.css); this file
 * only sets geometry, type and states so every CTA, figure and field on the site matches.
 *
 * `body:not(#gwm)` lifts these rules above the theme's older page-specific button rules without !important.
 */
:root {
	--gwm-btn-h: 52px;
	--gwm-btn-px: 26px;
	--gwm-field-h: 52px;
	--gwm-hair: #d9dcd6;
	--gwm-field-line: #b9beb9;
	--gwm-ink-solid: #111615;
	--gwm-error: #b32d2e;
	--gwm-finish-ease: cubic-bezier(.2, .7, 0, 1);
}
@media (max-width: 599px) {
	:root {
		--gwm-btn-h: 48px;
		--gwm-btn-px: 18px;
	}
}

/* 1. Buttons ------------------------------------------------------------------------------------------------- */
body:not(#gwm) :is(
	.wp-block-button__link,
	.wp-element-button,
	.gwm-specs-pending__secondary,
	.gwm-lead-form button[type="submit"]
):not(.gwm-fc__submit):not(.screen-reader-text) {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: auto;
	min-height: var(--gwm-btn-h);
	padding: 0 var(--gwm-btn-px);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: .01em;
	text-align: center;
	text-decoration: none;
	border-radius: 0;
}
/* outline variant: same box as solid, a quieter 1px line that firms up on hover */
body:not(#gwm) :is(.is-style-outline > .wp-block-button__link, .wp-element-button.is-style-outline, .gwm-specs-pending__secondary) {
	border-width: 1px;
	border-style: solid;
}
/* header CTA sits in a 44px bar */
body:not(#gwm) header:not(#gwm-header) :is(.wp-block-button__link, .wp-element-button):not(#gwm-cta) {
	--gwm-btn-h: 44px;
	--gwm-btn-px: 20px;
	font-size: 13.5px;
}
/* arrows inside CTAs nudge on hover (pointer devices only) */
:is(.wp-block-button__link, .wp-element-button) span[aria-hidden="true"] {
	display: inline-block;
	transition: transform .35s var(--gwm-finish-ease);
}
@media (hover: hover) and (pointer: fine) {
	:is(.wp-block-button__link, .wp-element-button):hover span[aria-hidden="true"] {
		transform: translateX(4px);
	}
}
/* core button groups: even gaps, and equal-width pairs on phones */
body:not(#gwm) .wp-block-buttons {
	gap: 10px;
}
@media (max-width: 599px) {
	body:not(#gwm) main .wp-block-buttons:has(> .wp-block-button:nth-child(2):last-child) {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}
	body:not(#gwm) main .wp-block-buttons:has(> .wp-block-button:nth-child(2):last-child) .wp-block-button__link {
		width: 100%;
		padding-inline: 12px;
	}
}

/* 2. Figures: fixed-width digits so prices, specs and count-ups line up and never jitter ---------------------- */
:is(
	.gwm-trim-prices,
	.gwm-hero-prices,
	.gwm-home-price,
	.gwm-card-price,
	.gwm-vehicle-details__price,
	.gwm-stat-strip,
	.gwm-spec-group,
	.gwm-about-figure,
	.gwm-fc__num,
	.gwm-fc__emi,
	.gwm-range__prices,
	.gwm-compare table
) {
	font-variant-numeric: tabular-nums;
}

/* 3. Forms: enquiry modal and the forms that reuse its classes ------------------------------------------------ */
body:not(#gwm) .gwm-lead-form label {
	font-size: 12.5px;
	letter-spacing: .02em;
}
body:not(#gwm) .gwm-lead-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
	box-sizing: border-box;
	min-height: var(--gwm-field-h);
	padding: 0 14px;
	font-size: 16px; /* 16px keeps iOS from zooming the page on focus */
	color: var(--gwm-ink-solid);
	background-color: #fff;
	border: 1px solid var(--gwm-field-line);
	border-radius: 0;
	transition: border-color .2s var(--gwm-finish-ease), box-shadow .2s var(--gwm-finish-ease);
}
body:not(#gwm) .gwm-lead-form textarea {
	padding-block: 14px;
	line-height: 1.5;
}
body:not(#gwm) .gwm-lead-form select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 42px;
	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='%23111615' stroke-width='1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
}
@media (hover: hover) {
	body:not(#gwm) .gwm-lead-form :is(input, select, textarea):hover {
		border-color: #8d938f;
	}
}
body:not(#gwm) .gwm-lead-form :is(input, select, textarea):focus-visible {
	outline: 2px solid var(--gwm-ink-solid);
	outline-offset: 0;
	border-color: var(--gwm-ink-solid);
}
body:not(#gwm) .gwm-lead-form :is(input, select, textarea)[aria-invalid="true"] {
	border-color: var(--gwm-error);
	box-shadow: inset 0 0 0 1px var(--gwm-error);
}
body:not(#gwm) .gwm-lead-form input[type="checkbox"] {
	accent-color: var(--gwm-ink-solid);
}
body:not(#gwm) .gwm-lead-form button[type="submit"] {
	width: 100%;
	margin-top: 6px;
}
body:not(#gwm) .gwm-form-status {
	font-size: 14px;
	line-height: 1.5;
}
/* close control: a real 44px target, centred glyph */
body:not(#gwm) .gwm-lead-close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 28px;
	line-height: 1;
	color: var(--gwm-ink-solid);
	right: 12px;
	top: 12px;
}
body:not(#gwm) .gwm-lead-close:focus-visible {
	outline: 2px solid var(--gwm-ink-solid);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	:is(.wp-block-button__link, .wp-element-button) span[aria-hidden="true"],
	body:not(#gwm) .gwm-lead-form :is(input, select, textarea) {
		transition: none;
	}
}
