.tgmd-grid {
  display: grid;
  /* 1.5rem is the same value as the side gutter on .tgmd-archive and
     .tgmd-single below, so the space between two cards reads as the same
     rhythm as the space between a card and the page edge. */
  gap: var(--tgmd-grid-gap, 1.5rem);
  /* Figma: 2 columns on the full listing, 1 below 768px. A fixed column
     COUNT rather than the previous auto-fit/minmax floor, because the
     redesigned card is wide (663px in the 2-column desktop layout) and a
     floor-based track would fit 3+ narrow cards instead. minmax(0, 1fr) —
     not a bare 1fr, which has an auto (content) minimum — is what stops a
     card's own unbreakable mobile.de title token (measured worst case: 38
     characters, zero break opportunities) from pushing a track, and so
     the whole row, wider than the container; .tgmd-card__heading/__trim
     also carry their own overflow-wrap: break-word as a second guard.
     The Elementor "Spalten" control (Elementor\ControlSpec) overrides
     this at its own responsive breakpoints by emitting the same
     grid-template-columns property with a higher source-order rule, so
     it keeps working unchanged against this new default. */
  grid-template-columns: repeat(var(--tgmd-grid-columns, 2), minmax(0, 1fr));
}

@media (max-width: 47.9375rem) {
  /* 767px: below the Figma card's own natural breakpoint, one column so
     a 663px-designed card never has to shrink below a readable width. */
  .tgmd-grid {
    grid-template-columns: repeat(var(--tgmd-grid-columns-mobile, 1), minmax(0, 1fr));
  }
}

.tgmd-card {
  /* The containing block for .tgmd-card__link's stretched ::after below —
     without this, that absolutely positioned pseudo-element would escape
     to the next positioned ancestor up the page instead of covering just
     this card. */
  position: relative;
  display: flex;
  flex-direction: column;
  /* 24px between the image and the body, and (via .tgmd-card__body's own
     gap) between each group inside it — the Figma card's rhythm. */
  gap: var(--tgmd-card-gap, 1.5rem);
  border-radius: var(--tgmd-card-radius, 4px);
  /* Clips the image to the card's own rounded corners. */
  overflow: hidden;
  /* The host page embeds this grid inside arbitrary theme/page-builder
     sections (verified: a black Elementor section background), so the
     card owns its own opaque surface rather than inheriting whatever the
     section behind it happens to be. Both travel together: overriding
     the background without the foreground is what would reintroduce a
     contrast defect this pair exists to avoid. #f2f2f2/#000 (Figma) is
     18.1:1 by the WCAG 2.1 relative-luminance formula — comfortably past
     AA's 4.5:1 and AAA's 7:1. */
  background-color: var(--tgmd-card-bg, #f2f2f2);
  color: var(--tgmd-card-color, #000);
  transition: box-shadow 0.2s ease;
}

/* 1.4.0 (section 12) — :focus-within rather than :focus, so the ring
   below and this shadow both appear together while the card's one real
   control (.tgmd-card__link) is keyboard-focused, exactly as they do on
   mouse hover; reduced-motion is already handled for .tgmd-card and
   .tgmd-card__image by the existing media query further down this
   file. */
.tgmd-card:hover,
.tgmd-card:focus-within {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.tgmd-card:hover .tgmd-card__image,
.tgmd-card:focus-within .tgmd-card__image {
  /* .tgmd-card's own overflow: hidden (above) is the frame that clips
     this scale-up to the card's own rounded corners. The factor is the
     listing widget's "Bild-Zoom bei Hover". */
  transform: scale(var(--tgmd-card-image-hover-scale, 1.03));
}

.tgmd-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--tgmd-card-body-gap, 1.25rem);
  padding: var(--tgmd-card-body-padding, 0 0.75rem 1.5rem);
}

.tgmd-card__title-block {
  display: flex;
  flex-direction: column;
  gap: var(--tgmd-card-title-gap, 0.5rem);
  line-height: normal;
}

.tgmd-card__heading {
  margin: 0;
  font-weight: var(--tgmd-heading-font-weight, 900);
  font-size: var(--tgmd-heading-font-size, 2.25rem);
  letter-spacing: var(--tgmd-heading-letter-spacing, 0.72px);
  /* mobile.de's modelDescription joins trim tokens with "*" and no
     spaces at all (measured worst case: "1.2DIT*GS*Matrix*Navi*SHZ*LHZ*
     360°*PDC", 38 characters, zero break opportunities), and the heading
     half can still carry an unbroken run at 36px. overflow-wrap:
     break-word only opens a break INSIDE a token when that token is
     itself wider than the line and has no other break opportunity — an
     ordinary word is never split. See .tgmd-card__trim for why the trim
     line needs this even more. */
  overflow-wrap: break-word;
  /* 1.4.0: clamp to 2 lines everywhere - grid and carousel alike - so a
     long mobile.de title cannot make one card's body taller than its
     neighbours. -webkit-line-clamp is unprefixed nowhere yet in any
     shipping browser, but is universally supported under this prefix
     (Chrome, Safari, Firefox 68+) - the same "grade correctly" trade this
     file already accepts nowhere else because nothing else here needed
     clamping before 1.4.0. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Qualified with the ancestor class (specificity 0,2,0), not just
   `.tgmd-card__link` (0,1,0): measured live, the Gebrauchtwagen/Neuwagen
   pages embed the shortcode output inside hello-elementor's own
   `.page-content a { text-decoration: underline }` (theme.css,
   specificity 0,1,1), which already beats a single class and was
   rendering every card title underlined there while the homepage teaser
   (embedded via an Elementor Shortcode widget instead, inside a
   `.elementor` wrapper that carries its own `.elementor a` reset to
   `none`) looked correct by coincidence. `.tgmd-card .tgmd-card__link`
   outguns 0,1,1 unconditionally, on any page, without `!important`. */
.tgmd-card .tgmd-card__link {
  text-decoration: none;
  color: inherit;
}

.tgmd-card .tgmd-card__link::after {
  /* THE STRETCHED LINK. templates/parts/vehicle-card.php now emits
     exactly one <a>, on the title — the previous version wrapped the
     image in a second, identical link, a duplicate tab stop for no
     benefit. This pseudo-element is absolutely positioned to cover the
     whole .tgmd-card box (its containing block, via that rule's own
     position: relative above), making the entire card clickable while
     the DOM keeps a single focusable element. */
  content: "";
  position: absolute;
  inset: 0;
}

.tgmd-card .tgmd-card__link:focus-visible::after {
  /* The ring is drawn on the stretched ::after, not on the anchor's own
     (title-sized) box, so keyboard focus outlines the whole clickable
     card rather than just the title text. 1.4.0 (section 12): the
     site-wide yellow/black ring, replacing the earlier currentColor/
     negative-offset pair (--tgmd-card-focus-outline-* — confirmed unused
     by any Elementor control, so nothing is stranded) — the ring now
     sits just outside the card rather than inset into it, matching every
     other focusable element this plugin renders. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-card__trim {
  margin: 0;
  font-weight: var(--tgmd-trim-font-weight, 400);
  font-size: var(--tgmd-trim-font-size, 1.125rem);
  letter-spacing: var(--tgmd-trim-letter-spacing, 0.36px);
  /* See .tgmd-card__heading above — the trim line is where mobile.de's
     unbroken "*"-joined token run actually lives, so this is the rule
     that measurement was found against. */
  overflow-wrap: break-word;
  /* 1.4.0: clamp to 2 lines in the grid (spec: "In the grid, trim max 2
     lines") — the carousel below narrows this further to 1, since it
     additionally needs every card's price row to start at the same y. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tgmd-card__image,
.tgmd-gallery__item img {
  width: 100%;
  height: auto;
  display: block;
  /* 4/3 is mobile.de's own photo ratio, not a design preference -
     measured by fetching three renditions of one live ad photo:
     mo-360 = 360x270, mo-640 = 640x480 (both exactly 1.3333), mo-1024 =
     886x665 (1.3323, 4:3 after the CDN's own rounding). So the declared
     box matches the source, object-fit: cover above has essentially
     nothing to crop, and the height is reserved before the hotlinked
     image arrives - no layout shift while it loads. The property is
     here for a site that wants a different crop; deviating from 4/3
     means cover starts discarding real photo.
     One property deliberately covers both selectors, as the literal did:
     a card thumbnail and a gallery photo showing the same picture at
     different ratios would be a defect, not a feature. */
  aspect-ratio: var(--tgmd-image-aspect-ratio, 4 / 3);
  object-fit: cover;
}

/* Scoped to the card thumbnail only, not the shared rule above — the
   1.4.0 hover scale (.tgmd-card:hover .tgmd-card__image, further up this
   file) has no equivalent on a gallery photo. */
.tgmd-card__image {
  transition: transform 0.2s ease;
}

.tgmd-card__price-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--tgmd-price-row-gap, 1.25rem);
}

.tgmd-card__price {
  margin: 0;
  /* The price is the one datum a buyer scans a listing for, and it is
     promoted above the inherited body size and set semi-bold — enough to
     win the eye against the title without competing with the page's own
     headings. Size and weight only: no font-family is asserted anywhere
     in this stylesheet, because the host site owns its type identity
     (measured: the family is applied per Elementor widget, not through
     Elementor's global kit, so any family named here would be wrong on
     this site and on every other). nowrap: "18.950 €" wrapping between
     the number and the currency sign reads as a rendering defect on a
     price. */
  font-weight: var(--tgmd-price-font-weight, 600);
  font-size: var(--tgmd-price-font-size, 1.375rem);
  letter-spacing: var(--tgmd-price-letter-spacing, 0.44px);
  white-space: nowrap;
  /* Figma sets the card's small texts at ~1.2 (22px price = 26px line,
     14px chip = 17px); without it they inherit the theme's body 1.5 and
     every row of the card grows. Same value on the rating label, the
     consumption/CO2 lines and the chips below. */
  line-height: 1.2;
}

.tgmd-card__vat {
  display: block;
  margin-top: 0.125rem;
  font-weight: var(--tgmd-vat-font-weight, 300);
  font-size: var(--tgmd-vat-font-size, 0.875rem);
  /* Pflichtangabe (mandatory disclosure) under German PAngV — kept even
     though the Figma card omits it. rgba over the card's own
     --tgmd-card-bg rather than a fixed hex, so it stays legibly
     de-emphasised (not full-strength body colour) however a site
     retunes --tgmd-card-color. */
  color: var(--tgmd-vat-color, rgba(0, 0, 0, 0.6));
  line-height: 1.2;
}

.tgmd-card__rating {
  display: flex;
  flex-direction: column;
  gap: var(--tgmd-rating-gap, 0.25rem);
}

.tgmd-card__rating-bars {
  display: flex;
  /* Decorative — Frontend\VehicleSpecs::priceRatingBars()' own label is
     what a screen reader announces (see the aria-hidden on this element
     in the template), so no accessible name is built for the bars
     themselves. */
  gap: 1px;
}

.tgmd-card__rating-bar {
  width: var(--tgmd-rating-bar-width, 15px);
  height: var(--tgmd-rating-bar-height, 6px);
  background-color: var(--tgmd-rating-bar-empty, rgba(0, 0, 0, 0.3));
}

.tgmd-card__rating-bar-filled {
  background-color: var(--tgmd-rating-bar-filled, #179d20);
}

.tgmd-card__rating-label {
  font-weight: var(--tgmd-rating-label-font-weight, 300);
  font-size: var(--tgmd-rating-label-font-size, 0.875rem);
  letter-spacing: var(--tgmd-rating-label-letter-spacing, 0.28px);
  color: var(--tgmd-rating-label-color, rgba(0, 0, 0, 0.9));
  line-height: 1.2;
}

.tgmd-card__consumption,
.tgmd-card__co2,
.tgmd-card__co2-class {
  /* Pkw-EnVKV disclosure practice pairs these two lines, so they share
     one rule and one font-size — a visual difference between them would
     read as one being less important than the other, which is not the
     legal intent. 1.4.0's CO2-Klasse joins the CO2 line's own row (see
     .tgmd-card__co2-row below) and reads as its right-hand half, so it
     keeps the exact same size/weight rules rather than a third scale. */
  margin: 0;
  font-size: var(--tgmd-consumption-font-size, 1rem);
  line-height: 1.2;
}

.tgmd-card__consumption strong,
.tgmd-card__co2 strong,
.tgmd-card__co2-class strong {
  font-weight: var(--tgmd-consumption-label-font-weight, 700);
}

.tgmd-card__co2-row {
  /* 1.4.0: CO2-Emissionen (left) and CO2-Klasse (right) on one line;
     either may be absent on its own (see vehicle-card-summary.php's own
     comment), and space-between is what puts a single surviving half at
     the start rather than leaving a gap where the other one would have
     been. */
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--tgmd-co2-row-gap, 0.75rem);
}

