/**
 * EXVIN — global component styles.
 *
 * Design tokens (colors, fonts, sizes, spacing, layout) come from theme.json.
 * This file only covers what theme.json cannot express. Rules:
 * - Class prefix: exvin-
 * - CSS logical properties only (RTL-safe); no physical left/right.
 * - Identity guide v01 (owner, 2026-10-06): emerald #009B77 (fills; white text 3.53:1 = large/bold text and UI only), emerald-dark
 *   #007A5E for small emerald text (5.32:1), dark emerald #0B3B30 text (12.48:1), gold #D4AF37 for details only (dark text on gold
 *   5.94:1, never gold text on white), white #FFFFFF background. Flat colours only, no gradients.
 *
 * Contents:
 *  1. Base & typography helpers
 *  2. Utilities (.exvin-ltr, .exvin-badge)
 *  3. Focus styles
 *  4. Contrast guards for dark / colored backgrounds
 *  5. Forms & core search
 *  6. Header
 *  7. Hero
 *  8. Value props
 *  9. Category grid & cards
 * 10. Empty state
 * 11. Footer
 * 12. WooCommerce cosmetic touches
 * 13. Reduced motion
 */

/* ---------------------------------------------------------------------------
 * 1. Base & typography helpers
 * ------------------------------------------------------------------------ */

/* RTL documents use the Arabic-first stack (Alyamama, then Google Sans for Latin). */
html[dir="rtl"] body,
body.rtl {
	font-family: var(--wp--preset--font-family--arabic);
	/* Identity guide v01 (2026-10-06): Alyamama body 500 (headings 700); Google Sans body stays 400. */
	font-weight: 500;
}

body {
	overflow-wrap: break-word;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Form controls do not inherit the font family by default. */
button,
input,
select,
textarea {
	font-family: inherit;
}

a {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

:where(h1, h2, h3, .wp-block-post-title) {
	text-wrap: balance;
}

:where(p, li, figcaption) {
	text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
 * 2. Utilities
 * ------------------------------------------------------------------------ */

/* Identifiers (VIN, OEM, SKU, email, phone, reference numbers) stay LTR inside RTL text. */
.exvin-ltr {
	direction: ltr;
	unicode-bidi: isolate;
	overflow-wrap: anywhere;
}

/* Email / phone / URL inputs keep LTR entry inside RTL pages. */
[dir="rtl"] :is(input[type="email"], input[type="tel"], input[type="url"]) {
	direction: ltr;
}

/* Small pill label; gold accent always carries dark emerald text. */
.exvin-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.375em;
	padding-block: 0.25rem;
	padding-inline: 0.75rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.4;
}

/* ---------------------------------------------------------------------------
 * 3. Focus styles (visible keyboard focus everywhere)
 * ------------------------------------------------------------------------ */

:where(a, button, input, select, textarea, summary, [tabindex], .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--emerald-dark);
	outline-offset: 2px;
}

/* Hide the theme.json :focus ring for mouse/touch focus only; keyboard focus keeps it. */
:root :where(a, .wp-element-button, .wp-block-button__link):focus:not(:focus-visible) {
	outline: none;
}

/* ---------------------------------------------------------------------------
 * 4. Contrast guards for dark / colored backgrounds
 * ------------------------------------------------------------------------ */

/* Dark backgrounds: default to white text unless a text color was chosen. */
:is(.has-emerald-deep-background-color, .has-emerald-dark-background-color, .has-ink-background-color):not(.has-text-color) {
	color: var(--wp--preset--color--surface);
}

:is(.has-emerald-deep-background-color, .has-emerald-dark-background-color, .has-ink-background-color) :is(h1, h2, h3, h4, h5, h6, .wp-block-site-tagline, .wp-block-post-date, .wp-element-caption, figcaption) {
	color: inherit;
}

:is(.has-emerald-deep-background-color, .has-emerald-dark-background-color, .has-ink-background-color) a:where(:not(.wp-element-button)) {
	color: inherit;
}

:is(.has-emerald-deep-background-color, .has-ink-background-color) :focus-visible {
	outline-color: var(--wp--preset--color--accent); /* 6.35:1 on emerald-deep, 8.51:1 on ink */
}

.has-emerald-dark-background-color :focus-visible {
	outline-color: var(--wp--preset--color--surface); /* 5.32:1; gold would be 2.0:1 */
}

/* Emerald: white text (3.53:1, large/bold text). Gold accent: dark emerald text only (5.94:1). */
.has-emerald-background-color:not(.has-text-color) {
	color: var(--wp--preset--color--surface);
}

.has-accent-background-color:not(.has-text-color) {
	color: var(--wp--preset--color--ink);
}

:is(.has-emerald-background-color, .has-accent-background-color) a:where(:not(.wp-element-button)) {
	color: inherit;
}

/* Focus ring must reach 3:1 against the band (WCAG 1.4.11): white on emerald 3.53:1, ink on gold 5.94:1. */
.has-emerald-background-color :focus-visible {
	outline-color: var(--wp--preset--color--surface);
}

.has-accent-background-color :focus-visible {
	outline-color: var(--wp--preset--color--ink);
}

/* ---------------------------------------------------------------------------
 * 5. Forms & core search
 * ------------------------------------------------------------------------ */

.wp-block-search .wp-block-search__input {
	min-block-size: 44px;
	padding-block: 0.5rem;
	padding-inline: 0.875rem;
	border: 1px solid var(--wp--preset--color--ink-muted);
	border-radius: var(--wp--custom--radius--md, 8px);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font-size: max(1rem, 16px); /* avoids iOS zoom on focus */
}

.wp-block-search .wp-block-search__input::placeholder {
	color: var(--wp--preset--color--ink-muted);
	opacity: 1;
}

.wp-block-search .wp-block-search__button {
	flex-shrink: 0; /* min-inline-size replaces the flex min-width:auto; keep text buttons from shrinking below their label */
	min-block-size: 44px;
	min-inline-size: 44px;
	margin-inline-start: var(--wp--preset--spacing--20);
	white-space: nowrap;
}

.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper {
	border-color: var(--wp--preset--color--ink-muted);
	border-radius: var(--wp--custom--radius--md, 8px);
	background-color: var(--wp--preset--color--surface);
}

.wp-block-search.wp-block-search__button-inside .wp-block-search__input {
	border: 0;
}

.wp-block-search.wp-block-search__button-inside .wp-block-search__button {
	border-radius: var(--wp--custom--radius--sm, 6px);
}

/* Pagination: 44px targets (WCAG 2.2 SC 2.5.8 needs at least 24px). Covers posts, comments and
   WooCommerce Product Collection, which all use the core pagination blocks. */
:where(.wp-block-query-pagination-numbers, .wp-block-comments-pagination-numbers) .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-inline-size: 2.75rem;
	min-block-size: 2.75rem;
	padding-inline: 0.5rem;
	border-radius: var(--wp--custom--radius--md, 8px);
	box-sizing: border-box;
}

