/* NEW: Side-by-side layout */
.floor-filter-wrapper {
    display: flex;
    gap: 0; /* Remove gap between filter and gallery */
    align-items: stretch; /* Ensure children fill height */
    height: 100vh; /* Use viewport height to fill screen */
    width: 99.2vw; /* Increase width to 100% of the viewport */
}



/* Slider color change logic */
.size-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 70px;
    margin: 0;
    top: 0;
    left: 0;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s ease; /* Add transition for color change */
}

.filtered-gallery {
    flex: 1; /* Allow gallery to take remaining space */
    overflow-y: auto; /* Enable scrolling if gallery content overflows */
}

/* Responsive behavior */
@media (max-width: 768px) {
    .floor-filter-wrapper {
        flex-direction: column;
        width: 100vw;
        height: 100%;
        background: #C6A581;
    }
    .floor-filter-container {
        position: static;
        width: auto;
        max-width: 100vw;
        min-width: 0;
        height: auto;
        background: #C6A581;
        z-index: 1;
        transition: none;
        box-shadow: none;
        margin: -30;
        overflow-x: visible;
        overflow-y: visible;
        display: block;
        border-radius: 0;
    }
    .filter-title {
        font-size: 16px;
        margin-bottom: 4px;
    }
    .filter-options {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 0;
        background: none;
        width: 100%;
    }
    .filter-option {
        flex: 0 0 auto;
        min-width: 60px;
        font-size: 13px;
        justify-content: flex-start;
    }
    .filter-option span {
        font-size: 13px;
        padding-left: 4px;
    }
    .custom-slider-container {
        max-width: 200px;
        margin: 30px 20px 15px 10px;
        height: 28px;
    }
    .size-values {
        margin-left: 0px;
		margin-right: 100px;
    }
    .filtered-gallery {
        width: 100vw;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        background: #fff;
    }
    .filtered-gallery .elementor-gallery {
        display: grid;
        grid-template-columns: 1fr !important; /* Force only one item per row */
        justify-items: center;
        align-items: center;
        margin: 0 auto;
        width: 100vw;
        padding: 0;
    }
    .filtered-gallery .gallery-item {
        margin: 0 auto 10px auto;
        padding: 8px;
        border-width: 1px;
        max-width: 95vw;
        width: 100%;
        box-sizing: border-box;
    }
    .filtered-gallery .gallery-item img {
        margin-bottom: 8px;
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
    }
	html[dir="rtl"] .size-values {
		margin-left:  120px;
		margin-right: 0px;
    }

}

/* NEW: Floor Filter Styles */
.floor-filter-container {
    flex: 0 0 250px; /* Increase fixed width for filter */
    padding-bottom: 100px;
    margin-bottom: 30px;
    background: #8B7355;
    padding: 20px;
    color: white;
}

.filter-section {
    margin-bottom: 20px;
    border: none;
    overflow: hidden;
}

.filter-title {
    background: none;
    cursor: default;
    font-weight: bold;
    font-size: 20px;
    color: white;
}

/* Remove the +/- indicators */
.filter-title:after {
    content: none;
}

.filter-options {
    display: grid; /* Use grid layout */
    /* Apply 2 columns by default */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px; /* Maintain gap between items */
    padding: 10px 10px;
    background: none;
}



.filtered-gallery {
    flex: 1; /* Allow gallery to take remaining space */
    overflow-y: auto; /* Enable scrolling if gallery content overflows */
}


/* Tower styles */
.filter-option[data-filter="tower"] {
    background: transparent; /* Ensure background is transparent */
    border: none; /* Remove border */
    border-radius: 0; /* Remove border radius */
    color: white; /* Ensure text color is white */
    font-size: 16px;
    display: inline-block; /* Ensure text is displayed inline */
    width: auto; /* Remove fixed width */
    height: auto; /* Remove fixed height */
    padding: 0; /* Remove padding */
    font-weight: normal; /* Default font weight */
    cursor: pointer; /* Change cursor to pointer */
}

