/* components/dealers/Dealers.module.scss + page-hero/PageHero.module.scss (the dealers
   page header) + world-map/WorldMap.module.scss (the globe, js/modules/dealers-globe.mjs),
   or – .mk-dealers--map – Google Maps with the locator (js/modules/dealers-map.mjs), and the
   grid of every dealer under it (.mk-dealers__all). */
.mk-dealers { position: relative; }
.mk-dealers__stage { position: relative; }
@media (min-width: 720px) {
    .mk-dealers--globe .mk-dealers__stage { height: 100rem; min-height: 70vh; }
}
.mk-dealers__header { position: relative; z-index: 2; }

/* PageHero */
.mk-dealers-hero { position: relative; }
.mk-dealers-hero__container {
    padding-left: var(--container-gutter);
    padding-right: var(--container-gutter);
    margin: 0 auto;
    max-width: var(--page-width);
    box-sizing: content-box;
    padding-top: var(--mk-space-top, clamp(12rem, calc(12rem + 6 * ((100vw - 48rem) / 80)), 18rem));
}
@media (min-width: 720px) {
    .mk-dealers-hero__container {
        display: grid;
        row-gap: var(--grid-gutter);
        column-gap: min(var(--grid-gutter), calc(100% / 11));
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
}
.mk-dealers-hero__content { grid-column: 2 / span 6; }
@media (min-width: 1080px) {
    .mk-dealers-hero__content { grid-column: 2 / span 5; }
}
.mk-dealers-hero__side { display: flex; align-items: center; grid-column: span 5; }
.mk-dealers-hero__heading {
    margin: 0;
    padding: 0;
    display: inline-block;
    position: relative;
}
.mk-dealers-hero__dot {
    display: inline;
    color: var(--mk-dealers-accent, var(--color-accent-primary));
    margin-left: 0.5rem;
}
/* The heading block with the dot right after it (inline-flex: no gap from the whitespace
   after the block); the dot carries the heading's text style (ts-h1) in the template. */
.mk-dealers-hero__heading { display: inline-flex; align-items: baseline; }
.mk-js .mk-dealers-hero__heading { animation: mk-dealers-rise 1s cubic-bezier(0.22, 1, 0.36, 1) both; }

.mk-dealers__select { display: none; margin-left: 30%; }
@media (min-width: 720px) {
    .mk-dealers__select { display: flex; }
}
/* FormsElements __label: the form label's look (text style footnote, as rules.form "label"). */
.mk-dealers .mk-field__label { display: block; margin-bottom: 0.6rem; }
.mk-dealers .mk-field { margin-bottom: 2rem; } /* FormsElements __field: room for an error under it */
.mk-field__select-wrap { position: relative; }
.mk-field__select-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translate(0, -50%);
    height: 0;
    width: 0;
    border-left: 0.5rem solid transparent;
    border-right: 0.5rem solid transparent;
    border-top: 0.5rem solid var(--color-font);
    z-index: 1;
    pointer-events: none;
}
.mk-field__select {
    display: block;
    margin: 0;
    padding: 0.8rem 4rem 0.8rem 2rem;
    width: 100%;
    border: 0.1rem solid var(--color-font);
    border-radius: 0;
    background: var(--color-background-form);
    color: var(--color-font);
    font-size: 1.6rem;
    line-height: var(--line-height);
    appearance: none;
}
@media (min-width: 720px) {
    .mk-field__select { font-size: 1.2rem; }
}
.mk-field__select:focus { outline: none; border-color: var(--color-accent-primary-darker); }

.mk-dealers__segment { padding-top: var(--segment-padding); padding-bottom: var(--mk-space-bottom, var(--segment-padding)); }
.mk-dealers__container {
    padding-left: var(--container-gutter);
    padding-right: var(--container-gutter);
    margin: 0 auto;
    max-width: var(--page-width);
    box-sizing: content-box;
}
@media (min-width: 720px) {
    .mk-dealers__container {
        display: grid;
        row-gap: var(--grid-gutter);
        column-gap: min(var(--grid-gutter), calc(100% / 11));
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
}

/* ---- The globe (dealers__map, WorldMap) ---- */
.mk-dealers--globe .mk-dealers__map {
    position: sticky;
    top: -10rem;
    left: 0;
    right: 0;
    z-index: 1;
    height: 30rem;
    margin-top: -10rem;
    background: var(--color-background);
}
@media (min-width: 720px) {
    .mk-dealers--globe .mk-dealers__map {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100%;
        margin-top: auto;
        background: none;
    }
}
.mk-world-map { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease-in-out; }
.mk-world-map.is-loaded { opacity: 1; }
.mk-world-map__canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
@media (prefers-reduced-motion: reduce) {
    .mk-world-map { transition: none; }
}

/* ---- Mobile: every country in a list (dealers__list, DealersItem) ---- */
.mk-dealers__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-gap: 3rem;
}
.mk-dealers__item:not(:last-child) { padding-bottom: 3rem; border-bottom: 0.1rem solid var(--color-background-form); }
.mk-dealers__country { margin: 0 0 2rem; padding: 0; }
.mk-dealers__dealers { margin: 0; padding: 0; list-style: none; }
.mk-dealer:not(:last-child) { padding-bottom: 3rem; }

