﻿/* ============================================
   Previo Map Sidebar – Layout & Styles
   Aktywny motyw: ciemny + brąz
   ============================================ */

/*
 * AKTYWNA PALETA:
 *   #0e234f – akcent (granat)
 *   #6c77f4 – hover pinezek (fioletowo-niebieski)
 *   #bdc1c3 – jasne tło/border
 *   #000000 – tekst
 *   #b9c1cc – secondary/border
 */

/* Padding wyszukiwarki (jest poza .pmsb-layout) */
.pase-grid-filter-wrap {
    padding: 0 24px;
}

/* ---------- Wrapper flex: grid + mapa ---------- */
.pmsb-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 0 24px;
}

.pmsb-layout .pase-grid-wrapper {
    flex: 1;
    min-width: 0;
}

/* Siatka 3 kolumny obok mapy */
.pmsb-layout .pase-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}
@media (max-width: 1400px) {
    .pmsb-layout .pase-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 991px) {
    .pmsb-layout .pase-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 575px) {
    .pmsb-layout .pase-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Wyszukiwarka: 2 kolumny zamiast 3 (date fields merged) */
.pmsb-layout .pase-grid-filter-row {
    flex-wrap: wrap;
}
.pmsb-layout .pase-grid-filter-field {
    min-width: 140px;
}

/* ---------- Sidebar z mapą ---------- */
#pmsb-map-sidebar {
    position: sticky;
    top: 92px; /* 80px menu + 12px gap */
    width: 420px;
    min-width: 320px;
    flex-shrink: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .10);
    background: #F4EFE8;
    border: 1px solid #0e234f;
    max-height: calc(100vh - 104px); /* 80px menu + 12px top + 12px bottom */
}

#pmsb-map-canvas {
    width: 100%;
    height: calc(100vh - 104px); /* wypełnij całą dostępną wysokość */
}

/* ---------- Marker & popup ---------- */
.pmsb-marker-icon {
    background: none;
    border: none;
}

.pmsb-marker-pin {
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    /* Bazowy kolor pinezki - dziedziczony przez SVG przez `currentColor`. */
    color: #0e234f;
    transform-origin: 50% 100%;
    transition: color .25s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.pmsb-marker-pin svg {
    width: 30px;
    height: 40px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
    transition: filter .25s ease;
}

/* Stan aktywny / hover */
.pmsb-marker-pin.is-active,
.pmsb-marker-pin:hover {
    color: #6c77f4;
    transform: scale(1.3);
}
.pmsb-marker-pin.is-active svg,
.pmsb-marker-pin:hover svg {
    filter: drop-shadow(0 4px 12px rgba(108, 119, 244, .65));
}

/* Wynieś aktywną/hoverowaną pinezkę ponad inne markery (np. w klastrach). */
.leaflet-marker-icon.pmsb-marker-icon:hover,
.leaflet-marker-icon.pmsb-marker-icon.pmsb-icon-active {
    z-index: 1000 !important;
}

/* ---------- Etykieta z cen\u0105 nad pinezk\u0105 (permanentny tooltip) ---------- */
.leaflet-tooltip.pmsb-price-tooltip {
    background: #ffffff;
    color: #0e234f;
    border: 1px solid #0e234f;
    border-radius: 0;
    padding: 3px 10px;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    white-space: nowrap;
    pointer-events: none;
}
.leaflet-tooltip.pmsb-price-tooltip::before {
    /* Ukryj domyslny ogonek tooltipu */
    display: none;
}

/* Ukryj wszystkie permanentne ceny gdy jakis marker jest aktywny - poprawa czytelnosci
   w gestych klastrach pinezek (popup pokazuje pelna informacje dla wybranego). */
.leaflet-tooltip.pmsb-price-tooltip {
    transition: opacity .15s ease;
}
.leaflet-tooltip.pmsb-price-tooltip.pmsb-tooltip-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* Leaflet popup */
.pmsb-popup .leaflet-popup-content-wrapper {
    border-radius: 0;
    font-family: "Montserrat", sans-serif;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.pmsb-popup .leaflet-popup-content {
    margin: 10px 14px;
    font-size: 12px;
    line-height: 1.4;
}
.pmsb-popup .leaflet-popup-tip {
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
}

.pmsb-popup-title {
    font-size: 13px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 2px 0;
    font-family: "Playfair Display", serif;
}

/* Cena w popupie - widoczna obok nazwy (spakowane razem przy gęstych klastrach pinezek). */
.pmsb-popup-price {
    margin-top: 4px;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    line-height: 1.2;
    color: #666;
}
.pmsb-popup-price-label {
    font-weight: 400;
    color: #666;
}
.pmsb-popup-price-value {
    font-weight: 700;
    color: #0e234f;
}
.pmsb-popup-price-value sup {
    font-size: 0.6em;
    vertical-align: super;
    margin-left: 1px;
}
.pmsb-popup-price-night {
    font-weight: 400;
    color: #666;
    font-size: 11px;
}

/* ---------- Karta apartamentu – podświetlenie ---------- */
.pase-card {
    position: relative;
    transition: box-shadow .25s ease;
}
/* Pseudo-element rysuje obwódkę NAD dziećmi karty (img/price-bar mają własne tła,
   więc inset box-shadow na .pase-card byłby przez nie zasłonięty). */
.pase-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 0;
    pointer-events: none;
    border: 3px solid transparent;
    transition: border-color .25s ease, box-shadow .25s ease;
    z-index: 5;
}
.pase-card.pmsb-highlight::after {
    /* Brąz marki - kontrastuje z białą kartą ORAZ z ciemnogranatowym tłem sekcji. */
    border-color: #0e234f;
    box-shadow: 0 0 28px rgba(212, 159, 88, .6);
}

/* ---------- Przycisk toggle mapy (mobile) ---------- */
.pmsb-toggle-btn {
    display: none;
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9999;
    width: 54px;
    height: 54px;
    border-radius: 0;
    background: #0e234f;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.20);
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background .2s ease;
}
.pmsb-toggle-btn:hover {
    background: #0d2038;
}
.pmsb-toggle-btn svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.8;
}

