/* ================================================================
   KLEIMANN IMMOBILIEN – CSS
   Desktop-first | Vanilla CSS | Katja Dickels
   ================================================================ */

/* ── FONTS ─────────────────────────────────────────────────────
   Dateien in templates/fonts/ ablegen.
   Download: fonts.google.com
   - Cormorant Garamond: 300, 400, 500, 600 (regular + italic)
   - Inter: variable font inter-var.woff2
   ──────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-300.woff2') format('woff2');
    font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-italic.woff2') format('woff2');
    font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-500.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-var.woff2') format('woff2');
    font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ── VARIABLEN ──────────────────────────────────────────────── */
:root {
    /* Farben – warm, wohnlich, einladend */
    --color-bg:            #FEFCF8;
    --color-surface:       #F6F1E9;
    --color-surface-dark:  #211A12;
    --color-text:          #1C1814;
    --color-text-muted:    #7B6E63;
    --color-text-light:    #FFFFFF;
    --color-accent:        #A0704A;
    --color-accent-btn:    #8B5E3C;
    --color-accent-hover:  #724E30;
    --color-accent-light:  #F4EAE0;
    --color-border:        #E8DECE;
    --color-border-subtle: #F0EBE3;
    --color-success:       #2D6A4F;
    --color-error:         #991B1B;

    /* Typografie */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;

    /* Abstände */
    --space-xs:  0.5rem;
    --space-sm:  1rem;
    --space-md:  1.5rem;
    --space-lg:  3rem;
    --space-xl:  5rem;
    --space-2xl: 8rem;

    /* Layout */
    --wrapper-max:     82rem;
    --wrapper-padding: 1.5rem;
    --header-height:   5rem;

    /* Schatten */
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:   0 12px 48px rgba(0,0,0,0.14);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);

    /* Border-Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Übergänge */
    --transition: 220ms ease;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    opacity: 1; /* hebt opacity:0 aus kritischem CSS auf – kein transition = kein iOS-Bug */
    overflow-x: hidden;
}

img, video, picture { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; background: none; border: none; font: inherit; }
input, select, textarea { font: inherit; }
fieldset { border: none; }

/* br-Regel: ein Enter im CMS ergibt visuellen Abstand */
br { display: block; margin-bottom: 0.5em; }

/* Hover nur auf echten Pointer-Geräten */
@media (hover: hover) {
    a:hover { color: var(--color-accent); }
}

/* ── TYPOGRAFIE ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 0.72em;
    color: var(--color-text);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 400; }
h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 600; }

p {
    margin-block-start: 0;
    margin-block-end: 1em;
}
p:last-child { margin-bottom: 0; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.wrapper {
    max-width: var(--wrapper-max);
    margin-inline: auto;
    padding-inline: var(--wrapper-padding);
}

.section {
    padding-block: var(--space-xl);
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.section-sub {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* ── BUTTONS ────────────────────────────────────────────────── */
button.primary, a.button.primary,
.button.primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-accent-btn);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-body);
    letter-spacing: 0.01em;
    border: 2px solid transparent;
    transition: background var(--transition);
    white-space: nowrap;
}
button.secondary, a.button.secondary,
.button.secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--color-accent-btn);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-body);
    letter-spacing: 0.01em;
    border: 2px solid var(--color-accent-btn);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

@media (hover: hover) {
    button.primary:hover, a.button.primary:hover, .button.primary:hover {
        background: var(--color-accent-hover);
    }
    button.secondary:hover, a.button.secondary:hover, .button.secondary:hover {
        background: var(--color-accent-light);
    }
}