.mk-dealer__link {
    color: var(--mk-color, var(--color-font));
    text-decoration: underline;
    text-decoration-color: var(--color-link-decoration);
    text-decoration-thickness: 0.2rem;
    transition: text-decoration var(--transition-duration-leave);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mk-dealer__link:focus { outline: none; }
.mk-dealer__header .el-label { display: inline; }
.mk-dealer__link:is(:hover, :focus-visible) { text-decoration-color: var(--color-font); transition-duration: var(--transition-duration-enter); }

.mk-dealer__locations { margin: 1rem 0 0; padding: 0; list-style: none; }
.mk-dealer__location {
    position: relative;
    margin: 0;
    padding: 0 0 0 3.6rem;
    max-width: 80ch;
}
.mk-dealer__location::before {
    content: '';
    position: absolute;
    top: 1.5ex;
    left: 0;
    width: 1.2rem;
    height: 3px;
    border: 0.1rem solid var(--color-font);
    background: var(--color-background-form);
}
.mk-dealer__location:not(:last-child) { margin-bottom: 2rem; }
.mk-dealer__location-name { margin: 0; padding: 0.3rem 0 0; }
.mk-dealer__location-detail { margin: 0; }
/* The dealer link and the services note carry the design system's button-dot and meta
   styles (template); in the mobile list the original shows them as plain running text. */
@media (max-width: 719px) {
    .mk-dealers :is(.mk-dealer__link, .mk-dealer__services) { font: inherit; letter-spacing: inherit; text-transform: inherit; }
}

/* ---- Tablet and up: the active country in a card (DealersInfo) ---- */
@media (min-width: 720px) {
    .mk-dealers__list { display: block; grid-column: 1 / span 4; position: relative; z-index: 1; }
    .mk-dealers__item { display: none; }
    .mk-dealers__item:not(:last-child) { padding-bottom: 0; border-bottom: 0; }
    .mk-dealers__item.is-active {
        display: block;
        margin-bottom: 3rem;
        padding: clamp(1.5rem, calc(1.5rem + 1.5 * ((100vw - 48rem) / 80)), 3rem);
        background: var(--mk-dealers-card-bg, var(--color-background-alt));
        border-radius: var(--mk-dealers-card-radius, 0);
    }
    .mk-js .mk-dealers__item.is-entering { animation: mk-dealers-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
    .mk-js .mk-dealers__item.is-leaving { display: block; animation: mk-dealers-out 0.25s ease-in both; }
    .mk-dealer:not(:last-child) { padding-bottom: 0; }

    .mk-dealer__header { display: flex; align-items: center; }
    /* Button appearance="text" */
    .mk-dealer__link {
        position: relative;
        display: inline-flex;
        align-items: center;
        min-height: 2.6rem;
        padding: 0;
        text-decoration: none;
    }
    .mk-dealer__link::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 2.6rem;
        height: 2.6rem;
        background: var(--mk-dealers-accent, var(--color-accent-primary));
        border-radius: 2.6rem;
        transition: width 350ms, box-shadow 550ms;
    }
    .mk-dealer__link:is(:hover, :focus-visible)::after { width: calc(100% + 0.5rem); }
    .mk-dealer__link-content { position: relative; z-index: 1; padding-left: 0.5rem; }
    .mk-dealer__services {
        margin: -0.3ex 0 0 1rem;
        padding: 0;
    }
    .mk-dealer__services::before { content: ' - '; }
    .mk-dealer__locations { margin-top: 2rem; margin-bottom: 2rem; }
}

@keyframes mk-dealers-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes mk-dealers-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-30px); } }
@keyframes mk-dealers-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .mk-js .mk-dealers__item.is-entering, .mk-js .mk-dealers__item.is-leaving, .mk-js .mk-dealers-hero__heading { animation: none; }
}

