/* Akumulators pēc transportlīdzekļa (template-vehicles.php, inc/ac/vehicles.php). Desktop: the selection in a left
   column like the catalog's filters, the batteries beside it (Einars 2026-11-26: "saliekam sānā", "produktus pat
   neredz"). Phones: the selection on top. */

.ac-veh-hero { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; padding-bottom: 20px; }
.ac-veh-hero__text { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }
.ac-veh-hero .ac-h1 { font-size: 36px; }
.ac-veh-hero__lead { font-size: 16px; line-height: 1.5; color: var(--ac-text-2); }

.ac-veh-layout { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 80px; }
.ac-veh-finder { position: sticky; top: calc(24px + var(--ac-adminbar)); display: flex; flex-direction: column; gap: 18px; padding: 20px; border-radius: 16px; background: var(--ac-light); }
.ac-veh-step { display: flex; flex-direction: column; gap: 10px; }
.ac-veh-step__label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.ac-veh-step__label span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; background: var(--ac-black); color: var(--ac-white); font-size: 12px; }
.ac-veh-types { display: flex; flex-direction: column; gap: 4px; }
.ac-veh-type { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 6px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--ac-white); font: inherit; font-size: 14px; font-weight: 500; line-height: 1.35; text-align: left; color: var(--ac-black); cursor: pointer; transition: background-color var(--ac-fast) ease, border-color var(--ac-fast) ease, color var(--ac-fast) ease; }
.ac-veh-type small { flex: none; font-size: 12px; color: var(--ac-mid); }
.ac-veh-type:hover { border-color: var(--ac-grey-300); }
.ac-veh-type.is-on { background: var(--ac-black); border-color: var(--ac-black); color: var(--ac-white); }
.ac-veh-type.is-on small { color: var(--ac-on-dark-2); }
.ac-veh-type:focus-visible { outline: 2px solid var(--ac-black); outline-offset: 2px; }
.ac-veh-step--pick { gap: 8px; }
.ac-veh-pick .ac-select { width: 100%; }
.ac-veh-pick .ac-select.is-disabled { opacity: .55; pointer-events: none; }
.ac-veh-pick .ac-select__list { max-height: 320px; min-width: 100%; }
.ac-veh-pick:last-child .ac-select__list { width: max(100%, 420px); }

