/* ============================================================
   LISTINGS PAGE
   Split-screen results + map (Neighbor / Airbnb pattern).
   Compact app-style header (search lives in the site header) +
   thin filter chip bar pinned below it. Cards column flows with
   the page; map is sticky on the right so it stays in view while
   the user scans. Pagination ends the cards column; the marketing
   footer below is reached via normal page scroll.

   Layout offsets:
     --header-h     – published by marketing.css (compact listings ≈ 72px)
     --chips-h      – the thin filter row underneath the header (52px)
     --listings-top – combined offset used by sticky map / split top
   ============================================================ */
.listings-shell {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-top: 1px solid var(--line);
    --chips-h: 56px;
    --listings-top: calc(var(--header-h, 80px) + var(--chips-h));
}

/* ---------- Chips bar ------------------------------------------ */
/* Sticks just below the site header. Holds 4 chip buttons + a
   "More filters" trigger. Inspired by Neighbor's chip row + Airbnb's
   compact toolbar. */
.listings-chips-bar {
    position: sticky;
    top: var(--header-h, 80px);
    z-index: 45;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.listings-form {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Important: don't apply `overflow-x: auto` here — when overflow-x is set,
   browsers compute overflow-y to `auto` too (CSS Overflow spec), which
   would clip the chip popovers that flow downward. Instead we let chips
   wrap on narrow viewports and the bar height grow. */
.listings-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: var(--chips-h);
    padding: 8px 0;
}

/* ---------- Chip ------------------------------------------------ */
.lstr-chip {
    position: relative;
    flex: 0 0 auto;
}

.lstr-chip > summary {
    list-style: none;
    cursor: pointer;
}

.lstr-chip > summary::-webkit-details-marker { display: none; }

.lstr-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: white;
    color: var(--text);
    font: 600 0.85rem/1 var(--font-body, inherit);
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}

.lstr-chip-btn:hover {
    border-color: var(--text);
}

.lstr-chip-btn.is-set {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

.lstr-chip[open] .lstr-chip-btn {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    border-color: var(--text);
}

.lstr-chip-caret {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 140ms ease;
}

.lstr-chip[open] .lstr-chip-caret {
    transform: rotate(180deg);
}

/* Inline × on a chip summary — clears that filter without opening the popover. */
.lstr-chip-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0 -2px 0 2px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    opacity: 0.75;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 120ms ease, opacity 120ms ease;
}

.lstr-chip-clear:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

.lstr-chip-btn.is-set .lstr-chip-clear:hover {
    background: rgba(255, 255, 255, 0.18);
}

.lstr-chip-clear svg {
    width: 12px;
    height: 12px;
    pointer-events: none;
}

.lstr-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: white;
    color: var(--text);
    font: 600 0.85rem/1 var(--font-body, inherit);
    cursor: pointer;
    margin-left: 4px;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
    position: relative;
}

.lstr-more-btn:hover {
    border-color: var(--text);
}

.lstr-more-btn.is-set {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

.lstr-more-btn svg {
    width: 14px;
    height: 14px;
}

.lstr-more-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--brand);
    border: 1.5px solid white;
}

/* ---------- Popover (chip flyout) ------------------------------- */
/* Native <details> drives open/close — JS only adds outside-click
   dismissal. Width adapts to content. */
.lstr-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    z-index: 80;
    min-width: 320px;
    width: max-content;
    max-width: min(360px, calc(100vw - 32px));
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
    padding: 16px;
    display: grid;
    gap: 14px;
}

.lstr-pop fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.lstr-pop legend {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
    padding: 0;
    margin-bottom: 2px;
}

.lstr-pop-types {
    display: grid;
    gap: 4px;
}

.lstr-chip-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
}

.lstr-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--brand);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 2px;
    vertical-align: middle;
}

/* ── Price range slider ──────────────────────────────── */
.price-slider-wrap {
    padding: 4px 0 8px;
}

.price-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font: 700 1rem/1 var(--font-body, inherit);
    color: var(--text);
    margin-bottom: 20px;
}

.price-display-sep {
    color: var(--text-soft);
    font-weight: 400;
}

/* Track wrapper — range inputs sit on top of it absolutely. */
.range-track {
    position: relative;
    height: 4px;
    background: var(--line-strong);
    border-radius: 999px;
    margin: 12px 6px;
}

.range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--brand);
    border-radius: 999px;
    pointer-events: none;
}

.range-input {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    margin: 0;
    padding: 0;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--brand);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    pointer-events: all;
    cursor: pointer;
    transition: border-color 120ms ease, transform 120ms ease;
}

.range-input::-webkit-slider-thumb:hover,
.range-input:focus::-webkit-slider-thumb {
    border-color: var(--brand-deep);
    transform: scale(1.12);
}

.range-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--brand);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    pointer-events: all;
    cursor: pointer;
}

/* ── Size categories (Neighbor pattern) ──────────────── */
.size-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 2px;
}

.size-cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}

.size-cat-item:hover {
    border-color: var(--text-soft);
    background: var(--surface-soft);
}

.size-cat-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.size-cat-text {
    flex: 1;
    min-width: 0;
}

.size-cat-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.size-cat-desc {
    display: block;
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-top: 1px;
}

.size-cat-check {
    width: 18px;
    height: 18px;
    color: var(--brand-deep);
    opacity: 0;
    transition: opacity 120ms ease;
    flex-shrink: 0;
}

.size-cat-item.is-active,
.size-cat-item:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.size-cat-item.is-active .size-cat-label,
.size-cat-item:has(input:checked) .size-cat-label {
    color: var(--brand-deep);
}

.size-cat-item.is-active .size-cat-check,
.size-cat-item:has(input:checked) .size-cat-check {
    opacity: 1;
}

/* ── Features popover (wide — contains amenities grid) ── */
.lstr-pop-features {
    min-width: 360px;
    max-width: min(420px, calc(100vw - 32px));
    gap: 18px;
}

.lstr-pop-features fieldset + fieldset {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.lstr-feature-hint {
    margin: 0 0 10px;
    font-size: 0.76rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--text-soft);
}

.lstr-features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    font: 500 0.82rem/1 var(--font-body, inherit);
    color: var(--text);
    background: white;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
    user-select: none;
}

.feature-chip:hover {
    border-color: var(--text-soft);
}