:where(.wp-block-query-pagination-numbers, .wp-block-comments-pagination-numbers) .page-numbers.current {
	background-color: var(--wp--preset--color--surface-alt);
	font-weight: 600;
}

:where(.wp-block-query-pagination-previous, .wp-block-query-pagination-next, .wp-block-comments-pagination-previous, .wp-block-comments-pagination-next) {
	display: inline-flex;
	align-items: center;
	min-block-size: 2.75rem;
}

/* ---------------------------------------------------------------------------
 * 6. Header
 * ------------------------------------------------------------------------ */

.exvin-header {
	background-color: var(--wp--preset--color--surface);
	border-block-end: 1px solid var(--wp--preset--color--border);
}

.exvin-header__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.exvin-header .wp-block-site-logo {
	flex: 0 0 auto;
	line-height: 0;
}

.exvin-header .wp-block-site-logo img {
	max-inline-size: 100%;
	block-size: auto;
}

/* Phones: the search is last in the DOM, so it wraps to its own full-width row
   below the logo and actions; visual order and focus order stay the same. */
.exvin-header__search {
	flex: 1 1 100%;
	min-inline-size: 0;
}

.exvin-header__actions {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}

/* Push menu, account and cart (and, on desktop, the search after them) to the inline end.
   Two classes are needed to beat core's `.is-layout-flex > :is(*, div) { margin: 0 }`. */
.exvin-header__bar > .exvin-header__actions {
	margin-inline-start: auto;
}

/* Comfortable touch targets for header icon controls. */
.exvin-header :is(.wc-block-mini-cart__button, .wp-block-woocommerce-customer-account a, .wc-block-cart-link) {
	min-block-size: 44px;
	min-inline-size: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Navigation toggle: size only (core controls its display per breakpoint). */
.exvin-header .wp-block-navigation__responsive-container-open {
	min-block-size: 44px;
	min-inline-size: 44px;
	justify-content: center;
}

/* Desktop: one row, search at the inline end (no `order`, so DOM order = visual order). */
@media (min-width: 782px) {
	.exvin-header__search {
		flex: 1 1 20rem;
		max-inline-size: 36rem;
	}
}

/* Optional sticky header: add .exvin-header--sticky to the header group.
   Stickiness is applied to the template-part wrapper so it spans the page. */
.wp-block-template-part:has(> .exvin-header--sticky) {
	position: sticky;
	inset-block-start: 0;
	z-index: 50;
}

.admin-bar .wp-block-template-part:has(> .exvin-header--sticky) {
	inset-block-start: var(--wp-admin--admin-bar--height, 0px);
}

@media (max-width: 600px) {
	/* The admin bar is not fixed on small screens. */
	.admin-bar .wp-block-template-part:has(> .exvin-header--sticky) {
		inset-block-start: 0;
	}
}

/* ---------------------------------------------------------------------------
 * 7. Hero
 * ------------------------------------------------------------------------ */

.exvin-hero {
	position: relative;
	isolation: isolate;
}

.exvin-hero__title {
	text-wrap: balance;
}

.exvin-hero__lead {
	max-inline-size: 40rem;
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--large);
}

/* The hero heading is the core Site Tagline block (level 1); its size comes from the block's font-size preset. */
.exvin-hero .wp-block-site-tagline {
	font-weight: 700;
}

/* ---------------------------------------------------------------------------
 * 8. Value props
 * ------------------------------------------------------------------------ */

/* Fallback grid when the list is not laid out by a core layout. */
.exvin-value-props__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.exvin-value-props__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.exvin-value-props__list {
		grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	}
}

