/* Page base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #637885;
    color: #eef3f8;
}

.page {
    width: 100%;
    max-width: 1400px;
    padding: 40px 16px 40px 19px;
    margin: 0 auto;
}

/* Filters */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

.filter-button {
    appearance: none;
    border: 1px solid #ddd;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.20));
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    color: #333;
    font-size: 14px;
    font-weight: 400;
    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.filter-button:focus-visible {
    outline: 2px solid #21c9ee;
    outline-offset: 2px;
}

/* Active (non-Available) */
.filters-container .filter-button.active:not(.available),
.filters-container .filter-button[aria-pressed="true"]:not(.available) {
    color: #ffffff;
    background-color: #21c9ee;
    background-image: none;
    border-color: #21c9ee;
}

/* Available (green) */
.filters-container .filter-button.available {
    border-color: rgba(76, 175, 80, 0.65);
    color: #2e7d32;
    background: linear-gradient(180deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.08));
}

.filters-container .filter-button.available.active,
.filters-container .filter-button.available[aria-pressed="true"] {
    background-color: #4CAF50;
    color: #ffffff;
    border-color: #4CAF50;
}



/* Mobile tweaks */
@media (max-width: 600px) {
    .page {
        padding: 80px 16px 24px 16px;
        /* Increased top padding to clear fixed header */
    }

    .filters-container {
        gap: 8px;
    }

    .filter-button {
        padding: 7px 14px;
        font-size: 13px;
    }

    .properties-grid {
        gap: 0 0;
    }

    .property-card {
        padding-bottom: 6px;
    }

    .house-details {
        margin-top: 6px;
    }

    #filters-toggle-wrap {
        display: none !important;
    }

    #filters-panel {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        /* Allow wrapping */
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
        padding-bottom: 8px;
        width: 100%;
    }

    #filters-panel::-webkit-scrollbar {
        display: none;
    }

    #other-filters {
        display: contents !important;
    }

    /* Preserve JS behavior: hide other filters when calendar is open */
    body.calendar-open #other-filters {
        display: none !important;
    }

    #date-filter-tag {
        order: 1;
        flex: 0 0 auto;
    }

    #map-toggle-tag {
        order: 2;
        flex: 0 0 auto;
    }

    #labels-toggle-tag {
        order: 3;
        flex: 0 0 auto;
    }

    #calendar-wrapper {
        order: 4;
        width: 100% !important;
        margin-top: 10px;
        transition: all 0.3s ease;
    }

    /* Modal Calendar on Mobile */
    body.calendar-open #calendar-wrapper {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(1.05);
        /* Slightly less zoom */
        z-index: 30002;
        width: 90% !important;
        max-width: 340px !important;
        background: #fff;
        padding: 10px;
        /* Reduced padding */
        border-radius: 16px;
        box-shadow: none;
        margin: 0 !important;
    }

    /* Ensure inner calendar expands to fill the modal */
    body.calendar-open .flatpickr-calendar {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        /* Remove inner shadow */
        padding: 0 !important;
        /* Remove inner padding */
    }

    body.calendar-open .flatpickr-rContainer,
    body.calendar-open .flatpickr-days,
    body.calendar-open .dayContainer {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }

    /* Make days easier to tap */
    body.calendar-open .flatpickr-day {
        height: 40px;
        line-height: 40px;
        max-width: none;
        /* Let them grow */
    }

    /* Backdrop */
    #calendar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 30001;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    body.calendar-open #calendar-backdrop {
        display: block;
        opacity: 1;
    }

    #labels-container {
        order: 5;
        width: 100% !important;
        margin-top: 12px;
        /* Layout as pills row! */
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Style filters as pills on mobile */
    .filters-container .section-tag {
        flex: 0 0 auto;
        border: 1px solid #e0e0e0;
        background-color: #ffffff;
        border-radius: 999px;
        padding: 8px 16px;
        font-size: 14px;
        box-shadow: none;
        white-space: nowrap;
        height: 40px;
        color: #333;
    }

    .filters-container .section-tag svg {
        width: 18px;
        height: 18px;
        margin-right: 6px;
    }
}