/* Editable look: every country / location name at once (set on minkDealers; reaches
   every country's / location's text block, [class*="ts-"]). */
.mk-dealers[style*="--mk-dealers-country-font-size:"] .mk-dealers__country [class*="ts-"] {
    font-family: var(--mk-dealers-country-font-family); font-size: var(--mk-dealers-country-font-size); line-height: var(--mk-dealers-country-line-height); font-weight: var(--mk-dealers-country-font-weight);
    letter-spacing: var(--mk-dealers-country-letter-spacing, normal); text-transform: var(--mk-dealers-country-text-transform, none); font-style: var(--mk-dealers-country-font-style, normal);
}
.mk-dealers[style*="--mk-dealers-location-font-size:"] .mk-dealer__location-name [class*="ts-"] {
    font-family: var(--mk-dealers-location-font-family); font-size: var(--mk-dealers-location-font-size); line-height: var(--mk-dealers-location-line-height); font-weight: var(--mk-dealers-location-font-weight);
    letter-spacing: var(--mk-dealers-location-letter-spacing, normal); text-transform: var(--mk-dealers-location-text-transform, none); font-style: var(--mk-dealers-location-font-style, normal);
}
.mk-dealers[style*="--mk-dealers-country-color:"] .mk-dealers__country { color: var(--mk-dealers-country-color); }
.mk-dealers[style*="--mk-dealers-country-align:"] .mk-dealers__country { text-align: var(--mk-dealers-country-align); }
.mk-dealers[style*="--mk-dealers-location-color:"] .mk-dealer__location-name { color: var(--mk-dealers-location-color); }
.mk-dealers[style*="--mk-dealers-location-align:"] .mk-dealer__location-name { text-align: var(--mk-dealers-location-align); }

/* Below 720px the original shows a location's name as h4 (Dealers.module.scss: @include h4,
   the table layout from 720px uses h5 at 1.4–1.6rem = the block's text style). */
@media (max-width: 719px) {
    .mk-dealers:not([style*="--mk-dealers-location-font-size:"]) .mk-dealer__location-name [class*="ts-"] {
        font-size: var(--font-size-h4);
        line-height: 1.2;
        font-weight: 500;
    }
}

/* ---- Text inputs (as the select) ---- */
.mk-field__input {
    display: block;
    margin: 0;
    padding: 0.8rem 2rem;
    width: 100%;
    box-sizing: border-box;
    border: 0.1rem solid var(--color-font);
    border-radius: 0;
    background: var(--color-background-form);
    color: var(--color-font);
    font: inherit;
    font-size: 1.6rem;
    line-height: var(--line-height);
    appearance: none;
}
@media (min-width: 720px) {
    .mk-field__input { font-size: 1.2rem; }
}
.mk-field__input::placeholder { color: var(--color-placeholder); opacity: 1; }
.mk-field__input:focus { outline: none; border-color: var(--color-accent-primary-darker); }
.mk-field__input::-webkit-search-cancel-button { cursor: pointer; }

/* ---- The map (.mk-dealers--map, MapLibre + OpenFreeMap): locator, card, map ---- */
/* The hero: the top of the globe (dealers-globe.mjs, decor) – a square canvas much wider than
   the page, cropped to its top arc and faded out below – with the heading inside the arc.
   Globe strip and heading share one grid cell; the heading sits a third down the strip. */
