/* Patička — aktivní šířka (container), ne full-bleed prohlížeče */
.site-footer {
    --footer-bg: #2d2f43;
    --footer-fg: #ffffff;
    --footer-accent: #fbb900;
    margin: 32px 0 0;
    padding: 0 0 24px;
    background: transparent;
    color: var(--footer-fg);
    font-family: 'Barlow', sans-serif;
}

/* Kontakty střediska těsně nad patičkou — bez mezery */
.content:has(.kotak-kontakt) ~ .site-footer,
.content:has(.kotak-kontakt) + .site-footer {
    margin-top: 0;
}
.content:has(.kotak-kontakt) ~ .site-footer .site-footer__inner,
.content:has(.kotak-kontakt) + .site-footer .site-footer__inner {
    border-radius: 0 0 4px 4px;
}

.site-footer__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px 12px 16px;
    background: var(--footer-bg);
    border-radius: 4px;
}

@media (min-width: 1400px) {
    .site-footer__inner {
        max-width: 1320px;
    }
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}

.site-footer__top {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px 16px;
    align-items: start;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.site-footer__hq {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.35;
}

.site-footer__social {
    display: grid;
    grid-template-columns: repeat(2, 35px);
    gap: 8px;
    justify-self: end;
}

.site-footer__social-btn {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: #fff;
    color: #2d2f43;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    text-decoration: none !important;
}
.site-footer__social-btn:hover {
    background: var(--footer-accent);
    color: #2d2f43;
}

/* Mapa přes celý blok — výchozí modrá (tiles), legenda + zoom + toggle uvnitř */
.site-footer__map-block {
    position: relative;
    width: 100%;
    min-height: 420px;
    height: clamp(380px, 48vw, 560px);
    margin: 16px 0;
    border-radius: 4px;
    overflow: hidden;
    background: #3b3958;
}

.site-footer__mapa {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #3b3958;
}

.site-footer__mapa .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    background: #3b3958 !important;
}

/* MapLibre GL vrstva (leaflet-gl-layer) si drží vlastní px velikost — NEvynucovat 100% */
.site-footer__mapa .maplibregl-map {
    background: #3b3958 !important;
}
.site-footer__mapa .maplibregl-canvas-container {
    background: #3b3958 !important;
}
.site-footer__mapa .leaflet-gl-layer {
    z-index: 200 !important; /* pod markery, nad pozadím */
}
.site-footer__mapa .leaflet-marker-pane,
.site-footer__mapa .leaflet-popup-pane,
.site-footer__mapa .leaflet-tooltip-pane {
    z-index: 600;
}

.site-footer__map-block.is-normal-map,
.site-footer__map-block.is-normal-map .site-footer__mapa,
.site-footer__map-block.is-normal-map .leaflet-container {
    background: #ddd !important;
}

/* Přepínač běžné mapy — pravý horní roh; zoom pod ním */
.site-footer__map-toggle {
    position: absolute;
    z-index: 6;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #6b7ba8;
    background: rgba(59, 57, 88, 0.92);
    color: #a8b5d8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.site-footer__map-block.is-normal-map .site-footer__map-toggle {
    background: rgba(255, 255, 255, 0.92);
    color: #333;
    border-color: #ccc;
}
.site-footer__map-toggle input {
    margin: 0;
    cursor: pointer;
}
@media (max-width: 576px) {
    .site-footer__map-toggle {
        font-size: 11px;
        padding: 5px 8px;
    }
}

.site-footer__legend {
    position: absolute;
    z-index: 5;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: min(180px, 42%);
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
    background: transparent;
    border-radius: 6px;
}

.site-footer__legend-btn {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.site-footer__legend-btn img {
    width: 27px;
    height: 39px;
    object-fit: contain;
    flex-shrink: 0;
}
.site-footer__legend-btn span {
    display: block;
    max-width: 9.5rem;
}
.site-footer__legend-btn.is-active {
    color: var(--branch-color, var(--footer-accent));
    font-size: 0.95rem;
}

.site-footer__legend-item.has-children.is-open > .site-footer__legend-btn {
    color: var(--branch-color, var(--footer-accent));
}

.site-footer__legend-children {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.28);
}

.site-footer__legend-btn--child {
    font-size: 0.68rem;
    font-weight: 600;
    gap: 8px;
}
.site-footer__legend-btn--child img {
    width: 22px;
    height: 32px;
}
.site-footer__legend-btn--child.is-active {
    font-size: 0.8rem;
}

.site-footer__map-block.is-normal-map .site-footer__legend-children {
    border-left-color: rgba(45, 47, 67, 0.25);
}

/* Běžná OSM mapa — světlý panel + tmavé názvy */
.site-footer__map-block.is-normal-map .site-footer__legend {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(3px);
}
.site-footer__map-block.is-normal-map .site-footer__legend-btn {
    color: #2d2f43;
    text-shadow: none;
}
.site-footer__map-block.is-normal-map .site-footer__legend-btn.is-active {
    color: var(--branch-color, var(--footer-accent));
}