/* Special handling when calendar is open on mobile: Stack vertically */
@media (max-width: 600px) {
    body.calendar-open #filters-panel {
        flex-wrap: wrap;
        /* Allow wrapping when calendar is open */
        overflow-x: visible;
        mask-image: none;
        -webkit-mask-image: none;
    }

    body.calendar-open #date-filter-tag {
        flex: 1 0 100%;
        /* Full width for the active date button */
        justify-content: center;
        background-color: #f0f0f0;
        /* Highlight active state */
        border-color: transparent;
    }
}

/* Tablet / small desktop: keep filters aligned when not in left sidebar */
@media (min-width: 601px) and (max-width: 1199px) {
    #filters-toggle-wrap {
        margin-bottom: 18px !important;
    }

    #filters-panel {
        justify-content: center;
        align-items: center;
        gap: 12px;
        margin-top: 4px;
    }

    #other-filters {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
        width: auto !important;
    }

    #labels-container {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100% !important;
    }

    /* Improve touch comfort on smaller non-mobile screens */
    .filters-container .section-tag {
        min-height: 44px;
        padding: 10px 16px;
    }
}

/* Respect user reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none;
        animation: none !important;
    }
}





/* Results layout: list + optional map (map only on large screens) */
.results-layout {
    display: block;
}

.results-list {
    display: block;
}

.map-panel {
    display: none;
    /* hidden by default; shown at ≥1200px */
    background: #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    height: 60vh;
    position: sticky;
    top: 20px;
}

.map-container {
    width: 100%;
    height: 100%;
}

.map-close-btn {
    display: none;
}

.mapboxgl-ctrl-logo,
.mapboxgl-ctrl-attrib {
    display: none !important;
}

.price-marker {
    background-color: rgba(75, 85, 99, 0.95);
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
}


@media (min-width: 1200px) {
    :root {
        /* Keep map comfortable on smaller desktop widths */
        --desktop-map-col: clamp(360px, 33vw, 520px);
    }

    .results-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 36px;
        align-items: start;
    }

    body.show-map .results-layout {
        grid-template-columns: minmax(0, 1fr) var(--desktop-map-col);
    }

    .results-list {
        margin-top: 0;
        position: sticky;
        top: 70px;
        /* match page padding / map sticky */
        max-height: calc(100vh - 80px - 16px);
        /* keep inside viewport */
        overflow-y: auto;
        overflow-x: hidden;
        /* prevent horizontal scrollbar from pseudo elements */
        overscroll-behavior: contain;
        /* Hide scrollbars but keep scrolling */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge legacy */
    }

    .results-list::-webkit-scrollbar {
        width: 0;
        height: 0;
        background: transparent;
    }

    .map-panel {
        display: none;
        height: calc(100vh - 120px);
        top: 80px;
        /* match .page padding-top to avoid initial jump */
        margin-top: 0;
    }

    body.show-map .map-panel {
        display: block;
    }
}

@media (max-width: 1199px) {
    body.show-map {
        overflow: hidden;
    }

    body.show-map .map-panel {
        display: block;
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        z-index: 40010;
    }

    body.show-map .map-container {
        width: 100%;
        height: 100%;
    }

    body.show-map .map-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.65);
        border-radius: 999px;
        background: rgba(12, 19, 27, 0.7);
        color: #ffffff;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        z-index: 40011;
    }
}

/* Desktop: show filters as left sidebar, vertical stack, always visible */
@media (min-width: 1200px) {
    .page {
        display: grid;
        grid-template-columns: 280px minmax(0, 1.6fr) var(--desktop-map-col);
        column-gap: 24px;
        row-gap: 0;
        align-items: start;
        max-width: 1600px;
        padding-left: 40px;
        padding-right: 80px;
        padding-top: 80px;
        padding-bottom: 0;
        /* move whole layout lower on desktop */
    }

    body.calendar-open .page {
        grid-template-columns: 440px minmax(0, 1.6fr) var(--desktop-map-col);
    }

    #filters-toggle {
        display: none;
    }

    /* hide the toggle wrapper row so column 1 is free for the sidebar */
    #filters-toggle-wrap {
        display: none !important;
    }

    #filters-panel {
        display: flex !important;
        /* override inline display:none */
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        position: sticky;

        top: 200px;
        /* pushed down further per request */
        margin-top: 20vh;
        /* proportional spacing (approx 160px on typical laptop) */
        margin-left: 0;
        /* align flush with left padding of page */
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        /* Take full column width */
        overflow: visible;
        /* Allow calendar to be fully visible */
    }

    .filters-container .filter-button {
        width: auto;
        max-width: 100%;
        align-self: flex-start;
        text-align: left;
    }

    /* Separate groups vertically */


    .results-layout {
        grid-column: 2 / 4;
        /* occupy center + map columns */
        grid-row: 1;
    }
}

