/* =========================================================
   Posao EU — All-Pins Map: button + fullscreen overlay (v2.5.0)
   Loaded only where the [posao_map_all] shortcode is present.
   Brand: #F28C0F orange, #D97D0A dark orange, #1d1b20 ink.
   ========================================================= */

/* ---------- The placeable button ---------- */
.pmm-all-map-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: Quicksand, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #F28C0F;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.05s ease;
}

.pmm-all-map-trigger:hover {
    background: #D97D0A;
    color: #fff;
}

.pmm-all-map-trigger:active {
    transform: translateY(1px);
}

.pmm-all-map-trigger:focus-visible {
    outline: 2px solid #1d1b20;
    outline-offset: 2px;
}

.pmm-all-map-trigger__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---------- The fullscreen overlay ---------- */
.pmm-allmap {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    flex-direction: column;
    background: #ffffff;
}

.pmm-allmap--open {
    display: flex;
}

body.pmm-allmap-lock {
    overflow: hidden !important;
}

/* Top bar */
.pmm-allmap__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 56px;
    padding: 0 12px 0 18px;
    /* respect the iOS notch */
    padding-top: env(safe-area-inset-top, 0);
    box-sizing: content-box;
    background: #1d1b20;
    color: #fff;
}

.pmm-allmap__title {
    font-family: Quicksand, sans-serif;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header groups: title + count on the left, filter + close on the right. */
.pmm-allmap__lead {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pmm-allmap__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Live "235 poslova" pill. */
.pmm-allmap__count {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #ffffff;
    color: #1d1b20;
    font-family: Quicksand, sans-serif;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pmm-allmap__count[hidden] {
    display: none;
}

/* Variant A — the filter toggle adopted into the header bar. Overrides the
   floating white-pill rules from filter-panel.css (higher specificity, and
   this sheet loads later). */
.pmm-allmap .pmm-allmap__bar .pmm-filter-btn {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    height: 40px;
    padding: 0 16px;
    margin: 0;
    justify-content: flex-start;
    background: #F28C0F;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    font-family: Quicksand, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.pmm-allmap .pmm-allmap__bar .pmm-filter-btn:hover,
.pmm-allmap .pmm-allmap__bar .pmm-filter-btn:focus {
    background: #D97D0A;
    color: #ffffff;
}

.pmm-allmap .pmm-allmap__bar .pmm-filter-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Full label always visible in the bar (filter-panel.css hides it on mobile). */
.pmm-allmap .pmm-allmap__bar .pmm-filter-btn__label {
    display: inline;
}

/* Active-filter count badge: white on orange instead of orange on white. */
.pmm-allmap .pmm-allmap__bar .pmm-filter-btn__badge {
    position: static;
    margin-left: 2px;
    background: #ffffff;
    color: #D97D0A;
    box-shadow: none;
}

@media (max-width: 480px) {
    /* Tight phones: icon-only filter, keep the count pill readable. */
    .pmm-allmap .pmm-allmap__bar .pmm-filter-btn { padding: 0 12px; }
    .pmm-allmap .pmm-allmap__bar .pmm-filter-btn__label { display: none; }
    .pmm-allmap__title { font-size: 14px; }
}

.pmm-allmap__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pmm-allmap__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.pmm-allmap__close:focus-visible {
    outline: 2px solid #F28C0F;
    outline-offset: 2px;
}

/* Map stage fills the rest */
.pmm-allmap__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

.pmm-allmap__map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* hp-gl-style.css caps [data-component="map"] at 480px on the listings page
   (and 300px on single listings) for the INLINE map. The overlay's map element
   carries the same attribute, so it inherits the cap and renders half-height
   there. Lift it here at higher specificity (fullscreen.css does the same for
   inline fullscreen mode). */
.pmm-allmap .pmm-allmap__stage .pmm-allmap__map,
.pmm-allmap .pmm-allmap__stage [data-component="map"] {
    max-height: none !important;
    min-height: 0 !important;
    height: 100% !important;
}

/* Loading / error / empty state */
.pmm-allmap__status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-family: Quicksand, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1d1b20;
    background: #ffffff;
    pointer-events: none;
}

/* The [hidden] attribute only applies display:none at browser-default
   priority; the display:flex above overrode it, so the panel never hid.
   This higher-specificity rule makes hidden actually hide. */
.pmm-allmap__status[hidden] {
    display: none;
}

/* The overlay IS fullscreen, so the two fullscreen controls are redundant
   here and would nest fullscreens if clicked. Hide both; the filter panel
   (which attaches via the same pmm:map-ready event) stays visible. */
.pmm-allmap .pmm-fs-btn,
.pmm-allmap .gm-fullscreen-control {
    display: none !important;
}
