/* Airbnb-Style Filter - Complete Implementation */
:root {
    --primary: #ff385c;
    --brand-color: #d4af37;
    --brand-dark: #b89628;
    --text-main: #222222;
    --text-light: #717171;
    --bg-light: #f7f7f7;
    --border-color: #dddddd;
}

.shortlets-search-section {
    position: relative;
    z-index: 100;
    margin-top: -40px;
    padding-bottom: 20px;
    font-family: 'Circular', -apple-system, BlinkMacSystemFont, Roboto, Helvetica Neue, sans-serif;
}

.filter-wrapper {
    background: #ffffff;
    border-radius: 32px;
    display: flex;
    align-items: center;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
    max-width: 850px;
    margin: 0 auto;
    border: 1px solid #e1e1e1;
    position: relative;
    height: 66px;
}

/* Filter Segments */
.filter-segment {
    flex: 1;
    position: relative;
    height: 100%;
    cursor: pointer;
    border-radius: 32px;
    transition: background 0.2s;
}

.filter-segment:hover {
    background: #ebebeb;
    z-index: 1;
}

.filter-segment.active {
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.segment-content {
    padding: 14px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.segment-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-main);
    margin-bottom: 2px;
}

.segment-input {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    background: transparent;
    width: 100%;
    padding: 0;
    font-weight: 400;
}

.segment-input::placeholder {
    color: var(--text-light);
}

.segment-input:focus {
    outline: none;
}

/* Divider */
.divider {
    width: 1px;
    height: 32px;
    background-color: var(--border-color);
    flex: 0 0 1px;
}

/* Hide divider when adjacent is hovered/active */
.filter-segment:hover+.divider,
.filter-segment.active+.divider,
.divider.hidden {
    opacity: 0;
}

/* Search Button */
.search-btn-container {
    padding: 0 9px;
    flex: 0 0 auto;
}

.search-circle-btn {
    background: var(--brand-color);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.search-circle-btn:hover {
    background: var(--brand-dark);
    transform: scale(1.05);
}

.search-circle-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 3;
}

.search-text-expanded {
    display: none;
    margin-left: 8px;
    font-weight: 600;
    font-size: 16px;
}

/* POPUPS (Common) */
.popup-box {
    position: absolute;
    top: 75px;
    background: white;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 30px;
    display: none;
    z-index: 200;
    border: 1px solid #f0f0f0;
    animation: fadeIn 0.15s ease-out;
    cursor: default;
}

.popup-box.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* WHERE Popup (Suggestions) */
.where-popup {
    left: 0;
    width: 350px;
    padding: 24px 0;
}

.location-option {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background 0.1s;
}

.location-option:hover {
    background: #f7f7f7;
}

.loc-icon {
    background: #f1f1f1;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

/* WHEN Popup (Calendar) */
.when-popup {
    left: 50%;
    transform: translateX(-50%);
    width: 660px;
    /* Two months width approx */
    padding: 30px;
}

.conf-tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 20px;
    background: #ebebeb;
    padding: 4px;
    border-radius: 100px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.conf-tab {
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-main);
}

.conf-tab.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-wrapper {
    display: flex;
    gap: 40px;
}

.calendar-month {
    flex: 1;
}

.month-header {
    text-align: center;
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    color: var(--text-main);
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.day-name {
    font-size: 12px;
    color: #717171;
    margin-bottom: 8px;
    font-weight: 600;
}

.day-btn {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.1s;
    color: var(--text-main);
    border: 1px solid transparent;
}

.day-btn:hover {
    border-color: var(--text-main);
}

.day-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}

.day-btn.selected {
    background: var(--text-main);
    color: white;
}

.day-btn.in-range {
    background: #f7f7f7;
    border-radius: 0;
}

/* Round edges for range start/end */
.day-btn.selected.range-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.day-btn.selected.range-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.flexibility-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    border-top: 1px solid #ebebeb;
    padding-top: 20px;
}

.flex-pill {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-main);
}

.flex-pill.selected {
    border-color: var(--text-main);
    background: #f7f7f7;
    font-weight: 700;
    border-width: 2px;
    padding: 7px 15px;
    /* Adjust for border width */
}

/* WHO Popup */
.who-popup {
    right: 0;
    width: 350px;
}

.guest-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #ebebeb;
}

.guest-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.guest-row:first-child {
    padding-top: 0;
}

.counter-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #b0b0b0;
    background: white;
    color: #717171;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.qty-btn:hover:not(:disabled) {
    border-color: var(--text-main);
    color: var(--text-main);
}

.qty-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    border-color: #eee;
}

@media (max-width: 768px) {
    .shortlets-search-section {
        padding: 15px;
        background: #fff;
        margin-top: 0;
    }

    .filter-wrapper {
        flex-direction: column;
        height: auto;
        border: none;
        box-shadow: none;
        background: transparent;
        gap: 12px;
        border-radius: 0;
    }

    .filter-segment {
        width: 100%;
        background: #f7f7f7;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        height: 66px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .divider {
        display: none;
    }

    .search-btn-container {
        width: 100%;
        margin-top: 10px;
        padding: 0;
    }

    .search-circle-btn {
        width: 100%;
        border-radius: 8px;
        height: 48px;
    }

    .search-text-expanded {
        display: inline-block;
        color: white;
    }

    .popup-box {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
        transform: none;
        z-index: 9999;
        overflow-y: auto;
        padding: 20px;
        padding-top: 60px;
        /* Space for close button if we added one */
    }

    .when-popup {
        width: 100%;
        left: 0;
        transform: none;
    }

    .calendar-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .shortlets-search-bar {
        display: none;
    }

    /* Hide old if accidentally left */
}