.exvin-value-props :is(.exvin-value-prop, .exvin-value-props__item) {
	block-size: 100%;
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 12px);
	background-color: var(--wp--preset--color--surface);
}

.exvin-value-props :is(.exvin-value-prop, .exvin-value-props__item) > :first-child {
	margin-block-start: 0;
}

.exvin-value-props :is(.exvin-value-prop, .exvin-value-props__item) > :last-child {
	margin-block-end: 0;
}

.exvin-value-props :is(.exvin-value-prop__title, .exvin-value-props__title) {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
}

.exvin-value-props :is(.exvin-value-prop__text, .exvin-value-props__text) {
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Decorative icon (emerald is fine for non-text graphics on white). */
.exvin-value-props :is(.exvin-value-prop__icon, .exvin-value-props__icon) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 2.5rem;
	block-size: 2.5rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background-color: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--emerald-dark, #007A5E);
}

.exvin-value-props :is(.exvin-value-prop__icon, .exvin-value-props__icon) svg {
	inline-size: 1.25rem;
	block-size: 1.25rem;
	fill: currentColor;
}

/* ---------------------------------------------------------------------------
 * 9. Category grid & cards (exvin/category-grid block)
 * ------------------------------------------------------------------------ */

/* Mobile: always 2 columns (auto-fill with a 160px minimum would collapse to 1 at 360px). */
.exvin-category-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
	margin-block: 0;
	margin-inline: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.exvin-category-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: var(--wp--preset--spacing--40);
	}
}

@media (min-width: 1024px) {
	.exvin-category-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}
}

.exvin-category-grid > li {
	margin: 0;
	min-inline-size: 0;
}

.exvin-category-card {
	position: relative;
	display: flex;
	flex-direction: column;
	block-size: 100%;
	min-inline-size: 0;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 12px);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* The card itself, or the link inside it, carries no underline. */
a.exvin-category-card,
.exvin-category-card a {
	color: inherit;
	text-decoration: none;
}

.exvin-category-card__link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.exvin-category-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background-color: var(--wp--preset--color--surface-alt);
}

.exvin-category-card img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.exvin-category-card__media img {
	block-size: 100%;
}

/* No image: neutral tile, never a fake product photo. */
.exvin-category-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	background-color: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--ink-muted);
}

.exvin-category-card__placeholder img,
.exvin-category-card__placeholder svg {
	inline-size: 40%;
	max-inline-size: 5rem;
	block-size: auto;
	aspect-ratio: auto;
	object-fit: contain;
	opacity: 0.6;
}

.exvin-category-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding-block: var(--wp--preset--spacing--30);
	padding-inline: var(--wp--preset--spacing--30);
}

.exvin-category-card__title {
	margin: 0;
	padding-block: var(--wp--preset--spacing--30) 0;
	padding-inline: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.exvin-category-card__count,
.exvin-category-card__meta {
	margin: 0;
	padding-block: 0 var(--wp--preset--spacing--30);
	padding-inline: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--small);
}

.exvin-category-card__body > .exvin-category-card__title,
.exvin-category-card__body > .exvin-category-card__count,
.exvin-category-card__body > .exvin-category-card__meta {
	padding: 0;
}

.exvin-category-card:hover,
.exvin-category-card:has(a:hover) {
	border-color: var(--wp--preset--color--emerald);
	box-shadow: var(--wp--preset--shadow--card, 0 6px 16px rgba(11, 59, 48, 0.08));
	transform: translateY(-2px);
}

.exvin-category-card:hover .exvin-category-card__title,
.exvin-category-card:has(a:hover) .exvin-category-card__title {
	color: var(--wp--preset--color--emerald-dark);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Keyboard focus: ring around the whole card. */
a.exvin-category-card:focus-visible,
.exvin-category-card:has(a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--emerald-dark);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--emerald-dark);
}

/* Only drop the inner link ring where :has() can draw the card ring instead. */
@supports selector(:has(*)) {
	.exvin-category-card a:focus-visible {
		outline: none;
	}
}

/* Single post: hide the previous/next row (and its top border) when there is no adjacent post. */
.exvin-post-nav:not(:has(a)) {
	display: none;
}

/* ---------------------------------------------------------------------------
 * 10. Empty state
 * ------------------------------------------------------------------------ */

.exvin-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	padding-block: var(--wp--preset--spacing--60);
	padding-inline: var(--wp--preset--spacing--40);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 12px);
	background-color: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--ink-muted);
	text-align: center;
}

.exvin-empty-state > * {
	margin-block: 0;
	max-inline-size: 36rem;
}

.exvin-empty-state__title {
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

.exvin-empty-state__text {
	color: var(--wp--preset--color--ink-muted);
}

/* ---------------------------------------------------------------------------
 * 11. Footer
 * ------------------------------------------------------------------------ */

/* Identity guide v01 (2026-10-06): white is the main background, so the footer is a white layout with a gold hairline. */
.exvin-footer {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
}

.exvin-footer :is(h1, h2, h3, h4, h5, h6) {
	color: inherit;
}

.exvin-footer a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}

.exvin-footer a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--emerald-dark);
	text-decoration-color: currentColor;
}

.exvin-footer :focus-visible {
	outline-color: var(--wp--preset--color--emerald-dark);
}