.feature-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feature-chip:has(input:checked) {
    border-color: var(--brand-deep);
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-weight: 600;
}

/* Right-anchor the last chip whose popover would overflow viewport. */
.lstr-chip[data-chip="features"] .lstr-pop {
    left: auto;
    right: 0;
}

.lstr-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    transition: background 120ms ease;
}

.lstr-radio:hover {
    background: var(--surface-soft);
}

.lstr-radio input {
    accent-color: var(--brand);
    margin: 0;
}

.lstr-radio:has(input:checked) {
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-weight: 600;
}

.lstr-pop-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lstr-pop-pair label {
    display: grid;
    gap: 6px;
}

.lstr-pop-pair label > span {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
}

.lstr-pop-pair input {
    height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
    font: 500 0.95rem/1 var(--font-body, inherit);
    color: var(--text);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.lstr-pop-pair input:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.lstr-pop-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.lstr-pop-clear {
    background: transparent;
    border: 0;
    color: var(--text);
    font: 600 0.85rem/1 var(--font-body, inherit);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px 0;
}

.lstr-pop-apply {
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--text);
    color: white;
    font: 700 0.85rem/1 var(--font-body, inherit);
    cursor: pointer;
    transition: background 140ms ease, transform 140ms ease;
}

.lstr-pop-apply:hover {
    background: var(--brand-deep);
    transform: translateY(-1px);
}

.lstr-pop-apply-only {
    margin-left: auto;
}

/* ---------- Inline sort in results header ------------------- */
.results-sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.results-sort-shell.is-open {
    z-index: 820;
}

.results-sort-prefix {
    font: 500 0.78rem/1 var(--font-body, inherit);
    color: var(--text-soft);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.results-sort-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.results-sort-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 11.5rem;
    max-width: min(20rem, 72vw);
    height: 34px;
    padding: 0 10px 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: white;
    color: var(--text);
    font: 600 0.8rem/1.25 var(--font-body, inherit);
    text-align: left;
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.results-sort-trigger:hover {
    border-color: var(--text-soft);
}

.results-sort-trigger:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.results-sort-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-sort-trigger-chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    transition: transform 160ms ease;
}

.results-sort-shell.is-open .results-sort-trigger-chevron {
    transform: rotate(180deg);
}

.results-sort-menu {
    position: absolute;
    z-index: 800;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 100%;
    width: max-content;
    max-width: min(22rem, 92vw);
    margin: 0;
    padding: 6px;
    list-style: none;
    background: white;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
}

.results-sort-shell.is-open .results-sort-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.results-sort-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: 600 0.8rem/1.3 var(--font-body, inherit);
    text-align: left;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.results-sort-option:hover,
.results-sort-option:focus-visible {
    outline: none;
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand-deep);
}

.results-sort-option.is-selected {
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-deep);
}

/* ---------- Unused dialog styles (kept for future reference) -- */
.lstr-dialog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.lstr-field {
    display: grid;
    gap: 6px;
}

.lstr-field > span {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
}

.lstr-field select,
.lstr-field input[type="date"] {
    height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
    font: 500 0.95rem/1 var(--font-body, inherit);
    color: var(--text);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.lstr-field select:focus,
.lstr-field input:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.lstr-features {
    border: 0;
    margin: 0;
    padding: 0;
}

.lstr-features legend {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    padding: 0;
}

.lstr-features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    background: white;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.feature-chip:hover {
    border-color: var(--brand);
}

.feature-chip input {
    accent-color: var(--brand);
    margin: 0;
}

.feature-chip:has(input:checked) {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-deep);
}

.lstr-dialog-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
}

.lstr-dialog-clear {
    background: transparent;
    border: 0;
    color: var(--text);
    font: 600 0.9rem/1 var(--font-body, inherit);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px 0;
}

.lstr-dialog-apply {
    height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--text);
    color: white;
    font: 700 0.9rem/1 var(--font-body, inherit);
    cursor: pointer;
    transition: background 140ms ease, transform 140ms ease;
}

.lstr-dialog-apply:hover {
    background: var(--brand-deep);
    transform: translateY(-1px);
}

/* ---------- Split layout ------------------------------------ */
/* The cards column drives the height of the split (natural document
   flow); the map column is sticky inside it so it follows the user
   as they scroll cards. When the cards run out (after pagination),
   the page continues into the marketing footer. */
.listings-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
}

.listings-results {
    padding: 24px 24px 60px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.listings-results-head {
    margin-bottom: 12px;
    /* Sit above the card grid so the sort menu (absolute, extends downward)
       is not covered — later siblings paint on top unless we set stacking. */
    position: relative;
    z-index: 30;
}

.listings-results-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* One quiet line: range + total; optional anchor only when user searched a place. */
.listings-results-line {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-soft);
    letter-spacing: 0.02em;
}

.listings-results-line-sep {
    margin: 0 0.35em;
    opacity: 0.65;
}

.listings-results-from {
    color: var(--text);
    font-weight: 600;
}

.listings-empty {
    display: grid;
    place-items: start;
    gap: 8px;
    padding: 28px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: white;
}

.listings-empty strong {
    font-size: 1.05rem;
}

.listings-empty p {
    margin: 0;
    color: var(--text-soft);
}

.button-outline {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    font-weight: 700;
    color: var(--text);
    background: white;
}

.button-outline:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
}

.listings-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    /* Competitor-style list: one item per row. */
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

/* Grid stretches each <li> to the row height; flex makes the card fill
   the cell so pairs in a row share one height (title wrap no longer
   leaves one card visually shorter). */
.listings-cards > li {
    display: flex;
    min-height: 0;
}

/* ---------- Card -------------------------------------------- */
.listing-card {
    /* Two-column row layout: thumbnail + details. */
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    /* Fixed row height so the card matches the thumbnail. */
    grid-template-rows: 156px;
    flex: 1;
    width: 100%;
    min-height: 0;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.listing-media {
    grid-column: 1;
    grid-row: 1;
}

.listing-right {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    height: 156px;
    overflow: hidden;
}

.listing-link {
    flex: 1;
}

.listing-card:hover,
.listing-card:focus-within,
.listing-card.is-active {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
}

.listing-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.listing-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
    border-radius: var(--radius-md);
}

/* ---------- Media + carousel -------------------------------- */
/* Slides stack via absolute positioning and crossfade — keeps things
   GPU-friendly and avoids the layout thrash of horizontal-scroll snap. */