/* ── SKIP LINK ──────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    background: var(--color-text);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-size: 0.875rem;
}
.skip-link:focus { top: 0; }

/* ── HEADER ─────────────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition);
}
.header.is-scrolled { box-shadow: var(--shadow-md); }

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    height: var(--header-height);
}

.site-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.site-logo img {
    height: 40px;
    width: auto;
    max-width: none;
}
.site-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-text);
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}
.nav-link {
    font-size: 0.9rem;
    font-weight: 450;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: color var(--transition), background var(--transition);
}
@media (hover: hover) {
    .nav-link:hover { color: var(--color-accent); background: var(--color-accent-light); }
}
.nav-link.is-active { color: var(--color-accent); font-weight: 600; }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.wishlist-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--color-text-muted);
    transition: color var(--transition);
}
@media (hover: hover) {
    .wishlist-icon:hover { color: var(--color-accent); }
}
.wishlist-icon.is-active { color: var(--color-accent); }
.wishlist-icon svg { transition: fill var(--transition); }
.wishlist-icon.has-items svg { fill: var(--color-accent); stroke: var(--color-accent); }

.wishlist-count {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--color-accent-btn);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.header-cta { font-size: 0.85rem; padding: 0.6rem 1.1rem; }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    margin-left: auto;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENÜ ────────────────────────────────────────────── */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--color-bg);
}
.mobile-menu.is-open { display: block; }

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-lg) var(--wrapper-padding);
}

.mobile-menu-close {
    align-self: flex-end;
    padding: 0.5rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.mobile-menu nav a {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 400;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text);
    display: block;
}

.mobile-menu-cta {
    margin-top: auto;
    padding-top: var(--space-md);
}
.mobile-menu-cta .button.primary { width: 100%; justify-content: center; }

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: 0;
}
/* Kein padding-block wie normale .section */

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
}
.hero-bg--placeholder {
    background: linear-gradient(135deg, #5C3A1B 0%, #8e6a2d 60%, #3d2610 100%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        rgba(0,0,0,0.62) 0%,
        rgba(0,0,0,0.45) 55%,
        rgba(0,0,0,0.15) 100%
    );
    z-index: 1;
}

.hero .wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-2xl);
    align-items: center;
    padding-top: calc(var(--header-height) + var(--space-xl));
    padding-bottom: var(--space-xl);
    min-height: 92vh;
}

.hero-text {
    color: #fff;
}
.hero-text h1 {
    color: #fff;
    font-weight: 300;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.hero-sub {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: rgba(255,255,255,0.85);
    margin-bottom: var(--space-md);
    max-width: 30rem;
}
.hero-ctas {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: var(--space-md);
}
.hero-ctas .button.secondary {
    border-color: rgba(255,255,255,0.7);
    color: #fff;
}
@media (hover: hover) {
    .hero-ctas .button.secondary:hover {
        background: rgba(255,255,255,0.15);
        border-color: #fff;
    }
}

/* Agent-Karte */
.hero-agent-card {
    background: #fff;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.agent-photo-wrap {
    aspect-ratio: 4/3;
    overflow: hidden;
}
.agent-photo-wrap picture { height: 100%; }
.agent-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}
.agent-card-body {
    padding: var(--space-md);
}
.agent-greeting {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.agent-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.2rem;
}
.agent-title { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.agent-bio {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.agent-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}
.agent-card-body .button.primary { width: 100%; justify-content: center; }

/* ── SUCHBOX ─────────────────────────────────────────────────── */
.search-section {
    position: relative;
    z-index: 10;
    padding-block: 0;
    margin-top: -3rem;
    margin-bottom: 0;
}
.search-box {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md) var(--space-lg);
}
.search-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-sm);
}
.search-tab {
    cursor: pointer;
}
.search-tab input { display: none; }
.search-tab span {
    display: block;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: background var(--transition), color var(--transition);
}
.search-tab input:checked + span,
.search-tab:has(input:checked) span {
    background: var(--color-accent-light);
    color: var(--color-accent);
}
@media (hover: hover) {
    .search-tab:hover span { color: var(--color-accent); }
}

.search-fields {
    display: grid;
    grid-template-columns: 1fr 2fr 1.2fr 1fr auto;
    gap: 0;
    align-items: end;
}
.search-field {
    padding: 0 var(--space-sm);
    border-right: 1px solid var(--color-border);
}
.search-field:first-child { padding-left: 0; }
.search-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.3rem;
}
.search-field input,
.search-field select {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
    padding: 0.25rem 0;
    appearance: none;
    -webkit-appearance: none;
}
.search-submit {
    margin-left: var(--space-sm);
    align-self: center;
    border-radius: var(--radius-lg);
    padding: 0.8rem 1.4rem;
}
.search-submit svg { flex-shrink: 0; }