/* Zoom vpravo pod přepínačem mapy */
.site-footer__mapa .leaflet-top.leaflet-right {
    right: 10px;
    top: 48px;
}
.site-footer__mapa .leaflet-control-zoom {
    border: 1px solid #ccc !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.site-footer__mapa .leaflet-control-zoom a {
    background: #fff !important;
    color: #333 !important;
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 16px;
}
.site-footer__mapa .leaflet-control-zoom a:hover {
    background: #f0f0f0 !important;
    color: #000 !important;
}

.leaflet-marker-icon.footer-mapa-ikona {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}
.leaflet-marker-icon.footer-mapa-ikona.is-active {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
    z-index: 600 !important;
}

/* Popup detail — Figma 216:35584: barevný pruh s ikonami vpravo od pinu
   Kotvení: levá hrana boxu (JS +½ šířky), gap v px — nezávislé na délce. */
.footer-map-popup {
    margin-bottom: 0 !important;
}
.footer-map-popup .leaflet-popup-content-wrapper {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 8px;
    /* vpravo od pinu s mezerou; dolní okraj boxu = dolní okraj loga */
    transform: translate(36px, 0);
}
.footer-map-popup .leaflet-popup-content {
    margin: 0;
    min-width: 0;
    line-height: 0;
}
.footer-map-popup .leaflet-popup-content:has(.footer-info-box--pc) {
    line-height: 1.2;
}
.footer-map-popup .leaflet-popup-tip-container,
.footer-map-popup a.leaflet-popup-close-button {
    display: none !important;
}

.footer-info-box {
    color: #2d2f43;
    border-radius: 7px;
    height: 40px;
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    box-shadow: none;
}
.footer-info-box__actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
}
.footer-info-box__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none !important;
    opacity: 1;
    transition: opacity .15s ease, transform .15s ease;
}
.footer-info-box__action:hover {
    opacity: 0.85;
    transform: scale(1.06);
}
.footer-info-box__action.is-active {
    opacity: 1;
    transform: scale(1.08);
}
.footer-info-box__ico {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}
.footer-info-box__ico--tel {
    width: 20px;
    height: 20px;
}
.footer-info-box__ico--mail {
    width: 22px;
    height: 18px;
}

/* PC: 1. řádek text, 2. řádek ikony — pevná velikost boxu (dost místa na adresu) */
.footer-info-box--pc {
    height: 58px;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    padding: 6px 10px;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 2px;
}
.footer-info-box--pc .footer-info-box__label {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 18px;
    min-width: 0;
}
.footer-info-box--pc .footer-info-box__label-text,
.footer-info-box--pc .footer-info-box__label-link {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}
.footer-info-box--pc .footer-info-box__label-link {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.footer-info-box--pc .footer-info-box__label-link:hover {
    opacity: 0.85;
}
.footer-info-box--pc .footer-info-box__label-text[hidden],
.footer-info-box--pc .footer-info-box__label-link[hidden] {
    display: none !important;
}
.footer-info-box--pc .footer-info-box__copy {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.85;
}
.footer-info-box--pc .footer-info-box__copy:hover,
.footer-info-box--pc .footer-info-box__copy.is-copied {
    opacity: 1;
}
.footer-info-box--pc .footer-info-box__copy[hidden] {
    display: none !important;
}
.footer-info-box--pc .footer-info-box__copy-ico {
    width: 13px;
    height: 13px;
    display: block;
    pointer-events: none;
}
.footer-info-box--pc .footer-info-box__actions {
    height: 24px;
}

@media (max-width: 767.98px) {
    .footer-info-box {
        height: 36px;
        width: 140px;
        min-width: 140px;
        max-width: 140px;
        padding: 0 6px;
    }
    .footer-info-box__actions {
        gap: 2px;
    }
    .footer-info-box__action {
        width: 22px;
        height: 22px;
    }
    .footer-info-box__ico,
    .footer-info-box__ico--tel,
    .footer-info-box__ico--mail {
        width: 22px !important;
        height: 22px !important;
    }
}

.site-footer__nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 20px 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.site-footer__nav-title {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.site-footer__nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer__nav-link {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.25;
}
.site-footer__nav-link.is-strong {
    font-weight: 700;
}

.site-footer__copy {
    margin: 16px 0 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 400;
}

@media (max-width: 991.98px) {
    .site-footer__top {
        grid-template-columns: 1fr 1fr;
    }
    .site-footer__social {
        justify-self: start;
        grid-column: 1 / -1;
    }
    .site-footer__nav {
        grid-template-columns: 1fr 1fr;
    }
    .site-footer__map-block {
        min-height: 360px;
        height: 420px;
    }
    .site-footer__legend {
        width: min(160px, 48%);
        gap: 8px;
    }
}

@media (max-width: 575.98px) {
    .site-footer__top {
        grid-template-columns: 1fr;
    }
    .site-footer__nav {
        grid-template-columns: 1fr;
    }
    .site-footer__legend {
        width: min(150px, 52%);
        top: 8px;
        left: 8px;
        bottom: auto;
        max-height: 55%;
    }
}
