/* =============================================
   DEALERSHIPS / OUTLET LOCATOR
   ============================================= */

.dealerships-section { padding: var(--space-7) 0 var(--space-9); }

.dealerships-layout {
    display: flex;
    gap: var(--space-6);
    align-items: flex-start;
}

/* ── Filter sidebar ── */
.dealerships-filters {
    width: 260px;
    flex-shrink: 0;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: var(--space-5);
    position: sticky;
    top: 16px;
}

.filter-heading {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 var(--space-4);
    color: #1a1a1a;
}

.filter-count {
    font-size: 12px;
    color: #888;
    margin: var(--space-2) 0 0;
}

/* ── Map + list column ── */
.dealerships-main { flex: 1; min-width: 0; }

#dealerships-map {
    height: 460px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-bottom: var(--space-6);
    z-index: 0;
}

#dealerships-map .leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.7);
    padding: 0 var(--space-1);
}

/* Boost the CARTO Voyager basemap's washed-out ocean to a richer blue.
   This is near the practical ceiling — the raster tile's water pixels plateau
   in saturation, so pushing further barely moves the color but does start
   shifting land tones. A genuinely deeper blue needs a different tile provider. */
#dealerships-map .leaflet-tile-pane {
    filter: saturate(2.6) hue-rotate(8deg) brightness(0.97) contrast(1.08);
}

/* ── Outlet cards — full-width list style ── */
.dealerships-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.outlet-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px var(--space-5);
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    font-size: 14px;
    line-height: 1.5;
}

.outlet-card--active {
    border-color: var(--color-primary, #FFC200);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(255, 194, 0, 0.15);
}

.outlet-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border-color: var(--color-primary, #FFC200);
}

.outlet-card p { margin: 2px 0; }

/* ── Card header: icon + name/badge ── */
.outlet-card__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: var(--space-2);
}

.outlet-card__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    object-fit: contain;
    margin-top: 2px;
}

.outlet-card__meta { flex: 1; }

.outlet-card__name {
    display: block;
    /* Name, address and products share one size/face. Quicksand is only loaded at
       400/500/600 — 700 would be a faux-bold of the 600 face, so use 600. */
    font-family: var(--font-body, 'Quicksand', sans-serif);
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 3px;
}

/* ── Address ── */
.outlet-card__address {
    color: #444;
    /* !important: group.css has a legacy "p { font-size:16px !important }" */
    font-family: var(--font-body, 'Quicksand', sans-serif) !important;
    font-size: 16px !important;
    margin: 6px 0 !important;
}

.outlet-card__address-city {
    color: #666;
    font-family: var(--font-body, 'Quicksand', sans-serif) !important;
    font-size: 16px !important;
    margin: 0 0 var(--space-2) !important;
}

/* ── Contact row: phone / email / website inline ── */
.outlet-card__contacts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin: var(--space-2) 0 !important;
    font-size: 13px;
}

.outlet-card__contacts a {
    color: #333;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.outlet-card__contacts a:hover {
    color: var(--color-primary, #FFC200);
}

/* ── Products line ── */
.outlet-card__families {
    /* !important: group.css has a legacy "p { font-size:16px !important }" */
    font-family: var(--font-body, 'Quicksand', sans-serif) !important;
    font-size: 16px !important;
    color: #555;
    margin-top: var(--space-2) !important;
}

.outlet-card__families strong {
    color: #333;
    font-weight: 600;
}

.outlet-card__families span {
    color: #333;
}

/* ── Outlet type badges ── */
.outlet-type {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 11px;
    font-weight: 600;
    color: #777;
    margin-top: 1px;
}

.outlet-type__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.outlet-type__dot--mc   { background: #FFC200; }
.outlet-type__dot--fa   { background: #006537; }
.outlet-type__dot--ho   { background: #000; }
.outlet-type__dot--dist { background: #8c8c8c; }

/* ── Leaflet popup ── */
.leaflet-popup-content-wrapper {
    min-width: 280px;
}
.leaflet-popup-content {
    min-width: 260px;
}
.outlet-popup {
    /* One type scale for every element in the popup. group.css (loaded later)
       has a legacy "p, ul li { font-size:16px !important }" and Elementor-style
       link typography, so the p / a / families rules below need !important. */
    --popup-fs-name: 15px;
    --popup-fs-body: 13px;
    --popup-fs-small: 12px;
    font-family: var(--font-body, 'Quicksand', sans-serif);
    font-size: var(--popup-fs-body);
    line-height: 1.4;
    min-width: 260px;
}

.outlet-popup strong { display: block; font-size: var(--popup-fs-name); font-weight: 700; margin-bottom: 3px; }
.outlet-popup p { margin: 4px 0; font-family: inherit !important; font-size: var(--popup-fs-body) !important; line-height: 1.4; }
.outlet-popup a { font-family: inherit !important; font-size: inherit !important; font-weight: 600; }
.outlet-popup__ico { display: inline-block; width: 20px; text-align: center; }
.outlet-popup .outlet-type { font-size: var(--popup-fs-small); margin-bottom: 5px; }
.outlet-popup .outlet-families { font-size: var(--popup-fs-small) !important; color: #444; }
.outlet-popup .outlet-permalink { display: block; margin-top: 6px; font-size: var(--popup-fs-small) !important; }
.outlet-popup .outlet-permalink a { font-size: var(--popup-fs-small) !important; }

/* ── Responsive ── */
@media (max-width: 1023px) {
    .dealerships-layout { flex-direction: column; }
    .dealerships-filters { width: 100%; position: static; }
    #dealerships-map { height: 320px; }
}

@media (max-width: 479px) {
    /* Forced min-widths on the Leaflet popup leave almost no margin on a
       320-375px phone — let it shrink instead of risking edge clipping. */
    .leaflet-popup-content-wrapper { min-width: 0; max-width: calc(100vw - 48px); }
    .leaflet-popup-content { min-width: 0; }

    .outlet-card__families { font-size: 13px !important; }
    .outlet-type { font-size: 12px; }
    /* Keep popup text at or above 12px on small phones */
    .outlet-popup { --popup-fs-small: 13px; }
}