/* ── PROPERTY CARDS ─────────────────────────────────────────── */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.property-card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}
@media (hover: hover) {
    .property-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }
    .property-card:hover .card-image img {
        transform: scale(1.04);
    }
}

.card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    background: var(--color-surface);
}
.card-image picture { height: 100%; }
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}
.card-image-placeholder { width: 100%; height: 100%; background: var(--color-surface); }

.card-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    z-index: 2;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    display: inline-block;
}
.badge--neu            { background: var(--color-accent-btn); color: #fff; }
.badge--reserviert     { background: #4B5563; color: #fff; }
.badge--exklusiv       { background: #92400E; color: #fff; }
.badge--provisionsfrei { background: #065F46; color: #fff; }
.badge--open-house     { background: #5B21B6; color: #fff; }

.card-wishlist {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: color var(--transition), background var(--transition), transform 150ms ease;
    box-shadow: var(--shadow-sm);
}
.card-wishlist:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.card-wishlist[aria-pressed="true"] {
    color: #DC2626;
    background: #fff;
}
.card-wishlist[aria-pressed="true"] svg { fill: #DC2626; stroke: #DC2626; }
@media (hover: hover) {
    .card-wishlist:hover { transform: scale(1.1); color: #DC2626; }
}

.card-body {
    padding: var(--space-sm);
}
.card-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.card-title {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.3;
}
.card-title a { color: var(--color-text); }
@media (hover: hover) {
    .card-title a:hover { color: var(--color-accent); }
}
.card-price {
    display: block;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}
.card-facts {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.card-facts span { display: flex; align-items: center; gap: 0.25rem; }

/* Fade-in beim Scrollen */
.property-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 400ms ease, transform 400ms ease, box-shadow var(--transition);
}
.property-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .property-card { opacity: 1; transform: none; transition: none; }
}

/* ── FILTER BAR ─────────────────────────────────────────────── */
.filter-section {
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding-block: var(--space-sm);
}

.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 8rem;
}
.filter-group--city { flex: 2; }

.filter-group label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
}
.filter-group select,
.filter-group input {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text);
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
}
.filter-group select:focus,
.filter-group input:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 0;
    border-color: var(--color-accent);
}

.filter-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.filter-submit { font-size: 0.875rem; padding: 0.55rem 1.1rem; }
.filter-reset { font-size: 0.8rem; color: var(--color-text-muted); text-decoration: underline; }
@media (hover: hover) { .filter-reset:hover { color: var(--color-accent); } }

.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    position: relative;
}
.filter-active-dot {
    width: 8px; height: 8px;
    background: var(--color-accent-btn);
    border-radius: 50%;
    position: absolute;
    top: 8px; right: 8px;
}

/* ── LISTING SECTION ────────────────────────────────────────── */
.listing-section { padding-top: var(--space-lg); }
.listing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}
.results-count { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }
.results-count strong { color: var(--color-text); font-size: 1.1rem; }

.no-results {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--color-text-muted);
}
.no-results svg { margin: 0 auto var(--space-md); }
.no-results h2 { font-size: 1.5rem; color: var(--color-text); margin-bottom: 0.5rem; }
.no-results p { margin-bottom: var(--space-md); }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}
.pagination-btn {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: background var(--transition);
}
@media (hover: hover) {
    .pagination-btn:hover { background: var(--color-accent-light); }
}
.pagination-info { font-size: 0.875rem; color: var(--color-text-muted); }

/* ── FILTER BOTTOM SHEET ────────────────────────────────────── */
.filter-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
}
.filter-sheet.is-open { display: block; }

.filter-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}
.filter-sheet-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform 320ms cubic-bezier(0.32,0.72,0,1);
}
.filter-sheet.is-open .filter-sheet-panel {
    transform: translateY(0);
}
.filter-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.filter-sheet-header h2 { font-size: 1.2rem; margin: 0; }
.filter-sheet-close { color: var(--color-text-muted); }
.filter-sheet-body { overflow-y: auto; padding: var(--space-md); flex: 1; }
.filter-sheet-footer {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
    padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
}
.filter-sheet-footer .button { flex: 1; justify-content: center; }