.listing-media {
    position: relative;
    /* Smaller thumbnail for list rows (more room for details). */
    width: 100%;
    height: 156px;
    overflow: hidden;
    background: var(--surface-soft);
    flex-shrink: 0;
}

.listing-slides {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    inset: 0;
}

.listing-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 320ms ease;
    pointer-events: none;
}

.listing-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.listing-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 700ms ease;
}

.listing-card:hover .listing-slide.is-active img {
    transform: scale(1.04);
}

/* Invisible click target sitting above the slides — clicking the photo
   navigates to the listing. Carousel buttons sit above this with a
   higher z-index so they intercept clicks first. */
.listing-media-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.listing-media-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -3px;
    border-radius: var(--radius-md);
}

/* Prev / next buttons — Airbnb pattern: hidden until card hover. */
.listing-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
    z-index: 3;
}

.listing-nav svg {
    width: 14px;
    height: 14px;
}

.listing-nav-prev {
    left: 10px;
}

.listing-nav-next {
    right: 10px;
}

.listing-card:hover .listing-nav:not([hidden]),
.listing-card:focus-within .listing-nav:not([hidden]) {
    opacity: 1;
}

.listing-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.06);
}

.listing-nav:focus-visible {
    opacity: 1;
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.listing-nav[hidden] {
    display: none;
}

/* Pagination dots — Airbnb-style. Sit centered above the price pill. */
.listing-dots {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    z-index: 3;
    pointer-events: auto;
    /* Soft shadow so dots stay legible over busy photos. */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.listing-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.55);
    padding: 0;
    cursor: pointer;
    transition: background 140ms ease, transform 140ms ease;
}

.listing-dot.is-active {
    background: white;
    transform: scale(1.25);
}

.listing-dot:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.listing-avail {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    max-width: calc(100% - 56px);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
    pointer-events: none;
}

.listing-avail--now {
    background: #ecfdf5;
    color: #047857;
}

.listing-avail--date {
    background: #eff6ff;
    color: #1d4ed8;
}

.listing-price {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background: white;
    color: var(--text);
    font-weight: 800;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    z-index: 3;
    pointer-events: none;
}

.listing-price small {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.78rem;
}

.listing-verified {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    background: white;
    color: var(--brand-deep);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    z-index: 3;
    pointer-events: none;
}

.listing-verified svg {
    width: 16px;
    height: 16px;
}

.listing-body {
    display: grid;
    gap: 8px;
    padding: 12px 14px 10px;
}

.listing-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.listing-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    /* Row cards: keep compact (no reserved 2-line height). */
    min-height: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

.listing-distance {
    flex: none;
    font-size: 0.84rem;
    color: var(--text-soft);
    font-weight: 600;
}

.listing-meta {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.listing-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    /* Keep the row height stable: only show one chip row. */
    max-height: 28px;
    overflow: hidden;
}

.listing-features li {
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--brand-soft);
    color: var(--brand-deep);
    padding: 4px 9px;
    border-radius: 999px;
    line-height: 1.4;
}

.listing-nutzungsart,
.listing-zustand {
    margin: 6px 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--brand-deep);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    background: white;
    margin-top: auto;
    flex-shrink: 0;
}

.listing-host {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    min-width: 0;
}

.listing-host > span:nth-of-type(1) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
}

.listing-host img {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    object-fit: cover;
    flex: none;
}

.listing-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--accent-deep);
    font-weight: 700;
    font-size: 0.82rem;
}

.listing-rating svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.listing-cta {
    flex: none;
    background: var(--text);
    color: white;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.84rem;
}

.listing-cta:hover {
    background: var(--brand-deep);
}

/* ---------- Show more (infinite-style append) ----------------- */
.listings-show-more {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.listings-show-more-btn {
    min-width: 200px;
    justify-content: center;
    font-weight: 600;
}

/* ---------- Top progress loader -------------------------------- */
/* Slim indeterminate bar that sits below the chips bar while the
   listings XHR is in flight. Same pattern as Airbnb / GitHub. */
.listings-loader {
    position: sticky;
    top: var(--listings-top);
    z-index: 44;
    width: 100%;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms ease;
}

.listings-loader.is-active {
    opacity: 1;
}

.listings-loader-bar {
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--brand) 40%, var(--brand-deep) 60%, transparent);
    transform: translateX(-100%);
    animation: listings-loader-slide 1.1s ease-in-out infinite;
}

@keyframes listings-loader-slide {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(60%); }
    100% { transform: translateX(260%); }
}

/* When the results column is busy, fade & disable interactions so
   stale cards don't get clicked mid-fetch. */
.listings-results[aria-busy="true"] {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 180ms ease;
}

/* ---------- Map -------------------------------------------- */
/* The wrap is the grid column. The actual map is sticky inside it,
   so it stays in view while the cards column scrolls past, until
   the cards column ends — at which point the map releases and the
   marketing footer scrolls into view. */
.listings-map-wrap {
    position: relative;
    background: var(--surface);
    align-self: stretch;
}

/* Map fits the visible viewport below the header + chips bar (no scroll
   needed to see its bottom edge). 100svh accounts for mobile browser
   chrome that resizes the visual viewport. */
.listings-map {
    position: sticky;
    top: var(--listings-top);
    height: calc(100svh - var(--listings-top));
    width: 100%;
}

.leaflet-container {
    font-family: var(--font-body, inherit);
}

.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.9) !important;
    font-size: 10px;
}

/* Custom price-pill divIcon */
.price-marker-wrap {
    background: transparent;
    border: 0;
}

.price-marker {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: white;
    color: var(--text);
    padding: 6px 12px;
    border-radius: 999px;
    font: 700 0.86rem/1 var(--font-body, inherit);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
    white-space: nowrap;
}

.price-marker:hover,
.price-marker-wrap.is-active .price-marker {
    background: var(--text);
    color: white;
    border-color: var(--text);
    transform: translateY(-2px) scale(1.04);
}

.price-marker:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.price-marker.price-marker--dot {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
}

.price-marker-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* ---------- Mobile filter drawer + bottom sheet (default off) ---- */
/* These elements only appear on small viewports — desktop hides them. */
.filters-backdrop,
.filters-drawer-head,
.listings-sheet-handle,
.listings-view-toggle {
    display: none;
}

