/**
 * [partner_map] — partnerių paieškos puslapis su žemėlapiu.
 *
 * Spalvos ir formos kaip [partner_search]: tamsi filtrų juosta, pilkos
 * #F5F4F5 kortelės, apvalūs mygtukai. Šriftas paveldimas iš Elementor.
 */

.pmap {
    --pmap-dark: #1a1a1a;
    --pmap-card: #f5f4f5;
    --pmap-border: #e3e1e3;
    --pmap-muted: #6b6b6b;
    --pmap-height: 640px;
    width: 100%;
    color: var(--pmap-dark);
}

.pmap [hidden] {
    display: none !important;
}

/* Filtrai */
.pmap-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 24px;
    background: var(--pmap-dark);
    border-radius: 16px;
}

.pmap-filter {
    display: flex;
    flex: 1 1 200px;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.pmap-filter__label {
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #9a9a9a;
}

.pmap .pmap-filter select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 16px;
    font-size: 15px;
    color: #fff;
    background-color: #2a2a2a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    border: 1px solid #444;
    border-radius: 8px;
    appearance: none;
    cursor: pointer;
}

.pmap .pmap-filter select:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.pmap-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pmap .pmap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 28px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pmap .pmap-btn--primary {
    color: var(--pmap-dark);
    background: #fff;
    border: 1px solid #fff;
}

.pmap .pmap-btn--primary:hover {
    background: #e9e9e9;
}

.pmap .pmap-btn--primary:disabled {
    opacity: 0.6;
    cursor: progress;
}

.pmap .pmap-btn--ghost {
    color: #fff;
    background: transparent;
    border: 1px solid #666;
}

.pmap .pmap-btn--ghost:hover {
    border-color: #fff;
}

/* Būsena */
.pmap-status,
.pmap-geo-error {
    margin: 20px 0 12px;
    font-size: 15px;
    color: var(--pmap-muted);
}

.pmap-geo-error {
    color: #b42318;
}

/* Sąrašas + žemėlapis */
.pmap-body {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 24px;
    align-items: start;
}

.pmap-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: var(--pmap-height);
    padding-right: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pmap-map-wrap {
    position: sticky;
    top: 100px;
}

.pmap-map {
    position: relative;
    z-index: 0; /* Leaflet sluoksniai (z-index 400+) nelenda virš lipnios antraštės */
    isolation: isolate;
    height: var(--pmap-height);
    overflow: hidden;
    background: #e8e8e8;
    border-radius: 16px;
}

/* Neutralios plytelės, kad žemėlapis derėtų prie juodai baltos svetainės.
   Filtras kiekvienai plytelei, ne visam sluoksniui — kitaip tarp jų matosi siūlės. */
.pmap-map .leaflet-tile {
    filter: grayscale(1) contrast(0.95) brightness(1.03);
}

/* Kortelė */
.pmap-card {
    padding: 20px;
    background: var(--pmap-card);
    border-radius: 12px;
}

.pmap-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.pmap-card__logo-box {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 48px;
    padding: 4px;
    background: #fff;
    border-radius: 8px;
}

/* Dvi klasės — Elementor „.elementor img" kitaip nustelbia aukštį. */
.pmap .pmap-card .pmap-card__logo {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
}

.pmap .pmap-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--pmap-dark);
}

.pmap-card__locations {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pmap-loc {
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid var(--pmap-border);
}

.pmap-loc.is-active .pmap-loc__address {
    font-weight: 600;
}

.pmap .pmap-loc p {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.45;
}

.pmap .pmap-loc a {
    color: var(--pmap-dark);
    text-decoration: none;
}

.pmap .pmap-loc a:hover {
    text-decoration: underline;
}

.pmap .pmap-loc__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin: 8px 0 0;
}

.pmap .pmap-loc .pmap-link {
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--pmap-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    cursor: pointer;
}

.pmap-loc__distance {
    margin-left: auto;
    font-size: 14px;
    color: var(--pmap-muted);
}

.pmap .pmap-card__eshop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pmap-dark);
}

.pmap-empty {
    padding: 24px;
    text-align: center;
    color: var(--pmap-muted);
    background: var(--pmap-card);
    border-radius: 12px;
}

/* Žymeklis */
.pmap-pin {
    background: none;
    border: 0;
}

.pmap-pin svg {
    display: block;
    fill: var(--pmap-dark, #1a1a1a);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
    transition: transform 0.15s ease;
    transform-origin: 50% 100%;
}

.pmap-pin.is-active svg {
    fill: #2f80ed;
    transform: scale(1.2);
}

/* Iššokantis langas */
.pmap-popup strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.pmap-popup p {
    margin: 0 0 2px !important;
    font-size: 14px;
}

.pmap-popup a {
    color: #1a1a1a;
}

.pmap-popup .pmap-popup__route {
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
}

/* Telefonas / planšetė: žemėlapis viršuje, sąrašas be savo slinkimo. */
@media (max-width: 900px) {
    .pmap-filters {
        padding: 16px;
        border-radius: 12px;
    }

    .pmap-filters__actions,
    .pmap .pmap-btn {
        width: 100%;
    }

    .pmap-body {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pmap-map-wrap {
        position: static;
        order: -1;
    }

    .pmap-map {
        height: 360px;
        border-radius: 12px;
    }

    .pmap-list {
        max-height: none;
        padding-right: 0;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pmap-pin svg {
        transition: none;
    }
}