.filter-sheet-body fieldset { margin-bottom: var(--space-md); }
.filter-sheet-body legend {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: block;
}
.sheet-radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sheet-radio-group label {
    cursor: pointer;
    font-size: 0.875rem;
}
.sheet-radio-group input { position: absolute; opacity: 0; width: 0; height: 0; }
.sheet-radio-group label:has(input) {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.sheet-radio-group label:has(input:checked) {
    border-color: var(--color-accent-btn);
    background: var(--color-accent-light);
    color: var(--color-accent-btn);
    font-weight: 600;
}
.full-width { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }

/* ── SPOTLIGHT SECTION ──────────────────────────────────────── */
.spotlight-section { background: var(--color-surface); }
.properties-grid--spotlight { grid-template-columns: repeat(3, 1fr); }

/* ── USP SECTION ────────────────────────────────────────────── */
.usp-section { background: var(--color-bg); }
.usp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}
.usp-item { text-align: left; }
.usp-icon {
    width: 56px;
    height: 56px;
    background: var(--color-accent-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}
.usp-item h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.usp-item p { font-size: 0.875rem; color: var(--color-text-muted); margin: 0; }

/* ── AGENT CTA SECTION ──────────────────────────────────────── */
.agent-cta-section { background: var(--color-surface); }
.agent-cta-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: var(--space-2xl);
    align-items: center;
}
.agent-cta-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 3/4;
    max-width: 420px;
}
.agent-cta-photo { width: 100%; height: 100%; object-fit: cover; }
.agent-cta-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.agent-cta-title { font-size: 0.95rem; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.agent-cta-list {
    margin: var(--space-sm) 0 var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.agent-cta-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}
.agent-cta-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── KONTAKT SECTION ────────────────────────────────────────── */
.contact-section { background: var(--color-surface); }
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: var(--space-2xl);
    align-items: start;
}
.contact-intro h2 { margin-bottom: 0.75rem; }
.contact-intro p { color: var(--color-text-muted); font-size: 0.95rem; }
.contact-direct {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--color-accent);
    margin-top: var(--space-sm);
}

/* ── FORMULARE ──────────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input,
.form-group textarea,
.form-group select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(27,58,92,0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-privacy { font-size: 0.8rem; color: var(--color-text-muted); }
.form-privacy a { color: var(--color-accent); text-decoration: underline; }
.contact-form .button.primary { align-self: flex-start; }

.form-message {
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}
.form-message--success { background: #DCFCE7; color: var(--color-success); border: 1px solid #BBF7D0; }
.form-message--error   { background: #FEE2E2; color: var(--color-error);   border: 1px solid #FECACA; }

/* ── EINZELOBJEKT – GALERIE ─────────────────────────────────── */
.gallery-section { margin-top: var(--header-height); }
.gallery-hero { position: relative; }
.gallery-hero-img {
    width: 100%;
    height: 70vh;
    object-fit: cover;
    cursor: zoom-in;
}
.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #000;
    overflow-x: auto;
}
.gallery-thumb-img {
    height: 90px;
    width: auto;
    object-fit: cover;
    cursor: zoom-in;
    opacity: 0.75;
    transition: opacity var(--transition);
    flex-shrink: 0;
    border-radius: 2px;
}
@media (hover: hover) { .gallery-thumb-img:hover { opacity: 1; } }
.gallery-show-all {
    flex-shrink: 0;
    height: 90px;
    padding: 0 1rem;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.875rem;
    border-radius: 2px;
}

/* ── EINZELOBJEKT – LAYOUT ──────────────────────────────────── */
.property-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-2xl);
    align-items: start;
    padding-block: var(--space-lg);
}

.property-main { min-width: 0; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}
.breadcrumb a { color: var(--color-text-muted); }
@media (hover: hover) { .breadcrumb a:hover { color: var(--color-accent); } }
.breadcrumb span[aria-current] { color: var(--color-text); }

.property-header { margin-bottom: var(--space-lg); }
.property-header-top { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); flex-wrap: wrap; }
.property-badges { position: static; }
.listing-id { font-size: 0.75rem; color: var(--color-text-muted); }
.property-header h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: 0.5rem; }
.property-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

