/* ══════════════════════════════════════════════════════════════
   Explore — Responsive (Elementor breakpoints)
   ══════════════════════════════════════════════════════════════ */

/* ── Tablet Portrait (≤1024px) ───────────────────────────────── */
@media (max-width: 1024px) {
    .xp-date-filter .xp-loop-menu {
        width: 220px;
    }

    .xp-activity-date__day { 
        font-size: 24px!important;
    }

    .xp-activity-date__month {
        font-size: 11px!important;
    }

    .xp-activity-date {
        padding: 6px 0px!important;
    }
}

/* ── Mobile Portrait (≤767px) ────────────────────────────────── */
@media (max-width: 767px) {
    .xp-date-filter .xp-loop-toggle {
        font-size: 13px;
        padding: 6px 12px;
    }

    .xp-date-filter .xp-loop-menu {
        width: 100%;
        left: 0;
        right: 0;
    }

    /* Map popup cards — constrain for mobile */
    .leaflet-popup.tpl-map-card .lf-item-map-card > a {
        min-width: 80px;
        max-width: 150px;
        padding: 8px 10px !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   Explore Craftperson Map — Active filter chips (all viewports)
   ══════════════════════════════════════════════════════════════ */
body.page-slug-explore-craftperson-map .xp-map-active-filters {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    margin: 26px 0;
    padding: 0;
}

body.page-slug-explore-craftperson-map .xp-map-active-filters:empty,
body.page-slug-explore-craftperson-map .xp-map-active-filters:not(:has(.xp-chip)) {
    display: none !important;
}

/* PC (≥1200px): hide the active filter chips entirely — responsive only */
@media (min-width: 1200px) {
    body.page-slug-explore-craftperson-map .xp-map-active-filters {
        display: none !important;
    }
}

body.page-slug-explore-craftperson-map .xp-map-active-filters .xp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: #014783;
    border-radius: 4px;
    white-space: nowrap;
}

body.page-slug-explore-craftperson-map .xp-map-active-filters .xp-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: rgba(1, 37, 69, .25);
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
}

body.page-slug-explore-craftperson-map .xp-map-active-filters .xp-chip-remove:hover {
    background: rgba(1, 37, 69, .5);
}