/* ---------- Responsive ---------------------------------------- */
@media (max-width: 1100px) {
    .listings-split {
        grid-template-columns: 1fr;
    }
    .listings-results {
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .listings-map {
        position: static;
        height: 60vh;
    }
    /* Keep competitor-style list on tablet too. */
    .listings-cards {
        grid-template-columns: 1fr;
    }
    .lstr-dialog-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Drawer trigger lives in the header only on small viewports; desktop uses
   the sticky chips row — without this rule the button is still in the DOM
   but unstyled and shows as a stray strip to the right of search. */
.filters-toggle {
    display: none;
}

@media (max-width: 820px) {
    /* The chips bar becomes a right offcanvas on mobile. */
    .listings-shell {
        --chips-h: 0px;
    }

    .listings-form {
        padding: 0 16px;
    }
    /* Drawer: kill centering + max-width so the form spans the panel
       (margin:auto on a flex item otherwise shrink-wraps to ~content width). */
    .listings-chips-bar .listings-form,
    .listings-chips-bar #listings-filters.listings-form {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }
    .listings-cards {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Card: photo on top, details below. Allow content to size naturally. */
    .listing-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
    .listing-media {
        grid-column: 1;
        grid-row: 1;
        height: auto;
        aspect-ratio: 5 / 3;
    }
    .listing-right {
        grid-column: 1;
        grid-row: 2;
        height: auto;
        overflow: visible;
        padding: 14px 16px 16px;
        gap: 10px;
    }
    .listing-link { padding: 0; }
    .listing-foot {
        padding-top: 10px;
        margin-top: 4px;
        border-top: 1px solid var(--line);
    }

    .listings-results {
        padding: 18px 16px 90px;
    }
    .lstr-dialog-grid {
        grid-template-columns: 1fr;
    }
    .lstr-pop {
        min-width: min(320px, calc(100vw - 32px));
    }

    /* ============ Filter button (in header next to search) ============ */
    .filters-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        border: 1px solid var(--line-strong);
        border-radius: 12px;
        background: white;
        color: var(--text);
        cursor: pointer;
        margin-left: 8px;
        transition: border-color 140ms ease;
    }
    .filters-toggle:hover { border-color: var(--text); }
    .filters-toggle svg { width: 20px; height: 20px; }

    .filters-toggle-badge {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        box-sizing: border-box;
        border-radius: 999px;
        background: var(--brand-deep, #0f766e);
        color: #fff;
        font-size: 0.62rem;
        font-weight: 800;
        line-height: 17px;
        text-align: center;
        letter-spacing: -0.02em;
        pointer-events: none;
        box-shadow: 0 0 0 1.5px #fff;
    }
    .filters-toggle-badge[hidden] {
        display: none !important;
    }

    .header-search-slot {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    /* One pill: Ort on top, Raumtyp dropdown line below (Neighbor-style column) */
    .header-search-slot .header-search.header-search--split {
        flex: 1 1 auto;
        min-width: 0;
        height: auto;
        min-height: 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        transition: none;
    }

    .header-search-slot .header-search.header-search--split:focus-within {
        border: none;
        box-shadow: none;
    }

    .header-search-slot .header-search--split .header-search-cluster {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: 100%;
        position: relative;
        padding: 8px 12px;
        box-sizing: border-box;
        background: white;
        border: 1px solid var(--line-strong);
        border-radius: 999px;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
        transition: border-color 160ms ease, box-shadow 160ms ease;
    }

    .header-search-slot .header-search.header-search--split:focus-within .header-search-cluster {
        border-color: var(--brand);
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    }

    .header-search-slot .header-search-card--location {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .header-search-slot .header-search-card--location:focus-within {
        border: none;
        box-shadow: none;
    }

    .header-search-slot .header-search-icon {
        display: none;
    }

    .header-search-slot .header-search-stack {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 1px;
        min-width: 0;
        padding: 2px 0;
    }

    .header-search-slot .header-search-card--location .header-search-input {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0;
        border: 0;
        font-size: 0.8125rem;
        line-height: 1.2;
        font-weight: 600;
        color: var(--text);
    }

    .header-search-slot .header-search-type-hint {
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        gap: 3px;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
        font-family: inherit;
        text-align: left;
        max-width: 100%;
        min-width: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .header-search-slot .header-search-type-hint-value {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--brand-deep, #24523e);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }

    .header-search-slot .header-search-type-hint-chevron {
        flex-shrink: 0;
        color: var(--brand-deep, #24523e);
    }

    .header-search-slot .header-search-submit {
        display: none;
    }

    .header-search-slot .filters-toggle {
        margin-left: 0;
        flex-shrink: 0;
    }

    /*
     * Hidden picker keeps listbox + hidden input; panel anchors under the pill.
     */
    .header-search-slot .header-search-card--type {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 0;
        overflow: visible;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        pointer-events: none;
    }

    .header-search-slot .header-search-card--type .search-category-picker {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: auto;
        z-index: 55;
    }

    .header-search-slot .header-search-card--type .search-category-trigger,
    .header-search-slot .header-search-card--type .search-category-clear {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
        pointer-events: none;
    }

    /* ============ Filter drawer (chips bar → right offcanvas) ========== */
    .filters-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 92;
        opacity: 0;
        transition: opacity 220ms ease;
        pointer-events: none;
    }
    .filters-backdrop.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .listings-chips-bar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(380px, 92vw);
        background: white;
        z-index: 93;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        transition: transform 240ms cubic-bezier(.2,.8,.2,1);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 0;
    }

    /** Lateral shadow only when drawer is visible (avoids stray edge artefact off-screen). */
    .listings-chips-bar.is-open {
        transform: translateX(0);
        box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
    }

    .filters-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        border-bottom: 1px solid var(--line);
        flex: 0 0 auto;
    }
    .filters-drawer-title {
        font-weight: 700;
        font-size: 1.02rem;
    }
    .filters-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--text);
        cursor: pointer;
    }
    .filters-drawer-close:hover { background: var(--surface-soft); }
    .filters-drawer-close svg { width: 18px; height: 18px; }

    /* Form fills the rest, scrolls vertically. */
    #listings-filters {
        flex: 1 1 auto;
        align-self: stretch;
        width: 100%;
        overflow-y: auto;
        padding: 0 0 24px;
        max-width: none;
    }

    /* In the drawer: stack chips as full-width accordion rows with a
       divider between them. Each chip's options expand inline below. */
    .listings-chips {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        padding: 0;
        min-height: 0;
    }
    .lstr-chip {
        width: 100%;
        flex: 0 0 auto;
        align-self: stretch;
        border-bottom: 1px solid var(--line);
    }
    .lstr-chip:last-of-type { border-bottom: 0; }

    /* Width only — never display:block here: it wins over .lstr-chip-btn
       (0,1,1 vs 0,1,0) when <details> is closed, so flex/gap never run and
       icons sit flush against the label; [open] had higher specificity so
       open rows looked correct. */
    .lstr-chip > summary {
        width: 100%;
    }

    /* One selector, open + closed: summary.lstr-chip-btn beats .lstr-chip > summary alone. */
    .lstr-chip > summary.lstr-chip-btn {
        display: flex;
        width: 100%;
        height: auto;
        padding: 16px 18px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--text);
        justify-content: flex-start;
        align-items: center;
        font-size: 1rem;
        font-weight: 600;
        box-shadow: none;
        gap: 14px;
    }
    .lstr-chip-btn:hover {
        border-color: transparent;
        background: var(--surface-soft);
    }
    .lstr-chip-btn.is-set {
        background: transparent;
        color: var(--brand-deep);
        border-color: transparent;
    }

    .lstr-chip-icon {
        width: 18px;
        height: 18px;
        opacity: 0.85;
        flex: 0 0 auto;
    }
    .lstr-chip-label {
        flex: 1 1 auto;
        text-align: left;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .lstr-chip-caret {
        width: 16px;
        height: 16px;
        opacity: 0.55;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .lstr-chip-clear {
        margin-left: 0;
        margin-right: 0;
    }

    .lstr-pop {
        position: static;
        min-width: 0;
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 4px 18px 18px;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* ============ Map full-screen + cards as bottom sheet =============== */
    /*
     * Layout strategy: flex column on the app shell so the map area
     * fills EXACTLY whatever height is left after the header, with no
     * `--header-h` arithmetic needed at all.
     *
     *  [site-shell.is-app]  flex column, 100dvh, overflow hidden
     *    [site-header]      flex: 0 0 auto  (any height, always at top)
     *    [main]             flex: 1 1 auto, min-height: 0  (fills the rest)
     *      [listings-shell] flex: 1 1 auto, min-height: 0, flex-column
     *        [listings-split] flex: 1 1 auto, min-height: 0, position: relative
     *          [listings-map-wrap]  position: absolute, inset: 0
     *          [listings-results]   position: absolute, bottom 0 + snap top
     *    [site-footer]      display: none  (hidden on mobile listings)
     */
    /* Footer takes no space — the map owns the full remaining height. */
    .site-shell.is-app .site-footer { display: none; }
    .listings-shell {
        background: transparent;
        border-top: 0;
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        --chips-h: 0px;
    }
    .site-shell.is-app {
        height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .site-shell.is-app .site-header {
        flex: 0 0 auto;
        position: relative;
    }
    .site-shell.is-app > main {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    /* Progress bar pinned to top of the map area (i.e. below the header). */
    .listings-loader {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        z-index: 60;
    }
    /* The split fills main and is the containing block for the map and sheet. */
    .listings-split {
        flex: 1 1 auto;
        min-height: 0;
        display: block;
        position: relative;
        overflow: hidden;
        height: auto;
    }
    .listings-map-wrap {
        position: absolute;
        inset: 0;
        z-index: 1;
        /* Match Leaflet's light tile palette so there's no white flash
           while tiles load or when Leaflet re-measures after init. */
        background: #e8e0d8;
    }
    .listings-map {
        /* Leaflet detects position:static and forces position:relative via
           inline style, which causes the base top:var(--listings-top) to
           kick in and push the map down. Explicitly zero it out here. */
        position: relative;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
    }
    .listings-results {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 50%;
        z-index: 10;
        background: white;
        border: 0;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.16);
        /* Flex column: handle sits outside the scroll area so it is always
           visible regardless of scroll position or iOS sticky quirks. */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
        transition: top 260ms cubic-bezier(.2, .8, .2, 1);
    }
    /* No transition while dragging — sheet follows the pointer 1:1. */
    .listings-split.is-sheet-dragging .listings-results {
        transition: none;
    }
    /* Default / before JS: discrete snap heights. Inline top from JS wins once the sheet is moved. */
    [data-listings-split][data-sheet-state="full"] .listings-results {
        top: 8%;
    }
    [data-listings-split][data-sheet-state="half"] .listings-results {
        top: 50%;
    }
    [data-listings-split][data-sheet-state="peek"] .listings-results {
        top: calc(100% - 96px);
    }

    /* Drag handle pill — non-scrolling flex row at the very top of the sheet. */
    .listings-sheet-handle {
        display: flex;
        flex: 0 0 auto;
        position: static;        /* no sticky needed — it's outside the scroll area */
        height: 26px;
        align-items: center;
        justify-content: center;
        cursor: grab;
        touch-action: none;
        user-select: none;
        background: white;
        border-radius: 18px 18px 0 0;
        /* Extend edge-to-edge to cover the rounded corner gap */
        margin: 0;
        z-index: auto;
    }
    .listings-sheet-handle:active { cursor: grabbing; }
    .listings-sheet-grip {
        display: block;
        width: 44px;
        height: 4px;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.22);
    }

    /* Scrollable content area — fills the remaining height of the sheet. */
    .listings-results-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 16px 100px;
    }

    /* Floating Map / List toggle button — absolute inside the split */
    .listings-view-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        position: absolute;
        left: 50%;
        bottom: 18px;
        transform: translateX(-50%);
        z-index: 20;
        height: 44px;
        padding: 0 18px;
        border-radius: 999px;
        border: 0;
        background: var(--text);
        color: white;
        font-weight: 700;
        font-size: 0.92rem;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
        cursor: pointer;
        white-space: nowrap;
    }
    .listings-view-toggle svg { width: 16px; height: 16px; }
    .listings-view-toggle-map,
    .listings-view-toggle-list {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    /* Default ("half") and "full" states show the "Map" label.
       "peek" state (map dominant) shows the "List" label. */
    [data-listings-split][data-sheet-state="peek"] .listings-view-toggle-map { display: none; }
    [data-listings-split]:not([data-sheet-state="peek"]) .listings-view-toggle-list { display: none; }

    /* Price-marker popup: tuck the sheet away so only the map + preview show */
    [data-listings-split].is-map-popup-open .listings-results {
        top: 100% !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    [data-listings-split].is-map-popup-open .listings-view-toggle {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Hide the show-more border when sheet is short on space. */
    .listings-show-more { margin-top: 24px; padding-top: 16px; }
}

@media (max-width: 480px) {
    .listing-media { aspect-ratio: 16 / 10; }
    .listings-results-head { margin-bottom: 8px; }
    .listings-cards { gap: 12px; }
}

/* ============================================================
   AUTOCOMPLETE DROPDOWN (hero + listings toolbar)
   Grouped suggestions with icons + keyboard navigation.
   ============================================================ */
.autocomplete-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    max-height: 360px;
    overflow-y: auto;
    z-index: 60;
    padding: 8px 0;
}

/* Make sure the parent search container can host the absolute panel */
.search-bar,
.listings-search {
    position: relative;
}

.autocomplete-group + .autocomplete-group {
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 4px;
}

.autocomplete-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    padding: 8px 16px 4px;
}

.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.autocomplete-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text);
    transition: background 120ms ease;
}

.autocomplete-item.is-active,
.autocomplete-item:hover {
    background: var(--brand-soft);
}

.autocomplete-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--brand-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.autocomplete-icon svg {
    width: 16px;
    height: 16px;
}

.autocomplete-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.autocomplete-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-label mark {
    background: transparent;
    color: var(--brand-deep);
    font-weight: 800;
    padding: 0;
}

.autocomplete-sub {
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-top: 1px;
}

.autocomplete-price {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brand-deep);
    background: var(--brand-soft);
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.autocomplete-empty {
    padding: 16px 18px;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ============================================================
   LISTING DETAIL PAGE
   Airbnb-style: gallery mosaic, sticky booking card, location.
   ============================================================ */
.listing-detail {
    background: white;
    padding: 0 0 80px;
    color: var(--text);
}

.listing-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 24px;
    padding-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.listing-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.listing-breadcrumb a:hover {
    color: var(--brand-deep);
}

.listing-breadcrumb svg {
    width: 14px;
    height: 14px;
}

.listing-breadcrumb-sep {
    color: var(--line-strong);
}

.listing-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 18px;
}

.listing-detail-head h1 {
    margin: 0;
    font-size: clamp(1.65rem, 2.4vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.listing-detail-meta {
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.listing-detail-meta .meta-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-weight: 700;
}

.listing-detail-meta .meta-rating svg {
    width: 14px;
    height: 14px;
    fill: #f59e0b;
}

.listing-detail-meta .meta-rating-count {
    font-weight: 500;
    color: var(--text-soft);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.listing-detail-meta .meta-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--brand-deep);
    font-weight: 700;
}

.listing-detail-meta .meta-verified svg {
    width: 14px;
    height: 14px;
}

.listing-trust-badges {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.listing-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--brand-deep) 12%, var(--line));
    background: var(--brand-soft);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    flex: 0 0 auto;
}

