:root {--wp--custom--spacing--baseline: 0px !important;}

/* Visually hidden but accessible to screen readers (WCAG) */
.xyz-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Top-right control buttons styling */
.leaflet-top.leaflet-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    white-space: nowrap;
}

.xyz-map-title.leaflet-bar {
    background: white;
    padding: 4px 10px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    border-radius: 4px;
    color: #333;
    border: none;
}

.xyz-legend-button.leaflet-bar,
.xyz-layers-button.leaflet-bar {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    border-radius: 4px;
}

.xyz-legend-button.leaflet-bar:hover,
.xyz-layers-button.leaflet-bar:hover {
    background: #f5f5f5;
}

/* Dropdown panels */
.xyz-dropdown-panel,
.xyz-layers-panel {
    display: none;
    position: fixed;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 300px;
    max-width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 10000;
    font-size: 14px;
    line-height: 1.6;
}

.xyz-dropdown-panel.open,
.xyz-layers-panel.open {
    display: block;
}

/* Layers panel specific styles */
.xyz-layer-control-row {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.xyz-layer-control-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.xyz-layer-control-row input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.xyz-layer-control-row label {
    cursor: pointer;
    font-weight: 500;
    flex: 1;
    color: #1d2327;
    font-size: 14px;
    margin: 0;
}

.xyz-opacity-slider {
    cursor: pointer;
}

/* Mobile responsive */
@media (max-width: 720px) {
    .xyz-dropdown-panel,
    .xyz-layers-panel {
        left: 10px !important;
        right: 10px !important;
        min-width: auto;
        max-width: none;
    }
}

#xyz-map-0 {
    height: 150px;
    width: 100%;
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}

.marker-cluster span
 {
    line-height: 40px;
}

.marker-cluster div {
    border-radius: 20px;
    font: 12px Helvetica Neue, Arial, Helvetica, sans-serif;
    height: 40px;
    text-align: center;
    width: 40px;
}

.marker-cluster-small {
    background-color: hsla(91,60%,72%,.6)
}

.marker-cluster-small div {
    background-color: rgba(110,204,57,.6)
}

.marker-cluster-medium {
    background-color: rgba(241,211,87,.6)
}

.marker-cluster-medium div {
    background-color: rgba(240,194,12,.6)
}

.marker-cluster-large {
    background-color: hsla(18,97%,72%,.6)
}

.marker-cluster-large div {
    background-color: rgba(241,128,23,.6)
}

.leaflet-popup-content { width: auto !important; }