.exvin-footer :is(.wp-block-site-tagline, .exvin-footer__muted, .wp-block-post-date, .wp-element-caption, figcaption) {
	color: var(--wp--preset--color--ink-muted);
}

.exvin-footer .wp-block-separator {
	color: var(--wp--preset--color--border);
}

.exvin-footer .wp-block-navigation a {
	color: inherit;
}

/* The round icon file has an opaque white square background; clip it to a circle
   for display only (the image file and its artwork are unchanged). */
.exvin-footer__icon img {
	border-radius: 50%;
}

/* ---------------------------------------------------------------------------
 * 12. WooCommerce cosmetic touches
 * ------------------------------------------------------------------------ */

/* Consistent radius on WooCommerce buttons. */
:where(.wc-block-components-button:not(.is-link), .wc-block-components-checkout-place-order-button, .wc-block-cart__submit-button) {
	border-radius: var(--wp--custom--radius--md, 8px);
}

/* Classic (shortcode) WooCommerce buttons follow the brand button. */
:is(.woocommerce, .woocommerce-page) :is(a.button, button.button, input.button) {
	border-radius: var(--wp--custom--radius--md, 8px);
	background-color: var(--wp--preset--color--emerald-dark);
	color: var(--wp--preset--color--surface);
	font-weight: 600;
}

:is(.woocommerce, .woocommerce-page) :is(a.button, button.button, input.button):hover {
	background-color: var(--wp--preset--color--emerald-deep);
	color: var(--wp--preset--color--surface);
}

/* Product cards (Product Collection / legacy product grids). */
:where(.wc-block-product, .wc-block-grid__product) {
	display: flex;
	flex-direction: column;
	padding: var(--wp--preset--spacing--30);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 12px);
	background-color: var(--wp--preset--color--surface);
	min-inline-size: 0;
}

:where(.wc-block-product, .wc-block-grid__product) > :last-child {
	margin-block-start: auto;
}

:where(.wc-block-product, .wc-block-grid__product) img {
	border-radius: var(--wp--custom--radius--md, 8px);
}

/* Long (including Arabic) product names wrap instead of overflowing. */
:where(.wc-block-product .wp-block-post-title, .wc-block-components-product-name, .wc-block-grid__product-title, .woocommerce-loop-product__title) {
	overflow-wrap: anywhere;
	line-height: 1.35;
}

:where(.wc-block-components-product-price, .wc-block-grid__product-price, .woocommerce .price) {
	color: var(--wp--preset--color--ink);
	font-weight: 600;
}

:where(.wc-block-components-product-price, .wc-block-grid__product-price, .woocommerce .price) del {
	color: var(--wp--preset--color--ink-muted);
	font-weight: 400;
}

:where(.wc-block-components-product-price, .wc-block-grid__product-price, .woocommerce .price) ins {
	text-decoration: none;
}

/* Sale badge: gold accent with dark text only. */
.wc-block-components-product-sale-badge,
.wc-block-grid__product-onsale,
.woocommerce span.onsale {
	border-color: var(--wp--preset--color--accent);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
}

/* ---------------------------------------------------------------------------
 * 13. Reduced motion
 * ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.exvin-category-card:hover,
	.exvin-category-card:has(a:hover) {
		transform: none;
	}
}

/* ==========================================================================
   12. Sticky footer — footer always reaches the bottom of the window
   ========================================================================== */

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-block-size: 100vh;
	min-block-size: 100dvh;
}

.admin-bar .wp-site-blocks {
	min-block-size: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
	min-block-size: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

.wp-site-blocks > footer {
	margin-block-start: auto;
}

/* ==========================================================================
   13. Launching-soon sections, cards, page heroes
   ========================================================================== */

.exvin-section,
.exvin-page-hero,
.exvin-hero--launch {
	margin-block: 0;
	padding-block: var(--wp--preset--spacing--70);
}

.wp-site-blocks main > .exvin-section,
.wp-site-blocks main > .exvin-page-hero,
.wp-site-blocks main > .exvin-hero {
	margin-block-start: 0;
}

.exvin-section__head {
	max-inline-size: 46rem;
}

.exvin-section__head > *,
.exvin-section__lead {
	margin-block: 0;
}

.exvin-hero--launch .exvin-badge,
.exvin-section__head .exvin-badge {
	margin-block-end: var(--wp--preset--spacing--20);
}

.exvin-hero--launch .exvin-hero__lead {
	max-inline-size: 42rem;
}

.exvin-grid {
	gap: var(--wp--preset--spacing--40);
}

/* Let cards fill the row (auto-fit) instead of leaving empty columns. */
.exvin-grid.is-layout-grid {
	grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.exvin-card {
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 12px);
	block-size: 100%;
}

.exvin-card > * {
	margin-block: 0;
}

.exvin-card > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

.exvin-card__title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

.exvin-card__text {
	color: var(--wp--preset--color--ink-muted);
}

.exvin-step__number {
	display: inline-grid;
	place-items: center;
	inline-size: 2.5rem;
	block-size: 2.5rem;
	border-radius: 999px;
	background: var(--wp--preset--color--emerald-dark);
	color: var(--wp--preset--color--surface);
	font-weight: 700;
	line-height: 1;
}

.exvin-cta__inner {
	gap: var(--wp--preset--spacing--40);
}

.exvin-cta__text {
	max-inline-size: 40rem;
}

.exvin-cta__text > * {
	margin-block: 0;
}

.exvin-split {
	gap: var(--wp--preset--spacing--60);
	align-items: flex-start;
}

.exvin-form-card {
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 12px);
	box-shadow: var(--wp--preset--shadow--card, 0 6px 16px rgba(11, 59, 48, 0.08));
}

