.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 1em;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.wp-hike-filter-wrapper {
    --hike-primary: #C20061;
    --hike-primary-dark: #9f0050;
    --hike-accent: #0f766e;
    --hike-ink: #1f2937;
    --hike-muted: #667085;
    --hike-line: #d9e2df;
    --hike-soft: #f6f8f7;
    --hike-surface: #ffffff;
    display: flex;
    flex-direction: column;
    color: var(--hike-ink);
}

.wp-hike-filter-surface {
    background: var(--hike-surface);
    padding: 14px;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
}

.wp-hike-filter-map-container {
    position: relative;
    height: 450px;
    width: 100%;
    flex: 0 0 auto;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: #e8f1ef;
    box-shadow: none;
}

.map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hike-soft);
    color: var(--hike-muted);
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
}

.notice-error {
    padding: 1rem;
    background: #fee2e2;
    color: #b91c1c;
}

/* noUiSlider overrides */
.wp-hike-filter-slider {
    margin: 12px 9px 4px;
}

.wp-hike-filter-wrapper .wp-hike-filter-slider.noUi-target {
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: #e3e8e6;
    box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.08);
}

.wp-hike-filter-wrapper .wp-hike-filter-slider .noUi-connect {
    background: var(--hike-primary);
    border-radius: 999px;
}

.wp-hike-filter-wrapper .wp-hike-filter-slider .noUi-handle {
    width: 18px !important;
    height: 18px !important;
    right: -9px !important;
    top: -7px !important;
    border-radius: 50%;
    background: var(--hike-primary);
    border: 2px solid #fff;
    box-shadow: none;
    cursor: grab;
}

.wp-hike-filter-wrapper .wp-hike-filter-slider .noUi-handle:before,
.wp-hike-filter-wrapper .wp-hike-filter-slider .noUi-handle:after {
    display: none;
}

.wp-hike-filter-wrapper .wp-hike-filter-slider .noUi-handle:focus-visible {
    outline: 3px solid rgba(194, 0, 97, 0.24);
    outline-offset: 3px;
}

.wp-hike-filter-wrapper .wp-hike-filter-slider .noUi-handle:active {
    cursor: grabbing;
}

.wp-hike-filter-wrapper .wp-hike-filter-slider .noUi-tooltip {
    display: none;
    background: var(--hike-primary);
    color: #fff;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    bottom: 120%;
}

#filter-drawer {
    position: static;
    transform: none !important;
    width: 100%;
    flex-shrink: 0;
    overflow-y: visible;
    margin-top: 0;
    padding: 14px 0 8px;
    border-bottom: 0;
    border-radius: 0;
    background: #fff;
}

.wp-hike-filter-controls {
    display: grid;
    gap: 16px;
}

.wp-hike-filter-range-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.wp-hike-filter-control {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.wp-hike-filter-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.wp-hike-filter-label {
    display: block;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.wp-hike-filter-value-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--hike-primary);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
    white-space: nowrap;
}

.wp-hike-filter-category-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 0 14px;
    border-bottom: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.wp-hike-filter-range-row .wp-hike-filter-control {
    min-width: 0;
}

.wp-hike-filter-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.wp-hike-filter-category-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.wp-hike-filter-type-option,
.wp-hike-filter-type-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: #f6f8f7;
    color: var(--hike-ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.wp-hike-filter-type-option:hover,
.wp-hike-filter-type-chip:hover {
    background: #eef3f1;
}

.wp-hike-filter-type-chip:has(input:checked) {
    background: #fff7fb;
    color: var(--hike-primary);
    box-shadow: none;
}

.wp-hike-filter-type-option input,
.wp-hike-filter-type-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.wp-hike-filter-type-option:has(input:focus-visible),
.wp-hike-filter-type-chip:has(input:focus-visible) {
    outline: 3px solid rgba(194, 0, 97, 0.22);
    outline-offset: 3px;
}

.wp-hike-filter-type-icon {
    font-size: 14px;
    line-height: 1;
}

.wp-hike-filter-type-label {
    white-space: nowrap;
}

.wp-hike-filter-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 12px 0 0;
    border-top: 0;
    color: #3f4444;
    font-size: 13px;
    line-height: 1.35;
}

.wp-hike-filter-reset-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #5f6666;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.wp-hike-filter-reset-link:hover {
    color: var(--hike-primary);
}

.wp-hike-filter-reset-link:focus-visible {
    outline: 3px solid rgba(194, 0, 97, 0.2);
    outline-offset: 3px;
    border-radius: 4px;
}

.wp-hike-filter-result-count {
    color: #3f4444;
    font-weight: 500;
    text-align: right;
}

.wp-hike-filter-result-count strong {
    font-weight: 800;
}

.wp-hike-filter-actions {
    gap: 12px;
    margin-top: 16px;
    padding-top: 2px;
}