/* Properties grid */
.properties-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* single column by default */
    gap: 40px 30px;
    width: 100%;
    margin-top: 36px;
}

.properties-grid>a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.properties-grid>a.property-link {
    text-decoration: none;
    color: inherit;
}

@media (min-width: 900px) {
    .properties-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.property-card {
    background: transparent;
    border: 0;
    position: relative;
    padding-bottom: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Subtle grey grid lines like before */
.property-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(200, 200, 200, 0.35);
}

@media (min-width: 900px) {
    .property-card::before {
        content: '';
        position: absolute;
        top: -20px;
        bottom: -20px;
        right: -15px;
        width: 1px;
        background-color: rgba(200, 200, 200, 0.35);
    }

    /* Remove vertical line from the last column (2-col layout) */
    .properties-grid>a:nth-child(2n)>.property-card::before {
        display: none;
    }
}

.property-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    /* consistent ratio like earlier */
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.property-media::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 55%;
    height: 45%;
    background: radial-gradient(at right bottom, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.18) 45%, rgba(0, 0, 0, 0) 75%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.show-prices .property-media::after {
    opacity: 1;
}

.property-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.price-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #fff;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 13px;
    line-height: 1;
    font-weight: 500;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.show-prices .price-badge {
    opacity: 1;
}

/* Larger screens (laptops and up): make cards smaller and add breathing room */
@media (min-width: 1200px) {
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 48px 36px;
    }

    .property-card {
        padding-bottom: 40px;
    }

    /* In 2-col layout, hide the vertical line on the 2nd column (last in row) */
    .properties-grid>a:nth-child(2n)>.property-card::before {
        display: none;
    }

    /* Remove the 3-col logic */
    .properties-grid>a:nth-child(3n)>.property-card::before {
        display: block;
    }
}

/* When map is visible on large screens, use 2 cols for the list */
@media (min-width: 1200px) {
    body.show-map .results-list .properties-grid {
        grid-template-columns: 1fr;
        gap: 36px 0;
    }

    /* Hide all vertical separators in single column map view */
    body.show-map .results-list .property-card::before {
        display: none !important;
    }
}

.house-details {
    margin-top: 10px;
}

.house-name {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.3;
    margin: 0 0 4px 0;
    padding-left: 6px !important;
    color: #f4f7fb;
    letter-spacing: 1px;
}

.property-card .house-details .house-location,
.property-card .house-details .house-capacity {
    font-size: 13px;
    color: #d8e2ee;
    font-weight: 300;
    margin: 0;
    padding-left: 6px !important;
}

#show-unavailable-btn {
    background: transparent;
    border: 0;
    padding: 0;
    color: #d8e2ee;
    font-size: 13px;
    font-weight: 300;
    text-decoration: none;
}

/* Navigation (Hamburger, Back, Menu) */
.hamburger-menu {
    display: block;
    position: fixed;
    top: 12px;
    right: 18px;
    z-index: 30000;
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #ffffff;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.hamburger-menu.active span {
    background-color: #0d3b66;
}

.back-button {
    position: fixed;
    top: 12px;
    left: 18px;
    z-index: 30000;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
}

.back-button svg {
    width: 32px;
    height: 32px;
}

body.nav-dark .hamburger-menu span {
    background-color: #0d3b66;
}

body.nav-dark .back-button {
    color: #0d3b66;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 33.333vw;
    min-width: 260px;
    max-width: 420px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.97);
    z-index: 20003;
    padding: 84px 24px 44px 28px;
    text-align: left;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    text-decoration: none;
    color: #1f2937;
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 500;
    padding: 14px 8px;
    border-radius: 12px;
    display: block;
    line-height: 1.45;
    letter-spacing: 0.25px;
    min-height: 48px;
    max-width: 360px;
    border-bottom: 1px solid #eef2f6;
}

.mobile-menu a+a {
    margin-top: 4px;
}

.mobile-menu a:hover,
.mobile-menu a:focus {
    color: #0f3b63;
    text-decoration: underline;
}