.listing-trust-badge svg {
    width: 13px;
    height: 13px;
    color: var(--brand-deep);
    flex-shrink: 0;
}

.listing-detail-actions {
    display: flex;
    gap: 8px;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}

.ghost-button:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
}

.ghost-button svg {
    width: 16px;
    height: 16px;
}

/* --- Gallery mosaic ------------------------------------------ */
.gallery {
    display: grid;
    gap: 8px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--surface-soft);
    margin-top: 8px;
}

.gallery-cell {
    margin: 0;
    overflow: hidden;
    background: var(--surface-soft);
}

.gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 700ms ease;
}

.gallery-cell:hover img {
    transform: scale(1.04);
}

.gallery-thumb {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    cursor: zoom-in;
    border-radius: 0;
    background: transparent;
}

.gallery-thumb:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.gallery-1 {
    grid-template-columns: 1fr;
}

.gallery-2 {
    grid-template-columns: 1fr 1fr;
}

.gallery-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.gallery-3 .gallery-cell:nth-child(1) {
    grid-row: span 2;
}

.gallery-4 {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.gallery-4 .gallery-cell:nth-child(1) {
    grid-row: span 2;
}

/* --- Listing detail grid (gallery + main + booking) ------------ */
.listing-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
    grid-template-areas:
        "gallery gallery"
        "host aside"
        "main aside";
    gap: 32px 64px;
    margin-top: 8px;
    align-items: start;
}

