:root {
    --brand-blue: #3874AC;
    --brand-blue-dark: #243447;
    --brand-blue-soft: #EEF5FB;
    --border-color: #D9E4EF;
    --text-main: #15212B;
    --text-muted: #5B6773;
    --surface: #FFFFFF;
    --page-bg: #F4F8FB;
    --error-bg: #FBEAEA;
    --error-text: #A52828;
    --price-highlight-bg: #FFF0D9;
    --price-highlight-border: #F2B366;
    --price-highlight-text: #A85A00;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: var(--page-bg);
    color: var(--text-main);
}

html {
    overflow-x: hidden;
}

/* FIX: genügend Platz für fixed header */
body {
    padding-top: 168px;
    overflow-x: hidden;
}

body.search-open {
    padding-top: 272px;
}

/* =========================
   HEADER / LOGO
========================= */

.top-logo-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(6px);
}

.top-logo-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.top-logo {
    width: 365px;
    max-width: 72%;
    height: auto;
    display: block;
}

/* =========================
   SEARCH BAR (FIXED)
========================= */

.sticky-search-shell {
    position: fixed;
    top: 96px; /* FIX */
    left: 0;
    right: 0;
    z-index: 49;
    background: rgba(244, 248, 251, 0.98);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(6px);
}

.sticky-search-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px 12px;
}

/* FIX: Farbe stabil erzwingen */
.search-collapsed-bar,
.search-box {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(36, 52, 71, 0.12);
    background: var(--brand-blue-dark) !important;
    color: #fff !important;
}

.search-collapsed-bar {
    display: none;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.3;
}

.search-box {
    padding: 14px;
}

.search-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 230px) 170px;
    gap: 12px;
    align-items: center;
}

.location-input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 14px;
    font-size: 16px;
    color: var(--brand-blue);
    background: #fff;
    font-weight: 700;
}

.slider-wrap {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.10);
}

.slider-top {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #fff;
    margin-bottom: 6px;
}

.radius-value {
    font-weight: 700;
}

.search-button {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    background: #fff;
    color: var(--brand-blue-dark);
    cursor: pointer;
}

/* =========================
   CONTENT
========================= */

.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 18px 16px 40px;
}

.summary {
    margin: 4px 0 14px;
    color: var(--text-muted);
    font-size: 15px;
}

/* =========================
   CARDS
========================= */

.list {
    display: grid;
    gap: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(36, 52, 71, 0.05);
}

.distance-top {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-blue);
    margin-bottom: 8px;
}

.card-main {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    gap: 16px;
}

.card-photo,
.card-photo-placeholder {
    width: 138px;
    height: 138px;
    border-radius: 16px;
    object-fit: cover;
}

.card-photo-placeholder {
    background: var(--brand-blue-soft);
}

.title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    word-break: break-word;
}

.meta {
    font-size: 14px;
    margin: 6px 0;
    color: var(--text-muted);
}

.price-highlight {
    background: var(--price-highlight-bg);
    border: 1px solid var(--price-highlight-border);
    color: var(--price-highlight-text);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
    display: inline-block;
}

.links a {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 700;
}

/* =========================
   STATES
========================= */

body.search-collapsed .search-box {
    display: none;
}

body.search-collapsed .search-collapsed-bar {
    display: block;
}

body.search-open .search-box {
    display: block;
}

body.search-open .search-collapsed-bar {
    display: none;
}

/* =========================
   MODAL
========================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(21, 33, 43, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    max-width: 560px;
    width: 100%;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
}

.modal-header {
    background: var(--brand-blue-dark);
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
}

.modal-body {
    padding: 18px;
}

/* =========================
   MOBILE FIX
========================= */

@media (max-width: 760px) {
    body {
        padding-top: 170px;
    }

    body.search-open {
        padding-top: 330px;
    }

    .sticky-search-shell {
        top: 96px;
    }

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

    .card-main {
        grid-template-columns: 117px minmax(0, 1fr);
    }

    .card-photo,
    .card-photo-placeholder {
        width: 117px;
        height: 117px;
    }
}