.tgmd-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tgmd-chip-gap, 0.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tgmd-card__chip {
  background-color: var(--tgmd-chip-bg, rgba(0, 0, 0, 0.1));
  border-radius: var(--tgmd-chip-radius, 4px);
  padding: var(--tgmd-chip-padding, 0.25rem 0.5rem);
  font-size: var(--tgmd-chip-font-size, 0.875rem);
  font-weight: var(--tgmd-chip-font-weight, 400);
  color: var(--tgmd-chip-color, #000);
  white-space: nowrap;
  line-height: 1.2;
}

.tgmd-single__price {
  /* Un-shared from .tgmd-card__price (Task 1 redesigned only the card;
     the detail page's own price keeps the value it already had). Own
     property names rather than reusing --tgmd-price-*, so retuning the
     card's price style through those variables cannot silently change
     this page too — the opposite of the coupling that used to exist
     here. */
  font-weight: var(--tgmd-single-price-font-weight, 700);
  font-size: var(--tgmd-single-price-font-size, 1.25rem);
  margin: 0;
}

.tgmd-single__vat {
  font-size: var(--tgmd-single-vat-font-size, 0.8125rem);
  font-weight: normal;
  color: var(--tgmd-single-vat-color, #646970);
  display: block;
  margin-top: 0.25rem;
  line-height: 1.2;
}

.tgmd-gallery {
  display: grid;
  /* Both of these are load-bearing beyond this rule: .tgmd-single's
     max-width below is derived from exactly these two numbers (see its
     comment - 3 * 320px + 2 * 0.75rem =~ 984px is what makes a 3-column
     gallery fit at 75rem). They are overridable, but retuning either
     without re-reading that calculation changes how many gallery columns
     the detail page ends up with. 0.75rem is half .tgmd-grid's 1.5rem:
     photos of one vehicle are a set and read as a group, where separate
     cards need the wider separation. */
  gap: var(--tgmd-gallery-gap, 0.75rem);
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, var(--tgmd-gallery-column-min, 20rem)), 1fr)
  );
}

/* --- The visitor filter (templates/vehicle-filter.php) -------------------
   New markup, so unlike the rules above there is no previously computed
   value to preserve — these ARE the defaults. They are deliberately
   structural only: layout, sizing and the two browser defaults that
   actually break the form. No colour, no font-family, no border beyond
   resetting the one the browser imposes, so the form inherits the host
   site's identity and the Elementor controls (Elementor\FilterControlSpec)
   supply the rest. */

.tgmd-filter {
  /* The text size and line height every text in the filter starts from,
     on the form because the widget's "Grundschrift" writes to the form:
     on the set, they outranked anything the form handed down. The only
     visible text outside the set, the mobile toggle, sets its own. */
  font-size: 1.125rem;
  line-height: 1.65;
}

.tgmd-filter__set {
  /* A <fieldset> is the accessible container for a group of controls, and
     the browser's own default styling of one is actively wrong here: a UA
     border and padding around the whole form, and — the one that really
     matters — `min-inline-size: min-content`, which is a fieldset-only UA
     rule that makes it refuse to shrink below its widest content and
     therefore overflow a narrow viewport horizontally. `min-inline-size: 0`
     is the documented remedy and is why the fieldset can carry a
     responsive layout at the 390px floor at all.
     The Figma sidebar: #f2f2f2 surface, 4px corners, 24px inset, its
     groups stacked 48px apart. Every one of these is a property with the
     Figma value as its fallback, same discipline as the rest of this
     file. */
  min-inline-size: 0;
  border: var(--tgmd-filter-border, 0);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--tgmd-filter-group-gap, 3rem);
  width: var(--tgmd-filter-width, 19.375rem);
  max-width: 100%;
  box-sizing: border-box;
  padding: var(--tgmd-filter-padding, 1.5rem);
  background-color: var(--tgmd-filter-background-color, #f2f2f2);
  border-radius: var(--tgmd-filter-radius, 4px);
  /* The form's (.tgmd-filter, above), handed on explicitly so that no
     theme rule on <fieldset> can come between them. */
  font-size: inherit;
  line-height: inherit;
  color: var(--tgmd-filter-text-color, rgba(0, 0, 0, 0.75));
}

/* Inside the Elementor widget the panel fills the widget, so the widget's
   own width (Erweitert > Breite; 310px on this site, the Figma value)
   sizes it. The bare [tg_vehicle_filter] shortcode has no such wrapper and
   keeps the Figma width above. */
.elementor-widget-tgmd_vehicle_filter .tgmd-filter__set {
  width: auto;
}

.tgmd-filter__group {
  display: flex;
  flex-direction: column;
  gap: var(--tgmd-filter-gap, 1.5rem);
}

.tgmd-filter__field {
  /* The <label> wraps its own control (see the template for why implicit
     labelling is used), so it has to stack the caption above the control
     itself rather than sitting inline with it. 1.4.0 moved Sortierung
     onto the same picker/popup pattern as every other single-value field
     (see .tgmd-filter__picker below), so nothing in the current markup
     emits this bare class any more — kept, inert, rather than removed,
     on the same "a class can outlive the element it named" precedent as
     ControlSpec's FACT_LABEL/FACT_VALUE (no FilterControlSpec control
     targets it either way, so there is no saved Elementor value at risk
     either way — this is pure documentation-of-intent, not a load-bearing
     compatibility shim like those two are). */
  display: flex;
  flex-direction: column;
  gap: var(--tgmd-filter-label-gap, 0.25rem);
}

.tgmd-filter__label {
  font-weight: 600;
  color: var(--tgmd-filter-label-color, inherit);
}

.tgmd-filter__control {
  font: inherit;
  color: inherit;
}

/* The generic look for a select that is neither a picker row's plain-text
   value nor a range row's half — today, only the "Sortierung" control
   inside .tgmd-filter__more. Both contexts below override this with a
   more specific selector. */
.tgmd-filter__select {
  width: 100%;
  box-sizing: border-box;
  display: block;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.8);
  border-radius: 2px;
  background-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%229%22%20viewBox%3D%220%200%2014%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.8212%201.27236L7.45044%208.78008C7.3913%208.8498%207.32108%208.90511%207.2438%208.94284C7.16651%208.98058%207.08368%209%207.00003%209C6.91637%209%206.83354%208.98058%206.75626%208.94284C6.67897%208.90511%206.60875%208.8498%206.54961%208.78008L0.178835%201.27236C0.0627864%201.13076%20-0.00142745%200.941114%202.40832e-05%200.744264C0.00147561%200.547414%200.0684763%200.35911%200.186596%200.219911C0.304715%200.0807118%200.464502%200.00175328%200.631542%204.2701e-05C0.798582%20-0.00166787%200.959509%200.0740057%201.07966%200.210765L7%207.18767L12.9203%200.210751C13.0405%200.0739914%2013.2014%20-0.00168219%2013.3685%202.83812e-05C13.5355%200.00173896%2013.6953%200.080696%2013.8134%200.219895C13.9315%200.359095%2013.9985%200.547398%2014%200.744248C14.0014%200.941098%2013.9373%201.13076%2013.8212%201.27236Z%22%20fill%3D%22black%22%20fill-opacity%3D%220.75%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.875rem 0.5625rem;
  cursor: pointer;
}

.tgmd-filter__select:focus-visible {
  /* 1.4.0 (section 12): the site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

/* --- Group 1 / Group 3: picker rows ("Marke", "Modell", "Kraftstoffart", … ) ---
   1.4.0 rewrote these from a <select> into a <details class="tgmd-filter__picker">
   holding a checkbox/radio popup (templates/vehicle-filter.php's own
   $renderPicker()) — the rules below replace the pre-1.4.0 select-based
   ones outright rather than extending them, since a <select> is no longer
   anywhere inside this element for them to style. */

.tgmd-filter__picker {
  /* The popup's own positioning anchor, exactly the role
     .tgmd-filter__range-box plays for the Von/Bis popup below. The ROW
     itself stays borderless, as in Figma (node 73:747: label, value line,
     pen icon, no box) - "the same pop-up styling" in the client's brief
     is about the popup, which does match the Von/Bis popup below. */
  position: relative;
}

.tgmd-filter__picker-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0;
  /* The custom pen icon below already marks this as expandable — a
     second, native disclosure triangle beside it would read as a
     rendering bug. list-style: none is enough in current Chrome/Firefox;
     the pseudo-element covers older WebKit/Blink that only honours the
     legacy marker selector. */
  list-style: none;
}

.tgmd-filter__picker-summary::-webkit-details-marker {
  display: none;
}

.tgmd-filter__picker-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.tgmd-filter__picker-value {
  /* The Figma row's grey second line — selected label(s), or
     "Beliebig". Single line with an ellipsis: $valueLine() (the
     template) already puts the untruncated text in this element's own
     `title`, so nothing is lost, only visually clipped when it would
     otherwise wrap the row taller than its neighbours. */
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Figma: Blauer Nue Regular 18, the label's own colour. */
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--tgmd-filter-value-color, inherit);
}

/* 1.4.0 (section 12): hover/open → label and value to full black and the
   pen darkens (below); the borderless row has no box to recolour.
   :focus-within (not :focus) covers a popup input inside gaining focus,
   e.g. via Tab, without a separate hover on the row itself. */
.tgmd-filter__picker .tgmd-filter__label,
.tgmd-filter__picker .tgmd-filter__picker-value {
  transition: color 0.2s ease;
}