.mobile-menu a[aria-current="page"],
.mobile-menu a.active {
    color: #0f3b63;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

#menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 20000;
}

body.mobile-menu-open {
    overflow: hidden;
}

.menu-logo {
    display: none;
    position: fixed;
    top: 10px;
    left: 56px;
    z-index: 20004;
}

.menu-logo img {
    display: block;
    height: 17px;
    width: auto;
}



/* Inline calendar container */
#inline-calendar-container {
    width: 100%;
    margin: 0;
    padding: 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        max-height: 400px;
        transform: translateY(0);
    }
}

/* Calendar wrappers */
#calendar-wrapper {
    margin: 0;
    padding: 0;
}

/* Main calendar container */
.flatpickr-calendar {
    font-family: 'Inter', sans-serif !important;
    background: #ffffff;
    border: 0;
    box-shadow: none;
    border-radius: 20px;
    padding: 20px;
    width: 340px !important;
    max-width: 100% !important;
}

.flatpickr-calendar.inline {
    width: 340px !important;
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    /* Subtle border-like shadow */
    border: 1px solid #f0f0f0;
    top: 0;
}

/* Month navigation */
.flatpickr-months {
    padding-bottom: 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flatpickr-month {
    height: auto;
    overflow: visible;
    flex: 1;
}

.flatpickr-current-month {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    /* Softened from #111 */
    padding-top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    left: 0;
    height: auto;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    /* Softened from #111 */
    appearance: none;
    background: transparent;
    border: none;
    margin: 0;
    padding: 0 5px;
}

.flatpickr-current-month .numInputWrapper {
    font-size: 16px;
    font-weight: 600;
    padding: 0 5px;
    display: inline-block !important;
    /* Show year */
}

.flatpickr-current-month input.cur-year {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    /* Softened from #111 */
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

.flatpickr-current-month input.cur-year:focus {
    outline: none;
}

/* Hide spinner buttons on number input */
.flatpickr-current-month input.cur-year::-webkit-inner-spin-button,
.flatpickr-current-month input.cur-year::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 3;
    fill: #555;
    /* Much softer grey */
    transition: background-color 0.2s, fill 0.2s;
    background: transparent;
    cursor: pointer;
}

.flatpickr-prev-month {
    left: 0;
}

.flatpickr-next-month {
    right: 0;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: rgba(0, 0, 0, 0.04);
    fill: #333;
    /* Darker on hover, but not pure black */
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5;
    /* Slightly thicker stroke */
}

/* Weekdays */
.flatpickr-weekdays {
    margin-bottom: 8px;
}

span.flatpickr-weekday {
    color: #888;
    /* Slightly lighter */
    font-weight: 500;
    font-size: 13px;
    text-transform: capitalize;
    /* "Sun" instead of "SUN" if font allows */
}

.flatpickr-days {
    width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    justify-items: center;
    gap: 0 !important;
    /* Remove gap for tighter fit */
    padding: 0 !important;
    margin: 0 !important;
}

/* Day cells */
.flatpickr-day {
    border-radius: 8px;
    /* Slightly tighter radius */
    border: 0;
    font-weight: 400;
    color: #444;
    /* Softened text */
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    height: 40px;
    line-height: 40px;
    width: 40px;
    max-width: 40px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px 0;
    /* Tiny vertical margin */
}

.flatpickr-day:hover {
    background: #f0f0f0;
    color: #222;
}

/* Today */
.flatpickr-day.today {
    border: 0;
    background: #f0f0f0;
    font-weight: 600;
    color: #333;
}

/* Selected / Range */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange {
    background: #4f8fda;
    /* Softer blue accent */
    color: #fff;
    border-color: #4f8fda;
    border-radius: 8px;
    box-shadow: none;
}

/* In Range Middle */
.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange {
    background: #e9f2ff;
    /* Light blue for middle range */
    border-color: transparent;
    box-shadow: -5px 0 0 #e9f2ff, 5px 0 0 #e9f2ff;
    /* Continuous look */
    color: #2f4f7a;
    border-radius: 0;
}

.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),
.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),
.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)) {
    box-shadow: -10px 0 0 #4f8fda;
}

/* Disabled */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #d9d9d9;
    background: transparent;
    cursor: default;
}