.exvin-checklist {
	padding-inline-start: 1.25rem;
}

.exvin-checklist li + li {
	margin-block-start: var(--wp--preset--spacing--20);
}

.exvin-prose > * {
	margin-block: 0;
}

.exvin-prose > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* FAQ (details/summary) */

.exvin-faq__list {
	max-inline-size: 52rem;
}

.exvin-faq__item {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md, 8px);
	padding: 0;
}

.exvin-faq__item > summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--40);
	min-block-size: 44px;
	font-weight: 600;
}

.exvin-faq__item > summary::-webkit-details-marker {
	display: none;
}

.exvin-faq__item > summary::after {
	content: "+";
	flex: none;
	font-size: 1.5em;
	line-height: 1;
	color: var(--wp--preset--color--emerald-dark);
}

.exvin-faq__item[open] > summary::after {
	content: "−";
}

.exvin-faq__item > :not(summary) {
	margin: 0;
	padding-inline: var(--wp--preset--spacing--40);
	padding-block-end: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--ink-muted);
}

/* Header call to action */

.exvin-header__cta .wp-block-button__link {
	white-space: nowrap;
	padding-block: 0.6em;
	padding-inline: 1em;
}

/* Footer columns */

.exvin-footer__main {
	gap: var(--wp--preset--spacing--60);
}

.exvin-footer__heading {
	margin: 0;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.exvin-footer__col p {
	margin: 0;
	line-height: 1.8;
}

/* ==========================================================================
   14. EXVIN Core forms
   ========================================================================== */

.exvin-form {
	display: grid;
	gap: var(--wp--preset--spacing--30);
}

.exvin-form__field {
	display: grid;
	gap: 0.375rem;
	margin: 0;
}

.exvin-form__field label {
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
}

.exvin-form__optional {
	font-weight: 400;
	color: var(--wp--preset--color--ink-muted);
}

.exvin-form__required {
	color: #ed1117;
}

.exvin-form input[type="text"],
.exvin-form input[type="email"],
.exvin-form input[type="tel"],
.exvin-form input[type="date"],
.exvin-form input[type="time"],
.exvin-form input[type="search"],
.exvin-form select,
.exvin-form textarea {
	box-sizing: border-box;
	inline-size: 100%;
	min-block-size: 44px;
	padding: 0.625rem 0.75rem;
	border: 1px solid #009B77;
	border-radius: var(--wp--custom--radius--md, 8px);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font: inherit;
}

.exvin-form textarea {
	resize: vertical;
}

.exvin-form :is(input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--emerald-dark);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--emerald-dark);
}

.exvin-form__help {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--ink-muted);
}

.exvin-form__field--consent {
	grid-template-columns: auto 1fr;
	align-items: start;
	gap: 0.625rem;
}

.exvin-form__field--consent input {
	inline-size: 1.25rem;
	block-size: 1.25rem;
	margin-block-start: 0.15rem;
	accent-color: var(--wp--preset--color--emerald-dark);
}

.exvin-form__field--consent label {
	font-weight: 400;
}

.exvin-form__actions {
	margin: 0;
}

.exvin-form__submit {
	inline-size: 100%;
	min-block-size: 48px;
	cursor: pointer;
}

.exvin-form__hp {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.exvin-form__notice {
	margin: 0 0 var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--md, 8px);
	border-inline-start: 4px solid;
}

.exvin-form__notice--success {
	background: #e5f5f1;
	border-color: var(--wp--preset--color--emerald-dark);
	color: var(--wp--preset--color--emerald-deep);
}

.exvin-form__notice--error {
	background: #fff;
	border-color: #ed1117;
	color: #ed1117;
	font-weight: 600;
}

.exvin-section [id],
.exvin-form-wrap {
	scroll-margin-block-start: 6rem;
}

/* Product page: brand, part number, fit note (EXVIN Core). */
.exvin-pfacts {
	margin-block: 1rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	background: var(--wp--preset--color--surface-alt);
}

.exvin-pfacts__list {
	display: grid;
	gap: 0.35rem;
	margin: 0 0 0.6rem;
}

.exvin-pfacts__list > div {
	display: flex;
	gap: 0.5rem;
}

.exvin-pfacts__list dt {
	min-inline-size: 7.5rem;
	color: var(--wp--preset--color--ink-muted);
}

.exvin-pfacts__list dd {
	margin: 0;
	font-weight: 600;
}

.exvin-pfacts__fit {
	margin: 0;
	font-size: 0.95em;
}

.exvin-pfacts__fit a {
	display: inline-block;
	min-block-size: 44px;
	line-height: 44px;
}

/* ---------------------------------------------------------------------------
 * Home sections (exvin/home-sections block, EXVIN Core): Spare parts · Accessories · Tyres & batteries
 * ------------------------------------------------------------------------ */

.exvin-home-sections {
	display: grid;
	gap: var(--wp--preset--spacing--60);
}

