/* Visit Map */
.visit-map.ns-events {
    position: relative;
}

.visit-map .visit-map-content {
    position: relative;
}

.visit-map #visit-map-canvas {
    width: 100%;
    height: 500px;
    border-radius: 5px;
    border: 1px solid #E9E9E9;
}

.visit-map .visit-map-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: #ACACAC;
}

/* Filter checkboxes */
.visit-map-checkboxes {
    margin-bottom: 0.5rem;
    margin-left: 28px;
}

.visit-map-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.4;
}

.visit-map-checkbox span {
    margin-bottom: -5px;
}

.visit-map-checkbox:hover span {
    color: #D3222A;
}

.visit-map-checkbox input[type="checkbox"] {
    accent-color: #D3222A;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Loading overlay */
.visit-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.visit-map-loading.active {
    opacity: 1;
    pointer-events: auto;
}

.visit-map-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #E9E9E9;
    border-top-color: #D3222A;
    border-radius: 50%;
    animation: visit-map-spin 0.7s linear infinite;
}

@keyframes visit-map-spin {
    to { transform: rotate(360deg); }
}

/* App banner */
.visit-map-app-banner {
    margin-top: 1.5rem;
}

.visit-map-app-banner-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    background-image: linear-gradient(157deg, #d3222a 0%, #aa1c25 100%);
}

.visit-map-app-banner-image {
    flex-shrink: 0;
}

.visit-map-app-banner-image img {
    max-height: 80px;
    display: block;
}

.visit-map-app-banner-text {
    flex: 1;
}

.visit-map-app-banner-text h2 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.visit-map-app-banner-links {
    display: block;
    flex-shrink: 0;
}

.visit-map-app-btn {
    display: block;
    max-width: 100px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.visit-map-app-btn:hover {
    opacity: 0.85;
}

.visit-map-app-btn img {
    display: block;
    width: 100%;
}

/* Responsive: stack on small screens */
@media screen and (max-width: 768px) {
    .visit-map-app-banner-inner {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
        gap: 1rem;
    }

    .visit-map-app-banner-text h2 {
        font-size: 1.1rem;
    }

    .visit-map-app-banner-links {
        justify-content: center;
    }

    .visit-map-app-btn {
        max-width: 130px;
    }
}

/* =========================================================================
   Toolbar (view switcher + sort)
   ========================================================================= */

.visit-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.visit-map-view-switcher {
    display: flex;
    gap: 10px;
    border: none;
    border-radius: 5px;
    overflow: hidden;
    width: fit-content;
}

.visit-map-view-switcher button {
    margin: 0;
}

button.visit-map-view-btn {
    border: solid 1px #E9E9E9;
}

/* Sort dropdown */
.visit-map-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #666;
}

.visit-map-sort label {
    font-weight: 600;
    white-space: nowrap;
    margin: 0;
}

.visit-map-orderby {
    padding: 7px 12px;
    border: 1px solid #E9E9E9;
    border-radius: 5px;
    background: #fff;
    font-size: 0.875rem;
    color: #373737;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.visit-map-orderby:hover,
.visit-map-orderby:focus {
    border-color: #D3222A;
}

.visit-map-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: #fff;
    color: #666;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.visit-map-view-btn + .visit-map-view-btn {
    border-left: 1px solid #E9E9E9;
}

.visit-map-view-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.visit-map-view-btn.active {
    background: #D3222A;
    color: #fff;
}

.visit-map-view-btn svg {
    flex-shrink: 0;
}

/* View containers */
.visit-map-view {
    display: none;
}

.visit-map-view.active {
    display: block;
}

/* =========================================================================
   List view — card grid
   ========================================================================= */

.visit-map-view--list .facetwp-template {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 200px;
    position: relative;
}

.visit-map-view--list .facetwp-template > .list-item {
    display: block;
    width: calc(33.333% - 14px);
    text-decoration: none;
    color: inherit;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #E9E9E9;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    background: #fff;
}

.visit-map-view--list .facetwp-template > .list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.visit-map-view--list .facetwp-template > .list-item .thumb {
    height: 200px;
    border-radius: 5px 5px 0 0;
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.visit-map-view--list .facetwp-template > .list-item .item-meta {
    padding: 12px 14px;
}

.visit-map-view--list .facetwp-template > .list-item .item-meta .item-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
    max-height: 2.6em;
    overflow: hidden;
    color: #373737;
}

.visit-map-view--list .facetwp-template > .list-item .item-meta .item-loc,
.visit-map-view--list .facetwp-template > .list-item .item-meta .icon-marker {
    font-size: 12px;
    color: #ACACAC;
}

/* Discount labels in list view */
.visit-map-view--list .label_discount {
    position: absolute;
    top: auto;
    bottom: 10px;
    left: 10px;
    background: #D3222A;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 2;
}

.visit-map-view.visit-map-view--list.active span.card-liptov {
    top: -2.1rem;
    right: -1.5rem;
}

.visit-map-view--list .label_is-top {
    position: absolute;
    bottom: auto;
    top: auto;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 2;
}

/* =========================================================================
   Thumbnail overlay tags (season icons, open/closed, reservation)
   Shared between list view and map popup
   ========================================================================= */

/* Season icons — top-right */
.visit-map-thumb-seasons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.visit-map-icon-season {
    display: block;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Open / Closed — bottom-right */
.visit-map-thumb-status {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 2;
}

.visit-map-open-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1.4;
}