.ac-veh-search { position: relative; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--ac-grey-200); }
.ac-veh-search__label { font-size: 14px; font-weight: 600; line-height: 1.4; }
.ac-veh-search__box { position: relative; display: flex; align-items: center; }
.ac-veh-search__box .ac-icon { position: absolute; left: 14px; color: var(--ac-mid); pointer-events: none; }
.ac-veh-search__in { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--ac-grey-300); border-radius: 12px; background: var(--ac-white); font: inherit; font-size: 15px; color: var(--ac-black); }
.ac-veh-search__in:focus { outline: none; border-color: var(--ac-black); box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.ac-veh-hits { position: absolute; z-index: 30; left: 0; top: 100%; width: max(100%, 420px); margin: 6px 0 0; padding: 6px; max-height: 360px; overflow: auto; list-style: none; border: 1px solid var(--ac-grey-200); border-radius: 12px; background: var(--ac-white); box-shadow: var(--ac-shadow-lg); }
.ac-veh-hits li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.ac-veh-hits li small { flex: none; font-size: 12px; color: var(--ac-mid); }
.ac-veh-hits li.is-active, .ac-veh-hits li:hover { background: var(--ac-light); }
.ac-veh-hits .is-empty { color: var(--ac-text-2); cursor: default; }

.ac-veh-main { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.ac-veh-out { scroll-margin-top: calc(24px + var(--ac-adminbar)); }
.ac-veh-out.is-loading { opacity: .5; transition: opacity 200ms ease; }
.ac-veh-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 32px; border: 1px dashed var(--ac-grey-300); border-radius: 16px; }
.ac-veh-empty__icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 4px; border-radius: 14px; background: var(--ac-green-tint); color: var(--ac-green-text); }
.ac-veh-empty__title { font-size: 20px; font-weight: 600; line-height: 1.3; }
.ac-veh-empty__text { max-width: 640px; font-size: 15px; line-height: 1.55; color: var(--ac-text-2); }
.ac-veh-res { display: flex; flex-direction: column; gap: 28px; }
.ac-veh-res__head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--ac-grey-200); border-radius: 16px; background: var(--ac-white); }
.ac-veh-res__icon { flex: none; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--ac-graphite); color: var(--ac-green); }
.ac-veh-res__id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ac-veh-res__kind { font-size: 12px; font-weight: 600; line-height: 1.3; letter-spacing: .06em; text-transform: uppercase; color: var(--ac-green-text); }
.ac-veh-res__title { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ac-veh-res__facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.ac-veh-res__facts li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--ac-light); font-size: 13px; line-height: 1.4; color: var(--ac-text-2); }
.ac-veh-res__facts strong { color: var(--ac-black); font-weight: 600; }
.ac-veh-res__count { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 120px; padding: 10px 14px; border-radius: 12px; background: var(--ac-green-tint); font-size: 12px; line-height: 1.3; text-align: center; color: var(--ac-green-text); }
.ac-veh-res__count strong { font-size: 26px; line-height: 1.1; color: var(--ac-black); }
.ac-veh-res__none { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; border-radius: 16px; background: var(--ac-light); font-size: 15px; line-height: 1.5; }
.ac-veh-res__none p { flex: 1 1 360px; }
.ac-veh-group { display: flex; flex-direction: column; gap: 14px; }
.ac-veh-group__head { display: flex; flex-direction: column; gap: 4px; }
.ac-veh-group__title { font-size: 20px; font-weight: 600; line-height: 1.3; }
.ac-veh-group__title small { margin-left: 6px; font-size: 14px; font-weight: 500; color: var(--ac-mid); }
.ac-veh-group__sub { font-size: 14px; line-height: 1.5; color: var(--ac-text-2); }
.ac-veh-main .ac-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1439px) { .ac-veh-main .ac-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.ac-veh-help { display: flex; flex-direction: column; gap: 12px; }
.ac-veh-help__card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 24px; border-radius: 16px; background: var(--ac-graphite); color: var(--ac-white); }
.ac-veh-help__card p { flex: 1 1 320px; font-size: 16px; line-height: 1.5; }
.ac-veh-help__icon { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ac-green); color: var(--ac-black); }
.ac-veh-help__card .ac-btn--dark { background: var(--ac-white); color: var(--ac-black); }
.ac-veh-help__source { font-size: 13px; line-height: 1.5; color: var(--ac-mid); }

