/* Custom Filter Popup Styles */

/* Filter Button */
#wpestate-filter-trigger {
    display: flex;
    color: rgba(30, 30, 30, 1);
    padding:12px 12px 12px 12px !important;
    cursor: pointer;
    position: absolute;
    right: 0px;
    top: auto;
    bottom: -55px;
    align-items: center;
    align-self: baseline;
    border: 1px solid rgba(118, 118, 118, 1);
    border-radius: 30px;
    height: 44px !important;
    transition: all 0.3s ease;
    background: transparent;
    font-size: 14px;
    font-family: 'Roboto';
    font-weight: 500;
}

#wpestate-filter-trigger:hover {
    background: rgba(230, 230, 230, 1);
    transition: all 0.3s ease;
}
#wpestate-filter-trigger svg {
    margin-right: 8px;
}

/* Modal Styles */
.wpestate-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.wpestate-modal-content {
    background-color: rgba(255, 255, 255, 1);
    margin: 5% auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 744px; /* Adjusted max-width based on screenshot */
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal Header */
.wpestate-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 48px 0px 16px 0px;
    border-bottom: 2px solid rgba(27, 31, 38, 0.72);
    margin: 0 96px;
  }

.wpestate-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #000;
}

.wpestate-close {
    color: rgb(30, 30, 30);
    font-size: 30px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    right: -75px;
    top: -40px;
  }

.wpestate-close:hover {
    color: #555; /* Darker hover */
}

/* Modal Body */
.wpestate-modal-body {
    padding: 32px 96px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px; /* Add padding to the bottom of each group */
    border-bottom: 1px solid rgba(27, 31, 38, 0.72); /* Add a light separator line */
}
.filter-group.no-border {
    border-bottom: none !important;
}
.filter-group.quantity {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
.filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none; /* No border for the last group */
}
.filter-group.no-border label {
    color: rgba(0, 0, 0, 1);
    font-weight: bold;
}
.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400; /* Bolder font weight for labels */
    color: rgba(9, 9, 9, 1);
    font-size: 20px; /* Slightly larger font size for labels */
}
.ui-widget-header {
    border: 1px solid rgb(30, 30, 30) !important;
    background: rgb(30, 30, 30) 50% 50% repeat-x !important;
}
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
    border: 1px solid rgb(30, 30, 30) !important;
    background: rgb(30, 30, 30) 50% 50% repeat-x !important;
    font-weight: bold;
    color: rgb(30, 30, 30) !important;
  }
.filter-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px; /* Slightly more rounded corners for select */
    font-size: 14px;
    background-color: #f8f9fa;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Price Slider */
.price-slider-container {
    position: relative;
    padding: 0 10px; /* Add some padding to align with inputs */
}

#price-slider {
    margin: 20px 0 10px 0; /* Adjusted margins */
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.price-inputs input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px; /* More rounded corners */
    font-size: 14px;
    text-align: left; /* Text alignment to left */
    padding-left: 15px; /* Add padding-left for better appearance */
}

.price-inputs span {
    color: #666;
    font-weight: 500;
}

/* Property Features Grid */
/*.property-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, auto)) !important; 
    gap: 12px 16px; 
    justify-content: start; 
}*/

.property-features-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px 16px !important;
}
.property-features-grid > * {
    flex: 0 0 auto; /* не розтягувати */
}

