/* UIkit Map Panel template (map background + overlay list panel)
   UIkit-first: layout is ours, components (inputs, dropdowns, icons) are UIkit.
*/

.zba-template-map-panel .zba-map-panel-wrap {
    position: relative;
    width: 100%;
    min-height: 640px;
}

.zba-template-map-panel [data-zba-map].zba-map {
    position: relative;
    width: 100%;
    height: min(80vh, 760px);
    min-height: 640px;
    z-index: 1;
}

/* Overlay panel */
.zba-template-map-panel .zba-panel {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 420px;
    max-width: calc(100% - 48px);
    max-height: calc(100% - 48px);
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    z-index: 700;

    /* Design target */
    background: #f8f4e9;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Prevent theme box-sizing quirks from making controls overflow */
.zba-template-map-panel .zba-panel,
.zba-template-map-panel .zba-panel * {
    box-sizing: border-box;
}

.zba-template-map-panel .zba-panel-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.zba-template-map-panel .zba-panel-title {
    margin: 0 0 30px;
    font-size: 23px;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
}

.zba-template-map-panel .zba-panel-subrow {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

/* Tag bar (grouped filters) */
.zba-template-map-panel .zba-tagbar {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 2px;
    /* Make sure the bar area doesn't collapse to 0 in edge cases */
    min-height: 22px;
}

/* No horizontal scrolling for chips in this template */
.zba-template-map-panel .zba-tagbar::-webkit-scrollbar {
    display: none;
}

.zba-template-map-panel .zba-chip {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1;
    border-radius: 999px;
    white-space: nowrap;
    user-select: none;

    /* Inactive = 30% red */
    border: 1px solid rgba(237, 28, 36, 0.3);
    background: rgba(237, 28, 36, 0.3);
    color: #ed1c24;
    font-weight: 700;
}

.zba-template-map-panel .zba-chip.is-active {
    background: #ed1c24;
    color: #fff;
}

.zba-template-map-panel .zba-chip::after,
.zba-template-map-panel .uk-label.zba-chip::after {
    content: "+";
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
}

.zba-template-map-panel .zba-chip.is-active::after,
.zba-template-map-panel .uk-label.zba-chip.is-active::after {
    content: "×";
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
}

.zba-template-map-panel .zba-panel-status {
    min-width: 0;
}

/* Sort icon inside UIkit icon-button */
.zba-template-map-panel .zba-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Remove the default UIkit icon-button ring/background (mock has none) */
.zba-template-map-panel .zba-sort-btn.uk-icon-button {
    background: transparent;
    border: 0;
    box-shadow: none;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

/* Hover / active feedback */
.zba-template-map-panel .zba-sort-btn.uk-icon-button:hover {
    background: rgba(237, 28, 36, 0.1);
}

.zba-template-map-panel .zba-sort-btn.uk-icon-button:active {
    background: rgba(237, 28, 36, 0.18);
    transform: translateY(1px);
}

.zba-template-map-panel .zba-sort-btn.uk-icon-button:focus,
.zba-template-map-panel .zba-sort-btn.uk-icon-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.22);
}

.zba-template-map-panel .zba-sort-ico {
    width: 22px;
    height: 18px;
    display: block;
}

/* Ensure the search input has room for the flipped icon */
.zba-template-map-panel [data-zba-muni-wrap] .uk-input {
    padding-right: 44px;
    border-radius: 999px;
}

/* Autocomplete */
.zba-template-map-panel .zba-autocomplete {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    z-index: 1100;
    margin: 8px 0 0;
    padding: 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    max-height: 240px;
    overflow: auto;
}

.zba-template-map-panel .zba-panel-body {
    padding: 12px 16px 16px;
    overflow: auto;
}

/* Cards (closer to mock) */
.zba-template-map-panel .zba-event-card {
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fffefa;
    overflow: hidden;
    margin-bottom: 14px;
}

.zba-template-map-panel .zba-event-card.uk-card {
    margin: 0 0 14px;
}

/* Reduce UIkit card body padding for this template (YOOtheme default can be large) */
.zba-template-map-panel .zba-event-content.uk-card-body {
    padding: 20px;
}

.zba-template-map-panel .zba-event-tag {
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
}

/* Tags / pills (avoid theme default blue labels) */
.zba-template-map-panel .uk-label {
    background: #ed1c24;
    color: #fff;
}

.zba-template-map-panel .uk-label a,
.zba-template-map-panel .uk-label span {
    color: inherit;
}

/* Tagbar chips override the generic uk-label styling */
.zba-template-map-panel .uk-label.zba-chip {
    border: 1px solid rgba(237, 28, 36, 0.3);
    background: rgba(237, 28, 36, 0.3);
    color: #ed1c24;
}

.zba-template-map-panel .uk-label.zba-chip.is-active {
    background: #ed1c24;
    color: #fff;
}

.zba-template-map-panel .zba-event-title {
    display: block;
    font-weight: 800;
    font-size: 19px;
    color: #333 !important;
    line-height: 1.2;
    text-decoration: none;
    color: inherit;
    margin: 2px 0 6px;
}

.zba-template-map-panel .zba-event-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: none;
    border-radius: 18px 18px 0 0;
}