.wp-hike-filter-button {
    min-height: 52px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.wp-hike-filter-button:focus-visible {
    outline: 3px solid rgba(194, 0, 97, 0.2);
    outline-offset: 3px;
}

.wp-hike-filter-button-primary {
    border: 1px solid var(--hike-primary);
    background: var(--hike-primary);
    color: #fff;
    box-shadow: none;
}

.wp-hike-filter-button-primary:hover {
    border-color: var(--hike-primary-dark);
    background: var(--hike-primary-dark);
}

.wp-hike-filter-button-secondary {
    border: 1px solid #cfdad7;
    background: #fff;
    color: #344054;
    box-shadow: none;
}

.wp-hike-filter-button-secondary:hover {
    border-color: #b9c7c3;
    background: var(--hike-soft);
}

.wp-hike-filter-results {
    margin-top: 8px;
    background: transparent;
    overflow: visible;
}

.wp-hike-filter-result-card {
    overflow: hidden;
    border: 1px solid rgba(217, 226, 223, 0.92);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    transition: border-color 0.12s ease;
}

.wp-hike-filter-result-card:hover {
    border-color: rgba(15, 118, 110, 0.28);
}

.wp-hike-filter-result-link {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    padding: 0;
    position: relative;
    color: inherit;
}

.wp-hike-filter-result-image {
    display: block;
    width: 100%;
    height: 160px;
    aspect-ratio: 16 / 10;
    flex: none;
    object-fit: cover;
    border-radius: 0;
    background: var(--hike-soft);
}

.wp-hike-filter-result-body {
    display: flex;
    min-width: 0;
    flex: none;
    flex-direction: column;
    gap: 8px;
    padding: 4px 12px 10px;
}

.wp-hike-filter-wrapper .wp-hike-filter-result-body {
    padding-top: 4px;
}

.wp-hike-filter-result-title {
    margin: 0;
    color: var(--hike-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.wp-hike-filter-result-place {
    margin: 5px 0 0;
    color: var(--hike-muted);
    font-size: 12px;
    line-height: 1.4;
}

.wp-hike-filter-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: #52605c;
    font-size: 12px;
    font-weight: 700;
}

.wp-hike-filter-result-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--hike-soft);
}

.wp-hike-filter-result-meta-item .material-icons {
    color: var(--hike-accent);
    font-size: 15px;
}

.wp-hike-filter-result-action {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 28px;
    margin-top: 0;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--hike-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.wp-hike-filter-result-link:hover .wp-hike-filter-result-action {
    background: var(--hike-primary-dark);
}

.wp-hike-filter-result-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 0;
    flex: 0 0 28px;
    border-radius: 999px;
    background: var(--hike-soft);
    color: var(--hike-muted);
    position: absolute;
    top: 10px;
    right: 10px;
}

.wp-hike-filter-info-window {
    --hike-primary: #C20061;
    --hike-primary-dark: #9f0050;
    --hike-accent: #0f766e;
    --hike-ink: #1f2937;
    --hike-muted: #667085;
    --hike-soft: #f6f8f7;
    box-sizing: border-box;
    width: min(220px, calc(100vw - 128px));
    max-width: 220px;
    color: var(--hike-ink);
}

.wp-hike-filter-info-card {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.wp-hike-filter-info-header {
    min-width: 0;
    padding-right: 26px;
}

.wp-hike-filter-info-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--hike-ink);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.wp-hike-filter-info-place {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--hike-muted);
    font-size: 11.5px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.wp-hike-filter-info-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.wp-hike-filter-info-meta-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 28px;
    padding: 4px 5px;
    border-radius: 999px;
    background: var(--hike-soft);
    color: #52605c;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.wp-hike-filter-info-meta-item .material-icons {
    color: var(--hike-accent);
    font-size: 14px;
    line-height: 1;
}

.wp-hike-filter-info-action {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--hike-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.wp-hike-filter-info-action:hover {
    background: var(--hike-primary-dark);
}


/* Google Maps infowindow adjustments */
.gm-style-iw-c {
    padding: 0 !important;
    max-width: 250px !important;
    border-radius: 8px !important;
}

.gm-style-iw {
    overflow: visible !important;
}

.gm-style-iw-d {
    overflow: visible !important;
    max-height: none !important;
}

.gm-style-iw-chr {
    height: 0 !important;
    min-height: 0 !important;
}

.gm-style-iw-ch {
    display: none !important;
}

.gm-style .gm-style-iw-c .gm-ui-hover-effect {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    width: 28px !important;
    height: 28px !important;
    opacity: 0.72;
}

.gm-style-iw a {
    color: #fff !important;
}

/* Make the InfoWindow close button smaller */
.gm-ui-hover-effect > img {
    /* Shrink close button to roughly one third of the default size */
    width: 8px !important;
    height: 8px !important;
}

/* Utility class for clamping text to two lines */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
}

/* Ensure results have a little padding so shadows aren't clipped */
#wp-hike-filter-results-list {
    gap: 14px;
    padding: 8px 0 2px;
}

.wp-hike-filter-error {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 24px 12px;
}

.wp-hike-filter-retry {
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--hike-primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.wp-hike-filter-retry:hover {
    background: var(--hike-primary-dark);
}

.wp-hike-filter-retry:focus-visible {
    outline: 3px solid rgba(194, 0, 97, 0.24);
    outline-offset: 3px;
}

/* Prevent underline on hike links */
#wp-hike-filter-results-list a,
#wp-hike-filter-results-list a:hover {
    text-decoration: none;
}

@media (max-width: 980px) {
    .wp-hike-filter-range-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 720px) {
    .wp-hike-filter-surface {
        padding: 10px;
    }

    .wp-hike-filter-map-container {
        height: clamp(280px, 58vh, 390px);
    }

    .wp-hike-filter-control {
        padding: 0;
    }

    .wp-hike-filter-control-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .wp-hike-filter-range-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .wp-hike-filter-category-control {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .wp-hike-filter-category-chips {
        width: 100%;
    }

    .wp-hike-filter-summary-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .wp-hike-filter-result-count {
        text-align: left;
    }

    .wp-hike-filter-result-link {
        gap: 0;
        min-height: 0;
        padding: 0;
    }

    .wp-hike-filter-result-image {
        width: 100%;
        height: 140px;
        aspect-ratio: 16 / 10;
        flex-basis: auto;
    }

    .wp-hike-filter-result-arrow {
        display: none;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .wp-hike-filter-wrapper {
        flex-direction: column;
    }

    #wp-hike-filter-results {
        position: static;
        width: 100%;
        flex-shrink: 0;
        overflow: visible;
    }

    #wp-hike-filter-results-list {
        max-height: none;
    }
}