.mk-dealers--map .mk-dealers-hero {
    --mk-hero-globe-top: clamp(9rem, 9vw, 13rem);
    --mk-hero-globe-height: clamp(28rem, 38vw, 56rem);
    display: grid;
    overflow-x: clip; /* the canvas is wider than the page; below, the faded globe runs on behind the search */
}
.mk-dealers--map .mk-dealers-hero > * { grid-area: 1 / 1; }
.mk-dealers--map .mk-dealers-hero__container {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding-top: calc(var(--mk-hero-globe-top) + var(--mk-hero-globe-height) * 0.3);
    padding-bottom: 0;
    text-align: center;
}
.mk-dealers--map .mk-dealers-hero__content { position: relative; }
/* A soft glow behind the heading: it reads on the land and the sea alike. */
.mk-dealers--map .mk-dealers-hero__content::before {
    content: '';
    position: absolute;
    inset: -40% -25%;
    z-index: -1;
    background: radial-gradient(closest-side, var(--color-background), transparent);
    opacity: 0.75;
}
.mk-dealers-hero__globe {
    position: relative;
    height: var(--mk-hero-globe-height);
    margin-top: var(--mk-hero-globe-top);
    /* The search and map start in the strip's faded lower part, close under the heading;
       the globe stays where it is and is faded out before them. */
    margin-bottom: calc(var(--mk-hero-globe-height) * -0.42);
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 66%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 66%);
}
.mk-dealers-hero__globe .mk-world-map {
    inset: auto;
    top: 0;
    left: 50%;
    width: max(170vw, 64rem);
    max-width: 240rem;
    aspect-ratio: 1;
    transform: translate(-50%, -2%); /* the sphere's top edge (2.7% down the canvas) just inside the strip */
}
@media (min-width: 720px) {
    .mk-dealers-hero__globe .mk-world-map { width: 115vw; }
}
.mk-dealers--map .mk-dealers__segment { position: relative; z-index: 1; padding-top: 4rem; }
.mk-dealers--map .mk-dealers__container { display: flex; flex-direction: column; gap: 3rem; }
.mk-dealers--map .mk-dealers__map { order: 1; }
.mk-dealers--map .mk-dealers__list { order: 2; }
.mk-dealers__tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2rem 4rem; }
.mk-dealers__locator { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.5rem 3rem; margin: 0; flex: 1 1 48rem; }
.mk-dealers__select--tools { margin-left: auto; flex: 0 0 22rem; }
.mk-dealers__select--tools .mk-field { width: 100%; margin-bottom: 0; }
/* "All countries" (the map): every country with its number of dealers; a click picks it. */
.mk-dealers__overview { margin: 0; padding: 0; list-style: none; }
.mk-dealers__overview-country {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 0.9rem 0;
    border: 0;
    border-bottom: 0.1rem solid var(--color-background-form);
    background: none;
    color: var(--mk-color, var(--color-font));
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mk-dealers__overview li:last-child .mk-dealers__overview-country { border-bottom: 0; }
.mk-dealers__overview-country > span:first-child {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 0.2rem;
    transition: text-decoration-color var(--transition-duration-leave);
}
.mk-dealers__overview-country:is(:hover, :focus-visible) > span:first-child { text-decoration-color: var(--mk-dealers-accent, var(--color-accent-primary)); transition-duration: var(--transition-duration-enter); }
.mk-dealers__overview-count { color: var(--color-font-light); }
.mk-dealers__back {
    display: inline-block;
    margin: 0 0 1.6rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-font-light);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 0.1rem;
}
.mk-dealers__back:is(:hover, :focus-visible) { color: var(--mk-color, var(--color-font)); text-decoration-color: currentColor; }
/* Mobile (map): the country picker under the search, and only that country's card (as on
   tablet and up; the grid below has every dealer). */
@media (max-width: 719px) {
    .mk-dealers--map .mk-dealers__select--tools { display: flex; margin-left: 0; flex: 1 1 100%; }
    .mk-dealers--map .mk-dealers__item { display: none; }
    .mk-dealers--map .mk-dealers__item.is-active { display: block; padding-bottom: 0; border-bottom: 0; }
}
.mk-dealers__locator[hidden] { display: none; }
.mk-dealers__locator .mk-field { margin-bottom: 0; }
.mk-dealers__search { flex: 1 1 100%; }
/* [input][Search]  or  ● Near me – on one line, centred on the input; on small screens
   "or Near me" goes on its own line under the search. */
.mk-dealers__search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.4rem; }
.mk-dealers__search-box { display: flex; flex: 1 1 32rem; max-width: 56rem; }
.mk-dealers__search-box .mk-field__input { flex: 1 1 auto; min-width: 0; border-right: 0; }
.mk-dealers__search-box .mk-button { flex: none; align-self: stretch; }
.mk-dealers__near-wrap { display: inline-flex; align-items: center; gap: 1.6rem; }
.mk-dealers__near-wrap[hidden] { display: none; }
.mk-dealers__or { color: var(--color-font-light); }
.mk-dealers__near[disabled] { opacity: 0.5; pointer-events: none; }
.mk-dealers__status { flex: 1 0 100%; margin: -0.5rem 0 0; }
.mk-dealers__status:empty { display: none; }
.mk-dealers--map .mk-dealers__map {
    position: relative;
    height: 36rem;
    background: var(--color-background-form);
}
.mk-dealers-map,
.mk-dealers-map.maplibregl-map { position: absolute; inset: 0; } /* MapLibre's CSS sets "relative" */
.mk-dealers-map .maplibregl-map { font: inherit; }
@media (min-width: 720px) {
    .mk-dealers--map .mk-dealers__container { display: grid; }
    .mk-dealers--map .mk-dealers__tools { grid-column: 1 / -1; }
    .mk-dealers--map .mk-dealers__list { grid-column: 1 / span 4; order: 0; }
    .mk-dealers--map .mk-dealers__map {
        grid-column: 5 / span 8;
        order: 0;
        height: clamp(44rem, 70vh, 68rem);
        position: sticky;
        top: 10rem;
    }
    .mk-dealers--map .mk-dealers__item.is-active { margin-bottom: 0; }
}

