/* ==========================================================================
   m45_objekte_listing — Immobilien-Übersichtsseite
   Hero wird von m33_page_hero.css gehandled.
   Figma: node 54:7 (Aktuelle Immobilien, 1920px Referenz)
   ========================================================================== */

/* --------------------------------------------------------------------------
   FILTER-BAR
   -------------------------------------------------------------------------- */
.m45_filter_wrap {
    margin-top: clamp(-60px, -5vw, -80px);  /* Filterbar überlappt den Hero V-Cut */
    position: relative; z-index: 10;
    padding-bottom: 48px;
}
.m45_filter_box {
    background: #fff;
    /* Figma: top 68px, bottom 74px, horizontal 125px (scaled) */
    padding: clamp(40px, 4.7vw, 68px) clamp(24px, 8.7vw, 125px) clamp(40px, 5.1vw, 74px);
}
@media (max-width: 1400px) {
    .m45_filter_box {
        padding-left: clamp(20px, 4vw, 60px);
        padding-right: clamp(20px, 4vw, 60px);
    }
}

/* Meta-Zeile */
.m45_filter_meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 30px;
    gap: 8px 16px;
}
.m45_filter_meta_label {
    color: var(--hs-text);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0.03em;
}
.m45_filter_meta_count {
    color: var(--hs-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Tabs — Figma: zwei Trennlinien (oben + unten), Tabs zentriert */
.m45_tabs {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0;
    border-top: 1px solid #E1E2E3;
    border-bottom: 1px solid #E1E2E3;
    padding: 37px 0 33px;
    margin-bottom: 37px;
}
.m45_tab {
    position: relative;
    padding: 0;
    margin-right: clamp(24px, 3vw, 50px);
    color: var(--hs-text);
    font-size: clamp(13px, 1.8vw, 16px);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s;
}
.m45_tab:last-child { margin-right: 0; }
.m45_tab:hover { color: var(--hs-gold); }
.m45_tab--active { color: var(--hs-text); }
.m45_tab--active::after {
    content: '';
    position: absolute;
    bottom: -33px; left: 0;
    width: 100%; height: 4px;
    background: var(--hs-gold);
}
/* Schmale Screens: Tabs vertikal stapeln, Strich direkt unter den aktiven Tab */
@media (max-width: 460px) {
    .m45_tabs {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 22px 0 18px;
        margin-bottom: 28px;
        gap: 18px;
    }
    .m45_tab {
        margin-right: 0;
        padding-bottom: 8px;
        font-size: 13px;
    }
    .m45_tab--active::after {
        bottom: 0;
        height: 3px;
    }
}

/* Dropdowns
   Desktop  (>1100px):  4 Spalten + Button-Spalte in einer Zeile
   Tablet   (601–1100): 2x2 Grid, Button rechts in Zeile 2
   Mobile   (≤600px):   1 Spalte gestapelt, Button rechts ausgerichtet
*/
.m45_dropdowns {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 57px;
    gap: clamp(12px, 2.6vw, 40px);
    align-items: end;
}
@media (max-width: 1100px) {
    .m45_dropdowns {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 20px;
    }
    .m45_drop_submit {
        grid-column: 2;
        justify-self: end;
        width: 57px;
    }
}
@media (max-width: 600px) {
    .m45_dropdowns {
        grid-template-columns: 1fr;
        row-gap: 16px;
    }
    .m45_drop_submit {
        grid-column: 1;
        justify-self: end;
        width: 57px;
    }
}

.m45_drop_wrap {
    display: flex; flex-direction: column; gap: 15px;
}
.m45_drop_label {
    color: rgba(47,58,70,0.50);
    font-size: 14.5px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.083em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Native select ausblenden – mM_select.js ersetzt es durch eigene DIV-Struktur */
.m45_drop_wrap select.m45_drop_select {
    display: none !important;
}

/* Position-Kontext damit das Dropdown absolut positioniert werden kann */
.m45_drop_wrap.mM_custom_select {
    position: relative;
}

/* mM_select: sichtbarer Trigger (".mM_select_selected") */
.m45_drop_wrap .mM_select_selected {
    position: relative;
    height: 57px;
    display: flex;
    align-items: center;
    padding: 0 44px 0 28px;
    background: rgba(250,250,250,0.5);
    border: 1px solid #D1D5D7;
    color: var(--hs-dark);
    font-size: 16px;
    font-weight: 300;
    font-family: inherit;
    letter-spacing: 0.0625em;
    cursor: pointer;
    user-select: none;
    box-shadow: none;
    border-radius: 0;
    transition: border-color 0.2s;
    /* Langer Label-Text soll nicht umbrechen */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m45_drop_wrap .mM_select_selected:hover { border-color: #aab0b5; }

/* mM_select: Pfeil-Container */
.m45_drop_wrap .mM_select_arrows {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    width: auto;
    height: auto;
    border: none;
    background: none;
    padding: 0;
}
.m45_drop_wrap .mM_select_arrow_down {
    width: 11px;
    height: 7px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none'%3E%3Cpath d='M1 1L5.5 6L10 1' stroke='%232F3A46' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        center / contain no-repeat;
    transition: transform 0.25s ease;
}
.m45_drop_wrap .mM_select_selected.mM_select_arrow_active .mM_select_arrow_down {
    transform: rotate(180deg);
}

/* mM_select: Dropdown-Liste */
.m45_drop_wrap .mM_select_items {
    position: absolute;
    top: 100%; left: -1px; right: -1px;
    z-index: 200;
    background: #fff;
    border: 1px solid transparent;
    border-top: none;
    /* mM_select.js setzt max-height/height inline — !important nötig */
    max-height: 280px !important;
    overflow-y: auto !important;
    transition: border-color 0.2s;
}
.m45_drop_wrap .mM_select_items.mM_select_hide {
    height: 0 !important;
    overflow: hidden !important;
}
.m45_drop_wrap .mM_select_items:not(.mM_select_hide) {
    border-color: #D1D5D7;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* mM_select: Einzelne Einträge */
.m45_drop_wrap .mM_select_item {
    padding: 11px 18px;
    color: var(--hs-dark);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: 0.0625em;
    cursor: pointer;
    transition: background 0.15s;
    margin: 0;
}
.m45_drop_wrap .mM_select_item:hover { background: #F7F7F7; }
.m45_drop_wrap .mM_select_item.mM_same_as_selected { color: var(--hs-gold); }

.m45_drop_submit {
    width: 57px; height: 57px;
    background: var(--hs-gold);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    align-self: end;
    transition: background 0.2s;
}
.m45_drop_submit:hover { background: var(--hs-gold-dark, #8d7440); }
.m45_drop_submit svg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   OBJEKTE-GRID
   -------------------------------------------------------------------------- */
.m45_listing_wrap { padding-bottom: 64px; }

.m45_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}
@media (max-width: 1024px) {
    .m45_grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 600px) {
    .m45_grid { grid-template-columns: 1fr; gap: 20px; }
}

/* --------------------------------------------------------------------------
   KARTE
   -------------------------------------------------------------------------- */
.m45_card {
    background: #fff;
    display: flex; flex-direction: column;
}
.m45_card_link {
    display: flex; flex-direction: column; flex: 1;
    text-decoration: none; color: inherit;
}
.m45_card_link:hover .m45_card_img { transform: scale(1.03); }

.m45_card_media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 463 / 247.5;
    flex-shrink: 0;
    background: #e1e2e3;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), 0 100%);
}
.m45_card_img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
/* Gradient-Overlay oben (für Verkauf-Badge) */
.m45_card_media::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(47,58,70,0.70) 0%, rgba(47,58,70,0) 50%);
    pointer-events: none;
}

.m45_card_badge {
    position: absolute;
    top: 26px; right: 25px;
    z-index: 2;
    height: 40px;
    padding: 0 18px;
    display: flex; align-items: center;
    background: rgba(255,255,255,0.30);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #fff;
    font-size: 16px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    line-height: 1;
}

.m45_card_body {
    padding: clamp(20px, 3.4vw, 50px) clamp(20px, 3.4vw, 50px) clamp(24px, 3vw, 40px);
    display: flex; flex-direction: column; flex: 1;
    gap: 0;
}

.m45_card_location {
    display: flex; align-items: center; gap: 12px;
    color: var(--hs-gold);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    line-height: 1;
    margin: 0 0 17px;
}
.m45_card_location_mark {
    display: inline-block;
    width: 30px; height: 2px;
    background: var(--hs-gold);
    flex-shrink: 0;
}

.m45_card_title {
    font-family: var(--hs-font-display);
    font-size: clamp(18px, 1.5vw, 22px);
    font-weight: 400;
    line-height: 1.23;
    letter-spacing: 0.03em;
    color: var(--hs-dark);
    margin: 0 0 28px;
}

.m45_card_meta {
    display: flex;
    border-top: 1px solid #E1E2E3;
    border-bottom: 1px solid #E1E2E3;
    margin-top: auto;
    margin-bottom: 25px;
    gap: 0;
}
.m45_card_meta_item {
    flex: 1;
    display: flex; flex-direction: column; gap: 8px;
    padding: 23px 0 19px;
}
.m45_card_meta_item + .m45_card_meta_item {
    border-left: 1px solid #E1E2E3;
    padding-left: 20px;
}
.m45_card_meta_label {
    color: rgba(47,58,70,0.50);
    font-size: 14.5px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.083em;
    line-height: 1;
}
.m45_card_meta_value {
    color: var(--hs-text);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.33;
    letter-spacing: 0.027em;
}
.m45_card_meta_item + .m45_card_meta_item .m45_card_meta_value {
    font-weight: 400;
}

.m45_card_price {
    margin: 4px 0 0;
    color: var(--hs-gold);
    font-family: var(--hs-font-display);
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.022em;
}

/* --------------------------------------------------------------------------
   CTA "Nichts Passendes dabei?"
   m32_team_cta 1:1 kopiert — nur Farb-Overrides
   -------------------------------------------------------------------------- */

/* Kein Top-Bleed auf dieser Seite — m32-Padding entfernen */
.m45_cta { padding-top: 0; margin-top: 0; }
.m45_cta .m32_bg { top: 0; }

/* Hintergrund: Gold → Cream */
.m45_cta .m32_bg { background: #F2EEE5; }

/* Text: Weiß → Dunkel */
.m45_cta .m32_content       { color: var(--hs-dark); }
.m45_cta .m32_headline      { color: var(--hs-dark); font-family: var(--hs-font-display); font-weight: 400; }
.m45_cta .m32_text          { color: var(--hs-text); margin-bottom: 72px; }

/* Button: Figma zeigt 38px links, 19px gap Strich→Text */
.m45_cta .m32_cta_box       { padding: 26px 38px; gap: 19px; }

/* Topline: Gold-Farbe bleibt */
.m45_cta_topline {
    display: flex; align-items: center; gap: 14px;
    color: var(--hs-gold);
    font-size: 16px; font-weight: 300;
    text-transform: uppercase; letter-spacing: 0.075em;
    line-height: 1; margin: 0 0 24px;
}
.m45_cta_topline_mark {
    display: inline-block; width: 30px; height: 2px;
    background: var(--hs-gold); flex-shrink: 0;
}

/* Button: Gold-Dash/-Label → Dunkel */
.m45_cta_mark_dark::before  { background: var(--hs-dark) !important; }
.m45_cta_label_dark         { color: var(--hs-dark) !important; }

/* --------------------------------------------------------------------------
   KEINE ERGEBNISSE
   -------------------------------------------------------------------------- */
.m45_no_results {
    padding: 80px 0;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.m45_no_results p {
    color: var(--hs-dark);
    font-size: 18px;
}

/* --------------------------------------------------------------------------
   PAGINATION  (Figma: aktive Seite = gefüllter Block #2F3A46)
   -------------------------------------------------------------------------- */
.m45_pagination_wrap { padding-bottom: 80px; }
.m45_pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.m45_page_num,
.m45_page_arrow,
.m45_page_dots {
    display: flex; align-items: center; justify-content: center;
    min-width: 62px; height: 62px;
    padding: 0 8px;
    color: var(--hs-dark);
    font-size: 14px;
    font-weight: 300;
    line-height: 1;
    text-decoration: none;
    transition: color 0.2s;
}

.m45_page_num { cursor: pointer; }
.m45_page_num:hover { color: var(--hs-gold); }

.m45_page_num--active {
    min-width: 62px; height: 62px;
    background: var(--hs-dark);
    color: #fff !important;
    font-size: 14px;
    font-weight: 300;
    cursor: default;
    pointer-events: none;
}

.m45_page_dots {
    color: rgba(47,58,70,0.4);
    cursor: default;
    letter-spacing: 0.15em;
    font-size: 14px;
}

.m45_page_arrow {
    cursor: pointer;
    color: var(--hs-dark);
    padding: 0 20px;
}
.m45_page_arrow:hover { color: var(--hs-gold); }
.m45_page_arrow--disabled {
    color: rgba(47,58,70,0.25);
    cursor: default;
    pointer-events: none;
}
.m45_page_arrow svg { width: 26px; height: 8px; display: block; }