@media (max-width: 1279px) {
	.ac-veh-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
	.ac-veh-main .ac-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* the folded selection (phones and tablets, a vehicle chosen) */
.ac-veh-finder__picked { display: none; }
@media (max-width: 1023px) {
	.ac-veh.is-picked .ac-veh-finder__picked { display: flex; align-items: center; gap: 10px; }
	.ac-veh.is-picked:not(.is-changing) .ac-veh-finder > :not(.ac-veh-finder__picked) { display: none; }
	.ac-veh.is-picked.is-changing .ac-veh-finder__picked { padding-bottom: 12px; border-bottom: 1px solid var(--ac-grey-200); }
	.ac-veh-finder__picked-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ac-graphite); color: var(--ac-green); }
	.ac-veh-finder__picked-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: 15px; line-height: 1.3; }
	.ac-veh-finder__picked-text small { font-size: 12px; color: var(--ac-mid); }
	.ac-veh-finder__picked-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.ac-veh-finder__change { flex: none; height: 40px; padding: 0 16px; }
	.ac-veh.is-picked .ac-veh-hero__lead, .ac-veh.is-picked .ac-veh-hero .ac-eyebrow { display: none; }
	/* the folded bar already names the vehicle: the card keeps only its facts and the count */
	.ac-veh.is-picked .ac-veh-res__kind, .ac-veh.is-picked .ac-veh-res__title, .ac-veh.is-picked .ac-veh-res__icon { display: none; }
	.ac-veh.is-picked .ac-veh-res__head { padding: 10px 12px; }
	.ac-veh.is-picked .ac-veh-res__facts { margin-top: 0; }
}
@media (max-width: 1023px) {
	.ac-veh-layout { grid-template-columns: minmax(0, 1fr); }
	.ac-veh-finder { position: static; }
	.ac-veh-types { flex-direction: row; flex-wrap: wrap; }
	.ac-veh-type { border-color: var(--ac-grey-300); border-radius: 999px; }
	.ac-veh-step--pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
	.ac-veh-step--pick .ac-veh-step__label { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
	.ac-veh-hero { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
	.ac-veh-hero .ac-h1 { font-size: 24px; }
	.ac-veh.is-picked .ac-veh-hero .ac-h1 { font-size: 20px; }
	.ac-veh.is-picked .ac-veh-finder { padding-block: 12px; }
	.ac-veh-hero__lead { font-size: 14px; }
	.ac-veh-layout { gap: 20px; padding-bottom: 48px; }
	.ac-veh-finder { gap: 14px; margin-inline: calc(-1 * var(--ac-gutter)); padding: 16px var(--ac-gutter); border-radius: 0; }
	.ac-veh-types { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--ac-gutter)); padding-inline: var(--ac-gutter); scrollbar-width: none; }
	.ac-veh-types::-webkit-scrollbar { display: none; }
	.ac-veh-type { flex: none; }
	.ac-veh-step--pick { grid-template-columns: minmax(0, 1fr); }
	.ac-veh-pick:last-child .ac-select__list, .ac-veh-hits { width: 100%; }
	.ac-veh-empty { padding: 20px; }
	.ac-veh-res { gap: 20px; }
	.ac-veh-res__head { flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; }
	.ac-veh-res__icon { display: none; }
	.ac-veh-res__id { flex-basis: 100%; }
	.ac-veh-res__title { font-size: 18px; }
	.ac-veh-res__facts li { padding: 2px 8px; font-size: 12px; }
	.ac-veh-res__count { flex-direction: row; align-items: baseline; gap: 6px; width: auto; min-width: 0; padding: 4px 10px; border-radius: 999px; }
	.ac-veh-res__count strong { font-size: 15px; }
	.ac-veh-group__title { font-size: 18px; }
	.ac-veh-main .ac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Product page: which vehicles the battery fits (template-parts/ac/vehicles/fits.php) */
.ac-veh-fits { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.ac-veh-fits__h { font-size: 18px; font-weight: 600; line-height: 1.4; }
.ac-veh-fits__lead { font-size: 14px; line-height: 1.5; color: var(--ac-text-2); }
.ac-veh-fits details { border: 1px solid var(--ac-grey-200); border-radius: 12px; background: var(--ac-white); }
.ac-veh-fits summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 15px; font-weight: 500; line-height: 1.4; cursor: pointer; list-style: none; }
.ac-veh-fits summary::-webkit-details-marker { display: none; }
.ac-veh-fits summary small { margin-left: 6px; color: var(--ac-mid); font-weight: 400; }
.ac-veh-fits summary .ac-icon { flex: none; transition: transform var(--ac-fast) ease; }
.ac-veh-fits details[open] summary .ac-icon { transform: rotate(180deg); }
.ac-veh-fits__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 24px; margin: 0; padding: 4px 16px 16px; }
.ac-veh-fits__brand { min-width: 0; }
.ac-veh-fits__brand dt { margin-bottom: 4px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.ac-veh-fits__brand dd { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ac-text-2); }
.ac-veh-fits__more { align-self: flex-start; font-size: 14px; font-weight: 500; text-decoration: underline; }