.exvin-home-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem var(--wp--preset--spacing--40);
	margin-block-end: var(--wp--preset--spacing--40);
}

.exvin-home-section__head h2 {
	margin: 0;
}

.exvin-home-section__head p {
	flex: 1 1 16rem;
	margin: 0;
	color: var(--wp--preset--color--ink-muted);
}

.exvin-home-section__all {
	font-weight: 600;
}

/* Mobile: 2 columns at 360/390/430px; 4 on wide screens. */
.exvin-home-section__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 900px) {
	.exvin-home-section__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--40);
	}
}

.exvin-home-section__grid > li {
	margin: 0;
	min-inline-size: 0;
}

.exvin-home-section__grid a {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	block-size: 100%;
	padding: var(--wp--preset--spacing--30);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 12px);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.exvin-home-section__grid a:hover {
	border-color: var(--wp--preset--color--ink-muted);
}

.exvin-home-section__grid img,
.exvin-home-section__noimg {
	display: block;
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	border-radius: var(--wp--custom--radius--md, 8px);
	background-color: var(--wp--preset--color--surface-alt);
}

.exvin-home-section__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.exvin-home-section__num {
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--small);
}

.exvin-home-section__empty,
.exvin-home-section__hint {
	margin: 0;
	color: var(--wp--preset--color--ink-muted);
}

.exvin-home-section__hint {
	margin-block-start: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------------------------------------------------------------------------
 * Home (owner, 2026-10-05, D-068): search panel, four sections, products, offers;
 * header support icon; phone bottom bar. EXVIN palette and fonts only.
 * ------------------------------------------------------------------------ */

.exvin-home {
	padding-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}

.exvin-home-search.exvin-vin-demo {
	max-inline-size: none;
	margin: 0;
	padding: 0;
	transform: none;
	animation: none;
}

/* White search card (owner, 2026-10-06: «حوّل … مربع البحث للأبيض»): white, emerald-tint border, ink text. */
.exvin-home-search__form {
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border-radius: 1.25rem;
	padding: 1.1rem 1.1rem 1.25rem;
}

.exvin-home-search__badge {
	display: inline-block;
	margin: 0 0 0.5rem;
	padding: 0.15rem 0.7rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	font-size: 0.8rem;
	font-weight: 700;
}

.exvin-home-search__title {
	margin: 0 0 0.75rem;
	color: inherit;
	font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.5rem);
	font-weight: 700;
	line-height: 1.4;
}

.exvin-home-search__row {
	display: flex;
	gap: 0.6rem;
	align-items: stretch;
}

.exvin-home-search__input {
	flex: 1 1 auto;
	min-inline-size: 0;
	min-block-size: 3.25rem;
	padding-inline: 1rem;
	border: 1.5px solid var(--wp--preset--color--emerald);
	border-radius: 0.8rem;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font-size: 1rem;
}

.exvin-home-search__go,
.exvin-home-search__cam {
	flex: 0 0 3.25rem;
	display: grid;
	place-items: center;
	block-size: 3.25rem;
	border-radius: 0.8rem;
	cursor: pointer;
}