.xyz-search { position:relative; z-index:1000; width:260px; top: 5px; left: 5px; }
.xyz-search input { width:100%; padding:8px 10px; border:1px solid #ccc; }
.xyz-search input:read-write { background:#fff; border-radius: 5px 5px 0 0 !important; border:none !important; box-shadow:0 2px 6px rgba(0,0,0,0.15); }
ul.xyz-search-results { 
    display: none;
    list-style: none;
    position: relative;
    right: 0;
    padding: 15px;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
    max-height: 260px;
    overflow: auto;
    margin: 0;
}
.xyz-search-results li { padding:0px; cursor:pointer;margin:0; font-size: 1.5em; }
.xyz-search-results li:hover, .xyz-search-results li.active { background:#f3f4f6; }

.xyz-mm {text-align: center;}

.xyz-bc{font-size:.9rem;margin:0 0 12px;opacity:.85}
.xyz-bc a{text-decoration:none}
/* Toggle markers button (placed next to Leaflet zoom controls) */
.leaflet-bar.xyz-toggle-markers-wrapper { margin-left: 6px;margin-top: 22px;float: left;z-index: 800; }
    .leaflet-bar.xyz-toggle-markers-wrapper .xyz-toggle-markers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #ccc;
    color: #222;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
.leaflet-bar.xyz-toggle-markers-wrapper .xyz-toggle-markers:hover {
    background: #f4f4f4;
}

/* compact variant for small screens */
@media (max-width: 480px) {
    .leaflet-bar.xyz-toggle-markers-wrapper .xyz-toggle-markers { padding: 4px 6px; font-size:16px;}
}

/* Icon + label inside toggle button */
.leaflet-bar.xyz-toggle-markers-wrapper .xyz-toggle-markers svg {
    display: inline-block;
    vertical-align: middle;
    width: 16px;
    height: 16px;
}
.leaflet-bar.xyz-toggle-markers-wrapper .xyz-toggle-text {
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

.leaflet-control-attribution.leaflet-control {
    position: absolute;
    bottom: 0;
    right: 0;
    white-space: nowrap;
}

.leaflet-bottom .leaflet-control-zoom {
    margin-bottom: 25px;
}

 .xyz-toggle-markers-wrapper {
    margin-bottom: 0;
 }

/* Simple lightbox styles for place gallery */
.xyz-lightbox-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.85); display:flex; align-items:center; justify-content:center; z-index:99999; opacity:0; pointer-events:none; transition:opacity .18s ease; }
.xyz-lightbox-overlay.open { opacity:1; pointer-events:auto; }
.xyz-lightbox-inner { position:relative; max-width:92%; max-height:92%; width:auto; }
.xyz-lightbox-stage { display:flex; align-items:center; justify-content:center; max-height:calc(100vh - 120px); }
.xyz-lightbox-img { max-width:100%; max-height:calc(100vh - 160px); display:block; border-radius:6px; box-shadow:0 6px 30px rgba(0,0,0,0.6); }
.xyz-lightbox-close, .xyz-lightbox-prev, .xyz-lightbox-next { 
    position:absolute; 
    top:8px; 
    background:rgba(255,255,255,0.8); border:0; color:#000; padding:0px 10px 4px; 
    border-radius:6px; cursor:pointer;
    font-size: 30px;
    font-weight: 900; }
.xyz-lightbox-close { right:8px; top:8px; }
.xyz-lightbox-prev { left:-48px; top:50%; transform:translateY(-50%); }
.xyz-lightbox-next { right:-48px; top:50%; transform:translateY(-50%); }
@media (max-width:600px){ .xyz-lightbox-prev{ left:8px; } .xyz-lightbox-next{ right:8px; } }


img.attachment-post-thumbnail.size-post-thumbnail.wp-post-image {
    width: 100%;
}

.leaflet-control {
    clear: none !important;
}

/* Lightbox disabled state and focus styles */
.xyz-lightbox-prev[disabled], .xyz-lightbox-next[disabled] {
    opacity: 0.42;
    cursor: default;
    pointer-events: none;
}
.xyz-lightbox-close:focus, .xyz-lightbox-prev:focus, .xyz-lightbox-next:focus {
    outline: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.3) inset;
}
.xyz-lightbox-overlay[aria-hidden="true"] { display:none; }

/* Provide an explicit class for disabled-looking buttons if needed */
.xyz-lightbox-button--disabled { opacity:0.42; cursor:default; pointer-events:none; }

/* Stronger contrast for control buttons to help visibility */
.xyz-lightbox-close, .xyz-lightbox-prev, .xyz-lightbox-next {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    border: 0;
}
.xyz-lightbox-caption {
    color: #ffffff;
    font-size: 0.95rem;
    margin-top: 8px;
    text-align: center;
    max-width: 90vw;
}
.xyz-lightbox-stage { flex-direction: column; gap: 10px; }

/* Skip link (visible on focus) */
.xyz-skip-link { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
.xyz-skip-link:focus { position:static; left:auto; width:auto; height:auto; padding:8px 12px; background:#000; color:#fff; z-index:100000; border-radius:4px; text-decoration:none; }

/* Make cluster/marker focus visible */
.leaflet-marker-icon:focus { outline: 3px solid #ffd54f; box-shadow: 0 0 0 3px rgba(0,0,0,0.45) inset; }
.leaflet-marker-icon[tabindex] { cursor: pointer; }

span.wp-block-post-terms__prefix {
    margin-right: 10px;
}

footer.sticky {
    position: sticky;
    bottom: 0px;
    z-index: 10000;
}

#xyz-map-1 {margin: 0;}

header.sticky {
        direction: ltr;
    /* Improved contrast: use pure white text on dark header for WCAG AA */
    color: #ffffff;
    font-size: 13px;
    font-weight: 400;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
    line-height: 2.46153846;
    height: 50px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-width: 600px;
    z-index: 99999;
    background: #1d2327;
    outline: 1px solid transparent;
}

.mapa, .page-id-5588 .entry-content {
    height: 100%;
    flex: 1 1 auto;
    display: flex !important;
}

.mapa-main {
    height: 100%;
    flex: 1 1 auto;
    display: flex !important;
}

body.page-id-4696, body.page-id-5588 {
    overflow-x: hidden;}

.page-id-4696 main, .page-id-5588 main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.single .wp-block-group > div {
    padding: 0 20px;
}

/* Slide-in info panel for map markers (opens on marker click) */
.xyz-info-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 48%;
    max-width: 640px;
    background: #ffffff;
    z-index: 2200;
    transform: translateX(100%);
    transition: transform .25s ease, opacity .25s;
    box-shadow: -10px 0 30px rgba(0,0,0,0.25);
    overflow: auto;
    pointer-events: none;
}
.xyz-info-panel.open { transform: translateX(0); pointer-events: auto; }
.xyz-info-panel .panel-inner { display:flex; flex-direction:column; min-height:100%; padding:18px; }
.xyz-info-panel .panel-close { right:12px; top:12px; background:transparent;border:0;font-size:18px;cursor:pointer; }
.xyz-info-panel .panel-body { margin-top:0; flex:1 1 auto; min-height:0; position:relative; }

/* Panel toolbar buttons: larger touch targets and styled SVG icons */
.xyz-info-panel .panel-toolbar {
    padding: 6px 0;
    /* Keep toolbar visible when panel content scrolls */
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 6; /* sit above panel body content */
    background: #ffffff; /* match panel background */
    backdrop-filter: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-bottom: 8px;
}
.xyz-info-panel .panel-toolbar button { display:inline-flex; align-items:center; justify-content:center; 
    width:44px; height:44px; border-radius:8px; border:0;
    /* Slightly stronger background so icons have contrast against white panel */
    background: rgba(0,0,0,0.10); cursor:pointer; padding:6px; box-sizing:border-box; }
.xyz-info-panel .panel-toolbar .panel-view {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #0b5cab;
    text-decoration: none;
    margin-left: 4px;
    margin-right: auto;
    padding: 6px 12px;
    border-radius:8px; border:0;
    /* Slightly stronger background so icons have contrast against white panel */
    background: rgba(0,0,0,0.10); cursor:pointer; box-sizing:border-box;
}
.xyz-info-panel .panel-toolbar .panel-view:hover,
.xyz-info-panel .panel-toolbar .panel-view:focus {
    text-decoration: underline;
}
.xyz-info-panel .panel-toolbar .panel-view:focus-visible {
    outline: 2px solid rgba(11,92,171,0.4);
    border-radius: 4px;
}
.xyz-info-panel .panel-toolbar button[disabled] { opacity:0.5; cursor:default; }
.xyz-info-panel .panel-icon { width:20px; height:20px; fill:currentColor; color:#0b0b0b; }
.xyz-info-panel .panel-icon-close { color:#990000; /* darker red for better contrast */ }
.xyz-info-panel .panel-icon-back { color:#0b0b0b; transform: rotate(0deg); }
.xyz-info-panel .panel-edit-btn { padding: 8px; }
.xyz-info-panel .panel-edit-btn svg { width:20px; height:20px; display:block; fill:currentColor; }
.xyz-info-panel .panel-toolbar .panel-move { background: rgba(0,0,0,0.08); color:#0b0b0b; }
.xyz-info-panel .panel-toolbar .panel-move svg { width:20px; height:20px; display:block; fill:currentColor; }
.xyz-info-panel .panel-toolbar .panel-move.active { background:#0f62fe; color:#fff; box-shadow:0 0 0 2px rgba(15,98,254,0.35); }
.xyz-info-panel .panel-toolbar button:hover { background: rgba(0,0,0,0.14); }
.xyz-info-panel .panel-toolbar button:focus { outline: 3px solid rgba(0,95,204,0.9); }
.xyz-info-panel .panel-toolbar .panel-expand { display: none; } /* Hidden on desktop */

@media (max-width: 720px) {
    .xyz-info-panel { left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: 40vh; max-height: 40vh; border-radius: 12px 12px 0 0; transform: translateY(100%); transition: height 0.3s ease, max-height 0.3s ease; }
    .xyz-info-panel.open { transform: translateY(0); }
    .xyz-info-panel.expanded { height: 85vh !important; max-height: 85vh !important; }
    .xyz-info-panel .panel-toolbar .panel-expand { display: inline-flex; } /* Show on mobile */
    /* Make the map search take full width on mobile */
    .xyz-search { width: 100% !important; left: 0; right: 0; box-sizing: border-box; }

    /* For bottom-sheet mobile variant ensure toolbar sticks to top of the sheet */
    .xyz-info-panel .panel-toolbar { position: sticky; top: 0;}
    
    /* Move topright controls below search on mobile */
    .leaflet-top.leaflet-right { 
        top: 32px !important; /* Space for search input */
    }

    /* Fallback: avoid fully covering header by default if header is approx 56px tall */
    .xyz-info-panel { max-height: calc(100vh - 56px); }
    .xyz-info-panel.expanded { max-height: calc(100vh - 56px) !important; }
}

/* --- Accessibility: screen-reader-only helper and stronger focus styles --- */
/* Utility class for SR-only text (visible on focus) */
.xyz-sr-only {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
.xyz-sr-only:focus, .xyz-sr-only:active {
    position: static !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    padding: 8px 12px !important;
    background: #000 !important;
    color: #fff !important;
    z-index: 100000 !important;
    border-radius: 4px !important;
}

/* stronger visible focus indication for panel toolbar buttons and links inside the panel */
.xyz-info-panel .panel-toolbar button:focus, .xyz-info-panel .panel-toolbar button:focus-visible,
.xyz-info-panel a:focus, .xyz-info-panel a:focus-visible {
    outline: 3px solid #005fcc !important; /* high-contrast blue */
    box-shadow: 0 0 0 3px rgba(0,95,204,0.12) !important;
}

/* also ensure keyboard focus on interactive elements inside the panel body is visible */
.xyz-info-panel .panel-body button:focus, .xyz-info-panel .panel-body input:focus, .xyz-info-panel .panel-body textarea:focus,
.xyz-info-panel .panel-body select:focus, .xyz-info-panel .panel-body a:focus {
    outline-offset: 2px;
}

/* Overlay shown while dragging a marker to a new position */
.xyz-move-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 500;
    background: rgba(8, 8, 8, 0.88);
    color: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.45);
    width: 260px;
    max-width: calc(100% - 32px);
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}
.xyz-move-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.xyz-move-overlay .xyz-move-title { font-weight: 600; display:block; margin-bottom:4px; }
.xyz-move-overlay .xyz-move-text { margin-bottom:8px; font-size: 12px; color: rgba(255,255,255,0.86); }
.xyz-move-overlay .xyz-move-coords { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size:12px; margin-bottom:10px; color:#e6f6ff; }
.xyz-move-overlay .xyz-move-actions { display:flex; gap:8px; }
.xyz-move-overlay button {
    flex:1 1 auto;
    border:0;
    border-radius:8px;
    padding:8px 10px;
    font-size:12px;
    font-weight:600;
    cursor:pointer;
    color:#0b0b0b;
}
.xyz-move-overlay .xyz-move-save { background:#9ef0a3; }
.xyz-move-overlay .xyz-move-save:disabled { opacity:0.6; cursor:progress; }
.xyz-move-overlay .xyz-move-cancel { background:#f4f4f4; }
.xyz-move-overlay .xyz-move-status { margin-top:10px; font-size:12px; min-height:16px; }
.xyz-move-overlay .xyz-move-status.success { color:#9ef0a3; }
.xyz-move-overlay .xyz-move-status.error { color:#ffb3b8; }
.leaflet-container.xyz-marker-move-active { cursor: grab; }
.xyz-temp-marker { filter: drop-shadow(0 4px 10px rgba(0,0,0,0.45)); pointer-events: auto; }
.xyz-temp-marker svg { pointer-events: none; }
@media (max-width: 720px) {
    .xyz-move-overlay { top: auto; bottom: 16px; left: 12px; right: 12px; max-width: none; width: auto; }
}

/* prefers-reduced-motion: disable panel and lightbox transitions to respect users' preference */
@media (prefers-reduced-motion: reduce) {
    .xyz-info-panel, .xyz-info-panel.open, .xyz-lightbox-overlay, .xyz-bottom-sheet {
        transition: none !important;
        animation: none !important;
    }
}

/* Ensure the slide-in panel is strictly hidden on mobile until opened. */
@media (max-width: 720px) {
    .xyz-info-panel {
        /* keep it offscreen and non-interactive by default */
        transform: translateY(110%); /* push further down to be safe */
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: transform .25s ease, opacity .18s ease, visibility 0s linear .25s;
    }
    .xyz-info-panel.open {
        transform: translateY(0);
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition: transform .25s ease, opacity .18s ease;
    }
    body.page-id-4696 {
    overflow-y: hidden;}
}

/* --- Make map fill remaining vertical space in its column (desktop & tablet) --- */
/* Target the WP columns layout used on the homepage; ensure columns stretch to the same height */
.wp-block-columns.is-layout-flex {
    display: flex;           /* ensure flex layout */
    align-items: stretch;    /* make sibling columns equal height */
}

/* Make each column a vertical flex container so children can be stacked
   (heading, description, map wrapper) and the map can grow */
.wp-block-columns.is-layout-flex > .wp-block-column {
    display: flex;
    flex-direction: column;
}

/* The group that wraps the map (has class .mapa-main in the markup) should expand */
.wp-block-group.mapa-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* allow group to take remaining space in the column */
    min-height: 0;  /* enable children to shrink properly inside flex */
}

/* Make the actual Leaflet container grow to fill the available height */
#xyz-map-1,
.wp-block-group.mapa-main > #xyz-map-1.leaflet-container {
    flex: 1 1 auto;
    height: auto !important; /* avoid fixed-height overrides */
    min-height: 0; /* important for proper flex behaviour */
    width: 100%;
}

/* If the theme wraps the map in an intermediate .mapa element, keep previous rules compatible */
.mapa { flex: 1 1 auto; min-height: 0; }


/* WP Search overlay: show search form in an accessible overlay instead of expanding inline
   This prevents layout shifts on small screens and keeps focus management predictable. */
.xyz-search-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: baseline;
    justify-content: center;
    background: rgba(255,255,255,0.95);
    z-index: 120000; /* sit above map panel and other overlays */
    padding-top: 60px;
}
.xyz-search-overlay.open { display: flex; }
.xyz-search-overlay .xyz-search-overlay-panel {
    width: min(720px, 94%);
    max-width: 720px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    padding: 16px;
    box-sizing: border-box;
}
.xyz-search-overlay .xyz-search-overlay-panel .overlay-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: transparent;
    border: 0;
    font-size: 20px;
    color: #222;
    cursor: pointer;
}
.xyz-search-overlay .xyz-search-overlay-body { margin-top: 4px; }

@media (max-width: 640px) {
    .xyz-search-overlay .xyz-search-overlay-panel { width: 96%; padding: 12px; border-radius: 8px; }
}

.wp-block-search__input {width: 100%;}

/* Marker relations section */
.xyz-marker-relations { margin-top:32px; padding-top:16px; border-top:1px solid #ddd; }
.xyz-marker-relations h2 { font-size:1.15rem; margin:0 0 14px; font-weight:600; }
.xyz-marker-relations-list { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.xyz-marker-relations-item { background:#f7f7f9; border:1px solid #e1e1e4; border-radius:8px; padding:10px 12px; font-size:.9rem; line-height:1.4; }
.xyz-marker-relations-item-type { display:inline-block; font-size:.65rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; background:#e0e7ff; color:#1d2d5a; padding:3px 6px; border-radius:4px; margin-right:8px; vertical-align:middle; }
.xyz-marker-relations-item-link { font-weight:600; text-decoration:none; color:#222; }
.xyz-marker-relations-item-link:hover, .xyz-marker-relations-item-link:focus { text-decoration:underline; }
.xyz-marker-relations-item-direction { font-size:.8rem; color:#666; margin-left:6px; }
.xyz-marker-relations-item-note { margin-top:4px; font-size:.75rem; color:#555; }
.xyz-marker-relations-none { font-size:.85rem; color:#555; }

/* Map Legend Button & Popup */
.xyz-legend-button {
    background: white !important;
    border: none !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65) !important;
    border-radius: 4px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.xyz-legend-button:hover {
    background: #f5f5f5 !important;
}

.xyz-legend-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-radius: 8px;
    z-index: 10000;
}

.xyz-legend-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 12px;
}

.xyz-legend-popup h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.xyz-legend-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.xyz-legend-close:hover {
    color: #333;
}

.xyz-legend-content {
    font-size: 14px;
    line-height: 1.6;
}

.xyz-legend-content ul {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.xyz-legend-content li {
    margin: 0.3em 0;
}

.xyz-legend-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}

/* ========================================
   Panel boczny mapy - dedykowane style
   ======================================== */

/* Główny kontener panelu markera */
.xyz-panel-marker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
}

/* Tytuł markera w panelu */
.xyz-panel-title {
    color: #1a1a1a;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Miniaturka w panelu */
.xyz-panel-thumbnail img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Treść markera */
.xyz-panel-content {
    color: #444;
}

.xyz-panel-content p {
    margin: 0 0 1em 0;
}

.xyz-panel-content a {
    color: #0073aa;
    text-decoration: none;
}

.xyz-panel-content a:hover {
    text-decoration: underline;
}

/* Sekcja taksonomii */
.xyz-panel-taxonomies {
    background: #f7f7f7;
}

.xyz-panel-tax-group:last-child {
    margin-bottom: 0;
}

/* Termy - hover states */
.xyz-panel-term {
    transition: all 0.2s ease;
}

.xyz-panel-term:hover {
    background: #f0f0f0 !important;
    border-color: #bbb !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Powiązane miejsca */
.xyz-panel-relations {
    background: #f0f4f8;
}

.xyz-panel-related-item {
    transition: all 0.2s ease;
}

.xyz-panel-related-item:hover {
    background: #f7f9fb !important;
    border-color: #aaa !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Meta informacje */
.xyz-panel-meta {
    color: #666;
    font-size: 13px;
}

/* Responsywność dla bardzo wąskich paneli */
@media (max-width: 400px) {
    .xyz-panel-marker {
        padding: 16px !important;
    }
    
    .xyz-panel-title {
        font-size: 1.4rem !important;
    }
    
    .xyz-panel-content {
        font-size: 15px !important;
    }
    
    .xyz-panel-terms {
        gap: 4px !important;
    }
    
    .xyz-panel-term {
        font-size: 12px !important;
        padding: 3px 8px !important;
    }
}

/* Scroll panelu - gładkie przewijanie */
.xyz-panel-body {
    scroll-behavior: smooth;
}

/* Galerie zdjęć w panelu */
.xyz-panel-content .gallery {
    margin: 1em 0;
}

.xyz-panel-content .gallery-item {
    display: inline-block;
    margin: 0 4px 4px 0;
}

.xyz-panel-content .gallery-item img {
    border-radius: 4px;
    transition: transform 0.2s;
}

.xyz-panel-content .gallery-item img:hover {
    transform: scale(1.05);
}

/* Tabele w treści panelu */
.xyz-panel-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.xyz-panel-content table th,
.xyz-panel-content table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.xyz-panel-content table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Przyciski w treści */
.xyz-panel-content .wp-block-button__link,
.xyz-panel-content button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.xyz-panel-content .wp-block-button__link:hover,
.xyz-panel-content button:hover {
    background: #005177;
}

/* Loading state */
.xyz-panel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* Error state */
.xyz-panel-error {
    padding: 20px;
    background: #fff5f5;
    color: #a10a0a;
    border: 1px solid #f1c0c0;
    border-radius: 6px;
    margin: 20px;
}

/* Usuwamy zbędne marginesy mini-map jeśli jakiś się pojawi */
.xyz-panel-content .xyz-mini-map,
.xyz-panel-content .xyz-minimap {
    display: none !important;
}

/* Empty state message for mini-map block when no GPS data */
.xyz-mini-map-empty {
    padding: 1rem !important;
    background: #f6f8fb;
    border: 4px solid #df8181;
    border-radius: 8px;
    color: #5c6b7a;
    font-size: 14px;
    text-align: center;
}

/* House markers on featured images */
.xyz-photo-with-house-markers {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.xyz-house-markers-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.xyz-house-marker {
    position: absolute;
    transform: translate(-50%, -100%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.xyz-house-marker-icon {
    width: 32px;
    height: 32px;
    display: block;
    margin-bottom: 4px;
}

.xyz-house-marker svg.xyz-house-marker-icon {
    color: #2271b1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.xyz-house-marker img.xyz-house-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.xyz-house-marker-label {
    background: #2271b1;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    white-space: nowrap;
    line-height: 1.2;
}

.xyz-house-marker:hover .xyz-house-marker-icon {
    transform: scale(1.15);
}

.xyz-house-marker:hover svg.xyz-house-marker-icon {
    color: #135e96;
}

.xyz-house-marker:hover .xyz-house-marker-label {
    background: #135e96;
    transform: scale(1.05);
}

/* Responsive adjustments for house markers */
@media (max-width: 768px) {
    .xyz-house-marker-icon {
        width: 24px;
        height: 24px;
    }
    
    .xyz-house-marker-label {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Print styles dla panelu */
@media print {
    .xyz-panel-marker {
        padding: 0 !important;
    }
    
    .xyz-panel-thumbnail img {
        max-width: 400px;
    }
    
    .xyz-panel-term,
    .xyz-panel-related-item {
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    /* Hide house markers when printing */
    .xyz-house-markers-overlay {
        display: none;
    }
}