.listing-detail-grid:not(:has(.listing-detail-gallery)) {
    grid-template-areas:
        "host aside"
        "main aside";
}

.listing-detail-gallery {
    grid-area: gallery;
}

.listing-detail-gallery .gallery {
    margin-top: 0;
}

.listing-detail-host {
    grid-area: host;
}

.listing-detail-main {
    grid-area: main;
    min-width: 0;
}

.detail-block {
    padding: 22px 0;
    border-top: 1px solid var(--line);
}

.listing-detail-host.detail-block {
    padding-top: 0;
    padding-bottom: 4px;
    border-top: 0;
}

.detail-block h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.detail-block p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
    font-size: 1rem;
}

.detail-nutzungsart {
    padding-top: 0;
}

.detail-nutzungsart-text {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(45, 106, 79, 0.08);
    border: 1px solid rgba(45, 106, 79, 0.14);
    color: var(--brand-deep);
    font-weight: 600;
    line-height: 1.5;
}

.detail-specs {
    display: grid;
    gap: 0;
}

.detail-spec-group h2 {
    margin-bottom: 8px;
}

.detail-spec-group--split {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.detail-zustand-value {
    display: inline-block;
    margin: 0;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.94rem;
    line-height: 1.35;
}

/* host strip */
.detail-host {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "info avatar"
        "badges badges";
    column-gap: 24px;
    row-gap: 6px;
    align-items: start;
}

.detail-host-info {
    grid-area: info;
    min-width: 0;
}

.detail-host-info h2 {
    margin-bottom: 4px;
}

.detail-host-info p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.detail-host-avatar {
    grid-area: avatar;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.detail-host .listing-trust-badges {
    grid-area: badges;
    margin: 0;
}

/* features list */
.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.feature-list li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.feature-list svg {
    width: 18px;
    height: 18px;
    color: var(--brand-deep);
    flex: none;
}

/* access table */
.access-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.access-table th,
.access-table td {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.95rem;
}

.access-table th {
    color: var(--text);
    font-weight: 600;
    width: 38%;
}

.access-table td {
    color: var(--text-soft);
}

.access-table tr + tr th,
.access-table tr + tr td {
    border-top: 1px solid var(--line);
}

/* location */
.detail-location-meta {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.detail-map {
    width: 100%;
    height: 360px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    margin-top: 4px;
}

/* Listing detail map: single location pin (no price pill / radius circle) */
.detail-map-pin {
    background: transparent !important;
    border: none !important;
}

.detail-map-pin .detail-map-pin-inner {
    display: block;
    color: var(--brand-deep);
    filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.35));
}

.detail-map-pin .detail-map-pin-inner svg {
    display: block;
    vertical-align: top;
}

.detail-location-note {
    margin-top: 12px;
    font-size: 0.88rem;
    color: var(--text-soft);
}

/* rules */
.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.rules-grid strong {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

.rules-grid p {
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* --- Sticky booking card ------------------------------------- */
.listing-detail-aside {
    grid-area: aside;
    position: sticky;
    top: 96px;
    align-self: start;
}

.booking-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.booking-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-bottom: 6px;
}

.booking-price-num {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

.booking-price-unit {
    color: var(--text-soft);
    font-weight: 600;
}

.booking-price-month {
    width: 100%;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.booking-discount-note {
    margin: 6px 0 14px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
    font-size: 0.88rem;
    color: var(--brand-deep);
    font-weight: 600;
}

.booking-form {
    display: grid;
    gap: 14px;
}

.booking-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.booking-dates label {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: 0.04em;
}

.booking-dates label + label {
    border-left: 1px solid var(--line);
}

.booking-dates input {
    border: 0;
    background: transparent;
    padding: 4px 0 0;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
}

.booking-dates input:focus {
    outline: 0;
}

.booking-submit {
    background: var(--brand-deep);
    color: white;
    border: 0;
    padding: 13px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease;
}

.booking-submit:hover {
    background: var(--brand);
    transform: translateY(-1px);
}

.booking-meta {
    margin: 0;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.booking-breakdown {
    margin: 16px 0 0;
    display: grid;
    gap: 10px;
    font-size: 0.92rem;
}

.booking-breakdown div {
    display: flex;
    justify-content: space-between;
    color: var(--text-soft);
}

.booking-breakdown dt {
    margin: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--line-strong);
}

.booking-breakdown dd {
    margin: 0;
    color: var(--text);
    font-weight: 600;
}

.booking-total {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.booking-total dt,
.booking-total dd {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
}

.booking-aside-note {
    text-align: center;
    margin-top: 18px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.booking-aside-note a {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-right: 4px;
}

.booking-message-host {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--brand-deep);
    border: 1.5px solid var(--line-strong);
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease;
}

.booking-message-host:hover {
    background: var(--surface-soft);
    border-color: var(--brand-deep);
}

.booking-aside-note-hint {
    margin: 10px 0 0;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.bk-enquiry-dialog {
    border: 0;
    border-radius: 20px;
    padding: 0;
    max-width: 22rem;
    width: calc(100% - 2rem);
    box-shadow: 0 24px 48px rgba(20, 32, 28, 0.18);
}

.bk-enquiry-dialog::backdrop {
    background: rgba(20, 32, 28, 0.45);
}

.bk-enquiry-dialog-inner {
    padding: 1.25rem 1.25rem 1.1rem;
}

.bk-enquiry-dialog-title {
    margin: 0 0 0.85rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.bk-enquiry-host-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.75rem;
    border-radius: 14px;
    background: var(--surface-soft, #fbf8f2);
}

.bk-enquiry-host-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
}

.bk-enquiry-host-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-deep);
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.bk-enquiry-host-name {
    margin: 0;
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}

.bk-enquiry-host-meta {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: var(--text-soft);
}

.bk-enquiry-dialog-body {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-soft);
}

.bk-enquiry-dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bk-enquiry-confirm-btn {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 1rem;
    background: var(--brand-deep);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.bk-enquiry-cancel-btn {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-weight: 600;
    padding: 0.45rem;
    cursor: pointer;
}

/* --- Similar carousel ---------------------------------------- */
.detail-similar {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.detail-similar-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 18px;
}

.detail-similar-head h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.ghost-link {
    color: var(--brand-deep);
    font-weight: 700;
    text-decoration: none;
}

.ghost-link:hover {
    text-decoration: underline;
}

.similar-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.similar-card {
    display: block;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.similar-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
}

.similar-media {
    aspect-ratio: 5 / 4;
    overflow: hidden;
    background: var(--surface-soft);
}

.similar-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-body {
    padding: 12px 14px 14px;
    display: grid;
    gap: 4px;
}

.similar-body strong {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.similar-body span {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.similar-price {
    color: var(--text) !important;
    font-weight: 700;
    margin-top: 4px;
}

.similar-price small {
    color: var(--text-soft);
    font-weight: 500;
    margin-left: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   LISTINGS MAP — Marker preview popup (Airbnb mini-card)
   Override Leaflet's default popup chrome and style the inner card.
   ============================================================ */
.listings-popup .leaflet-popup-content-wrapper {
    padding: 0;
    background: transparent;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    /* Leaflet inserts the close control *before* this node; without an
       explicit stack, the wrapper paints on top and hides the ×. */
    position: relative;
    z-index: 0;
}

.listings-popup .leaflet-popup-content {
    margin: 0;
    width: 320px !important;
    line-height: 1.35;
}

.listings-popup .leaflet-popup-tip {
    background: white;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

/* We render the preview as a floating card — no tooltip arrow. */
.listings-popup.leaflet-popup {
    margin-bottom: 0;
}

.listings-popup .leaflet-popup-tip-container,
.listings-popup .leaflet-popup-tip {
    display: none;
}

/* Mobile map preview: bottom-docked, wide card (Airbnb-style). Position from JS. */
@media (max-width: 820px) {
    .listings-popup .leaflet-popup-content {
        width: min(560px, calc(100vw - 20px)) !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .listings-popup .leaflet-popup-content-wrapper {
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.2);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .listings-popup.leaflet-popup .leaflet-popup-close-button {
        top: 12px;
        right: 12px;
    }

    .popup-card {
        border-radius: 20px 20px 0 0;
    }

    .popup-media {
        aspect-ratio: 16 / 10;
    }
}

/* Light grey pill + dark ×: reads on dark listing photos; high z-index
   so it stays above the full-bleed card (Leaflet paints wrapper after the
   close link in DOM order). × glyph: tight line-height + flex for centering. */
.listings-popup.leaflet-popup .leaflet-popup-close-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    top: 8px;
    right: 8px;
    padding: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 0 !important;
    text-align: center;
    text-indent: 0;
    text-decoration: none !important;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #0f172a !important;
    background: rgba(241, 245, 249, 0.98) !important;
    border: 1px solid rgba(15, 23, 42, 0.14) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.65) inset,
        0 2px 10px rgba(15, 23, 42, 0.18);
    z-index: 10000 !important;
    position: absolute !important;
    transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.listings-popup.leaflet-popup .leaflet-popup-close-button:hover {
    background: #e2e8f0 !important;
    color: #020617 !important;
    transform: scale(1.03);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 3px 12px rgba(15, 23, 42, 0.22);
}

.popup-card {
    display: block;
    background: white;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    border-radius: 18px;
}

.popup-card:hover .popup-cta {
    color: var(--brand);
}

.popup-card:hover .popup-media .listing-slide.is-active img,
.popup-card:hover .popup-media > img {
    transform: scale(1.04);
}

/* The popup's media wrapper inherits all listing-media + carousel styles,
   plus a bigger 4:3 aspect that better fits the wider 320px popup. */
.popup-media {
    aspect-ratio: 4 / 3;
}

.popup-media > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}

.popup-media-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--brand-soft), var(--surface-soft));
}

/* Always show the prev/next arrows on the popup carousel (the popup is
   already a hover/focus context, hiding them adds friction). */
.popup-card .listing-nav:not([hidden]) {
    opacity: 1;
}

.popup-card .listing-nav {
    width: 28px;
    height: 28px;
}

.popup-card .listing-nav svg {
    width: 13px;
    height: 13px;
}

.popup-price {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background: white;
    color: var(--text);
    font-weight: 800;
    font-size: 0.95rem;
    padding: 5px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

.popup-price small {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.74rem;
}

.popup-price.popup-price-muted {
    font-weight: 700;
    font-size: 0.82rem;
}

.popup-body-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.popup-body {
    padding: 12px 14px 14px;
    display: grid;
    gap: 6px;
}

.popup-body strong {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.popup-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.popup-nutzungsart {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--brand-deep);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--text);
    font-weight: 700;
}

.popup-rating svg {
    width: 12px;
    height: 12px;
    fill: #f59e0b;
}

.popup-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-deep);
    transition: color 140ms ease;
}

.popup-cta svg {
    width: 14px;
    height: 14px;
}

/* When a popup is open the underlying marker pulses with the active style. */
.leaflet-marker-icon .price-marker:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* --- Responsive ---------------------------------------------- */
@media (max-width: 1100px) {
    .listing-detail-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "gallery"
            "host"
            "aside"
            "main";
        gap: 12px;
        margin-top: 4px;
    }

    .listing-detail-grid:not(:has(.listing-detail-gallery)) {
        grid-template-areas:
            "host"
            "aside"
            "main";
    }

    .listing-detail-aside {
        position: static;
        margin-top: 0;
    }

    .booking-card {
        max-width: none;
    }

    .listing-detail-host.detail-block {
        padding-bottom: 0;
    }

    .detail-block {
        padding: 14px 0;
    }

    .detail-block h2 {
        margin-bottom: 6px;
        font-size: 1.15rem;
    }

    .detail-spec-group--split {
        margin-top: 12px;
        padding-top: 12px;
    }

    .feature-list {
        gap: 8px 16px;
    }

    .detail-host-info h2 {
        font-size: 1.15rem;
    }

    .similar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .rules-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .listing-detail-head {
        padding-bottom: 12px;
    }

    .listing-detail-head h1 {
        font-size: 1.5rem;
    }
    .gallery {
        aspect-ratio: 4 / 3;
    }
    .gallery-3,
    .gallery-4 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
    .gallery-3 .gallery-cell:nth-child(1),
    .gallery-4 .gallery-cell:nth-child(1) {
        grid-row: span 1;
        grid-column: span 2;
    }
    .feature-list {
        grid-template-columns: 1fr;
    }
    .rules-grid {
        grid-template-columns: 1fr;
    }
    .detail-map {
        height: 260px;
    }
    .similar-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Listing detail: full-screen photo lightbox (Airbnb-style) --------- */
.listing-photo-lightbox[hidden] {
    display: none !important;
}

.listing-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    display: flex;
    flex-direction: column;
    outline: none;
}

.listing-photo-lightbox-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.listing-photo-lightbox-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px 16px calc(14px + env(safe-area-inset-top, 0px));
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.listing-photo-lightbox-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    padding: 8px 10px;
    margin: -8px -10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.listing-photo-lightbox-close svg {
    width: 18px;
    height: 18px;
}

.listing-photo-lightbox-close:hover {
    opacity: 0.88;
}

.listing-photo-lightbox-counter {
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.listing-photo-lightbox-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.listing-photo-lightbox-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.listing-photo-lightbox-icon-btn svg {
    width: 22px;
    height: 22px;
}

.listing-photo-lightbox-icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.listing-photo-lightbox-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.listing-photo-lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 12px calc(16px + env(safe-area-inset-bottom, 0px));
    position: relative;
}

.listing-photo-lightbox-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
}

.listing-photo-lightbox-img {
    max-width: 100%;
    max-height: min(88vh, calc(100dvh - 130px));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.listing-photo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.listing-photo-lightbox-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
}

.listing-photo-lightbox-nav:disabled {
    opacity: 0.22;
    cursor: default;
}

.listing-photo-lightbox-nav svg {
    width: 22px;
    height: 22px;
}

.listing-photo-lightbox-prev {
    left: 12px;
}

.listing-photo-lightbox-next {
    right: 12px;
}

@media (max-width: 760px) {
    .listing-photo-lightbox-prev {
        left: 6px;
    }

    .listing-photo-lightbox-next {
        right: 6px;
    }

    .listing-photo-lightbox-main {
        padding-left: 6px;
        padding-right: 6px;
    }
}