.property-feature-item {
    display: flex !important;
    padding: 16px !important;
    border: 1px solid rgba(128, 128, 128, 0.55) !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    text-align: left;
    position: relative;
    height: 58px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.property-feature-item:hover {
    border-color: rgba(27, 31, 38, 0.72) !important;
    background: rgba(245, 245, 245, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.property-feature-item:has(input[type="checkbox"]:checked) {
    border-color: rgba(27, 31, 38, 0.72) !important;
    background: rgba(245, 245, 245, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* Hide the items initially beyond the first 5 */
.property-feature-item.hidden-feature {
    display: none !important;
}

/* Custom Checkbox Styling */
.property-feature-item input[type="checkbox"] {
    /* Hide the default checkbox */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative; /* Keep it in flow for positioning the custom box */
    width: 20px; /* Size of the custom checkbox */
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 4px; /* Slightly rounded corners for the checkbox */
    outline: none;
    cursor: pointer;
    margin-right: 10px; /* Space between checkbox and icon/text */
    flex-shrink: 0; /* Prevent checkbox from shrinking */
    transition: all 0.2s ease;
}

/* Checkbox checked state */
.property-feature-item input[type="checkbox"]:checked {
    background-color: #000; /* Black background when checked */
    border-color: #000; /* Black border when checked */
}

/* Checkmark for the custom checkbox */
.property-feature-item input[type="checkbox"]:checked::after {
    content: '✓'; /* Unicode checkmark character */
    display: block;
    color: white; /* White checkmark */
    font-size: 14px;
    line-height: 1; /* Adjust line-height to center the checkmark */
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the checkmark */
}

/* Icon (img) styling */
.feature-icon {
    display: none;
    width: 24px; /* Size of the feature icons */
    height: 24px;
    margin-right: 8px; /* Space between icon and text */
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* Placeholder for missing icons */
.feature-icon-placeholder {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    /* Optional: Add a subtle background or border to indicate missing icon */
    /* background-color: #f0f0f0; */
    /* border: 1px dashed #ccc; */
    /* border-radius: 4px; */
}

/* Text span styling */
.property-feature-item span {
    font-size: 15px !important;
    color: #090909;
    font-weight: 400;
    line-height: 1.2;
    flex-grow: 1; /* Allow text to take available space */
}

/* "Show More" link style */
.show-more-features {
    font-size: 15px;
    color: #333; /* Standard link blue */
    text-decoration: underline;
    margin-top: 16px; /* Space above the link */
    display: inline-block; /* Allows margin-top */
    transition: color 0.3s ease;
}

.show-more-features:hover {
    color: #000; /* Darker blue on hover */
}

.filter-badge {
    display: inline-block;
    min-width: 22px;
    padding: 0px 5px;
    background: #000;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 1;
  }
  

/* Counter Controls */
.counter-control {
    display: flex;
    align-items: center;
    gap: 12px; /* Slightly reduced gap */
    justify-content: flex-start; /* Align counters to the start */
}

.counter-btn {
    width: 40px; /* Larger buttons */
    height: 40px; /* Larger buttons */
    border: 1px solid #ccc; /* Lighter border */
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px; /* Larger font size for +/- */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.counter-btn:hover {
    background: #f0f0f0; /* Lighter hover effect */
    border-color: #aaa;
}

.counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.counter-value {
    font-size: 18px; /* Larger font size for value */
    font-weight: 500;
    min-width: 30px; /* Increased min-width */
    text-align: center;
    color: #333; /* Darker color for value */
}

.counter-btn.minus:disabled {
    background-color: #ccc !important;
    border-color: #666 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.counter-btn.minus:disabled:hover {
    background-color: #ccc !important;
    transform: none !important;
}

/* Property Type Grid */
.filter-group.no-border { /* Adding the parent class for better specificity */
    /* Remove any default margin/padding if present from the parent wrapper */
    margin-bottom: 20px; /* Example spacing below the whole group */
}

.filter-group.no-border > label { /* Styling the main label "Тип житла" */
    font-size: 18px;
    font-weight: 600;
    color: #333; /* Darker text for the heading */
    margin-bottom: 16px; /* Space between heading and grid */
    display: block; /* Ensures margin-bottom works */
}

.property-type-grid {
    display: flex;
    gap: 8px 16px;
    flex-wrap: wrap;
}

.property-type-item {
    display: flex !important;
    flex-direction: column !important; /* Stack icon and text vertically */
    align-items: center !important; /* Center items horizontally within the flex container */
    justify-content: center !important; /* Center items vertically within the flex container */
    padding: 16px; /* Padding inside each item */
    border: 1px solid #ddd; /* Light grey border */
    border-radius: 8px; /* More rounded corners as per design */
    cursor: pointer;
    transition: all 0.3s ease; /* Smooth transition for hover/active states */
    background: white; /* White background by default */
    text-align: center; /* Center text */
    position: relative; /* For the hidden radio button */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtle shadow for depth */
}

.property-type-item:hover {
    border-color: #999; /* Slightly darker border on hover */
    background: #f0f0f0; /* Lighter background on hover */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Slightly more pronounced shadow on hover */
}

/* Hide the default radio button */
.property-type-item input[type="checkbox"] {
    position: absolute;
    opacity: 0; /* Hide the actual radio button */
    width: 0;
    height: 0;
    pointer-events: none; /* Make it not interactable */
}

/* Style for the icon (SVG) */
.property-type-icon {
    width: 24px; /* Adjust icon size based on mockup */
    height: 24px; /* Ensure aspect ratio */
    margin-bottom: 8px; /* Space between icon and text */
    color: #666; /* Default icon color (assuming currentColor) */
    transition: color 0.3s ease; /* Smooth transition for icon color */
}

/* Style for the text span */
.property-type-item span {
    font-size: 15px; /* Adjust font size */
    color: #090909; /* Default text color */
    margin-top: 8px;
    font-weight: 400; /* Medium font weight */
    line-height: 1.2; /* Adjust line height for multi-line names */
    transition: all 0.3s ease; /* Smooth transition for text color/weight */
}

/* -------------------------------------------------------------------------- */
/* STYLING FOR THE CHECKED STATE (when a radio button is selected)           */
/* -------------------------------------------------------------------------- */

/* Target the .property-type-item itself when its descendant radio is checked.
   This requires the `:has()` pseudo-class for pure CSS.
   If browser support for :has() is an issue, you'll need JS to add a class like 'is-selected'
   to the .property-type-item when its radio is checked.
*/
.property-type-item:has(input[type="checkbox"]:checked) {
    border-color: #000; /* Black border for selected item */
    background: #eee; /* Lighter grey background for selected item */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); /* More pronounced shadow when selected */
}

/* Change icon color when the parent .property-type-item is selected */
.property-type-item:has(input[type="checkbox"]:checked) .property-type-icon {
    color: #000; /* Black icon when selected */
}

/* Change text color and weight when the parent .property-type-item is selected */
.property-type-item:has(input[type="checkbox"]:checked) span {
    color: #000; /* Black text when selected */
    font-weight: 600; /* Bolder text when selected */
}

/* Fallback/alternative if :has() is not supported and HTML structure is input then svg then span:
   This will only style the siblings *following* the checked input, not the parent.
   The border/background of the .property-type-item itself won't change without :has() or JS.
*/
.property-type-item input[type="checkbox"]:checked + .property-type-icon {
    color: #000; /* Black icon when selected */
}

.property-type-item input[type="checkbox"]:checked + .property-type-icon + span {
    color: #000; /* Black text when selected */
    font-weight: 600; /* Bolder text when selected */
}

/* "Show More" link style */
.filter-group.no-border a { /* Targeting the link directly */
    font-size: 15px;
    color: #1E1E1E; /* Standard link blue */
    text-decoration: underline;
    margin-top: 16px; /* Space above the link */
    display: inline-block; /* Allows margin-top */
    transition: color 0.3s ease;
}

.filter-group.no-border a:hover {
    color: #1B1F26B8; /* Darker blue on hover */
}

/* Modal Footer */
.wpestate-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 96px;
    border-top: 1px solid rgba(27, 31, 38, 0.72);
    background: #fff;
    border-radius: 0 0 16px 16px;
}

.filter-btn {
    padding: 16px 78px; /* Increased padding for buttons */
    border: 1px solid rgba(44, 44, 44, 1);
    border-radius: 8px; /* More rounded corners for buttons */
    cursor: pointer;
    font-size: 16px; /* Larger font size for buttons */
    font-weight: 400; /* Bolder text for buttons */
    transition: all 0.3s ease;
}

.fil-btn-primary {
    background: rgba(44, 44, 44, 1); /* Black background for primary button */
    color: white;
}

.fil-btn-primary:hover {
    background: #333; /* Darker black on hover */
}

.fil-btn-secondary {
    background: transparent; /* Transparent background for secondary button */
    color: rgba(30, 30, 30, 1); /* Black text for secondary button */
    border: 1px solid rgba(118, 118, 118, 1); /* No border */
}

.fil-btn-secondary:hover {
    background: #f0f0f0; /* Light gray background on hover */
}

/* Results Header - Keep if you want to display "X properties found" outside the modal */
.results-header {
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

#results-count {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}
.wpestate_marker { pointer-events: auto; cursor: pointer; }
.wpestate_marker .interior_pin_price { font-weight: 600; line-height: 1; }
/* Property Items - These styles are crucial and will apply to the main grid */
.property-item {
    display: flex; /* Or grid depending on your main layout */
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease; /* Added transform for consistency with JS hover */
}

.property-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.property_flex.col-md-3 {
    padding-left: 2px !important;
    padding-right: 2px !important;
}
.property-image {
    width: 200px; /* Adjust as per your main grid image size */
    height: 150px; /* Adjust as per your main grid image size */
    overflow: hidden;
    flex-shrink: 0;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-content {
    padding: 16px;
    flex: 1;
}

.property-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.property-content h3 a {
    color: #333;
    text-decoration: none;
}

.property-content h3 a:hover {
    color: #007cba;
}

.property-address {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.property-details {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.property-details span {
    font-size: 14px;
    color: #555;
}

.property-price {
    font-size: 18px;
    font-weight: 600;
    color: #007cba;
}

/* Pagination */
.filter-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.page-btn:hover,
.page-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Loading State */
/* This loading class should be applied to MAIN_PROPERTY_CONTAINER_SELECTOR */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative; /* Needed for absolute positioning of spinner */
    min-height: 100px; /* Ensure space for spinner */
}

.loading::before { /* Changed from ::after to ::before for better visibility sometimes */
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px; /* Larger spinner */
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3; /* Thicker border */
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10; /* Ensure spinner is on top */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpestate-modal-content {
        width: 100%;
        margin: 0% auto;
        height: 100%;
        border-radius: 0px;
    }
    
    /* Assuming your main property grid also adapts to column layout */
    /* If your main property item itself becomes column, these are fine */
    .property-item {
        flex-direction: column;
    }
    
    .property-image {
        width: 100%;
        height: 200px;
    }
    
    .property-type-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .wpestate-modal-footer {
        flex-direction: row;
        gap: 12px;
        padding: 24px 20px !important;
    }
    .filter-btn {
        padding: 16px 35px !important;
        font-size: 14px !important;
    }
    .wpestate-modal-footer .btn {
        width: 50%;
    }
    #wpestate-filter-trigger {
        /*display: none !important;*/
        font-size: 0px !important;
        right: 16px;
        top: auto;
        bottom: -70px;
    }
    #wpestate-filter-trigger svg {
        margin-right: 0px;
    }
     .wpestate_display_item_list_top_bar_wrapper ul::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 80px;
        height: 55px;
        pointer-events: none;
        background: linear-gradient(to right, rgba(255,255,255,0) 0%, #fff 70%, #fff 100%);
        z-index: 99;
        margin-right: 16px;
    }
    .wpestate-modal-header {
        padding: 28px 0px 16px 0px !important;
        margin: 0 20px !important;
    }
    .wpestate-modal-body {
        padding: 32px 20px !important;
        max-height: 57vh !important;
    }
    .wpestate-close {
        right: -5px !important;
        top: -25px !important;
    }
    .price-inputs input {
        width: 30% !important;
    }
    
}

/* jQuery UI Slider Customization */
.ui-slider {
    background: #f1f1f1;
    border: none;
    height: 8px;
    border-radius: 4px;
}

.ui-slider-handle {
    background: #000; /* Black handle as in screenshot */
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
}

.ui-slider-handle:hover {
    background: #333; /* Darker black on hover */
}

.ui-slider-range {
    background: #000; /* Black range as in screenshot */
    border: none;
    border-radius: 4px;
}

/* Hide property types for show more functionality */
.hidden-property-type {
    display: none !important;
}

/* Default state - hide items after 5 */
.features_wrapper .listing_detail:not(.feature_chapter_name):nth-child(n+7),
.feature_block_others .listing_detail:not(.feature_chapter_name):nth-child(n+7),
.amenities-container:not(.expanded) label:nth-child(n+7) {
    display: none;
}

/* Expanded state - show all items */
.features_wrapper.show-all .listing_detail:not(.feature_chapter_name),
.feature_block_others.show-all .listing_detail:not(.feature_chapter_name),
.amenities-container.expanded label {
    display: block !important;
}

/* Toggle button styling */
.toggle-btn,
.show-more-features {
    margin-top: 24px;
    margin-bottom: 32px;
    color: rgba(9, 9, 9, 1);
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 16px;
    background: none;
    width: auto;
    display: flex;
}

.toggle-btn:hover,
.show-more-features:hover {
    text-decoration: none;
}

/* Hide toggle button if not enough items */
.features_wrapper .toggle-btn,
.feature_block_others .toggle-btn,
.amenities-container .toggle-btn {
    display: none;
}