/* ---------- Mobile overlay mapy ---------- */
.pmsb-map-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 99998;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.pmsb-map-overlay.is-open {
    display: flex;
}
.pmsb-map-overlay-inner {
    width: 100%;
    height: 70vh;
    background: #F4EFE8;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.pmsb-map-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(212, 159, 88, .25);
}
.pmsb-map-overlay-title {
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #000000;
}
.pmsb-map-overlay-close {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.pmsb-map-overlay-close:hover {
    background: rgba(0,0,0,.06);
}
.pmsb-map-overlay-close svg {
    width: 18px;
    height: 18px;
    stroke: #000000;
    fill: none;
    stroke-width: 2;
}
#pmsb-map-canvas-mobile {
    flex: 1;
    width: 100%;
}

/* ---------- Tooltip / protip na FAB mapy (mobile) ---------- */
.pmsb-fab-tooltip {
    display: none;
    position: fixed;
    left: 16px;
    bottom: 80px; /* FAB(54px) + 16px bottom + 10px gap */
    z-index: 9999;
    max-width: 260px;
    padding: 12px 16px;
    background: #0d2038;
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    line-height: 1.45;
    border-radius: 0;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
    cursor: pointer;
}
.pmsb-fab-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
/* Strzałka wskazująca na FAB */
.pmsb-fab-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 22px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid #0d2038;
}
/* Złoty akcent – emoji mapy */
.pmsb-fab-tooltip-icon {
    margin-right: 6px;
    font-size: 15px;
}

/* ---------- Responsywność ---------- */
@media (max-width: 1024px) {
    /* Ukryj desktop sidebar, pokaż przycisk FAB */
    .pmsb-layout {
        flex-direction: column;
    }
    #pmsb-map-sidebar {
        display: none !important;
    }
    .pmsb-toggle-btn {
        display: flex;
    }
    .pmsb-fab-tooltip {
        display: block;
    }
    /* Przywróć 2 kolumny na tablecie */
    .pmsb-layout .pase-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 575px) {
    .pmsb-layout .pase-grid {
        grid-template-columns: 1fr !important;
    }
}