.tgmd-filter__picker:hover .tgmd-filter__label,
.tgmd-filter__picker:focus-within .tgmd-filter__label,
.tgmd-filter__picker[open] .tgmd-filter__label {
  color: var(--tgmd-filter-label-active-color, #000);
}

.tgmd-filter__picker:hover .tgmd-filter__picker-value,
.tgmd-filter__picker:focus-within .tgmd-filter__picker-value,
.tgmd-filter__picker[open] .tgmd-filter__picker-value {
  color: var(--tgmd-filter-value-active-color, #000);
}

.tgmd-filter__picker-summary:focus-visible {
  /* 1.4.0 (section 12): the site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-filter__pen {
  flex: 0 0 auto;
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  /* Figma's pen.svg - a 24px yellow circle with a black pen glyph - in two
     colours a designer can set: the circle is this box, the glyph a mask
     over its ::before (the same path, so the same shape). Decorative - the
     row's own implicit <label> already names the control, so this carries
     aria-hidden in the template rather than a second accessible name. */
  border-radius: 50%;
  background-color: var(--tgmd-filter-pen-bg, #ffe70d);
  transition: background-color 0.2s ease;
}

.tgmd-filter__pen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--tgmd-filter-pen-color, #000);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M17.005%208.48717L18%207.49215L16.5078%206L15.5128%206.99502L15.0153%206.49751L7.14664%2014.3662L7.10586%2014.407L6.15317%2016.329L6.66354%2016.8393L6%2017.5029L6.49711%2018L7.16065%2017.3365L7.67103%2017.8468L9.59301%2016.8941L16.0103%2010.4768L16.5082%2010.9747L13.9185%2013.5645L14.4156%2014.0616L17.5025%2010.9747L16.5075%209.9797L17.5025%208.98468L17.005%208.48717ZM16.5078%206.99422L17.0058%207.49213L16.5078%207.99004L16.0099%207.49213L16.5078%206.99422ZM7.00727%2016.1888L7.49274%2015.2094L8.79055%2016.5072L7.81112%2016.9927L7.00727%2016.1888ZM9.38524%2016.1077L7.89229%2014.6148L14.0203%208.48677L15.5133%209.97972L9.38524%2016.1077ZM16.0104%209.48259L14.5174%207.98966L15.0153%207.49175L16.5083%208.9847L16.0104%209.48259Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") no-repeat 0 0 / contain;
  mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M17.005%208.48717L18%207.49215L16.5078%206L15.5128%206.99502L15.0153%206.49751L7.14664%2014.3662L7.10586%2014.407L6.15317%2016.329L6.66354%2016.8393L6%2017.5029L6.49711%2018L7.16065%2017.3365L7.67103%2017.8468L9.59301%2016.8941L16.0103%2010.4768L16.5082%2010.9747L13.9185%2013.5645L14.4156%2014.0616L17.5025%2010.9747L16.5075%209.9797L17.5025%208.98468L17.005%208.48717ZM16.5078%206.99422L17.0058%207.49213L16.5078%207.99004L16.0099%207.49213L16.5078%206.99422ZM7.00727%2016.1888L7.49274%2015.2094L8.79055%2016.5072L7.81112%2016.9927L7.00727%2016.1888ZM9.38524%2016.1077L7.89229%2014.6148L14.0203%208.48677L15.5133%209.97972L9.38524%2016.1077ZM16.0104%209.48259L14.5174%207.98966L15.0153%207.49175L16.5083%208.9847L16.0104%209.48259Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") no-repeat 0 0 / contain;
}

/* 1.4.0 (section 12): "the pen circle darkens to #E6CF00" on hover and
   open. Until 1.5.0 this darkened the whole flat SVG with brightness(0.9)
   (#E6D00C); now the circle is a colour of its own, so it is the brief's
   exact #E6CF00, and settable. */
.tgmd-filter__picker:hover .tgmd-filter__pen,
.tgmd-filter__picker:focus-within .tgmd-filter__pen,
.tgmd-filter__picker[open] .tgmd-filter__pen {
  background-color: var(--tgmd-filter-pen-hover-bg, #e6cf00);
}

/* The picker's own popup — deliberately the Von/Bis popup's own look
   (white, 1px solid rgba(0,0,0,.8), radius 2px, shadow
   0 4px 12px rgba(0,0,0,.15), directly under the row, full row width,
   ~7 rows then scroll): the client explicitly asked for "the same
   pop-up styling as the other fields", so this reuses those exact
   values rather than a second set that could drift from them. `font:
   inherit` is the FIX the brief calls out by name — the pre-1.4.0
   .tgmd-range-combo__popup never set a font-family, so this popup family
   otherwise renders in the browser's UI font instead of the host site's
   own (Blauer Nue on this site). */
.tgmd-filter__popup {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 20;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0;
  box-sizing: border-box;
  background-color: var(--tgmd-filter-popup-bg, #fff);
  border: 1px solid var(--tgmd-filter-popup-border-color, rgba(0, 0, 0, 0.8));
  border-radius: 2px;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
  /* Same formula as .tgmd-range-combo__popup's own 7-row default: 0.5rem
     top/bottom padding plus the 18px/1.65 text (1.125rem * 1.65 =
     1.85625rem) = 2.85625rem per row. Ausstattung's grouped popup reuses
     this same cap rather than a row-counting formula of its own — its
     rows are two different heights (group headings + options), so an
     exact row count does not apply, and this already lands close to the
     same ~20rem a 7-row popup reaches. The count is FilterControlSpec's
     "Sichtbare Optionen je Popup" (default 7), shared with the Von/Bis
     popups; assets/js/vehicles.js caps it further at the room left in the
     window, never above it. */
  max-height: calc(var(--tgmd-filter-popup-rows, 7) * 2.85625rem);
  overflow-y: auto;
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.65;
}

/* Positioned by JS (assets/js/vehicles.js's initFilterPickers()) when the
   row is too close to the bottom of the viewport for the popup to open
   downward without being clipped — see that function's own docblock.
   Flips the anchor point only; every other property above is unchanged. */
.tgmd-filter__popup.tgmd-filter__popup--up {
  top: auto;
  bottom: calc(100% + 0.25rem);
}

.tgmd-filter__popup[hidden] {
  display: none;
}

.tgmd-filter__option-group + .tgmd-filter__option-group {
  border-top: 1px solid var(--tgmd-filter-divider-color, rgba(0, 0, 0, 0.15));
}

/* Also the "weitere Filter" dialog's own group <legend> — one heading
   style for both, since both are "a group of related options with a
   title", not two different ideas. */
.tgmd-filter__group-heading {
  display: block;
  padding: 0.5rem 1.5rem 0.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.tgmd-filter__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* Figma's own popup-option metric, same as the Von/Bis popup's own
     0.5rem 1.5rem ("~8px 24px" per the brief). */
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-weight: 400;
  color: var(--tgmd-filter-option-color, inherit);
}

.tgmd-filter__row:hover,
.tgmd-filter__row:focus-within {
  background-color: var(--tgmd-filter-option-hover-bg, #f2f2f2);
}

/* The selected RADIO row reads as chosen even before a visitor notices
   the filled box — 600 weight, matching the range combo's own
   `[aria-selected="true"]` treatment. Not applied to a checked checkbox:
   several can be checked at once in one popup, and bolding all of them
   would stop reading as emphasis at all. Qualified with the form's class
   (0,4,1) so it outranks a weight the widget's option typography sets
   (0,4,0). */
.tgmd-filter .tgmd-filter__row:has(input[type="radio"]:checked) {
  font-weight: 600;
}

.tgmd-filter__row--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tgmd-filter__row--disabled:hover {
  background-color: transparent;
}

.tgmd-filter__row input {
  /* The real, functional input stays in the DOM and in the tab order —
     only clipped from view, never display:none — with
     .tgmd-filter__check below standing in for it visually. Same idiom as
     .tgmd-sr-only elsewhere in this file, repeated rather than shared:
     that class is JS-applied only (see the range combo's own use of it),
     where this one has to work with no JS at all. */
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.tgmd-filter__check {
  flex: 0 0 auto;
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  border: 1.5px solid var(--tgmd-filter-check-border-color, rgba(0, 0, 0, 0.8));
  border-radius: 2px;
  background-color: var(--tgmd-filter-check-bg, #fff);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* The radio variant of the very same class — shape is the only
   difference, decided by the sibling input's own [type], so
   $renderOptionRow() (the template) can share one span/class for both
   rather than branching its own markup. */
.tgmd-filter__row input[type="radio"] + .tgmd-filter__check {
  border-radius: 50%;
}

.tgmd-filter__row:hover .tgmd-filter__check {
  border-color: var(--tgmd-filter-check-active-border-color, #000);
}

.tgmd-filter__row input:checked + .tgmd-filter__check {
  background-color: var(--tgmd-filter-check-checked-bg, #ffe70d);
  border-color: var(--tgmd-filter-check-active-border-color, #000);
}

.tgmd-filter__row input:checked + .tgmd-filter__check::after {
  content: "";
  position: absolute;
}

/* The checkmark glyph — two rotated borders, not a background-image, so
   it needs no second SVG kept in sync with the box's own colours. */
.tgmd-filter__row input[type="checkbox"]:checked + .tgmd-filter__check::after {
  left: 0.25rem;
  top: 0.125rem;
  width: 0.375rem;
  height: 0.625rem;
  border: solid var(--tgmd-filter-check-mark-color, #000);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tgmd-filter__row input[type="radio"]:checked + .tgmd-filter__check::after {
  left: 0.3125rem;
  top: 0.3125rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--tgmd-filter-check-mark-color, #000);
}

/* 1.4.0 (section 12): the site-wide focus ring, drawn on the VISIBLE
   custom box via the sibling combinator — the real <input> it belongs to
   is itself clipped to 1px (.tgmd-filter__row input, above), so a ring
   on the input directly would be invisible. */
.tgmd-filter__row input:focus-visible + .tgmd-filter__check {
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-filter__row-label {
  flex: 1 1 auto;
  min-width: 0;
}

.tgmd-filter__count {
  flex: 0 0 auto;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.875rem;
}

/* --- Group 2: "Von | Bis" range rows ("Preis", "Erstzulassung", "Kilometerstand") --- */

.tgmd-filter__range {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tgmd-filter__range-box {
  display: flex;
  align-items: stretch;
  /* The panel's inner width: 262px in the 310px Figma sidebar. */
  width: var(--tgmd-filter-range-width, 100%);
  max-width: 100%;
  border: 1px solid var(--tgmd-filter-field-border-color, rgba(0, 0, 0, 0.8));
  border-radius: 2px;
  /* Positions the enhanced popup below (.tgmd-range-combo__popup, further
     down this file) - it is inserted as this box's own child so it can
     be sized to the box's FULL width regardless of which half opened
     it, rather than the narrower ~131px half. */
  position: relative;
  transition: border-color 0.2s ease;
}

/* 1.4.0 (section 12): hover/focus-within → border and the field's own
   label to full black — one hover idea covering the whole field, not
   just whichever half the pointer happens to be over. */
.tgmd-filter__range:hover .tgmd-filter__range-box,
.tgmd-filter__range:focus-within .tgmd-filter__range-box {
  border-color: var(--tgmd-filter-field-border-hover-color, #000);
}

.tgmd-filter__range:hover .tgmd-filter__label,
.tgmd-filter__range:focus-within .tgmd-filter__label {
  color: var(--tgmd-filter-label-active-color, #000);
}

.tgmd-filter__range-half {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
}

.tgmd-filter__range-half:first-child {
  padding: 0.75rem 0.75rem 0.75rem 1.5rem;
}

.tgmd-filter__range-half:last-child {
  /* Figma pads both halves alike: 24px left, 12px right. */
  padding: 0.75rem 0.75rem 0.75rem 1.5rem;
}

.tgmd-filter__range-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 1.5rem;
  align-self: center;
  background-color: var(--tgmd-filter-range-divider-color, rgba(0, 0, 0, 0.6));
}

.tgmd-filter__range-half .tgmd-filter__select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 0;
  padding-right: 1.25rem;
  border: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%229%22%20viewBox%3D%220%200%2014%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.8212%201.27236L7.45044%208.78008C7.3913%208.8498%207.32108%208.90511%207.2438%208.94284C7.16651%208.98058%207.08368%209%207.00003%209C6.91637%209%206.83354%208.98058%206.75626%208.94284C6.67897%208.90511%206.60875%208.8498%206.54961%208.78008L0.178835%201.27236C0.0627864%201.13076%20-0.00142745%200.941114%202.40832e-05%200.744264C0.00147561%200.547414%200.0684763%200.35911%200.186596%200.219911C0.304715%200.0807118%200.464502%200.00175328%200.631542%204.2701e-05C0.798582%20-0.00166787%200.959509%200.0740057%201.07966%200.210765L7%207.18767L12.9203%200.210751C13.0405%200.0739914%2013.2014%20-0.00168219%2013.3685%202.83812e-05C13.5355%200.00173896%2013.6953%200.080696%2013.8134%200.219895C13.9315%200.359095%2013.9985%200.547398%2014%200.744248C14.0014%200.941098%2013.9373%201.13076%2013.8212%201.27236Z%22%20fill%3D%22black%22%20fill-opacity%3D%220.75%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 0.875rem 0.5625rem;
  font: inherit;
  color: var(--tgmd-filter-value-color, inherit);
  cursor: pointer;
  /*
   * Also matched by `.tgmd-range-combo__trigger` (assets/js/vehicles.js's
   * enhanced trigger BUTTON carries both classes, reusing this exact
   * look rather than duplicating it - see that rule's own comment
   * further down this file), which is where these two properties matter:
   * a real <button> is what hello-elementor's own reset targets (see the
   * comment on `.tgmd-filter .tgmd-filter__submit` above), and this
   * selector's specificity - two classes, 0,2,0 - already outguns it.
   */
  text-transform: none;
  box-shadow: none;
}

/* --- The enhanced Von/Bis combobox (assets/js/vehicles.js's
   initRangeCombo()) - a WAI-ARIA APG "select-only combobox": a trigger
   button plus a listbox popup, layered on top of a native <select> that
   stays in the DOM, functional, and visually hidden (.tgmd-sr-only,
   applied by the script) for a no-JS visitor or before the script runs.
   Every colour below is a var() with the CURRENT value as its fallback -
   FilterControlSpec's "Auswahl-Popups" section writes these custom
   properties on the widget wrapper, shared with the picker rows' own
   popups, so an untouched panel is a visual no-op, same discipline as the
   rest of this stylesheet. --------------------------------------------------- */

.tgmd-filter__range-half .tgmd-range-combo__trigger {
  text-align: left;
  /* The chevron becomes its own ::after below, rotatable independently
     of this button's own text — the inherited background-image chevron
     from .tgmd-filter__range-half .tgmd-filter__select above would
     rotate the "70 kW" label along with it if used directly here. */
  background-image: none;
  position: relative;
  padding-right: 1.25rem;
}

/* 1.4.0 (section 12): "open state → chevron rotated 180°" — the exact
   same arrow SVG .tgmd-filter__select already uses elsewhere in this
   file, just isolated onto its own element so only IT rotates. */
.tgmd-filter__range-half .tgmd-range-combo__trigger::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.875rem;
  height: 0.5625rem;
  transform: translateY(-50%);
  /* The chevron's path as a mask over its own colour - the same shape the
     select's background image draws, in rgba(0, 0, 0, 0.75) by default
     exactly as that image's fill-opacity paints it. */
  background-color: var(--tgmd-filter-range-icon-color, rgba(0, 0, 0, 0.75));
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%229%22%20viewBox%3D%220%200%2014%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.8212%201.27236L7.45044%208.78008C7.3913%208.8498%207.32108%208.90511%207.2438%208.94284C7.16651%208.98058%207.08368%209%207.00003%209C6.91637%209%206.83354%208.98058%206.75626%208.94284C6.67897%208.90511%206.60875%208.8498%206.54961%208.78008L0.178835%201.27236C0.0627864%201.13076%20-0.00142745%200.941114%202.40832e-05%200.744264C0.00147561%200.547414%200.0684763%200.35911%200.186596%200.219911C0.304715%200.0807118%200.464502%200.00175328%200.631542%204.2701e-05C0.798582%20-0.00166787%200.959509%200.0740057%201.07966%200.210765L7%207.18767L12.9203%200.210751C13.0405%200.0739914%2013.2014%20-0.00168219%2013.3685%202.83812e-05C13.5355%200.00173896%2013.6953%200.080696%2013.8134%200.219895C13.9315%200.359095%2013.9985%200.547398%2014%200.744248C14.0014%200.941098%2013.9373%201.13076%2013.8212%201.27236Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") no-repeat 0 0 / contain;
  mask: url("data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%229%22%20viewBox%3D%220%200%2014%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.8212%201.27236L7.45044%208.78008C7.3913%208.8498%207.32108%208.90511%207.2438%208.94284C7.16651%208.98058%207.08368%209%207.00003%209C6.91637%209%206.83354%208.98058%206.75626%208.94284C6.67897%208.90511%206.60875%208.8498%206.54961%208.78008L0.178835%201.27236C0.0627864%201.13076%20-0.00142745%200.941114%202.40832e-05%200.744264C0.00147561%200.547414%200.0684763%200.35911%200.186596%200.219911C0.304715%200.0807118%200.464502%200.00175328%200.631542%204.2701e-05C0.798582%20-0.00166787%200.959509%200.0740057%201.07966%200.210765L7%207.18767L12.9203%200.210751C13.0405%200.0739914%2013.2014%20-0.00168219%2013.3685%202.83812e-05C13.5355%200.00173896%2013.6953%200.080696%2013.8134%200.219895C13.9315%200.359095%2013.9985%200.547398%2014%200.744248C14.0014%200.941098%2013.9373%201.13076%2013.8212%201.27236Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") no-repeat 0 0 / contain;
  transition: transform 0.2s ease;
}

.tgmd-filter__range-half .tgmd-range-combo__trigger:hover,
.tgmd-filter__range-half .tgmd-range-combo__trigger:focus,
.tgmd-filter__range-half .tgmd-range-combo__trigger:active {
  /* Hello Elementor's reset paints every [type=button] #c36 with white
     text on :hover AND :focus (a mouse click leaves the trigger focused),
     at (0,2,0) - this (0,3,0) keeps the transparent field and only
     darkens the text, matching the box's own hover border. */
  background-color: transparent;
  color: var(--tgmd-filter-value-active-color, #000);
}

.tgmd-filter__range-half .tgmd-range-combo__trigger[aria-expanded="true"]::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Popup width: the WHOLE 262px range box, not just the trigger's own
   ~131px half - option padding (0.5rem 1.5rem, Figma's "~8px 24px")
   would leave a half far too narrow for "100.000 km" or "25.000 €"
   without wrapping. Inserted as a child of `.tgmd-filter__range-box`
   (position: relative, above), which both Von's and Bis's popup share
   as their positioning ancestor - only one is ever open at a time
   (initRangeCombo()'s own rule), so the shared anchor never overlaps
   two open popups. */
.tgmd-range-combo__popup {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 20;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
  background-color: var(--tgmd-filter-popup-bg, #fff);
  border: 1px solid var(--tgmd-filter-popup-border-color, rgba(0, 0, 0, 0.8));
  border-radius: 2px;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
  /* 7 rows by default (FilterControlSpec's own default): each row is
     0.5rem top/bottom padding plus the 18px/1.65 text
     (1.125rem * 1.65 = 1.85625rem), i.e. 2.85625rem tall. */
  max-height: calc(var(--tgmd-filter-popup-rows, 7) * 2.85625rem);
  overflow-y: auto;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--tgmd-filter-option-color, inherit);
}

.tgmd-range-combo__popup[hidden] {
  display: none;
}

.tgmd-range-combo__option {
  padding: 0.5rem 1.5rem;
  cursor: pointer;
}

/* :not([aria-disabled="true"]) — section 12: a disabled option gets "no
   hover" (its own rule below already blocks the click, but a mouse
   resting on it would otherwise still trigger this background). */
.tgmd-range-combo__option:not([aria-disabled="true"]):hover,
.tgmd-range-combo__option.is-active {
  background-color: var(--tgmd-filter-option-hover-bg, #f2f2f2);
}

/* The currently selected option, kept in sync with the native select by
   initRangeCombo() on every change - Figma's own "selected option scrolls
   into view and is highlighted", the weight half of "highlighted". */
.tgmd-filter .tgmd-filter__range-box .tgmd-range-combo__popup .tgmd-range-combo__option[aria-selected="true"] {
  /* (0,5,0): outranks a weight the widget's option typography sets. */
  font-weight: 600;
}

/* A Von option above the active Bis (or a Bis option below the active
   Von) - the same rule templates/vehicle-filter.php already applies to
   the native <select>'s own `disabled` attribute (see its own
   docblock), kept in sync here by initRangeCombo() whenever the PARTNER
   half changes. Not clickable, not reachable by ArrowUp/ArrowDown. */
.tgmd-range-combo__option[aria-disabled="true"] {
  /* 1.4.0 (section 12): "not-allowed cursor" — was `default`. */
  opacity: 0.4;
  cursor: not-allowed;
}

.tgmd-filter__range-half .tgmd-range-combo__trigger:focus-visible {
  /* 1.4.0 (section 12): the site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

/* Never actually matched today — DOM focus stays on the trigger button
   throughout this combo (aria-activedescendant marks the active option
   instead, see setActiveOption()'s own docblock), so no <li> here is
   ever a focus target. Updated anyway, for the one thing that would
   change that: a future tabindex on these options. */
.tgmd-range-combo__option:focus-visible {
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

/* --- Buttons: "Suchen" (primary) and "weitere Filter" (secondary) ------- */

/* Qualified with the ancestor class (specificity 0,2,0) on every button/
   toggle in this file, not just `.tgmd-filter__submit` etc. (0,1,0): a
   live measurement on bennemann.1wp.site's Hello Elementor theme found
   its own reset.css - `button, [type=button] { display: inline-block }`
   (0,1,0) and `button:hover { background: #c36; color: #fff }` (0,1,1) -
   loading AFTER this stylesheet, so a tied specificity is decided by
   source order in Hello's favour: `.tgmd-filter__mobile-toggle {
   display: none }` lost outright, and every button below was one hover
   away from Hello's magenta. `.tgmd-filter .tgmd-filter__submit` (0,2,0)
   outguns both unconditionally, on any page, without `!important` - same
   reasoning, same fix shape, as `.tgmd-card .tgmd-card__link` and
   `.tgmd-load-more-wrap .tgmd-load-more` above. Every property Hello's
   button reset touches (display, border, background, color,
   text-transform, font-size, padding, border-radius, box-shadow) is
   declared explicitly here too, even where the plugin's own default
   already matched it, so nothing is left for Hello's `button` element
   selector to win by default. */
.tgmd-filter .tgmd-filter__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  width: 100%;
  padding: var(--tgmd-filter-submit-padding, 0.75rem 1.5rem);
  /* Figma: 48px tall. min-height keeps that even where the Elementor
     border control removes the 3px border the padding assumes. */
  min-height: 3rem;
  font-size: 1.125rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.9px;
  line-height: 1;
  border-radius: 2px;
  border: 3px solid var(--tgmd-filter-submit-bg, #ffe70d);
  background-color: var(--tgmd-filter-submit-bg, #ffe70d);
  color: var(--tgmd-filter-submit-color, #000000);
  box-shadow: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* 1.4.0 (section 12 — the Figma file has no hover/active frames of its
   own; every value below is derived from its palette, as that section's
   own preamble says). Also styles .tgmd-filter__more-apply, the
   dialog's primary button, which carries this same class. */
.tgmd-filter .tgmd-filter__submit:focus {
  /* Hello's reset: `[type=submit]:focus` #c36 + white text, same
     (0,2,0) as the base rule above, so it would win on load order alone
     and keep a clicked button pink until blur. */
  background-color: var(--tgmd-filter-submit-bg, #ffe70d);
  color: var(--tgmd-filter-submit-color, #000000);
}

.tgmd-filter .tgmd-filter__submit:hover {
  background-color: #e6cf00;
  color: var(--tgmd-filter-submit-color, #000000);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.tgmd-filter .tgmd-filter__submit:active {
  background-color: #d4be00;
  color: var(--tgmd-filter-submit-color, #000000);
  box-shadow: none;
  transform: translateY(1px);
}

.tgmd-filter .tgmd-filter__submit:focus-visible {
  /* 1.4.0 (section 12): the site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

/* Hovered AND keyboard-focused at once (e.g. focused via keyboard, then
   also under the pointer): box-shadow does not merge across separate
   rules on its own, only the more specific/later one wins outright — so
   the coordinator's amendment ("combine them in the :focus-visible rule,
   comma-separated") is written out explicitly here rather than relying
   on cascade order. */
.tgmd-filter .tgmd-filter__submit:hover:focus-visible {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-filter__search-icon {
  width: 0.625rem;
  height: 0.625rem;
  /* The magnifier in the button's own text colour (currentColor), so it
     follows whatever the widget's "Suchen" colours set. */
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2211%22%20height%3D%2211%22%20viewBox%3D%220%200%2011%2011%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%224.28568%22%20cy%3D%224.28573%22%20r%3D%223.28568%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3Cline%20x1%3D%226.3835%22%20y1%3D%226.32219%22%20x2%3D%229.3835%22%20y2%3D%229.32219%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E") no-repeat 0 0 / contain;
  mask: url("data:image/svg+xml,%3Csvg%20width%3D%2211%22%20height%3D%2211%22%20viewBox%3D%220%200%2011%2011%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%224.28568%22%20cy%3D%224.28573%22%20r%3D%223.28568%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3Cline%20x1%3D%226.3835%22%20y1%3D%226.32219%22%20x2%3D%229.3835%22%20y2%3D%229.32219%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E") no-repeat 0 0 / contain;
  transition: transform 0.2s ease;
}

.tgmd-filter .tgmd-filter__submit:hover .tgmd-filter__search-icon {
  transform: translateX(3px);
}

/* Raised specificity + explicit reset: see the comment above
   `.tgmd-filter .tgmd-filter__submit` for why. */
.tgmd-filter .tgmd-filter__more-toggle {
  display: block;
  width: 100%;
  cursor: pointer;
  padding: var(--tgmd-filter-more-toggle-padding, 0.8125rem 1.5rem);
  min-height: 3rem;
  font-size: 1.125rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.9px;
  line-height: 1;
  text-align: center;
  border-radius: 2px;
  border: 2px solid var(--tgmd-filter-more-toggle-border-color, #ffe70d);
  background-color: var(--tgmd-filter-more-toggle-bg, transparent);
  color: var(--tgmd-filter-more-toggle-color, #000000);
  box-shadow: none;
  transition: background-color 0.2s ease;
}

/* 1.4.0 (section 12): the "outline button" treatment. Also applied to
   .tgmd-filter__mobile-toggle, further down inside its own media query —
   the two share this exact visual style (border + transparent fill), so
   both get the same hover/active behaviour rather than only the one
   section 12 names by example. */
.tgmd-filter .tgmd-filter__more-toggle:hover {
  background-color: var(--tgmd-filter-more-toggle-hover-bg, #ffe70d);
  color: var(--tgmd-filter-more-toggle-hover-color, #000000);
}

.tgmd-filter .tgmd-filter__more-toggle:active {
  background-color: var(--tgmd-filter-more-toggle-active-bg, #e6cf00);
  color: var(--tgmd-filter-more-toggle-hover-color, #000000);
}

.tgmd-filter .tgmd-filter__more-toggle:focus-visible {
  /* 1.4.0 (section 12): the site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-filter__more {
  /* 1.4.0: no longer a flex row of its own — .tgmd-filter__more-panel
     (a normal block, full sidebar width) replaced the old direct
     sort-select + reset-link pair this rule used to lay out. */
  margin-top: 1rem;
}

/* Hidden only once assets/js/vehicles.js confirms the toggle actually
   works and wires up a click handler — see initFilterToggles() and the
   template's own comment on .tgmd-filter__more-toggle. Without JS both
   panels stay visible unconditionally. */
.tgmd-filter__more.is-collapsed {
  display: none;
}

/* --- "weitere Filter" — Task 6: no-JS <details> fallback + JS <dialog> ---
   The markup (templates/vehicle-filter.php) is identical either way:
   .tgmd-filter__more-panel holds a header, a scrollable body of
   .tgmd-filter__dialog-group fieldsets, and a footer. Without JS this
   stays exactly where the template put it — inside <details
   class="tgmd-filter__more">, expanding inline in the sidebar single-
   column. With JS (assets/js/vehicles.js's initFilterDialog()), the SAME
   panel is MOVED, unchanged, into a real
   <dialog class="tgmd-filter__more-dialog"> appended inside the form —
   so every rule below that does not mention .tgmd-filter__more-dialog
   applies equally to both, and only the rules under that class add the
   modal-specific chrome (centring, backdrop, close button, scrolling
   body). */

.tgmd-filter__more-panel {
  /* The 3-column layout further down queries THIS element's own width
     with a CONTAINER query, deliberately not a viewport media query:
     the no-JS fallback is only ever as wide as the sidebar (~310px)
     regardless of viewport size, while the JS dialog can be up to
     1100px wide on that very same viewport — only a container query
     gets both right from one rule instead of two contradictory ones. */
  container-type: inline-size;
  margin-top: 0.75rem;
}

.tgmd-filter__more-header,
.tgmd-filter__more-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tgmd-filter__more-header {
  margin-bottom: 1rem;
}

.tgmd-filter__more-title {
  font-weight: 600;
  font-size: 1.125rem;
}

/* Raised specificity (0,2,0), not a bare .tgmd-filter__more-close —
   it is a real <button>, exactly as vulnerable to Hello Elementor's own
   `button, [type=button] { display: inline-block }` / `button:hover
   { background: #c36; color: #fff }` as every other button in this file
   (see the comment on `.tgmd-filter .tgmd-filter__submit` for the
   measurement this pattern is based on). */
.tgmd-filter .tgmd-filter__more-close {
  /* Shown only inside the JS dialog (see
     .tgmd-filter__more-dialog .tgmd-filter__more-close below) — in the
     inline no-JS fallback there is nothing modal to close, the summary
     itself already collapses the panel again. `color` is explicit because
     Hello Elementor's reset paints every <button> #c36 otherwise. It is
     the widget's "Farbe „Schließen“", a custom property so that it cannot
     outrank the hover pair below. */
  display: none;
  color: var(--tgmd-filter-close-color, #000);
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tgmd-filter .tgmd-filter__more-close:focus {
  /* Hello's `[type=button]:focus` would otherwise paint it #c36/white. */
  background-color: transparent;
  color: var(--tgmd-filter-close-color, #000);
}

.tgmd-filter .tgmd-filter__more-close:hover {
  background-color: #f2f2f2;
  color: #000;
}

.tgmd-filter .tgmd-filter__more-close:focus-visible {
  /* 1.4.0 (section 12): the site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-filter__dialog-group {
  /* Resets the same two <fieldset> UA defaults .tgmd-filter__set itself
     resets, and for the same reason — see that rule's own comment. */
  min-inline-size: 0;
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
  /* Keeps one group's heading and its own option rows together in one
     column of the 3-column layout below, rather than splitting mid-list
     — same idiom as .tgmd-desc__feature-item's own break-inside. */
  break-inside: avoid;
}

.tgmd-filter__dialog-group .tgmd-filter__group-heading {
  padding: 0 0 0.5rem;
}

.tgmd-filter__more-footer {
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* The footer's own two buttons keep their natural width here even
   though .tgmd-filter__submit normally fills its container — a 100%-wide
   button in a space-between row would crowd the reset link out
   entirely. */
.tgmd-filter__more-footer .tgmd-filter__submit,
.tgmd-filter__more-footer .tgmd-filter__reset {
  width: auto;
}

@container (min-width: 36rem) {
  /* 576px of PANEL width — every tablet from 768px up (a 768px viewport
     leaves ~720px of dialog content) gets the client's three columns;
     only phones fall back to one. See .tgmd-filter__more-panel's own
     comment for why this is a container query. Multi-column, not grid, for the
     same reading-order reason .tgmd-desc__features uses it: a group's
     heading and its own options should read top-to-bottom before moving
     to the next column, not left-to-right row by row. */
  .tgmd-filter__more-body {
    columns: 3;
    column-gap: 2rem;
  }
}

/* --- The JS dialog's own chrome — entirely absent from the no-JS fallback --- */

.tgmd-filter__more-dialog {
  max-width: 68.75rem; /* 1100px */
  width: calc(100% - 2rem);
  max-height: 70dvh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* [open] only: a bare `display: flex` on the element would override the
   browser's own `dialog:not([open]) { display: none }`, leaving the closed
   dialog rendered inline in the sidebar. The header/body/footer children
   below become "sticky" through flex layout, not position: sticky -
   simpler, and it has none of position: sticky's own prerequisites about
   which ancestor actually scrolls. */
.tgmd-filter__more-dialog[open] {
  display: flex;
  flex-direction: column;
}

.tgmd-filter__more-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.tgmd-filter__more-dialog .tgmd-filter__more-panel {
  display: flex;
  flex-direction: column;
  /* Lets the body flex-child below actually shrink and scroll instead
     of growing the dialog past its own max-height — the standard
     "min-height: 0 on a flex column that must scroll" fix. */
  min-height: 0;
  padding: 1.5rem;
}

.tgmd-filter__more-dialog .tgmd-filter__more-header {
  flex: 0 0 auto;
}

.tgmd-filter__more-dialog .tgmd-filter__more-close {
  display: inline-flex;
}

.tgmd-filter__more-dialog .tgmd-filter__more-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.tgmd-filter__more-dialog .tgmd-filter__more-footer {
  flex: 0 0 auto;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tgmd-filter-divider-color, rgba(0, 0, 0, 0.15));
}

/* Set by assets/js/vehicles.js while the dialog is open — showModal()
   alone does not reliably stop the PAGE (as opposed to the dialog)
   scrolling behind it in every browser, so this is the explicit belt
   the brief's own "page scroll locked while open" asks for. */
body.tgmd-filter-dialog-open {
  overflow: hidden;
}

/* `.tgmd-filter__reset` is an <a>, not a <button>, so Hello's button
   reset does not apply to it - but hello-elementor's
   `.page-content a { text-decoration: underline }` (0,1,1) does, on the
   Gebrauchtwagen/Neuwagen pages, for the exact reason documented on
   `.tgmd-card .tgmd-card__link` above. `.tgmd-filter .tgmd-filter__reset`
   (0,2,0) outguns it unconditionally. */
.tgmd-filter .tgmd-filter__reset {
  display: inline-block;
  cursor: pointer;
  /* 1.4.0 (section 12): "underline on hover, colour unchanged" — flipped
     from the pre-1.4.0 default (always underlined, hover removed it and
     dimmed the opacity); the specificity reasoning above is unchanged
     either way. */
  text-decoration: none;
  color: inherit;
}

.tgmd-filter .tgmd-filter__reset:hover {
  text-decoration: underline;
}

.tgmd-filter .tgmd-filter__reset:focus-visible {
  /* 1.4.0 (section 12): the site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

/* --- Mobile: the whole filter collapses behind a "Filter" toggle -------- */

/* THE bug as reported: at 0,1,0 this tied Hello's own
   `button, [type=button] { display: inline-block }` (also 0,1,0, see the
   comment on `.tgmd-filter .tgmd-filter__submit` above), and Hello's
   stylesheet loading after this one meant the tie went to Hello - the
   "Filter" toggle stayed visible above the 768px breakpoint, in Hello's
   own button colours (a magenta border), on bennemann.1wp.site's live
   /gebrauchtwagen/ page. `.tgmd-filter .tgmd-filter__mobile-toggle`
   (0,2,0) outguns it unconditionally. */
.tgmd-filter .tgmd-filter__mobile-toggle {
  display: none;
}

@media (max-width: 64rem) {
  /* Phones AND tablets: below 1025px the sidebar stacks above the listing
     (Elementor's own tablet layout), and a ~1170px form there would push
     every car below two screens of controls. */
  .tgmd-filter .tgmd-filter__mobile-toggle {
    display: block;
    width: 100%;
    cursor: pointer;
    /* 48px, like the sidebar's own two buttons. */
    padding: 0.8125rem 1.5rem;
    min-height: 3rem;
    line-height: 1;
    font-size: 1.125rem;
    font-weight: 500;
    text-transform: none;
    border-radius: 2px;
    border: 2px solid var(--tgmd-filter-mobile-toggle-border-color, #ffe70d);
    background-color: var(--tgmd-filter-mobile-toggle-bg, transparent);
    color: var(--tgmd-filter-mobile-toggle-color, #000000);
    box-shadow: none;
    margin-bottom: 1rem;
  }

  /* 1.4.0 (section 12): same "outline button" hover/active treatment as
     .tgmd-filter__more-toggle above — identical visual style, so the
     same behaviour, in the custom properties FilterControlSpec's own
     "Filter" button section writes. */
  .tgmd-filter .tgmd-filter__mobile-toggle:focus {
    /* Hello's `[type=button]:focus` would otherwise paint it #c36/white
       after a tap. */
    background-color: var(--tgmd-filter-mobile-toggle-bg, transparent);
    color: var(--tgmd-filter-mobile-toggle-color, #000000);
  }

  .tgmd-filter .tgmd-filter__mobile-toggle:hover {
    background-color: var(--tgmd-filter-mobile-toggle-hover-bg, #ffe70d);
    color: var(--tgmd-filter-mobile-toggle-hover-color, #000000);
  }

  .tgmd-filter .tgmd-filter__mobile-toggle:active {
    background-color: var(--tgmd-filter-mobile-toggle-active-bg, #e6cf00);
    color: var(--tgmd-filter-mobile-toggle-hover-color, #000000);
  }

  .tgmd-filter .tgmd-filter__mobile-toggle:focus-visible {
    /* 1.4.0 (section 12): the site-wide focus ring. */
    outline: 3px solid var(--tgmd-focus-color, #ffe70d);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
  }

  /* Same no-js-safe pattern as .tgmd-filter__more.is-collapsed: without
     JS the fieldset stays visible unconditionally, so every card is
     still reachable without scrolling past the whole form. */
  .tgmd-filter__set.is-collapsed {
    display: none;
  }

  /* The panel opens under the full-width toggle, so it takes the full
     width too - the 310px panel and 262px Von/Bis boxes are the desktop
     sidebar's. */
  .tgmd-filter__set,
  .tgmd-filter__range-box {
    width: 100%;
  }
}

/* Tablet: one full-width 1170px column would push the cars two screens
   down, so the search fields (left) and the list fields (right) sit side
   by side, with the two buttons under them. Each group is placed by its
   own modifier class (templates/vehicle-filter.php); .is-collapsed (0,2,0)
   still hides the whole panel. A theme's own copy of a pre-1.5 template
   names no group (no .tgmd-filter__set--named-groups) and always renders
   all three, so its groups are placed by position, as 1.4.5 placed them. */
@media (min-width: 48rem) and (max-width: 64rem) {
  .tgmd-filter__set {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "pickers lists"
      "ranges  lists"
      "submit  more";
    column-gap: 2.5rem;
    align-items: start;
  }

  .tgmd-filter__set:not(.tgmd-filter__set--named-groups) > .tgmd-filter__group:first-of-type {
    grid-area: pickers;
  }

  .tgmd-filter__set:not(.tgmd-filter__set--named-groups) > .tgmd-filter__submit ~ .tgmd-filter__group {
    grid-area: lists;
  }

  .tgmd-filter__set > .tgmd-filter__group--make-model {
    grid-area: pickers;
  }

  .tgmd-filter__set > .tgmd-filter__group--ranges {
    grid-area: ranges;
  }

  .tgmd-filter__set > .tgmd-filter__group--lists {
    grid-area: lists;
  }

  .tgmd-filter__set > .tgmd-filter__submit {
    grid-area: submit;
  }

  .tgmd-filter__set > .tgmd-filter__more {
    grid-area: more;
    /* Level with "Suchen" beside it; the 1rem is the stacked sidebar's. */
    margin-top: 0;
  }

  /* A group whose fields the widget hides is not in the markup at all
     (Frontend\FilterDisplay), so the areas close up around it instead of
     keeping an empty row and its gap. */
  .tgmd-filter__set--named-groups:not(:has(> .tgmd-filter__group--make-model)) {
    grid-template-areas:
      "ranges lists"
      "submit more";
  }

  .tgmd-filter__set--named-groups:not(:has(> .tgmd-filter__group--ranges)) {
    grid-template-areas:
      "pickers lists"
      "submit  more";
  }

  .tgmd-filter__set--named-groups:not(:has(> .tgmd-filter__group--lists)) {
    grid-template-areas:
      "pickers ranges"
      "submit  more";
  }

  .tgmd-filter__set--named-groups:not(:has(> .tgmd-filter__group--make-model)):not(:has(> .tgmd-filter__group--ranges)) {
    grid-template-areas:
      "lists  lists"
      "submit more";
  }

  .tgmd-filter__set--named-groups:not(:has(> .tgmd-filter__group--make-model)):not(:has(> .tgmd-filter__group--lists)) {
    grid-template-areas:
      "ranges ranges"
      "submit more";
  }

  .tgmd-filter__set--named-groups:not(:has(> .tgmd-filter__group--ranges)):not(:has(> .tgmd-filter__group--lists)) {
    grid-template-areas:
      "pickers pickers"
      "submit  more";
  }

  .tgmd-filter__set--named-groups:not(:has(> .tgmd-filter__group--make-model)):not(:has(> .tgmd-filter__group--ranges)):not(:has(> .tgmd-filter__group--lists)) {
    grid-template-areas: "submit more";
  }
}

/* Figma's own vertical rhythm (node 73:747): every text layer in that
   sidebar is set with text-box-trim (cap / alphabetic), so a line takes
   only its cap height - a label/value row is 13 + 12 + 13 = 38px, a Von/
   Bis block 13 + 12 + 37 = 62px. `text-box` reproduces that exactly where
   supported (Chrome 133+, Safari 18.2+); elsewhere the rows keep their
   untrimmed line-height and are simply taller. */
@supports (text-box: trim-both cap alphabetic) {
  /* 1.6.0: the listing's sort toolbar is a form of its own outside
     .tgmd-filter, so its picker needs the same rules to stand as tall as
     the sidebar's (38px, not 59px). */
  .tgmd-filter .tgmd-filter__picker-text,
  .tgmd-sort .tgmd-filter__picker-text {
    gap: 0.75rem;
  }

  .tgmd-filter .tgmd-filter__picker-text > .tgmd-filter__label,
  .tgmd-sort .tgmd-filter__picker-text > .tgmd-filter__label,
  .tgmd-sort .tgmd-filter__picker-value,
  .tgmd-filter .tgmd-filter__picker-value,
  .tgmd-filter .tgmd-filter__range > .tgmd-filter__label,
  .tgmd-filter .tgmd-filter__range-half .tgmd-filter__select {
    text-box: trim-both cap alphabetic;
  }

  /* The value clips at its padding box (overflow: hidden, for the
     ellipsis) and the trim shrinks that box to the cap height, which cut
     off descenders ("Beliebig") and umlaut dots. Padding with an equal
     negative margin widens the clip without moving anything. */
  .tgmd-filter .tgmd-filter__picker-value,
  .tgmd-sort .tgmd-filter__picker-value {
    padding-block: 0.3em;
    margin-block: -0.3em;
  }

  .tgmd-filter .tgmd-filter__range {
    gap: 0.75rem;
  }

  .tgmd-filter .tgmd-filter__range-half:first-child,
  .tgmd-filter .tgmd-filter__range-half:last-child {
    padding-top: 0.6875rem;
    padding-bottom: 0.6875rem;
  }
}

/* --- Task 9: sticky filter (desktop >= 1025px only) ---
   The sidebar stays pinned 24px below the viewport top (the widget's
   "Abstand zum oberen Fensterrand", --tgmd-filter-sticky-offset, plus the
   WP admin bar, which assets/js/vehicles.js measures into
   --tgmd-filter-admin-bar) for as long as the listing beside it scrolls;
   the widget's "Beim Scrollen nicht mitlaufen" turns it off. It is
   usually taller than the viewport (~1170px against ~1030px usable on a
   1080p screen), so it is capped at the viewport height and scrolls on
   its own: Marke/Modell and Preis at its top stay reachable at every page
   position, which pinning it by its bottom edge would not allow.
   (0,2,0) on purpose: Elementor's own `.elementor-widget { position:
   relative }` is (0,1,0) as well and loads later, so a bare widget class
   lost - the widget stayed relative and `top` merely pushed it 56px out
   of line with the grid beside it. */
@media (min-width: 64.0625rem) {
  .elementor-widget.elementor-widget-tgmd_vehicle_filter,
  .tgmd-filter {
    position: sticky;
    top: calc(var(--tgmd-filter-sticky-offset, 1.5rem) + var(--tgmd-filter-admin-bar, 0px));
    align-self: flex-start;
    max-height: calc(100vh - var(--tgmd-filter-sticky-offset, 1.5rem) - var(--tgmd-filter-admin-bar, 0px) - 1.5rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
  }

  /* Elementor wraps the rendered form in its own
     .elementor-widget-tgmd_vehicle_filter container (FilterWidget::
     get_name() - Elementor names this class after it automatically) -
     THAT outer box is the sticky, scrolling one there, so the <form>
     itself resets rather than doubling up a second, nested sticky box
     inside the first. The bare [tg_vehicle_filter] shortcode has no such
     wrapper (Frontend\FilterShortcode::render() returns the <form>
     directly), so the rule above stays exactly as written for that case. */
  .elementor-widget-tgmd_vehicle_filter .tgmd-filter {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }
}

/* No stock on the page at all: Elementor\FilterWidget prints this hidden
   placeholder instead of an empty form, and the widget's own wrapper
   collapses so the listing beside it can take the freed width. */
.elementor-widget-tgmd_vehicle_filter:has(.tgmd-filter-placeholder) {
  display: none;
}

.tgmd-filter-notice {
  margin: 0;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  background-color: #f2f2f2;
  font-size: 0.875rem;
}

.tgmd-filter.is-loading,
.tgmd-sort.is-loading,
.tgmd-grid.is-loading,
.tgmd-empty.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tgmd-pagination {
  /* Converted from literals to properties for Task C6; both fallbacks are
     the exact values that were hardcoded here, so this is a visual no-op.
     2rem separates the pager from the last row of cards by more than
     .tgmd-grid's own 1.5rem gap, so it reads as "after the grid" rather
     than as another grid row; 0.5rem is deliberately tighter than that
     gap, because the page numbers are one control and should read as a
     group. */
  margin-top: var(--tgmd-pagination-margin-top, 2rem);
  display: flex;
  gap: var(--tgmd-pagination-gap, 0.5rem);
  flex-wrap: wrap;
}

.tgmd-pagination .page-numbers {
  /* paginate_links( ['type' => 'plain'] ) emits <a class="page-numbers">
     for every link and <span class="page-numbers current"> for the page
     being viewed — those class names are WordPress core's, not ours, which
     is why they carry no tgmd- prefix.
     EVERY FALLBACK HERE IS THE CURRENT COMPUTED VALUE, so this rule is a
     visual no-op: the pager has never had styling of its own, so each
     property resolves to exactly what the theme was already producing —
     inherited colour, no background, no padding, no radius. The point is
     the knobs, not a new look. */
  color: var(--tgmd-pagination-link-color, inherit);
  background-color: var(--tgmd-pagination-link-bg, transparent);
  padding: var(--tgmd-pagination-link-padding, 0);
  border-radius: var(--tgmd-pagination-link-radius, 0);
}

.tgmd-pagination .page-numbers.current {
  /* Same no-op discipline: the current page inherits from the rule above
     until a site or a designer sets these. Split into its own rule
     because "which page am I on" is the one distinction a pager has to
     make, and a designer needs to be able to make it without touching the
     other links. */
  color: var(--tgmd-pagination-current-color, inherit);
  background-color: var(--tgmd-pagination-current-bg, transparent);
}

/* --- Task 2: "Mehr laden" (load more) ------------------------------------ */

.tgmd-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--tgmd-pagination-margin-top, 2rem);
}

/* Qualified with the ancestor class (specificity 0,2,0), not just
   `.tgmd-load-more` (0,1,0), for the exact reason `.tgmd-card
   .tgmd-card__link` is (see that rule's own comment): hello-elementor's
   `.page-content a { text-decoration: underline }` (0,1,1) already beats
   a single class and would otherwise render this button underlined, in
   the theme's own link colour, on the Gebrauchtwagen/Neuwagen pages.
   `.tgmd-load-more-wrap .tgmd-load-more` outguns 0,1,1 unconditionally,
   on any page, without `!important`. */
.tgmd-load-more-wrap .tgmd-load-more {
  display: inline-block;
  cursor: pointer;
  background-color: var(--tgmd-load-more-bg, #000);
  border: 3px solid var(--tgmd-load-more-border-color, #000);
  border-radius: var(--tgmd-load-more-radius, 2px);
  padding: var(--tgmd-load-more-padding, 1.75rem 3rem);
  color: var(--tgmd-load-more-color, #ffe70d);
  font-size: var(--tgmd-load-more-font-size, 1.875rem);
  font-weight: var(--tgmd-load-more-font-weight, 500);
  letter-spacing: var(--tgmd-load-more-letter-spacing, 1.5px);
  line-height: 1;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.tgmd-load-more-wrap .tgmd-load-more[aria-busy="true"],
.tgmd-load-more-wrap .tgmd-load-more.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* 1.4.0: the same inversion the site's other black buttons use on hover
   ("Mehr über uns erfahren", "Servicetermin vereinbaren"): yellow fill,
   black text, border unchanged. */
.tgmd-load-more-wrap .tgmd-load-more:hover {
  background-color: var(--tgmd-load-more-hover-bg, #ffe70d);
  border-color: var(--tgmd-load-more-hover-border-color, var(--tgmd-load-more-border-color, #000));
  color: var(--tgmd-load-more-hover-color, #000);
}

.tgmd-load-more-wrap .tgmd-load-more:active {
  background-color: var(--tgmd-load-more-active-bg, #e6cf00);
  color: var(--tgmd-load-more-hover-color, #000);
}

.tgmd-load-more-wrap .tgmd-load-more:focus-visible {
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

/* --- 1.6.0: the sort toolbar above .tgmd-grid -----------------------------
   "The sort order filter is placed best on top of the car grid at the
   right top side" (Enrico, the site's designer). templates/parts/
   sort-picker.php - the SAME file templates/vehicle-filter.php includes
   for its own Sortierung row - is what actually renders the picker here,
   so EVERY structural/layout/focus-ring rule the filter's own picker
   already has above (.tgmd-filter__picker, __picker-summary, __pen,
   __popup, __row, __check, ...) is UNSCOPED BY DESIGN - not qualified by
   `.tgmd-filter` - and already applies here for free, with no rule of
   this file's own. What genuinely needs a rule of its own is only the
   COLOUR side: the filter's colour rules read --tgmd-filter-*, written
   on the FILTER WIDGET's own {{WRAPPER}}, which this toolbar - rendered
   inside the LISTING widget's wrapper instead - can never see, so it
   needs its own --tgmd-sort-* set (Elementor\ControlSpec's own
   "Sortierung" style section) and its own, higher-specificity rules
   reading them. Every fallback below is the exact literal the filter's
   own picker computes, so an untouched toolbar is pixel-identical to it,
   not merely internally consistent. */

.tgmd-sort {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  /* The sidebar's picker takes its text size and line height from its
     form (.tgmd-filter above); this is a form of its own outside it, so it
     needs the same base, or its picker renders at the page's default. */
  font-size: 1.125rem;
  line-height: 1.65;
}

.tgmd-sort__fieldset {
  /* Same fieldset-overflow fix as .tgmd-filter__set above, and for the
     identical reason: a bare <fieldset>'s UA min-inline-size: min-content
     refuses to shrink below its widest content otherwise. */
  min-inline-size: 0;
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tgmd-sort .tgmd-filter__picker {
  /* The Figma sidebar's own width (.tgmd-filter__set's own
     --tgmd-filter-width fallback) - "the picker width defaults to the
     sidebar's picker width" (the brief's own words) - the FILTER's own
     picker never sets a width of its own; it simply fills that 310px
     column. This toolbar has no such column to inherit from (it is a
     flex ROW, not the sidebar's flex COLUMN), so it needs an explicit
     one to match by default.
     Elementor\ControlSpec's own "Breite" control (a direct, wrapper-
     scoped write, like every other size control in this class - no
     custom property needed, since width never competes with a
     hover/open state rule) overrides this plainly, the same
     relationship .tgmd-carousel__button's own default has with
     "Größe der Pfeile". */
  width: 19.375rem;
  max-width: 100%;
}

.tgmd-sort .tgmd-filter__label {
  color: var(--tgmd-sort-label-color, inherit);
}

.tgmd-sort .tgmd-filter__picker:hover .tgmd-filter__label,
.tgmd-sort .tgmd-filter__picker:focus-within .tgmd-filter__label,
.tgmd-sort .tgmd-filter__picker[open] .tgmd-filter__label {
  color: var(--tgmd-sort-label-active-color, #000);
}

.tgmd-sort .tgmd-filter__picker-value {
  color: var(--tgmd-sort-value-color, inherit);
}

.tgmd-sort .tgmd-filter__picker:hover .tgmd-filter__picker-value,
.tgmd-sort .tgmd-filter__picker:focus-within .tgmd-filter__picker-value,
.tgmd-sort .tgmd-filter__picker[open] .tgmd-filter__picker-value {
  color: var(--tgmd-sort-value-active-color, #000);
}

.tgmd-sort .tgmd-filter__pen {
  background-color: var(--tgmd-sort-pen-bg, #ffe70d);
}

.tgmd-sort .tgmd-filter__pen::before {
  background-color: var(--tgmd-sort-pen-color, #000);
}

.tgmd-sort .tgmd-filter__picker:hover .tgmd-filter__pen,
.tgmd-sort .tgmd-filter__picker:focus-within .tgmd-filter__pen,
.tgmd-sort .tgmd-filter__picker[open] .tgmd-filter__pen {
  background-color: var(--tgmd-sort-pen-hover-bg, #e6cf00);
}

.tgmd-sort .tgmd-filter__popup {
  background-color: var(--tgmd-sort-popup-bg, #fff);
  border: 1px solid var(--tgmd-sort-popup-border-color, rgba(0, 0, 0, 0.8));
  max-height: calc(var(--tgmd-sort-popup-rows, 7) * 2.85625rem);
}

.tgmd-sort .tgmd-filter__row {
  color: var(--tgmd-sort-option-color, inherit);
}

.tgmd-sort .tgmd-filter__row:hover,
.tgmd-sort .tgmd-filter__row:focus-within {
  background-color: var(--tgmd-sort-option-hover-bg, #f2f2f2);
}

/* The selected radio row bolds, exactly like the sidebar's own picker -
   see the filter's own `.tgmd-filter .tgmd-filter__row:has(...)` rule
   above for why it needs an ancestor qualifier. The listing widget's
   "Schrift der Optionen" writes `{{WRAPPER}} .tgmd-sort .tgmd-filter__row`,
   and {{WRAPPER}} is three classes, so that rule scores (0,5,0); the popup
   qualifier lifts this one to (0,5,1), so a weight set there cannot
   un-bold the chosen order. */
.tgmd-sort .tgmd-filter__popup .tgmd-filter__row:has(input[type="radio"]:checked) {
  font-weight: 600;
}

.tgmd-sort .tgmd-filter__check {
  border: 1.5px solid var(--tgmd-sort-check-border-color, rgba(0, 0, 0, 0.8));
  background-color: var(--tgmd-sort-check-bg, #fff);
}

.tgmd-sort .tgmd-filter__row:hover .tgmd-filter__check {
  border-color: var(--tgmd-sort-check-active-border-color, #000);
}

.tgmd-sort .tgmd-filter__row input:checked + .tgmd-filter__check {
  background-color: var(--tgmd-sort-check-checked-bg, #ffe70d);
  border-color: var(--tgmd-sort-check-active-border-color, #000);
}

.tgmd-sort .tgmd-filter__row input[type="radio"]:checked + .tgmd-filter__check::after {
  background-color: var(--tgmd-sort-check-mark-color, #000);
}

/* The no-JS "Sortieren" button - visible only until assets/js/vehicles.js
   has wired the form (initSort() adds `is-enhanced`, mirroring
   initCarousel()'s own `is-ready` marker), since a live radio change
   already submits the form for a visitor who has JS. No Figma spec of
   its own exists for it (a script-off fallback, not a designed element),
   so this is a plain, functional button rather than a styled one. */
.tgmd-sort__submit {
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.8);
  border-radius: 2px;
  padding: 0.5rem 1rem;
  background-color: transparent;
  font: inherit;
  color: inherit;
}

.tgmd-sort.is-enhanced .tgmd-sort__submit {
  display: none;
}

@media (max-width: 47.9375rem) {
  /* Same floor as .tgmd-grid's own single-column breakpoint - the
     toolbar becomes the full-width column-mate above it. */
  .tgmd-sort {
    flex-wrap: wrap;
  }

  /* The fieldset is the flex item: without this it sized to its content,
     and the picker's 100% filled only that, so the toolbar changed width
     with every choice (189px for "Standardsortierung", 304px for a longer
     label, at 375px). */
  .tgmd-sort__fieldset {
    flex: 1 1 100%;
  }

  .tgmd-sort .tgmd-filter__picker {
    width: 100%;
  }
}

/* --- Task 4: the homepage teaser carousel --------------------------------- */

.tgmd-carousel {
  /* The frame the arrow row sits in when the listing widget positions it
     freely ("Position der Pfeile"); nothing else inside is positioned
     against it. */
  position: relative;
}

.tgmd-carousel__nav {
  /* Hidden until assets/js/vehicles.js's initCarousel() marks the
     carousel ready: the buttons scroll by a card width via JS and have
     no working fallback (no href, no form) — without JS the track is
     still fully scrollable by touch, trackpad or keyboard, so showing an
     inert button pair would be worse than not showing them. */
  display: none;
  justify-content: var(--tgmd-carousel-nav-justify, flex-end);
  gap: var(--tgmd-carousel-nav-gap, 1.5rem);
  margin-bottom: 1rem;
}

.tgmd-carousel.is-ready .tgmd-carousel__nav {
  display: flex;
}

/* Raised specificity + explicit reset: see the comment on
   `.tgmd-filter .tgmd-filter__submit` above. `[type=button]` is not a
   type this button carries, but `button, button:hover` themselves are
   PLAIN type/pseudo-class selectors ((0,0,1) and (0,1,1)) - Hello's own
   `button:hover { background: #c36; color: #fff }` still outguns the
   PREVIOUS unqualified `.tgmd-carousel__button` (0,1,0) on hover, since
   (0,1,1) > (0,1,0) regardless of load order. `.tgmd-carousel
   .tgmd-carousel__button` (0,2,0) beats it outright, and `color` is now
   declared explicitly (it never was) so Hello's hover rule has nothing
   left to win. */
.tgmd-carousel .tgmd-carousel__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-transform: none;
  font-size: 1rem;
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* 1.4.0 (section 12): hover/active only while enabled — a disabled
   button has "no hover" per that section, and :not(:disabled) is what
   stops the pointer still resting on it after it becomes disabled
   (crossing into the first/last card) from applying either state. */
.tgmd-carousel .tgmd-carousel__button:hover:not(:disabled) {
  background-color: #e6cf00;
  color: inherit;
  transform: scale(1.05);
}

.tgmd-carousel .tgmd-carousel__button:active:not(:disabled) {
  transform: scale(0.97);
}

.tgmd-carousel .tgmd-carousel__button svg {
  width: 100%;
  height: 100%;
}

/* The arrows' Figma colours as custom properties the listing widget writes.
   The SVGs in templates/archive-vehicles.php carry the same values as
   presentation attributes, for a page without this stylesheet; these rules
   outrank them. The hover circle keeps the base colour unless the widget
   sets one. */
.tgmd-carousel .tgmd-carousel__button circle {
  fill: var(--tgmd-carousel-circle-color, #ffe70d);
  stroke: var(--tgmd-carousel-circle-color, #ffe70d);
}

.tgmd-carousel .tgmd-carousel__button path {
  fill: var(--tgmd-carousel-arrow-color, #000);
}

.tgmd-carousel .tgmd-carousel__button:hover:not(:disabled) circle {
  fill: var(--tgmd-carousel-circle-hover-color, var(--tgmd-carousel-circle-color, #ffe70d));
  stroke: var(--tgmd-carousel-circle-hover-color, var(--tgmd-carousel-circle-color, #ffe70d));
}

.tgmd-carousel .tgmd-carousel__button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* 1.4.0 (section 12): the site-wide focus ring (see the master rule
   further down this file for every OTHER focusable element) — written
   out in full here, rather than folded into that grouped rule, because
   this is the one focus-visible target in the whole file that already
   had its own designer-configurable colour (--tgmd-carousel-button-
   focus-color, pre-1.4.0); the `outline` SHORTHAND in the grouped rule
   would reset that colour back to its own literal on every page load
   regardless of source order, so it stays a standalone declaration. */
.tgmd-carousel .tgmd-carousel__button:focus-visible {
  outline: 3px solid var(--tgmd-carousel-button-focus-color, var(--tgmd-focus-color, #ffe70d));
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-carousel__track {
  display: flex;
  gap: var(--tgmd-carousel-gap, 1.5rem);
  /* The whole reason this is a track and not a grid: it scrolls
     horizontally by design, with each card snapping into place.
     overflow-x: auto (not `scroll`) keeps the scrollbar hidden on
     platforms that render one only while interacting (most touch/trackpad
     setups), while never removing scroll capability the way `hidden`
     would — the WebKit/scrollbar-width rules below hide the persistent
     bar some desktop browsers still draw, without touching overflow
     behaviour at all, so keyboard, touch and trackpad scrolling all keep
     working. */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Prevents the OUTER page from scrolling horizontally: without this,
     each card's own content (an unbreakable mobile.de title token) could
     still widen an item past its own flex-basis and push the whole page
     wider — measured as a real failure mode during this task, hence the
     360px page-scrollWidth check named in the brief. */
  max-width: 100%;
}

.tgmd-carousel__track::-webkit-scrollbar {
  display: none;
}

.tgmd-carousel__item {
  flex: 0 0 auto;
  /* 4 cards at the Figma's 1680px track width (24px gaps): each item is
     calc((100% - 3 * gap) / 4). The 2-up and 1-up breakpoints below
     divide the same formula by 2 and 1 card respectively. The listing
     widget's "Karten pro Ansicht" replaces all three with its own count
     (--tgmd-carousel-item-width, per device). */
  width: var(--tgmd-carousel-item-width, calc((100% - 3 * var(--tgmd-carousel-gap, 1.5rem)) / 4));
  scroll-snap-align: start;
  /* Figma: every card in the row is the same height - the card stretches
     to its item, and the items to the track's tallest. */
  display: flex;
}

.tgmd-carousel__item > .tgmd-card {
  flex: 1 1 auto;
}

@media (max-width: 64rem) {
  .tgmd-carousel__item {
    width: var(--tgmd-carousel-item-width, calc((100% - 1 * var(--tgmd-carousel-gap, 1.5rem)) / 2));
  }
}

@media (max-width: 47.9375rem) {
  .tgmd-carousel__item {
    width: var(--tgmd-carousel-item-width, 85%);
  }
}

/* 1.4.0: a horizontally-scrolling row reads as broken when neighbouring
   cards' price rows start at different heights - the grid (a vertically
   scrolling list) does not have this problem, so only the carousel
   reserves the heading's full 2-line height and narrows the trim clamp
   from the grid's 2 lines down to 1. */
.tgmd-carousel__item .tgmd-card__heading {
  /* A fixed line-height (rather than the default "normal" the grid
     keeps) is what makes an exact 2-line min-height calculable at all -
     "normal" has no single resolved value to multiply. Scoped to the
     carousel only, so the grid's own line-height is untouched. */
  line-height: 1.2;
  min-height: calc(1.2em * 2);
}

.tgmd-carousel__item .tgmd-card__trim {
  -webkit-line-clamp: 1;
  line-height: 1.2;
}

/* A card whose title has no trim part keeps that line's space (the flex
   gap above it comes with the pseudo-element), so its price row still
   lines up with its neighbours'. 1.125rem is the trim's default size. */
.tgmd-carousel__item .tgmd-card__title-block:not(:has(.tgmd-card__trim))::after {
  content: "";
  display: block;
  height: calc(1.125rem * 1.2);
}

/* 1.4.0: the buttons have no working fallback on a touch-only device
   (there is nothing for a tap to focus first, unlike a mouse hover), and
   native swiping (the track's own overflow-x + scroll-snap, untouched
   by this rule) already provides the same affordance without them -
   pointer: coarse excludes a touch-capable laptop with a mouse attached,
   where the buttons still work as intended. */
@media (hover: none) and (pointer: coarse) {
  .tgmd-carousel.is-ready .tgmd-carousel__nav {
    display: none;
  }
}

.tgmd-empty {
  /* The empty state — "Aktuell sind keine Fahrzeuge dieser Kategorie
     verfügbar…" — had no rule at all, so it rendered as a bare theme
     paragraph. It was measured correct on /neuwagen/ (the dealer
     genuinely has no new cars), so the job here is NOT to restyle it: it
     is to give it the same knobs the card got, without changing a pixel.
     Every fallback below is therefore the value a plain <p> already
     computed — inherited colour and alignment, transparent background,
     no padding, no radius, no border. */
  color: var(--tgmd-empty-color, inherit);
  background-color: var(--tgmd-empty-bg, transparent);
  padding: var(--tgmd-empty-padding, 0);
  border: var(--tgmd-empty-border, 0);
  border-radius: var(--tgmd-empty-radius, 0);
  text-align: var(--tgmd-empty-text-align, inherit);
}

/* "Filter zurücksetzen" inside the no-match message: the message's own
   colour, underlined. (0,1,0) already beats Hello's bare `a`; the hover
   rule is raised past its `a:hover` (0,1,1). */
.tgmd-empty__reset {
  color: var(--tgmd-empty-link-color, inherit);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.tgmd-empty .tgmd-empty__reset:hover,
.tgmd-empty .tgmd-empty__reset:focus-visible {
  color: var(--tgmd-empty-link-hover-color, #000);
  text-decoration-thickness: 2px;
}

.tgmd-empty .tgmd-empty__reset:focus-visible {
  /* The site-wide focus ring. */
  outline: 3px solid var(--tgmd-focus-color, #ffe70d);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tgmd-focus-shadow-color, #181818);
}

.tgmd-card__title,
.tgmd-archive__title,
.tgmd-single h1 {
  /* mobile.de's modelDescription joins trim tokens with "*" and no
     spaces at all (measured worst case: "1.2DIT*GS*Matrix*Navi*SHZ*LHZ*
     360°*PDC", 38 characters, zero break opportunities) - most of this
     dealer's titles look like that, so it's the common case here, not
     an edge case. overflow-wrap/word-break both computed "normal", so
     nothing could break it and it spilled 217px out of the card onto
     the section behind it.
     overflow-wrap: break-word only opens a break INSIDE a word/token
     when that token is itself wider than the line and has no other
     break opportunity - an ordinary word is never split. word-break:
     break-all was rejected: it breaks at any character boundary
     regardless of whether the word would otherwise have fit, so it
     would also chop ordinary short German words (e.g. "Fahrzeug")
     mid-syllable whenever one happened to land on a line edge, not just
     this pathological unbroken token.
     .tgmd-archive__title is included defensively, not for a measured
     overflow: its content is the static translated string "Fahrzeuge",
     which has break opportunities and cannot overflow today. It is here
     because it is the third of three headings this plugin emits, the
     other two need this, and a translation is the one part of that
     string a site can change without touching this file. Since the
     property only ever acts on a token wider than its line, adding it
     costs nothing when the string is ordinary. */
  overflow-wrap: break-word;
}

.tgmd-archive {
  /* The vehicle post type archive (/fahrzeuge/) has exactly the defect
     .tgmd-single below already fixes, for exactly the reasons documented
     there - that template also calls get_header()/get_footer() into a
     theme that supplies no content wrapper and floats its header over
     the content, so it has to own its container, gutter and top offset.
     It was simply never given the same treatment. See the comment on
     .tgmd-single for the reasoning and the header measurements; only
     this page's own numbers are recorded here.

     Measured live 2026-09-10 at a 1920px viewport: max-width none,
     padding 0, and so 1905px wide (edge-to-edge, no gutter), with
     document.elementFromPoint() over .tgmd-archive__title returning a
     DIV.elementor-element instead of the heading - the title was
     covered and not even the click target.

     75rem deliberately matches .tgmd-single rather than being sized
     independently, so the two pages share one measure and one gutter
     instead of drifting apart. What it gives this page: 1152px of
     content, which .tgmd-grid's minmax(min(100%, 17rem), 1fr) tracks
     fill as 3 columns of ~368px - a 4th would need 4 * 272px +
     3 * 1.5rem of gap = 1160px, more than the container has.

     The top offset gets its own property rather than reusing
     --tgmd-single-offset, even though it defaults to the same value:
     an archive and a detail page can sit under different headers (a
     landing-style header on one, a compact one on the other, or the
     same header at a different breakpoint), so a site has to be able
     to retune one without moving the other. The max-width gets its own
     property for the same reason - a listing and a detail page are
     allowed to want different measures - but defaults to .tgmd-single's
     value so that out of the box they agree. */
  max-width: var(--tgmd-archive-max-width, 75rem);
  margin: 0 auto;
  padding: var(--tgmd-archive-offset, 8.5rem) 1.5rem 0;
}

.tgmd-single {
  /* This template calls get_header()/get_footer(), but hello-elementor
     gives back a bare shell with no content wrapper at all - measured
     live: .site-main, #content and .ast-container are all absent. So,
     same lesson as .tgmd-card above (own your layout, don't trust a
     wrapper the theme never supplies): this page supplies its own
     centred container and gutter instead of running edge-to-edge
     (measured live: max-width none, padding 0, the <h1> starting at
     x=0 and the gallery photo touching the viewport edge).
     75rem (1200px) is sized for the photo gallery, not just the text:
     .tgmd-gallery's own tracks are minmax(min(100%,20rem), 1fr). At this
     max-width (minus the 2 * 1.5rem gutter below = 1152px content
     width), 3 columns fit (3*320px + 2*0.75rem gaps =~ 984px) and
     auto-fill's 1fr then grows all three to fill the row at ~376px
     each - a spacious 3-column gallery. A 4th column would need
     =~1316px, more than this container gives it; going wider just to
     fit a 4th was rejected as making the page unreasonably wide on a
     large desktop monitor for a 3-columns-already-comfortable gallery.
     Overridable, but the number above is the output of that calculation
     rather than a preference: it is a function of .tgmd-gallery's own gap
     and track floor. Widening this alone does not add a column until the
     content box reaches the ~1316px a 4th 20rem track needs - up to
     there the same three tracks simply grow. */
  max-width: var(--tgmd-single-max-width, 75rem);
  margin: 0 auto;
  /* No explicit width is set, so this stays a normal auto-width block:
     the browser solves width so that padding + content already fit the
     containing block, which is what keeps this safe at 390px (and any
     other viewport) with no horizontal overflow - the gutter can never
     itself push the page wider than its container.

     The top gutter is a separate problem from the side ones. Themes
     increasingly build their header with a page builder and float it
     over the top of the content rather than reserving space in the
     document flow. Measured live on this site: the <header> element is
     a 0-height empty shell, and document.elementFromPoint() over the
     <h1>'s own box returned a DIV.elementor-element instead of the
     heading - the title was covered and not even the click target. A
     theme-supplied wrapper would normally absorb this; there isn't one
     (see above). So reserve the space here.

     --tgmd-single-offset exists because the correct value is a property
     of the host theme's header, which a reusable plugin cannot know: a
     site can retune it in one declaration without editing this file or
     fighting specificity.

     8.5rem (136px) is deliberately generous rather than measured-exact.
     On this site the floating header occupies 40px-160px, clipping the
     <h1> by 24px at 6rem - but 32px of that offset is the logged-in
     admin bar, which a visitor never sees, so the true requirement is
     nearer 128px and varies with breakpoint and menu wrapping. The
     asymmetry of the two failure modes decides it: too little padding
     puts the vehicle's title under the header on a customer-facing
     page, while too much leaves some whitespace above it. On a theme
     whose header does reserve its own space, override the property
     down - that is what it is for. */
  padding: var(--tgmd-single-offset, 8.5rem) 1.5rem 0;
}

.tgmd-desc {
  width: 100%;
  max-width: var(--tgmd-desc-max-width, 100%);
  box-sizing: border-box;
}

.tgmd-single__description {
  /* mobile.de's plainTextDescription is one long, unstructured,
     single-paragraph wall of dealer copy (real example runs of "-" and
     "!!!") that would otherwise stretch the full width of .tgmd-single
     above (up to 1200px) - far past the ~45-75 characters-per-line
     typography guidance for readable prose. 65ch sits in the middle of
     that range. The `ch` unit is deliberate over a px/rem guess: it's
     defined as the width of the font's own "0" glyph, so the cap tracks
     an actual character count in whatever font the page renders with.
     overflow-wrap: break-word is repeated here for the same reason as
     the title rule above, not inherited from it: this is real free text
     with long punctuation runs that carry no natural break opportunity
     ("!!!!!!!!!!" is exactly as unbreakable as mobile.de's title
     tokens), and without this a long enough run would force this
     column - and the page - wider than the 390px floor this must not
     overflow.
     Overridable in ch, rem or px - whatever a site prefers to think in -
     but 65ch is the only one of those that keeps tracking a real
     character count if the inherited font changes, which is the point of
     the unit here. */
  max-width: var(--tgmd-single-description-max-width, 65ch);
  overflow-wrap: break-word;
}

.tgmd-desc__title {
  margin: 0 0 1rem;
  padding: var(--tgmd-desc-title-padding, 0.5rem 0);
  font-size: var(--tgmd-desc-title-font-size, 1.375rem);
  font-weight: 700;
  line-height: 1.3;
}

.tgmd-desc__lead,
.tgmd-single__lead {
  font-weight: 600;
  font-size: var(--tgmd-single-lead-font-size, 1.125rem);
  line-height: 1.4;
  margin: 0 0 1rem;
}

.tgmd-desc__features,
.tgmd-single__features {
  /* Multi-column, not grid. A grid fills ROW by row, so a list read
     zig-zag - item 1 left, item 2 middle, item 3 right - and one long
     item stretched its whole row, leaving its short neighbours floating
     above a hole (measured live: a 12-line row beside two 1-line
     items). mobile.de shows one item per line, top to bottom; columns
     flow the same way, so the reading order is the dealer's.
     `columns: <count> <width>` makes the count a MAXIMUM and the width a
     MINIMUM, so the browser drops columns on its own as the container
     narrows - a phone gets one column even when a designer set three,
     without anyone having to remember the mobile breakpoint. */
  columns: var(--tgmd-desc-columns, 2) var(--tgmd-single-feature-min-width, 16rem);
  column-gap: var(--tgmd-desc-column-gap, 2rem);
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.tgmd-desc__feature-item,
.tgmd-single__feature-item {
  position: relative;
  padding-left: 1.35rem;
  /* Row spacing lives on the item: `gap` does nothing vertically in a
     multi-column container. break-inside keeps an item that wraps to two
     lines in one column instead of splitting it across the column edge. */
  margin: 0 0 var(--tgmd-desc-row-gap, 0.45rem);
  break-inside: avoid;
  line-height: 1.5;
  font-size: var(--tgmd-single-feature-font-size, 0.9375rem);
}

.tgmd-desc__feature-item::before,
.tgmd-single__feature-item::before {
  content: "•";
  position: absolute;
  left: 0.25rem;
  top: 0;
  color: var(--tgmd-single-feature-bullet-color, currentColor);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
}

.tgmd-desc__disclaimer,
.tgmd-single__disclaimer {
  font-size: var(--tgmd-single-disclaimer-font-size, 0.8125rem);
  color: var(--tgmd-single-disclaimer-color, #646970);
  line-height: 1.5;
  margin: 0.5rem 0 0;
  padding-top: 0;
  border-top: none;
}

.tgmd-single__facts {
  /* Previously bare <dl>/<dt>/<dd> with no CSS at all, so it fell back
     to the browser default stacked rendering (dt alone on its own line,
     dd indented beneath it via the UA stylesheet's own
     `dd { margin-inline-start: 40px }`) - worse than the card's tidy
     "label ... value" grid despite this page having far more room.
     The base (narrow-viewport) case mirrors the card's own grid idiom
     exactly, for the same reasons it works there: auto/auto columns
     each size to their own content's widest item, and right-aligning
     the value column (below) lines up every value's edge instead of
     leaving it ragged against a shorter label. */
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.25rem 1rem;
}

.tgmd-single__facts dt {
  /* Bold rather than the card's dimmed #595959: unlike .tgmd-card, no
     contrast problem was measured for this page's own ambient
     background/text colour, so a de-emphasis colour here would be an
     unverified guess rather than a computed fix. Weight alone creates
     the same label/value hierarchy without asserting any colour. */
  font-weight: 600;
}

.tgmd-single__facts dd {
  margin: 0;
  text-align: right;
  /* Defensive, not observed: dd can now carry VehicleSpecs's humanised
     fallback for a gearbox/fuel value outside its known map (see that
     class). That fallback replaces underscores with spaces, so it
     normally wraps fine on its own - but a hypothetical future enum
     member with no underscore at all would be exactly as unbreakable as
     the mobile.de title tokens this same property fixes above. */
  overflow-wrap: break-word;
}

/* Qualified with the ancestor class (0,2,0) for exactly the reason
   .tgmd-card .tgmd-card__link is - see that comment for the measurement.
   A single class (0,1,0) loses to hello-elementor's `.page-content a`
   (0,1,1), and losing here costs more than an underline: it costs the
   colour too. Measured on a detail page, this element computed
   color rgb(204, 51, 102), padding 0px and a transparent background -
   the theme's default link colour, reading as a stray inline link rather
   than the call to action it is. single-vehicle.php always emits this
   link inside <main class="tgmd-single">, so the extra class is free.
   No !important. */
.tgmd-single .tgmd-single__mobile-link {
  /* Padding and a background on a box that is still inline would not
     push the lines around it apart - the button would overlap the text
     above and below. inline-block also keeps it shrink-to-fit, so it
     stays a button rather than becoming a full-width bar. */
  display: inline-block;
  /* Deliberately the card's own measured pair, inverted, rather than a
     new colour this plugin would then have to justify: #fff on #1a1a1a
     is 17.404:1 by the WCAG 2.1 relative-luminance formula
     (L(#1a1a1a) = 0.0103298, L(#fff) = 1, so (1 + 0.05) /
     (0.0103298 + 0.05)) - far past the 4.5:1 required of body text and
     past AAA's 7:1. The two travel together; a site overriding one has
     to re-check the other.
     One limit worth naming rather than leaving to be discovered: that
     ratio is the label against the button. The button against the PAGE
     is 17.4:1 on a white background but 1.21:1 on a black one, so on a
     dark page the label stays fully legible while the button's outline
     stops reading as a shape. Unlike .tgmd-card, this element is not
     dropped into arbitrary Elementor sections - it only ever renders
     inside the plugin's own detail template, whose background was not
     measured as dark - so no backdrop-independent surface is engineered
     here. --tgmd-single-mobile-link-bg is the knob if that changes. */
  background-color: var(--tgmd-single-mobile-link-bg, #1a1a1a);
  color: var(--tgmd-single-mobile-link-color, #fff);
  /* Sized as a touch target, not just for looks. The block padding is
     the part that has to be generous: measured at the 390px floor this
     renders 42px tall on a default 18px body line box - close to the
     44px of WCAG 2.5.5 and well past the 24px minimum of 2.5.8. The
     exact height tracks whatever line-height the inherited font gives,
     so it moves with the host's typography rather than being pinned
     here. */
  padding: var(--tgmd-single-mobile-link-padding, 0.75rem 1.25rem);
  border-radius: var(--tgmd-single-mobile-link-radius, 0.25rem);
  /* It is a button now, so it should not also carry a link underline -
     and on a page that does supply `.page-content a`, it would. */
  text-decoration: none;
}

.tgmd-single .tgmd-single__mobile-link:hover {
  /* A button with no hover feedback reads as inert. filter: brightness()
     rather than a second hardcoded colour pair: the button's surface is
     --tgmd-single-mobile-link-bg, which a site is expected to override,
     and a fixed hover colour would stop relating to it the moment it
     did. brightness() is computed FROM whatever that surface currently
     is, so the feedback survives a retheme with no second value to keep
     in sync - the same reasoning the focus ring below uses currentColor
     for.
     Lightening (>1) rather than darkening, because the default surface
     is #1a1a1a and there is almost no room below it; 1.35 on #1a1a1a
     lands near #232323, a visible shift that keeps the label's contrast
     far above 4.5:1. A site whose override is light instead gets a
     lightening hover, which is a weaker cue than darkening would be but
     never an illegible one - the alternative, branching on the
     surface's luminance, is not something CSS can do. */
  filter: brightness(var(--tgmd-single-mobile-link-hover-brightness, 1.35));
}

.tgmd-single .tgmd-single__mobile-link:focus-visible {
  /* Drawn inside the button's own surface (negative offset), not around
     it. An outline outside sits on the page background, which this
     stylesheet does not own and cannot measure - the same problem
     .tgmd-card solves by owning its surface - so a ring out there can
     land on a colour close enough to itself to disappear. Inside, it is
     on --tgmd-single-mobile-link-bg, which is known.
     currentColor is the default for the same reason: it resolves to
     --tgmd-single-mobile-link-color, which is by construction the colour
     already proven readable on that surface, so the ring keeps its
     contrast automatically when a site rethemes the button instead of
     being a third value to keep in sync.
     :focus-visible rather than :focus, so keyboard focus gets the ring
     and a mouse click does not. */
  outline: 2px solid var(--tgmd-single-mobile-link-focus-color, currentColor);
  outline-offset: -2px;
}

@media (min-width: 60rem) {
  .tgmd-single__facts {
    /* This page has far more width than a card, so above a
       desktop-ish breakpoint two label/value pairs share a row instead
       of one running the full page width - "something better suited to
       a longer spec list" as it grows. This needs no markup change: a
       <dl>'s flat dt,dd,dt,dd,... children auto-flow left-to-right into
       whichever grid-template-columns is active, so 4 auto columns
       naturally group into two adjacent label/value pairs per row.
       60rem is a deliberately conservative breakpoint: even a generous
       estimate of this dealer's longest label/value text (no label or
       value in this table exceeds ~16 characters today) stays well
       under the >=912px this container has to work with at 60rem
       (60rem viewport minus the 2 * 1.5rem gutter), leaving wide
       margin for font-metric differences on the live site. Below 60rem
       - which covers the required 390px case with even more room to
       spare - it stays the single-pair 2-column layout above, already
       reasoned safe at that floor. */
    grid-template-columns: repeat(4, auto);
    column-gap: 2rem;
  }
}

/* --- Vehicle specifications table (templates/vehicle-specs.php) --------- */
.tgmd-specs {
  display: grid;
  grid-template-columns: auto auto;
  gap: var(--tgmd-specs-row-gap, 0.5rem) var(--tgmd-specs-col-gap, 1.5rem);
  margin: 0;
  padding: var(--tgmd-specs-padding, 0);
}

.tgmd-specs__label {
  font-weight: 600;
  margin: 0;
}

.tgmd-specs__value {
  margin: 0;
  text-align: right;
  overflow-wrap: break-word;
}

/* --- Accessibility: Screen reader utility class --------------------------- */
.tgmd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  /* The current half of the idiom beside the deprecated clip. It matters
     for the filter's <legend>: Hello Elementor displays a legend as a
     table, which grows past the 1px width - clipped to nothing either way,
     and 1.4.x's (removed) "Überschrift ausblenden" control added this too. */
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
 * The native <select> the range combobox hides keeps its field styling:
 * `.tgmd-filter__range-half .tgmd-filter__select` (0,2,0) sets width: 100%
 * and out-ranks the single-class utility above, so the "hidden" select stayed
 * 260px wide, absolutely positioned, and pushed a 360px phone's page to 443px
 * (Hello Elementor's body overflow-x: clip hides that from scrollWidth, a real
 * phone still scrolls sideways). Re-assert the utility at a higher
 * specificity instead of reaching for !important.
 */
.tgmd-filter__range-half .tgmd-filter__select.tgmd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Accessibility: Reduced motion preferences (WCAG 2.2) ----------------- */
@media (prefers-reduced-motion: reduce) {
  .tgmd-filter,
  .tgmd-grid,
  .tgmd-empty,
  .tgmd-card,
  .tgmd-card__link,
  .tgmd-card__image,
  .tgmd-filter__control,
  .tgmd-filter__submit,
  .tgmd-filter__reset,
  .tgmd-load-more-wrap .tgmd-load-more,
  /* 1.4.0 additions — same reasoning, same fix shape: each of these
     gained its own `transition` (background-color/border-color/
     transform/filter) as part of section 12's hover/active/open states,
     and every one needs it switched off here too. */
  .tgmd-filter__picker,
  .tgmd-filter__picker .tgmd-filter__label,
  .tgmd-filter__picker .tgmd-filter__picker-value,
  .tgmd-filter__pen,
  .tgmd-filter__range-box,
  .tgmd-range-combo__trigger,
  .tgmd-filter__check,
  .tgmd-filter__more-close,
  .tgmd-carousel .tgmd-carousel__button {
    /* .tgmd-load-more-wrap .tgmd-load-more (0,2,0), not the bare class:
       the base rule above sets its `transition` at that same, higher
       specificity to outrank the theme's own link style, and a lower-
       specificity override here would silently lose to it and leave the
       opacity transition running regardless of this preference. */
    transition: none;
    animation: none;
  }

  .tgmd-carousel__track {
    /* assets/js/vehicles.js's own carousel prev/next handlers request
       smooth scrolling only when this media feature does NOT match (see
       their own matchMedia() check) — this rule additionally covers a
       native scroll-snap jump a keyboard or trackpad user triggers
       directly, which no JS in this file ever sees. */
    scroll-behavior: auto;
  }
}