.visit-map-status--open {
    background: rgba(46, 125, 50, 0.88);
    color: #fff;
}

.visit-map-status--closed {
    background: rgba(198, 40, 40, 0.88);
    color: #fff;
}

/* Reservation required — top-left */
.visit-map-thumb-reservation {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    line-height: 1.4;
}

/* List overlay — covers existing cards while loading */
.visit-map-view--list {
    position: relative;
}

.visit-map-list-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.visit-map-list-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Initial loading spinner (before first content) */
.visit-map-list-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 300px;
}

.visit-map-list-empty {
    width: 100%;
    text-align: center;
    color: #ACACAC;
    padding: 3rem 1rem;
    font-size: 0.9rem;
}

/* =========================================================================
   Pagination
   ========================================================================= */

.visit-map-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 1.5rem 0 0.5rem;
}

.visit-map-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #E9E9E9;
    border-radius: 4px;
    background: #fff;
    color: #373737;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.visit-map-page-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.visit-map-page-btn.active {
    background: #D3222A;
    color: #fff;
    border-color: #D3222A;
    cursor: default;
}

.visit-map-page-prev,
.visit-map-page-next {
    font-weight: 700;
}

.visit-map-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    color: #ACACAC;
    font-size: 0.875rem;
    user-select: none;
}

/* =========================================================================
   Responsive: list + pagination
   ========================================================================= */

@media screen and (max-width: 768px) {
    .visit-map-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .visit-map-view--list .facetwp-template > .list-item {
        width: calc(50% - 10px);
    }

    .visit-map-view--list .facetwp-template > .list-item .thumb {
        height: 160px;
    }

    .visit-map-page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

@media screen and (max-width: 480px) {
    .visit-map-view--list .facetwp-template > .list-item {
        width: 100%;
    }

    .visit-map-view--list .facetwp-template > .list-item .thumb {
        height: 180px;
    }

    .visit-map-sort {
        width: 100%;
    }

    .visit-map-orderby {
        flex: 1;
    }
}

/* =========================================================================
   Mobile filter sidebar
   ========================================================================= */

@media screen and (max-width: 991px) {
    .visit-map .ns-events-filter-toggle {
        display: block;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .visit-map .ns-events-filter-toggle .ns-events-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 24px;
        background: #D3222A;
        color: #fff;
        border-radius: 5px;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s;
    }

    .visit-map .ns-events-filter-toggle .ns-events-filter-btn:hover {
        background: #b31d24;
    }

    .visit-map .ns-events-filter-toggle .ns-events-filter-btn:before {
        content: "";
        display: inline-block;
        width: 16px;
        height: 16px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Cline x1='8' y1='12' x2='20' y2='12'/%3E%3Cline x1='12' y1='18' x2='20' y2='18'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: contain;
    }

    .visit-map .ns-events-filter-toggle .events-filter-title {
        display: block;
        font-size: 1.25rem;
        font-weight: 700;
        color: #D3222A;
        margin: 0.5rem 0 1rem;
    }

    .visit-map .events-filter.sidebar.visit-map-filter {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100%;
        max-height: 100%;
        min-height: 100%;
        background: #fff;
        z-index: 9999;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 50px 20px 20px;
        box-shadow: 3px 0 15px rgba(0, 0, 0, 0.12);
        transition: left 0.25s ease;
    }

    .visit-map.filter-active .events-filter.sidebar.visit-map-filter {
        left: 0;
        top: -26px;
        width: 280px;
    }

    .visit-map .visit-map-filter .close-btn {
        display: block;
        position: absolute;
        top: 14px;
        right: 14px;
        width: 24px;
        height: 24px;
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
    }

    .visit-map .visit-map-filter .close-btn:before,
    .visit-map .visit-map-filter .close-btn:after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 18px;
        height: 2px;
        background: #666;
        border-radius: 1px;
    }

    .visit-map .visit-map-filter .close-btn:before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .visit-map .visit-map-filter .close-btn:after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .visit-map .visit-map-filter .close-btn:hover:before,
    .visit-map .visit-map-filter .close-btn:hover:after {
        background: #D3222A;
    }

    /* Backdrop overlay */
    .visit-map .visit-map-filter-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9998;
    }

    .visit-map .visit-map-filter-backdrop.active {
        display: block;
    }
}

@media screen and (min-width: 992px) {
    .visit-map .ns-events-filter-toggle {
        display: none;
    }

    .visit-map .visit-map-filter .close-btn {
        display: none;
    }

    .visit-map .visit-map-content.blog-content {
        align-self: start;
        min-width: 818px;
    }

    .visit-map .visit-map-content.blog-content.is-stuck {
        position: fixed;
        top: 180px;
        width: var(--visit-map-content-width, 820px);
        min-width: 818px;
    }
}

/* =========================================================================
   Map popup — discount label
   ========================================================================= */

.visit-map-popup-discount {
    position: absolute;
    bottom: 8px;
    left: 0;
    z-index: 2;
}

.visit-map-popup-discount .label_discount {
    position: relative;
    display: inline-block;
    top: auto;
    background: #D3222A;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 0 3px 3px 0;
}

.visit-map-popup-discount .card-liptov {
    display: block;
    top: -2rem;
    right: -1.7rem;
}

/* =========================================================================
   Google Maps InfoWindow overrides
   ========================================================================= */

.visit-map .gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 5px;
    overflow: hidden;
}

.visit-map .gm-style .gm-style-iw-d {
    overflow: hidden !important;
}
