/**
 * Fix for clickable elements in station finder
 */

/* Ensure dropdowns are clickable */
.dropdown-checkbox-wrapper {
    position: relative;
    z-index: 100;
}

/* Make sure dropdown headers are clickable */
.dropdown-checkbox-header {
    position: relative;
    z-index: 101;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: white;
    border-radius: 5px;
}

/* Ensure dropdown options are accessible */
.dropdown-checkbox-options {
    position: absolute;
    z-index: 102;
    background-color: white;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    display: none;
}

/* Show dropdown options when active */
.dropdown-checkbox-wrapper.active .dropdown-checkbox-options {
    display: block;
}

/* Make sure the reset button is clickable */
#reset-filters {
    position: relative;
    z-index: 100;
    cursor: pointer;
    pointer-events: auto;
}

/* Fix for any potential overlay issues */
.station-finder-search {
    position: relative;
    z-index: 10;
}

/* Custom radius dropdown styles */
.custom-radius-options {
    padding: 10px 0;
    max-height: 100px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.radius-option {
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.radius-option:hover {
    background-color: #f5f5f5;
}

.radius-option.selected {
    background-color: #f0f0f0;
    font-weight: bold;
}

/* Fix radius wrapper to ensure dropdown is clickable */
.radius-wrapper {
    position: relative;
    cursor: pointer;
}

.radius-wrapper .dropdown-checkbox-header {
    pointer-events: none;
}

/* Fix for Google Places Autocomplete dropdown */
.pac-container {
    z-index: 10000 !important;
}

/* Ensure the places autocomplete input is clickable */
#places-autocomplete {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    z-index: 103;
    cursor: text;
    pointer-events: auto;
}

/* Hide the second input field in location dropdown */
.location-wrapper .dropdown-checkbox-options input:not(#places-autocomplete) {
    display: none;
}

/* Fix for any potential overlay issues */
.finder-form-bg {
    position: relative;
    z-index: 5;
}

/* Ensure the filter groups are clickable */
.filter-group {
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

/* Fix for brands dropdown */
.dropdown-checkbox-wrapper:not(.location-wrapper):not(.radius-wrapper) .dropdown-checkbox-options {
    max-height: 100px;
    overflow-y: auto;
    padding: 10px;
}

/* Fix for duplicate checkboxes in brands dropdown */
.dropdown-checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.dropdown-checkbox {
    margin-right: 8px;
}

/* Hide duplicate checkbox custom elements */
.dropdown-checkbox-custom:not(:first-of-type) {
    display: none;
}

/* Style for checkbox custom element */
.dropdown-checkbox-custom {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
}

/* Style for checked custom checkbox */
.dropdown-checkbox:checked + .dropdown-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #333;
}

/* Fix for dropdown icons */
.dropdown-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Fix for dropdown selected text */
.dropdown-selected-text {
    flex-grow: 1;
}

/* Fix for dropdown arrow */
.dropdown-arrow {
    margin-left: 10px;
}