.property-section { margin-bottom: var(--space-xl); }
.property-section h2 { font-size: 1.4rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-md); }

.property-text.rte { font-size: 0.95rem; line-height: 1.75; }
.property-text.rte p { margin-bottom: 1em; }
.property-text.rte p:last-child { margin-bottom: 0; }

.features-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: var(--space-md);
}
.features-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text);
}
.features-list svg { color: var(--color-accent); flex-shrink: 0; }

.floorplan-grid { display: flex; flex-direction: column; gap: var(--space-sm); }
.floorplan-img { width: 100%; border-radius: var(--radius-md); }

.map-embed { border-radius: var(--radius-md); overflow: hidden; margin-top: var(--space-sm); }
.map-address { display: flex; align-items: center; gap: 0.4rem; color: var(--color-text-muted); font-size: 0.9rem; }

.energy-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}
.energy-class {
    font-size: 1.5rem;
    font-weight: 700;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: #fff;
}
.energy-class--a-plus, .energy-class--a { background: #16a34a; }
.energy-class--b { background: #65a30d; }
.energy-class--c { background: #ca8a04; }
.energy-class--d { background: #d97706; }
.energy-class--e { background: #ea580c; }
.energy-class--f, .energy-class--g, .energy-class--h { background: #dc2626; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar-sticky { position: sticky; top: calc(var(--header-height) + 1rem); }
.sidebar-price-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
}
.sidebar-price {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.2rem;
    line-height: 1;
}
.sidebar-price-sqm { font-size: 0.85rem; color: var(--color-text-muted); margin: 0; }

.sidebar-facts {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}
.sidebar-fact {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem var(--space-md);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}
.sidebar-fact:last-child { border-bottom: none; }
.sidebar-fact dt { color: var(--color-text-muted); }
.sidebar-fact dd { font-weight: 500; }

.sidebar-agent {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}
.sidebar-agent-photo { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.sidebar-agent-photo img { width: 100%; height: 100%; object-fit: cover; }
.agent-avatar { width: 100%; height: 100%; object-fit: cover; }
.sidebar-agent-info { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-agent-info strong { font-size: 0.95rem; }
.sidebar-agent-info span { font-size: 0.8rem; color: var(--color-text-muted); }

.sidebar-ctas { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: var(--space-sm); }
.sidebar-cta { width: 100%; justify-content: center; }

.sidebar-wishlist {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    padding: 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: color var(--transition), border-color var(--transition);
}
.sidebar-wishlist[aria-pressed="true"] { color: #DC2626; border-color: #DC2626; }
.sidebar-wishlist[aria-pressed="true"] svg { fill: #DC2626; stroke: #DC2626; }
@media (hover: hover) { .sidebar-wishlist:hover { color: #DC2626; border-color: #DC2626; } }

/* ── LIGHTBOX ─────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.94);
}
.lightbox.is-open { display: flex; align-items: center; justify-content: center; }

.lightbox-img-wrap {
    max-width: 90vw;
    max-height: 85vh;
}
.lightbox-img-wrap img { max-width: 90vw; max-height: 85vh; object-fit: contain; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: rgba(255,255,255,0.8);
    padding: 0.75rem;
    transition: color var(--transition);
}
@media (hover: hover) { .lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { color: #fff; } }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-counter { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.6); font-size: 0.85rem; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.footer {
    background: var(--color-surface-dark);
    color: rgba(255,255,255,0.75);
    padding-top: var(--space-xl);
    padding-bottom: var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.footer-logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: rgba(255,255,255,0.95);
    display: block;
    margin-bottom: var(--space-sm);
}
.footer-tagline { font-size: 0.9rem; line-height: 1.55; margin-bottom: var(--space-sm); }
.footer-contact-link {
    display: block;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.3rem;
    transition: color var(--transition);
}
@media (hover: hover) { .footer-contact-link:hover { color: #fff; } }

.footer-nav-col h3 {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.45);
    margin-bottom: var(--space-sm);
}
.footer-nav-col nav { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-nav-col a {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.75);
    padding: 6px 0; /* Touch-Ziel ≥ 44px bei gestapelten Links */
    transition: color var(--transition);
}
@media (hover: hover) { .footer-nav-col a:hover { color: #fff; } }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
}
.footer-credit a {
    color: rgba(255,255,255,0.75);
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.35);
}
@media (hover: hover) { .footer-credit a:hover { color: #fff; } }

/* ── STATIC PAGES (Impressum etc.) ─────────────────────────── */
.page-content { max-width: 50rem; padding-block: var(--space-xl); }
.page-content h1 { margin-bottom: var(--space-md); }
.page-content .rte { font-size: 0.95rem; line-height: 1.8; }
.page-content .rte h2 { font-size: 1.3rem; margin-top: var(--space-md); }
.page-content .rte h3 { font-size: 1.05rem; margin-top: var(--space-sm); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* Tablet Landscape ≤ 1280px */
@media (max-width: 1280px) {
    .properties-grid { grid-template-columns: repeat(3, 1fr); }
    .search-fields { grid-template-columns: 1fr 1.5fr 1fr 1fr auto; }
}

/* Tablet ≤ 1024px */
@media (max-width: 1024px) {
    :root { --space-xl: 4rem; --space-2xl: 6rem; }

    .hero-content { grid-template-columns: 1fr 320px; gap: var(--space-lg); }
    .hero-text h1 { font-size: 2.6rem; }

    .usp-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }

    .contact-grid { grid-template-columns: 1fr; gap: var(--space-lg); }

    .agent-cta-grid { grid-template-columns: 1fr; }
    .agent-cta-image { max-width: 300px; aspect-ratio: 1; border-radius: 50%; }

    .property-layout { grid-template-columns: 1fr 300px; gap: var(--space-lg); }
    .features-list { grid-template-columns: repeat(2, 1fr); }

    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: var(--space-lg); }
}

/* Tablet Portrait ≤ 768px */
@media (max-width: 768px) {
    :root { --space-xl: 3rem; }

    .nav, .header-actions .header-cta { display: none; }
    .hamburger { display: flex; }
    .header-actions { gap: 0.5rem; }

    .hero-content { grid-template-columns: 1fr; padding-top: calc(var(--header-height) + 3rem); padding-bottom: 2rem; min-height: auto; }
    .hero-agent-card { max-width: 400px; }

    .search-section { margin-top: var(--space-md); }
    .search-tabs { display: none; }
    .search-fields { grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
    .search-field { padding: 0; border-right: none; }
    .search-field label { font-size: 0.75rem; }
    .search-field--location { grid-column: 1 / -1; }
    .search-field input, .search-field select { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 0.5rem; }
    .search-submit { grid-column: 1 / -1; width: 100%; justify-content: center; }

    .properties-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }

    .filter-bar { display: none; }
    .mobile-filter-btn { display: flex; }

    .property-layout { grid-template-columns: 1fr; }
    .property-sidebar { order: -1; }
    .sidebar-sticky { position: static; }

    .footer-grid { grid-template-columns: 1fr; gap: var(--space-md); }

    .contact-grid { grid-template-columns: 1fr; gap: var(--space-md); }
    .form-row { grid-template-columns: 1fr; }
}

/* Phone Landscape ≤ 600px */
@media (max-width: 600px) {
    .hero-ctas { flex-direction: column; }
    .hero-ctas .button.primary,
    .hero-ctas .button.secondary { width: 100%; justify-content: center; }
    .contact-form .button.primary { width: 100%; justify-content: center; }

    .usp-grid { grid-template-columns: 1fr; gap: var(--space-md); }
    .usp-item { display: flex; gap: var(--space-sm); align-items: flex-start; }
    .usp-icon { flex-shrink: 0; margin-bottom: 0; width: 44px; height: 44px; }

    .footer-bottom { flex-direction: column; align-items: flex-start; gap: var(--space-xs); }
}

/* Phone Portrait ≤ 480px */
@media (max-width: 480px) {
    :root { --wrapper-padding: 1rem; }
    .properties-grid { grid-template-columns: 1fr; }
    .search-box { padding: var(--space-sm); border-radius: var(--radius-lg); }
    .search-fields { grid-template-columns: 1fr; }
    .search-field--location { grid-column: auto; }
    .gallery-hero-img { height: 50vh; }
    .features-list { grid-template-columns: 1fr; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