.exvin-home-search__go {
	border: 0;
	background: var(--wp--preset--color--emerald-dark, #007A5E);
	color: var(--wp--preset--color--surface);
}

.exvin-home-search__cam {
	border: 1.5px solid var(--wp--preset--color--emerald);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--emerald-dark, #007A5E);
}

.exvin-home-search__go:focus-visible,
.exvin-home-search__cam:focus-visible,
.exvin-home-search__input:focus-visible {
	outline: 3px solid var(--wp--preset--color--emerald-dark, #007A5E);
	outline-offset: 2px;
}

.exvin-home-search__hint {
	margin: 0.6rem 0 0;
	color: var(--wp--preset--color--ink-muted, #2F6B5C);
	font-size: 0.85rem;
}

.exvin-home-search .exvin-vin__result:not(:empty) {
	margin-block-start: 0.9rem;
	padding: 0.9rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.8rem;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
}

.exvin-home-store__sections ul {
	display: grid;
	/* One row holding every section, equal widths (D-068; two sections since D-102, three since D-118). */
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 0.6rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.exvin-home-store__sections a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
	block-size: 100%;
	padding: 0.85rem 0.35rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 1rem;
	background: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--emerald-deep);
	text-align: center;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.85rem;
	line-height: 1.3;
}

.exvin-home-store__sections a:hover,
.exvin-home-store__sections a:focus-visible {
	border-color: var(--wp--preset--color--emerald);
	color: var(--wp--preset--color--emerald-dark, #007A5E);
}

.exvin-home-store__sections svg {
	inline-size: 2.4rem;
	block-size: 2.4rem;
}

.exvin-home-store__list {
	margin-block-start: 1.75rem;
}

.exvin-home-store__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-block-end: 0.75rem;
}

.exvin-home-store__head h2 {
	margin: 0;
	font-size: clamp(1.15rem, 1rem + 0.5vw, 1.5rem);
}

.exvin-home-store__head a {
	color: var(--wp--preset--color--emerald-dark, #007A5E);
	font-weight: 700;
	text-decoration: none;
}

.exvin-home-store__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.exvin-home-store__card {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	block-size: 100%;
	padding: 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 1rem;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.exvin-home-store__img {
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 0.6rem;
	background: var(--wp--preset--color--surface-alt);
}

.exvin-home-store__img img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: contain;
}

.exvin-home-store__name {
	font-weight: 700;
	line-height: 1.35;
}

.exvin-home-store__price {
	color: var(--wp--preset--color--emerald-dark, #007A5E);
	font-weight: 700;
}

@media (min-width: 782px) {
	.exvin-home-store__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.exvin-home-store__sections a {
		flex-direction: row;
		justify-content: center;
		padding: 1rem;
		font-size: 1rem;
	}
}

.exvin-header__support {
	display: inline-grid;
	place-items: center;
	color: var(--wp--preset--color--emerald-deep);
}

.exvin-bottom-nav {
	display: none;
}

@media (max-width: 781px) {
	body:has(.exvin-bottom-nav) {
		padding-block-end: calc(4.25rem + env(safe-area-inset-bottom));
	}

	.exvin-bottom-nav {
		display: block;
		position: fixed;
		inset-inline: 0;
		inset-block-end: 0;
		z-index: 90;
		padding-block-end: env(safe-area-inset-bottom);
		border-block-start: 1px solid var(--wp--preset--color--border);
		background: var(--wp--preset--color--surface);
	}

	.exvin-bottom-nav ul {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.exvin-bottom-nav a {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.15rem;
		padding: 0.5rem 0.15rem 0.45rem;
		color: var(--wp--preset--color--ink-muted);
		font-size: 0.75rem;
		text-decoration: none;
	}

	.exvin-bottom-nav a[aria-current="page"] {
		color: var(--wp--preset--color--emerald-dark, #007A5E);
		font-weight: 700;
	}

	/* Tab names are never broken inside a word and never run into the next tab (D-091 text size review; the app's rule):
	   a name wraps only at a space and, when the text is enlarged, shrinks to fit its fifth of the bar (the longest,
	   "Catalogue" in bold, is 4.9em). The full name stays the link's text. */
	.exvin-bottom-nav {
		container-type: inline-size;
	}

	.exvin-bottom-nav a {
		min-inline-size: 0;
		padding-inline: 2px;
		font-size: min(0.75rem, calc(4cqi - 1.2px));
	}

	.exvin-bottom-nav a > span {
		max-inline-size: 100%;
		overflow-wrap: normal;
		word-break: normal;
		text-align: center;
		line-height: 1.2;
	}
}

/* The bottom bar "Search" link lands on the box with a little room above it. */
#exvin-search {
	scroll-margin-top: 16px;
}

/* Home search: the camera is a button in the row here, not an icon inside the field (exvin-motion.css). */
.exvin-home-search .exvin-vin__cam.exvin-home-search__cam {
	position: static;
	inset: auto;
	transform: none;
	margin: 0;
	inline-size: 3.25rem;
	block-size: 3.25rem;
}

/* One search box on the home page: the header search is not repeated there. */
body:has(.exvin-home-search) .exvin-header__search {
	display: none;
}

/* Floating buttons (assistant, back to top) sit above the bottom bar on phones. */
@media (max-width: 781px) {
	body:has(.exvin-bottom-nav) .exvin-ai-launcher,
	body:has(.exvin-bottom-nav) .exvin-to-top {
		inset-block-end: calc(4.25rem + 0.75rem + env(safe-area-inset-bottom));
	}

	body:has(.exvin-bottom-nav) .exvin-ai-panel {
		inset-block-end: calc(4.25rem + 4.5rem + env(safe-area-inset-bottom));
	}
}

/* --------------------------------------------------------------------------
 * D-069: section photos, section search, microphone / photo tools
 * ------------------------------------------------------------------------ */

/* Section tiles: product photo on a light panel, label under it; one row of four, equal sizes. */
.exvin-home-store__sections a {
	padding: 0.4rem 0.4rem 0.7rem;
}

.exvin-home-store__photo {
	display: block;
	inline-size: 100%;
	aspect-ratio: 1;
	block-size: auto;
	object-fit: contain;
	border-radius: 0.75rem;
	background: #fff;
}

/* Tools next to a search box: outlined in green (the home search card is white too). */
.exvin-tool {
	flex: 0 0 3.25rem;
	display: grid;
	place-items: center;
	inline-size: 3.25rem;
	block-size: 3.25rem;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--wp--preset--color--border);
	border-radius: 0.8rem;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--emerald-deep);
	cursor: pointer;
}

.exvin-tool[hidden] {
	display: none;
}

.exvin-home-search .exvin-tool {
	border-color: var(--wp--preset--color--emerald);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--emerald-dark, #007A5E);
}

.exvin-tool.is-on {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	animation: exvin-mic 1.2s ease-in-out infinite;
}

@keyframes exvin-mic {
	50% {
		box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.35);
	}
}

@media (prefers-reduced-motion: reduce) {
	.exvin-tool.is-on {
		animation: none;
	}
}

.exvin-tool:focus-visible,
.exvin-tool:focus-within {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.exvin-tool-status {
	margin: 0.55rem 0 0;
	font-size: 0.9rem;
	font-weight: 600;
}

.exvin-tool-status[data-kind="error"] {
	color: #ed1117;
}

.exvin-home-search .exvin-tool-status {
	color: var(--wp--preset--color--ink);
}

/* The home search card is white: its errors use the error red #ED1117 like everywhere else (rule below). */
.exvin-home-search .exvin-tool-status[data-kind="error"] {
	color: #ed1117;
}

/* Error messages (owner, 2026-10-06): functional red #ED1117, errors only, never identity. It is 4.47:1 on white and
   4.1:1 on the emerald panel, so error text sits on white, is semibold, and always carries an error icon (the form
   notice has its own round icon in exvin-motion.css). */
.exvin-tool-status[data-kind="error"],
.exvin-form__notice--error,
.exvin-sp__errors li {
	font-weight: 600;
}

.exvin-tool-status[data-kind="error"]::before,
.exvin-vehicle-form__decoded.is-error::before,
.exvin-sp__errors li::before {
	content: "";
	display: inline-block;
	inline-size: 1.05em;
	block-size: 1.05em;
	margin-inline-end: 0.4em;
	vertical-align: -0.18em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%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 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.exvin-sp__errors {
	list-style: none;
	padding-inline-start: 0 !important;
}

/* On narrow phones the home row keeps the field usable: tools shrink a little. */
@media (max-width: 400px) {
	.exvin-home-search__row .exvin-tool,
	.exvin-home-search__row .exvin-home-search__go,
	.exvin-home-search__row .exvin-home-search__cam {
		flex-basis: 2.85rem;
		inline-size: 2.85rem;
		block-size: 3.25rem;
	}

	.exvin-home-search__row {
		gap: 0.4rem;
	}
}

/* Section page search ("What do you need for your car?"). */
.exvin-section-search {
	margin-block: 0 1.25rem;
}

.exvin-section-search__form {
	padding: 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 1.1rem;
	background: var(--wp--preset--color--surface-alt);
}

.exvin-section-search__title {
	margin: 0 0 0.6rem;
	color: var(--wp--preset--color--emerald-deep);
	font-size: clamp(1.1rem, 1rem + 0.5vw, 1.45rem);
}

.exvin-section-search__row {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

.exvin-section-search__row input[type="search"] {
	flex: 1 1 auto;
	min-inline-size: 0;
	min-block-size: 3.25rem;
	padding-inline: 1rem;
	border: 1.5px solid var(--wp--preset--color--border);
	border-radius: 0.8rem;
	background: var(--wp--preset--color--surface);
	font-size: 1rem;
}

.exvin-section-search__go {
	flex: 0 0 3.25rem;
	display: grid;
	place-items: center;
	block-size: 3.25rem;
	border: 0;
	border-radius: 0.8rem;
	background: var(--wp--preset--color--emerald);
	color: var(--wp--preset--color--surface);
	cursor: pointer;
}

.exvin-section-search__hint {
	margin: 0.6rem 0 0;
	font-size: 0.9rem;
}

/* Photo search answer. */
.exvin-photo-results {
	margin-block: 1rem;
}

.exvin-photo-results__title {
	margin: 0.75rem 0 0.5rem;
	font-size: 1.15rem;
}

.exvin-photo-results__note {
	margin-block-start: 0.6rem;
	color: var(--wp--preset--color--muted, #2f6b5c);
	font-size: 0.85rem;
}

/* The text field holds the microphone (and voice-clip) buttons at its end, so the field keeps its width. */
.exvin-field {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	min-inline-size: 0;
}

.exvin-field > input {
	flex: 1 1 auto;
	inline-size: 100%;
	min-inline-size: 0;
}

/* The box itself uses dir="auto" (an empty box counts as left-to-right), while the icons follow the page direction:
   reserve the room on the physical side where the icons are. */
.exvin-field:has(.exvin-tool:not([hidden])) > input {
	padding-right: 3rem;
}

[dir="rtl"] .exvin-field:has(.exvin-tool:not([hidden])) > input {
	padding-right: 1rem;
	padding-left: 3rem;
}

.exvin-field:has(.exvin-tool--mic:not([hidden])):has(.exvin-tool--clip) > input {
	padding-right: 5.6rem;
}

[dir="rtl"] .exvin-field:has(.exvin-tool--mic:not([hidden])):has(.exvin-tool--clip) > input {
	padding-right: 1rem;
	padding-left: 5.6rem;
}

.exvin-field .exvin-tool,
.exvin-home-search .exvin-field .exvin-tool {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: 0.3rem;
	inline-size: 2.5rem;
	block-size: 2.5rem;
	flex-basis: auto;
	margin-block-start: -1.25rem;
	border: 0;
	border-radius: 0.6rem;
	background: transparent;
	color: var(--wp--preset--color--emerald-deep);
}

.exvin-field .exvin-tool.exvin-tool--clip,
.exvin-home-search .exvin-field .exvin-tool.exvin-tool--clip {
	inset-inline-end: 2.9rem;
}

.exvin-field .exvin-tool--mic[hidden] + .exvin-tool.exvin-tool--clip,
.exvin-home-search .exvin-field .exvin-tool--mic[hidden] + .exvin-tool.exvin-tool--clip {
	inset-inline-end: 0.3rem;
}

.exvin-field .exvin-tool.is-on {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
}

/* One search box per page: the header search is hidden where a page has its own (home, section pages). */
body:has(.exvin-section-search) .exvin-header__search {
	display: none;
}