/* Mobile responsiveness override */
@media (max-width: 600px) {
    .flatpickr-calendar {
        width: 100% !important;
        padding: 16px;
    }

    .flatpickr-calendar.inline {
        width: 100% !important;
        border: 0;
        box-shadow: none;
    }

    .flatpickr-day {
        height: 40px;
        line-height: 40px;
        width: 100%;
        /* Fill grid cell */
        max-width: none;
    }
}



/* Section Tags (Styled like CCF.html for filter buttons) */
.section-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    padding: 8px 16px;
    color: #eef3f8;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    appearance: none;
    font-weight: normal;
}

.section-tag:hover {
    opacity: 0.7;
    /* transform: translateY(-1px); removed per request */
}

.section-tag svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    opacity: 0.9;
}

/* Active states for each filter type */
.section-tag[data-filter="two"].active {
    color: #ffffff;
    background: rgba(255, 107, 107, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

/* Ultra-wide screens: Fix "edges empty" and "clustered center" */
@media (min-width: 1650px) {
    .page {
        max-width: 95%;
        /* Use more screen width */
        padding-left: 60px;
        padding-right: 60px;
        /* Make map column flexible and wider */
        grid-template-columns: 280px minmax(0, 1.5fr) minmax(0, 1fr);
    }

    body.calendar-open .page {
        grid-template-columns: 440px minmax(0, 1.5fr) minmax(0, 1fr);
    }

    /* 3 columns for properties grid */
    .properties-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 48px 40px;
    }

    /* Adjust vertical separator lines for 3 columns */
    .properties-grid>a:nth-child(2n)>.property-card::before {
        display: block;
        /* Restore line */
    }

    .properties-grid>a:nth-child(3n)>.property-card::before {
        display: none;
        /* Hide at end of row */
    }

    /* Map View Overrides */
    body.show-map .results-layout {
        /* Make map flexible, roughly 40% of the content+map area */
        grid-template-columns: 1.5fr 1fr;
        gap: 40px;
    }

    body.show-map .map-panel {
        /* Ensure map panel fills the height */
        height: calc(100vh - 100px);
    }

    /* Allow 2 columns in the list when map is shown (instead of 1) */
    body.show-map .results-list .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 30px;
    }
}

@media (min-width: 2200px) {

    /* Even wider map column for massive screens */
    .page {
        grid-template-columns: 320px minmax(0, 1.5fr) minmax(0, 1fr);
    }

    body.calendar-open .page {
        grid-template-columns: 440px minmax(0, 1.5fr) minmax(0, 1fr);
    }

    /* 4 columns for extremely wide screens */
    .properties-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Adjust vertical separator lines for 4 columns */
    .properties-grid>a:nth-child(3n)>.property-card::before {
        display: block;
    }

    .properties-grid>a:nth-child(4n)>.property-card::before {
        display: none;
    }

    /* Map View Overrides for Massive Screens */
    body.show-map .results-layout {
        grid-template-columns: 1.4fr 1fr;
        /* Slightly more map space */
    }

    /* Allow 3 columns in the list when map is shown */
    body.show-map .results-list .properties-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}



.section-tag[data-filter="family"].active {
    color: #ffffff;
    background: rgba(76, 175, 80, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

.section-tag[data-filter="large"].active {
    color: #ffffff;
    background: rgba(255, 152, 0, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

.section-tag[data-filter="pool"].active {
    color: #ffffff;
    background: rgba(33, 150, 243, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

.section-tag[data-filter="winter"].active {
    color: #ffffff;
    background: rgba(0, 188, 212, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

/* Ensure focus styles are visible */
.section-tag:focus-visible {
    outline: 2px solid #21c9ee;
    outline-offset: 2px;
}

/* Show unavailable button visibility */
#show-unavailable-container {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 8px;
}

#show-unavailable-container.visible {
    opacity: 1;
    max-height: 100px;
}

#date-filter-tag.active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(76, 175, 80, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

#map-toggle-tag.active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(33, 150, 243, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

#labels-toggle-tag.active {
    color: inherit;
    font-weight: normal;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

#labels-toggle-tag.active:hover {
    opacity: 1;
}

#prices-toggle-tag.active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(156, 39, 176, 0.95);
    border-radius: 999px;
    box-shadow: none;
}

#prices-toggle-tag {
    color: #ffffff;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
}

#prices-toggle-tag svg {
    opacity: 1;
}

/* Hide prices when toggle is inactive */
body:not(.show-prices) .price-badge {
    display: none;
}