/**
 * Gas Impex Core — Карта АГЗС города (тёмная тема)
 */

.gi-agzs-map {
    --gi-map-bg: #111;
    --gi-map-line: #1e1e1e;
    --gi-map-text: #fff;
    --gi-map-muted: #a3a3a3;
    --gi-map-radius: 14px;
    font-family: 'Onest', sans-serif;
    color: var(--gi-map-text);
}

.gi-agzs-map *,
.gi-agzs-map *::before,
.gi-agzs-map *::after { box-sizing: border-box; }

.gi-agzs-map__head { margin-bottom: 32px; }

.gi-agzs-map__title {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(26px, 3.5vw, 40px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 12px;
}

.gi-agzs-map__title span { color: var(--gi-blue); }

.gi-agzs-map__lead {
    font-size: 15px;
    line-height: 1.6;
    color: var(--gi-map-muted);
    margin: 0;
}

.gi-agzs-map__body {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 16px;
    align-items: stretch;
}

/* ── Список точек ── */
.gi-agzs-map__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gi-agzs-map__item {
    background: var(--gi-map-bg);
    border: 1px solid var(--gi-map-line);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.gi-agzs-map__item:hover { border-color: #2c2c2c; }

.gi-agzs-map__item.is-active {
    border-color: rgba(var(--gi-red-rgb), 0.45);
    background: #151111;
}

.gi-agzs-map__item--office.is-active {
    border-color: rgba(var(--gi-blue-rgb), 0.5);
    background: #0f1318;
}

/* Кит Elementor красит все button градиентом (.elementor-kit-14 button, 0-1-1 и :hover 0-2-1),
   поэтому селекторы здесь с тремя классами */
.gi-agzs-map .gi-agzs-map__item .gi-agzs-map__point,
.gi-agzs-map .gi-agzs-map__item .gi-agzs-map__point:hover,
.gi-agzs-map .gi-agzs-map__item .gi-agzs-map__point:focus {
    all: unset;
    box-sizing: border-box;
    flex: 1 1 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

.gi-agzs-map .gi-agzs-map__item .gi-agzs-map__point:focus-visible {
    outline: 2px solid var(--gi-blue);
    outline-offset: 4px;
}

.gi-agzs-map .gi-agzs-map__item .gi-agzs-map__point:hover .gi-agzs-map__addr { color: #fff; }

.gi-agzs-map__badge {
    flex-shrink: 0;
    min-width: 46px;
    text-align: center;
    font-family: 'Geologica', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 6px;
    color: #fff;
    background: var(--gi-red);
}

.gi-agzs-map__item--office .gi-agzs-map__badge { background: var(--gi-blue); }

.gi-agzs-map__addr {
    font-size: 14px;
    line-height: 1.4;
    color: #e6e6e6;
    padding-top: 2px;
}

.gi-agzs-map__tel,
.gi-agzs-map__route {
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-left: 58px;
}

/* два класса: перебить цвет ссылок кита Elementor (.elementor-kit-14 a) */
.gi-agzs-map .gi-agzs-map__tel { color: #d0d0d0; }
.gi-agzs-map .gi-agzs-map__tel:hover { color: #fff; }

.gi-agzs-map__tel + .gi-agzs-map__route { margin-left: 0; }

.gi-agzs-map .gi-agzs-map__route {
    color: #5aa6f7;
    text-decoration: underline;
    text-decoration-color: rgba(90, 166, 247, 0.4);
    text-underline-offset: 3px;
}

.gi-agzs-map .gi-agzs-map__route:hover { color: #fff; text-decoration-color: #fff; }

/* ── Карта ── */
.gi-agzs-map__canvas {
    min-height: 460px;
    height: 100%;
    border-radius: var(--gi-map-radius);
    border: 1px solid var(--gi-map-line);
    overflow: hidden;
    background: #1b1b1b;
    z-index: 0;
}

/* Тёмная подложка из стандартных тайлов OSM */
.gi-agzs-map__canvas .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.55);
}

.gi-agzs-map__canvas .leaflet-control-zoom {
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.gi-agzs-map__canvas .leaflet-control-zoom a {
    background: #161616;
    color: #fff;
    border-bottom-color: #2a2a2a;
}

.gi-agzs-map__canvas .leaflet-control-zoom a:hover { background: #222; }

.gi-agzs-map__canvas .leaflet-control-attribution {
    background: rgba(17, 17, 17, 0.8);
    color: #9a9a9a;
    font-size: 10px;
}

.gi-agzs-map__canvas .leaflet-control-attribution a { color: #bdbdbd; }

/* Метки */
.gi-agzs-pin-wrap { background: none; border: 0; }

.gi-agzs-pin {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, calc(-100% - 7px));
    display: inline-block;
    white-space: nowrap;
    font-family: 'Geologica', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    padding: 7px 9px;
    border-radius: 7px;
    background: var(--gi-red);
    box-shadow: 0 6px 14px -4px rgba(var(--gi-red-rgb), 0.55);
}

.gi-agzs-pin::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    margin-left: -6px;
    border: 6px solid transparent;
    border-bottom: 0;
    border-top-color: var(--gi-red);
}

.gi-agzs-pin--office {
    background: var(--gi-blue);
    box-shadow: 0 6px 14px -4px rgba(var(--gi-blue-rgb), 0.55);
}

.gi-agzs-pin--office::after { border-top-color: var(--gi-blue); }

/* Попап */
.gi-agzs-map__canvas .leaflet-popup-content-wrapper {
    background: #161616;
    color: #fff;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.7);
}

.gi-agzs-map__canvas .leaflet-popup-tip { background: #161616; }

.gi-agzs-map__canvas .leaflet-popup-content { margin: 12px 14px; font-family: 'Onest', sans-serif; }

.gi-agzs-popup__addr { font-size: 13px; line-height: 1.4; color: #e6e6e6; margin-bottom: 8px; }

.gi-agzs-popup__tel { display: block; font-size: 13px; color: #d0d0d0 !important; text-decoration: none; margin-bottom: 6px; } /* !important: перебиваем цвет ссылок Leaflet */

.gi-agzs-popup__route { font-size: 13px; font-weight: 600; color: #5aa6f7 !important; text-decoration: none; } /* !important: перебиваем цвет ссылок Leaflet */

.gi-agzs-popup__route:hover { text-decoration: underline; }

/* ── Адаптив ── */
@media (max-width: 900px) {
    .gi-agzs-map__body { grid-template-columns: 1fr; }
    .gi-agzs-map__canvas { order: -1; min-height: 320px; height: 320px; }
}

@media (max-width: 480px) {
    .gi-agzs-map__head { margin-bottom: 24px; }
    .gi-agzs-map__item { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .gi-agzs-map__item { transition: none; }
}