.filter-option[data-filter="tower"].active {
    color: white; /* Keep text color white */
    font-weight: bold; /* Make text thicker when active */
    background: transparent; /* Ensure background remains transparent */
    border: none; /* Ensure no border is added */
    box-shadow: none; /* Remove any box shadow */
    transform: none; /* Ensure no transform is applied */
}

/* Floor type styles */
.filter-option label {
    border: none;
    padding: 0;
}

.filter-option {
    display: flex;
    align-items: center;
}

.filter-option input[type="checkbox"] {
    margin: 0; /* Remove all space around the checkbox */
    width: 18px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    background: #A68C6A; /* Slightly lighter than #ffffff */
    position: relative;
    cursor: pointer;
    border: 2px solid black; /* Ensure consistent border color */
    border-radius: 3px; /* Optional: add border radius for rounded corners */
    outline: none; /* Remove focus outline */
}


.filter-option span {
    /* margin-right: -10px; */ /* REMOVE this negative margin */
    padding: 0 0 0 8px; /* Add some padding between checkbox and text instead */
    color: white;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if text is too long */
    /* Ensure span can shrink if needed */
    min-width: 0;
    white-space: nowrap; /* Prevent wrapping within the span */
}

.filter-option input[type="checkbox"]:checked::before {
    content: '✔'; /* Check icon */
    color: #ffff; /* Light check icon color */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px; /* Adjust icon size */
}


.filter-option span {
    color: white;
    font-size: 16px;
    border: none;
    gap: 0;
}

/* Remove hover effects */
.filter-option:hover,
.filter-option[data-filter="tower"]:hover,
.filter-option label:hover {
    background: transparent;
    box-shadow: none;
}


/* Remove conflicting styles */
.filter-option span.active,
.filter-option span:hover,
.filter-option.active {
    cursor: pointer; /* Change cursor to pointer to indicate clickability */
}

.filter-option label {
    cursor: pointer; /* Ensure the label is clickable */
}


/* Update gallery grid and image styles */
.filtered-gallery {
    margin-left: 0; /* Remove the gap between filter and gallery if desired, or adjust */
}

.filtered-gallery .elementor-gallery {
    display: grid;
    /* Adjust minmax width as needed for desired column count */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 240px; /* <-- Add this: fixed row height for all items */
    grid-template-rows: unset; /* Remove this if present */
    gap: 0; /* Remove gap, borders will create separation */
    padding: 0;
    border: none; /* Remove container border, items will have borders */
}

.filtered-gallery .gallery-item {
    align-self: stretch; /* Stretch item to fill cell height */
    margin: 0;
    position: relative;
    padding: 15px; /* Add padding inside the cell */
    border-right: 1px solid #333; /* Add vertical border */
    border-bottom: 1px solid #333; /* Add horizontal border */
    border-top: 1px solid #333; /* Add top border to the gallery container */
    /* Remove specific padding-right if it exists */
    /* padding-right: 5px; */ /* Remove this line if present */
    display: flex; /* Use flexbox for layout within the item */
    flex-direction: column; /* Stack image and caption vertically */
	box-sizing: border-box;
}

/* Remove border rules that conflict */
/* .filtered-gallery .gallery-item:last-child {
    border-right: none;
    border: none;
}

.filtered-gallery .gallery-item:empty {
    border-right: none;
    border: none;
} */

/* Remove border from image itself */
/* Consolidated and corrected image styles */
.filtered-gallery .gallery-item img {
    border: none; /* Remove border previously applied directly to image */
    width: 100%; /* Make image fill the item width */
    height: 90%; /* Maintain aspect ratio */
    display: block;
    border-radius: 0; /* Remove border-radius if you want sharp corners */
    margin-bottom: 10px; /* Add space between image and caption */
    cursor: pointer; /* Keep cursor pointer */
    transition: transform 0.3s ease; /* Keep transition */
    object-fit: cover; /* Ensure image covers the area, might crop */
    /* Consider max-height if images become too tall */
    /* max-height: 400px; */
}