.zba-template-map-panel .zba-event-card.has-cover .zba-event-img {
    display: block;
}

.zba-template-map-panel .zba-event-content {
    background: #fffefa;
    border-radius: 18px;
}

.zba-template-map-panel .zba-event-card.has-cover .zba-event-content {
    border-radius: 0 0 18px 18px;
}

.zba-template-map-panel .zba-event-text {
    font-size: 15px;
    opacity: 1;
    line-height: 1.35;
}

/* CTA button (match mock: red pill + centered white text) */
.zba-template-map-panel .zba-event-cta {
    background-color: #e31b23;
    color: #fff !important;
    font-weight: 700;
    letter-spacing: 0.2px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

.zba-template-map-panel .zba-event-cta:hover,
.zba-template-map-panel .zba-event-cta:focus {
    background-color: #c9161d;
    color: #fff;
}

.zba-template-map-panel .zba-event-cta::after {
    content: "\2192";
    margin-left: 10px;
    font-size: 18px;
    line-height: 1;
}

.zba-template-map-panel .zba-event-cal {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.zba-template-map-panel .zba-event-cal-link {
    text-decoration: none;
}

/* First card keeps "featured" styling; remaining cards use outlined red-on-cream */
.zba-template-map-panel
    .zba-results
    > .zba-event-card:not(:first-child)
    .zba-event-cta {
    background-color: #fffefa !important;
    color: #ed1c24 !important;
    border: 2px solid #ed1c24 !important;
}

.zba-template-map-panel
    .zba-results
    > .zba-event-card:not(:first-child)
    .zba-event-cta:hover,
.zba-template-map-panel
    .zba-results
    > .zba-event-card:not(:first-child)
    .zba-event-cta:focus {
    background-color: #fffefa !important;
    color: #ed1c24 !important;
}

.zba-template-map-panel
    .zba-results
    > .zba-event-card:not(:first-child)
    .uk-label.zba-event-tag {
    background: #fffefa;
    color: #ed1c24;
    border: 1px solid #ed1c24;
}

/* dölj badge som standard */
[data-zba-results] .zba-topchip {
    display: none !important;
}

/* visa bara på första kortet */
[data-zba-results] > .zba-results > :first-child .zba-topchip {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px 0;
}

/* gör den mindre + samma röda som sorteringen */
[data-zba-results] > *:first-child .zba-topchip.uk-label {
    background: #ed1c24;
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px; /* mindre än vanliga chips */
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
}
.zba-panel-footer {
    padding: 20px;
}
.zba-no-nearby-active .zba-panel-footer {
    display: none;
}
.zba-panel-footer h3 {
    font-weight: 700;
    margin: 0 0 10px 0;
}

.zba-panel-body {
    scrollbar-color: #e1d9c4 #f8f4e9;
}

/* Chrome, Edge, Safari */
.zba-panel-body::-webkit-scrollbar {
    width: 10px;
}

.zba-panel-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.zba-panel-body::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 8px;
    border: 2px solid #f1f1f1;
}
.newsletter-like-zba .apsis-inline-row {
    display: grid;
    gap: 12px;
}

.newsletter-like-zba .apsis-inline-grow,
.newsletter-like-zba .apsis-inline-button {
    width: 100%;
}

.newsletter-like-zba input[type="email"] {
    width: 100%;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #d9d9d9;
    border-radius: 500px;
    background: #fff;
    box-sizing: border-box;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.newsletter-like-zba input[type="email"]::placeholder {
    color: #8c8c8c;
}

.newsletter-like-zba input[type="email"]:focus {
    border-color: #e31b23;
    box-shadow: 0 0 0 2px rgba(227, 27, 35, 0.12);
}

.newsletter-like-zba .apsis-inline-button button {
    width: 100%;
    min-height: 44px;
    padding: 0 30px;
    border: 0;
    border-radius: 500px;
    background-color: #e31b23;
    color: #fff;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.newsletter-like-zba .apsis-inline-button button:hover {
    background-color: #c9161d;
}

.newsletter-like-zba .apsis-inline-button button::after {
    content: "\2192";
    margin-left: 10px;
    font-size: 18px;
    line-height: 1;
}

.newsletter-like-zba .apsis-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.newsletter-like-zba .apsis-checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}
.newsletter-like-zba .apsis-inline-button button {
    text-transform: uppercase;
}
.newsletter-like-zba .apsis-checkbox-row {
    font-weight: 300;
    font-size: 11px;
}
/* Mobile / tablet layout: map above, panel overlaps from below */
@media (max-width: 1199px) {
    .zba-template-map-panel .zba-map-panel-wrap {
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .zba-template-map-panel [data-zba-map].zba-map {
        order: 1;
        display: block;
        width: 100%;
        height: min(52vh, 420px);
        min-height: 300px;
    }

    .zba-template-map-panel .zba-panel {
        order: 2;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto;
        max-width: none;
        max-height: none;
        margin: -44px 8px 0;
        border-radius: 22px;
    }
}

@media (max-width: 640px) {
    .zba-template-map-panel [data-zba-map].zba-map {
        height: min(46vh, 360px);
        min-height: 260px;
    }

    .zba-template-map-panel .zba-panel {
        margin: -36px 12px 0;
    }
}

/* Smooth, subtle results transitions for tag pills / sort changes */
.zba-template-map-panel [data-zba-results].zba-anim-fade {
    position: relative;
}

.zba-template-map-panel [data-zba-results].zba-anim-fade > .zba-results {
    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
    will-change: opacity, transform;
}

.zba-template-map-panel [data-zba-results].zba-anim-fade .zba-event-card {
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    transform-origin: 50% 20%;
    will-change: opacity, transform;
}

.zba-template-map-panel
    [data-zba-results].zba-anim-fade.zba-is-updating
    > .zba-results {
    opacity: 0;
    transform: translateY(4px);
}

.zba-template-map-panel
    [data-zba-results].zba-anim-fade.zba-is-updating
    .zba-event-card {
    opacity: 0;
    transform: translateY(6px);
}

.zba-template-map-panel
    [data-zba-results].zba-anim-fade:not(.zba-is-updating)
    .zba-event-card {
    transition-delay: 0ms !important;
}

@media (prefers-reduced-motion: reduce) {
    .zba-template-map-panel [data-zba-results].zba-anim-fade > .zba-results,
    .zba-template-map-panel [data-zba-results].zba-anim-fade .zba-event-card {
        transition: none !important;
    }
}