/* ══════════════════════════════════════════════════════════════
   Explore Craftperson Map — Responsive (≤1199px)
   Column layout: filters → map → listings
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1199px) {

    /* Override the ≥992px flex row — switch to column */
    body.page-slug-explore-craftperson-map .finder-container.fc-type-1 {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    body.page-slug-explore-craftperson-map .finder-container.fc-type-1 .fc-default {
        width: 100% !important;
        flex: none !important;
        display: contents !important;
    }

    /* Filters — full width on top */
    body.page-slug-explore-craftperson-map #finderSearch {
        order: 1 !important;
        display: contents !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
        padding: 12px !important;
        border-bottom: 1px solid #e2e5ea !important;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }

    body.page-slug-explore-craftperson-map #finderSearch .finder-tabs-wrapper {
        margin: 0 !important;
    }

    body.page-slug-explore-craftperson-map #finderSearch .finder-tabs,
    body.page-slug-explore-craftperson-map #finderSearch .tab-content,
    body.page-slug-explore-craftperson-map #finderSearch .search-tab,
    body.page-slug-explore-craftperson-map #finderSearch .search-filters {
        overflow: visible !important;
        height: auto !important;
    }

    /* Filter form — vertical stack of full-width pills (same as collab) */
    body.page-slug-explore-craftperson-map .search-filters .filter-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: none !important;
        border: none !important;
        overflow: visible !important;
    }

    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: none !important;
        border: none !important;
        float: none !important;
    }

    /* Reset floating labels */
    body.page-slug-explore-craftperson-map .search-filters .md-group label,
    body.page-slug-explore-craftperson-map .search-filters .md-group select:required:valid ~ label,
    body.page-slug-explore-craftperson-map .search-filters .md-group input:required:valid ~ label {
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        animation: none !important;
        background: none !important;
        border: none !important;
        pointer-events: none !important;
    }

    /* Search input pill */
    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group.wp-search-filter {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        height: 48px !important;
        padding: 0 16px 0 48px !important;
        background: #f0f1f3 !important;
        border: 1px solid var(--listing-color-border-input, #e2e5ea) !important;
        border-radius: var(--listing-radius, 8px) !important;
    }

    body.page-slug-explore-craftperson-map .filter-wrapper > .wp-search-filter::before {
        content: "search";
        font-family: "Material Icons";
        font-feature-settings: "liga";
        font-size: 22px;
        color: var(--listing-color-primary, #012545);
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
    }

    body.page-slug-explore-craftperson-map .filter-wrapper > .wp-search-filter input {
        width: 100% !important;
        height: 100% !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        font-size: 15px !important;
        color: #012545 !important;
        padding: 0 !important;
    }

    body.page-slug-explore-craftperson-map .filter-wrapper > .wp-search-filter.md-group label {
        position: absolute !important;
        left: 48px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        color: #6b7d92 !important;
    }

    body.page-slug-explore-craftperson-map .wp-search-filter.md-group input:required:valid ~ label {
        display: none !important;
    }

    /* Taxonomy dropdowns — full-width pills */
    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group.dropdown-filter {
        display: block !important;
        position: relative !important;
        width: 100% !important;
    }

    body.page-slug-explore-craftperson-map .form-group.dropdown-filter .main-term {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    body.page-slug-explore-craftperson-map .form-group.dropdown-filter .main-term > select {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        opacity: 0 !important;
        overflow: hidden !important;
    }

    body.page-slug-explore-craftperson-map .search-filters .filter-wrapper > .dropdown-filter.form-group.md-group label {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        height: 48px !important;
        padding: 0 40px 0 16px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #012545 !important;
        background: #fff !important;
        border: 1.5px solid var(--listing-color-border-input, #e2e5ea) !important;
        border-radius: var(--listing-radius, 8px) !important;
        cursor: pointer !important;
        z-index: 1 !important;
        margin: 0 !important;
    }

    body.page-slug-explore-craftperson-map .search-filters .filter-wrapper > .dropdown-filter.form-group.md-group label::after {
        content: "expand_more";
        font-family: "Material Icons";
        font-feature-settings: "liga";
        font-size: 22px;
        color: #012545;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
    }

    body.page-slug-explore-craftperson-map .search-filters .filter-wrapper > .dropdown-filter.form-group:hover label {
        border-color: var(--listing-color-primary, #012545) !important;
    }

    /* Select2 overlay */
    body.page-slug-explore-craftperson-map .form-group.dropdown-filter .select2-container {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 0 !important;
        z-index: 2 !important;
        cursor: pointer !important;
    }

    body.page-slug-explore-craftperson-map .form-group.dropdown-filter .select2-container .selection,
    body.page-slug-explore-craftperson-map .form-group.dropdown-filter .select2-container .selection .select2-selection {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        cursor: pointer !important;
    }

    body.page-slug-explore-craftperson-map .form-group.dropdown-filter .select2-selection__rendered {
        visibility: hidden !important;
        height: 0 !important;
    }

    /* Sort dropdown pill */
    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group.orderby-filter {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: 48px !important;
        background: #fff !important;
        border: 1.5px solid var(--listing-color-border-input, #e2e5ea) !important;
        border-radius: var(--listing-radius, 8px) !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group.orderby-filter > select {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        opacity: 0 !important;
        overflow: hidden !important;
    }

    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group.orderby-filter > label {
        display: none !important;
    }

    body.page-slug-explore-craftperson-map .orderby-filter .select2-container {
        position: static !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 1 !important;
    }

    body.page-slug-explore-craftperson-map .orderby-filter .select2-selection--single {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 40px 0 16px !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        cursor: pointer !important;
    }

    body.page-slug-explore-craftperson-map .orderby-filter .select2-selection__rendered {
        visibility: visible !important;
        height: auto !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #012545 !important;
        line-height: 1 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    body.page-slug-explore-craftperson-map .orderby-filter .select2-selection__clear,
    body.page-slug-explore-craftperson-map .orderby-filter .select2-selection__arrow {
        display: none !important;
    }

    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group.orderby-filter::after {
        content: "expand_more";
        font-family: "Material Icons";
        font-feature-settings: "liga";
        font-size: 22px;
        line-height: 1;
        color: #012545;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }

    /* Hide submit/reset buttons */
    body.page-slug-explore-craftperson-map .form-group.fc-search {
        display: none !important;
    }

    /* Map — full width, between filters and listings */
    body.page-slug-explore-craftperson-map #finderMap {
        order: 2 !important;
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: 45vh !important;
        min-height: 250px !important;
        max-height: 350px !important;
        flex-shrink: 0 !important;
        z-index: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-top: 1px solid #ccc !important;
        border-bottom: 1px solid #ccc !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        background: #aad3df !important;
    }

    /* Override parent theme: .cts-explore .finder-map:not(.map-mobile-visible) { visibility: hidden } */
    body.page-slug-explore-craftperson-map .cts-explore .finder-map {
        visibility: visible !important;
        z-index: 1 !important;
        position: relative !important;
        display: block !important;
    }

    body.page-slug-explore-craftperson-map #finderMap .c27-map {
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
        visibility: visible !important;
    }

    body.page-slug-explore-craftperson-map #finderMap .leaflet-container {
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
        background-color: #aad3df !important;
        transform: translateZ(0) !important;
    }

    /* Override parent theme's plus-lighter blend that washes out tiles */
    body.page-slug-explore-craftperson-map #finderMap .leaflet-container img.leaflet-tile {
        mix-blend-mode: normal !important;
    }

    body.page-slug-explore-craftperson-map #finderMap .leaflet-tile-pane {
        transform: translateZ(0) !important;
    }

    /* Listings — full width below map, scrollable */
    body.page-slug-explore-craftperson-map #finderListings {
        order: 3 !important;
        display: block !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide explore-head / mobile-head */
    body.page-slug-explore-craftperson-map .mobile-explore-head,
    body.page-slug-explore-craftperson-map .mobile-explore-head-top,
    body.page-slug-explore-craftperson-map .finder-overlay {
        display: none !important;
    }

    /* Type dropdown (user_type) — full-width pill style */
    body.page-slug-explore-craftperson-map .filter-wrapper > .form-group.xp-type-filter {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 48px !important;
        margin: 0 !important;
        background: #fff !important;
        border: 1.5px solid var(--listing-color-border-input, #e2e5ea) !important;
        border-radius: var(--listing-radius, 8px) !important;
        padding: 0 !important;
    }

    body.page-slug-explore-craftperson-map .search-filters .filter-wrapper > .dropdown-filter.form-group.md-group.xp-type-filter > label {
        display: none !important;
    }

    body.page-slug-explore-craftperson-map .xp-type-filter select {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        opacity: 0 !important;
        overflow: hidden !important;
    }

    body.page-slug-explore-craftperson-map .form-group.dropdown-filter.xp-type-filter .select2-container {
        position: static !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 1 !important;
    }

    body.page-slug-explore-craftperson-map .form-group.dropdown-filter.xp-type-filter .select2-selection--single {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 40px 0 16px !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        cursor: pointer !important;
    }

    body.page-slug-explore-craftperson-map .xp-type-filter.dropdown-filter .select2-selection__rendered {
        visibility: visible !important;
        height: auto !important;
        font-size: 0 !important; /* hide the selected option value */
        font-weight: 500 !important;
        color: #012545 !important;
        line-height: 1 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Show the static "Τύπος" label instead of the selected option,
       just like the other taxonomy filters. */
    body.page-slug-explore-craftperson-map .xp-type-filter.dropdown-filter .select2-selection__rendered::before {
        content: "Τύπος";
        font-size: 14px;
        font-weight: 500;
        color: #012545;
        line-height: 1;
    }

    body.page-slug-explore-craftperson-map .xp-type-filter.dropdown-filter .select2-selection__clear,
    body.page-slug-explore-craftperson-map .xp-type-filter.dropdown-filter .select2-selection__arrow {
        display: none !important;
    }

    body.page-slug-explore-craftperson-map .xp-type-filter::after {
        content: "expand_more";
        font-family: "Material Icons";
        font-feature-settings: "liga";
        font-size: 22px;
        line-height: 1;
        color: #012545;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }
    .finder-search .search-filters {
        padding: 0px !important;
    }

    .finder-tabs.col-md-12.with-listing-types {
        padding: 0px !important;
    }

    .fl-head {
        margin-top: 40px!important;
    }

    .results-view {
        margin-top: 30px!important;
    }

}

/* ── Craftperson map ≤767px — smaller map ─────────────────────── */
@media (max-width: 767px) {
    body.page-slug-explore-craftperson-map #finderMap {
        height: 240px !important;
        min-height: 200px !important;
        max-height: 300px !important;
    }

    body.page-slug-explore-craftperson-map #finderSearch {
        padding: 12px 10px !important;
    }
}

/* ── Craftperson map — remove OUTER left/right gap on result grid,
      keep the gap BETWEEN posts ───────────────────────────────────── */
/* Two-column view (769–1199px): keep inner padding, drop only outer edges */
@media (min-width: 769px) and (max-width: 1199px) {
    body.page-slug-explore-craftperson-map .results-view.grid .grid-item:nth-child(odd) {
        padding-left: 0 !important;
    }
    body.page-slug-explore-craftperson-map .results-view.grid .grid-item:nth-child(even) {
        padding-right: 0 !important;
    }
}
/* Single-column view (≤768px): no horizontal padding at all */
@media (max-width: 768px) {
    body.page-slug-explore-craftperson-map .results-view.grid .grid-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
/* Vertical gap between posts on responsive */
@media (max-width: 1199px) {
    body.page-slug-explore-craftperson-map .results-view.grid .grid-item > .lf-item-container {
        margin-bottom: 30px !important;
    }

    .finder-listings {
        box-shadow: none !important;
    }
}