/* Ensure caption is positioned correctly below the image */
.filtered-gallery .gallery-caption {
    position: static; /* Ensure caption flows naturally below image */
    background: none;
    color: #333;
    padding: 0; /* Remove extra padding if needed */
    font-size: 14px;
    margin-top: auto; /* Push caption towards the bottom if item height varies */
    display: flex; /* Use flex for title/size layout */
    justify-content: space-between; /* Space out title and size */
    align-items: flex-end; /* Align items at the bottom */
    line-height: 1.4;
}

.filtered-gallery .gallery-caption .title {
    font-weight: bold;
    margin-bottom: 5px;
}

.filtered-gallery .gallery-caption .size {
    color: #666;
}

/* Add modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85); /* Slightly darker for full-page effect */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    width: 100vw;
    height: 100vh;
    padding: 0;
}

.modal-overlay.active {
    display: flex;
}

.modal-content.split-modal {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: fixed; /* Change from relative to fixed */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    padding: 0;
    border-radius: 0;
    box-shadow: none;

}

.modal-image-container {
    flex: 1 1 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf9f6;
    padding: 0;
    height: 100%;
}

.modal-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0;
}

.modal-details {
    flex: 1 1 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 80px;
    background: white;
    height: 100%;
}

.modal-size {
    font-size: 2.2rem;
    color: #A68C6A;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.6rem;
    color: #A68C6A;
    font-weight: 500;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 60px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
	margin-top: 100px;
}

/* Responsive: On small screens, stack vertically */
@media (max-width: 900px) {
    .modal-content.split-modal {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
    }
    .modal-image-container,
    .modal-details {
        width: 100%;
        height: 50%;
        padding: 30px 10vw;
    }
    .modal-details {
        align-items: center;
        padding: 30px 10vw;
    }
}

.filtered-gallery .gallery-item:hover img {
    transform: scale(1.08);
}


.filtered-gallery .gallery-item img:hover {
    transform: scale(1.1); /* Scale image to 110% on hover */
}

/* Responsive adjustments */
@media (max-width: 1600px) {
    .filtered-gallery .elementor-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}



.filtered-gallery .gallery-caption {
    position: static;
    background: none;
    color: #333;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.4;
}

.filtered-gallery .gallery-caption .title {
    font-weight: bold;
    margin-bottom: 5px;
}

.filtered-gallery .gallery-caption .size {
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .filtered-gallery .elementor-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .filtered-gallery .elementor-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}


.loading, .no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Update tower filter option styles */
.filter-option[data-filter="tower"] {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 30px;
    color: rgba(255, 255, 255, 0.534);
    transition: all 0.3s ease;
}


.floor-filter-container .filter-option[data-filter="tower"].active {
    color: rgba(255, 255, 255, 0.979);
}

/* --- ADD/VERIFY NEW Custom Slider Styles --- */
.custom-slider-container {
    position: relative;
    width: 100%;
    max-width: 180px;
    height: 36px;
	margin: 30px 20px 15px 10px;
    /* Remove horizontal padding so track and handles align with container edges */
    padding: 0;
    box-sizing: border-box;
     direction: ltr;
}

.slider-track,
.slider-range {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 2px;
}

.slider-track {
    background-color: #ccc;
    width: 100%;
    z-index: 1;
}

.slider-range {
    background-color: #fff;
    z-index: 2;
}

.slider-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: #fff;
    border: 1px solid #bbb;
    border-radius: 50%;
    top: 50%;
    /* The JS should set left: 0% or left: 100% for min/max */
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 3;
}

/* Style for the text values below the slider */
.size-values {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-weight: bold;
  color: white;
  padding-right: 35px;
  direction: ltr;
}