/* The info box of a marker (a MapLibre popup) */
.mk-map-popup .maplibregl-popup-content { padding: 1.4rem 3rem 1.4rem 1.6rem; border-radius: 0.4rem; box-shadow: 0 0.4rem 1.6rem rgba(37, 31, 21, 0.2); }
.mk-map-popup .maplibregl-popup-close-button { width: 2.8rem; height: 2.8rem; font-size: 2rem; line-height: 1; color: #251f15; }
.mk-dealers-map .maplibregl-ctrl-attrib { font-size: 1.1rem; }
.mk-map-info { font-family: var(--font-family, inherit); font-size: 1.4rem; line-height: 1.45; color: #251f15; max-width: 26rem; }
.mk-map-info__title { display: inline-block; margin-bottom: 0.4rem; font-weight: 600; font-size: 1.5rem; color: inherit; }
a.mk-map-info__title { text-decoration: underline; text-decoration-color: #ffc30f; text-decoration-thickness: 0.2rem; }
.mk-map-info__services { margin-bottom: 0.4rem; color: #6b655c; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.05em; }
.mk-map-info a { color: inherit; }

/* ---- Every dealer in a grid ---- */
.mk-dealers__all { padding-top: 2rem; padding-bottom: var(--mk-space-bottom, var(--segment-padding)); }
.mk-dealers--map .mk-dealers__segment { padding-bottom: 4rem; }
.mk-dealers__all[hidden] { display: none; }
.mk-dealers__all .mk-dealers__container { display: block; }
.mk-dealers__all-heading { margin: 0 0 3rem; }
.mk-dealers__filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.5rem 3rem; margin-bottom: 3rem; }
.mk-dealers__filters .mk-field { flex: 0 1 26rem; margin-bottom: 0; }
.mk-dealers__check { display: inline-flex; align-items: center; gap: 0.8rem; margin-bottom: 0.9rem; cursor: pointer; }
.mk-dealers__check input { width: 1.6rem; height: 1.6rem; margin: 0; accent-color: var(--mk-dealers-accent, var(--color-accent-primary)); }
.mk-dealers__count { margin: 0 0 0.9rem auto; }
.mk-dealers__grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--grid-gutter, 2rem);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
}
.mk-dealers .mk-dealer-card {
    display: flex;
    flex-direction: column;
    padding: clamp(1.5rem, calc(1.5rem + 1.5 * ((100vw - 48rem) / 80)), 3rem);
    background: var(--mk-dealers-card-bg, var(--color-background-alt));
    border-radius: var(--mk-dealers-card-radius, 0);
}
.mk-dealers .mk-dealer-card[hidden] { display: none; }
.mk-dealers .mk-dealer-card:not(:last-child) { padding-bottom: clamp(1.5rem, calc(1.5rem + 1.5 * ((100vw - 48rem) / 80)), 3rem); }
.mk-dealer-card__country { margin: 0 0 1rem; color: var(--color-font-light); }
.mk-dealer-card .mk-dealer__header { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.mk-dealer-card .mk-dealer__services { margin: 0; }
.mk-dealer-card .mk-dealer__services::before { content: none; }
.mk-dealer-card .mk-dealer__locations { margin: 2rem 0; }
.mk-dealer-card__distance { margin: auto 0 1rem; }
.mk-dealer-card__distance[hidden] + .mk-dealer-card__map,
.mk-dealer-card > .mk-dealer__locations + .mk-dealer-card__distance[hidden] { margin-top: auto; }
.mk-dealer-card__map { align-self: flex-start; margin-top: auto; }
.mk-dealers__empty { margin: 2rem 0 0; }
.mk-dealers__empty[hidden] { display: none; }
@media (max-width: 719px) {
    .mk-dealer-card .mk-dealer__link { font: inherit; }
}

/* E-mail and phone as links (js/components/dealers.js) */
.mk-dealer__contact { color: inherit; text-decoration: underline; text-decoration-color: var(--color-link-decoration); text-underline-offset: 0.2em; }
.mk-dealer__contact:is(:hover, :focus-visible) { text-decoration-color: currentColor; }
