/* ============================================
   Rent in Aberdeen — Design System
   ============================================ */

/* --- Custom Properties --- */
/*
 * Design System v2 — Clean rewrite
 * Vision: Beat Citylets with space, simplicity, one colour.
 * One brand colour. White canvas. Properties are the hero.
 */
:root {
    /* The one brand colour — Granite City silver-blue */
    --ria-brand: #4A6FA5;
    --ria-brand-dark: #3B5A87;
    --ria-brand-light: #EEF2F7;

    /* Bootstrap overrides */
    --bs-primary: #4A6FA5;
    --bs-primary-rgb: 74, 111, 165;
    --bs-body-bg: #FFFFFF;
    --bs-body-color: #1A1A1A;

    /* Neutral palette */
    --ria-charcoal: #1A1A1A;
    --ria-muted: #666666;
    --ria-light: #999999;
    --ria-border: #E5E5E5;
    --ria-stone: #F5F5F5;
    --ria-input-bg: #F5F5F5;

    /* Legacy aliases (so existing CSS doesn't break) */
    --ria-primary: #4A6FA5;
    --ria-primary-dark: #3B5A87;
    --ria-primary-light: #EEF2F7;
    --ria-primary-hover: #3B5A87;
    --ria-accent: #4A6FA5;
    --ria-accent-light: #EEF2F7;
    --ria-blue: #4A6FA5;
    --ria-blue-dark: #3B5A87;
    --ria-blue-light: #EEF2F7;
    --ria-coral: #4A6FA5;
    --ria-coral-dark: #3B5A87;

    /* Shadows */
    --ria-card-shadow: 0 1px 3px rgba(0,0,0,0.04);
    --ria-card-shadow-hover: 0 4px 20px rgba(0,0,0,0.1);

    /* Radii — consistent everywhere */
    --ria-radius: 12px;
    --ria-radius-pill: 100px;
    --ria-radius-sm: 8px;

    /* System */
    --ria-focus-ring: 0 0 0 2px #fff, 0 0 0 4px var(--ria-brand);
    --ria-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ria-section-gap: 4rem;
    --ria-transition: 0.15s ease;
}

/* --- Base --- */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

::selection {
    background: var(--ria-brand);
    color: #fff;
}

body {
    font-family: var(--ria-font);
    color: var(--ria-charcoal);
    background: var(--bs-body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.65;
    letter-spacing: -0.01em;
}

main {
    flex: 1;
    padding-bottom: var(--ria-section-gap);
}

h1, h2, h3, h4 {
    text-wrap: balance;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

:focus-visible {
    outline: none;
    box-shadow: var(--ria-focus-ring);
}

a {
    transition: color var(--ria-transition);
    color: var(--ria-brand);
    text-underline-offset: 2px;
}

a:hover { color: var(--ria-brand-dark); }

img { image-rendering: auto; }

/* Global transition for interactive elements */
button, .btn, .property-card, .neighbourhood-card, .neighbourhood-card-v2,
.neighbourhood-chip, .filter-pill, .category-tab, .share-btn, .nav-link {
    transition: all var(--ria-transition);
}

/* Form inputs (warm grey-fill) */
.form-control, .form-select {
    min-height: 48px;
    font-size: 1rem;
    background: var(--ria-input-bg);
    border: 1.5px solid transparent;
    border-radius: var(--ria-radius-sm);
    padding: 0.75rem 1rem;
    transition: all var(--ria-transition);
    color: var(--ria-charcoal);
}

.form-control:focus, .form-select:focus {
    background: #fff;
    border-color: var(--ria-primary);
    box-shadow: 0 0 0 3px rgba(15,110,86,0.1);
}

.form-control::placeholder {
    color: var(--ria-muted);
    opacity: 0.7;
}

/* --- Header / Navbar --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--ria-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.navbar {
    padding: 0.875rem 0;
    --bs-navbar-color: var(--ria-charcoal);
    --bs-navbar-hover-color: var(--ria-charcoal);
    --bs-navbar-active-color: var(--ria-charcoal);
    --bs-navbar-brand-color: var(--ria-charcoal);
    --bs-navbar-brand-hover-color: var(--ria-charcoal);
    --bs-navbar-toggler-border-color: var(--ria-border);
}

.navbar-brand {
    font-size: 1.3125rem;
    font-weight: 800;
    color: var(--ria-charcoal) !important;
    letter-spacing: -0.04em;
}

.brand-icon {
    color: var(--ria-brand);
    margin-right: 0.125rem;
}

.navbar-toggler {
    padding: 0.5rem;
    color: var(--ria-charcoal);
}

/* Mobile nav: slide in from right */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 16px rgba(0,0,0,0.12);
        padding: 1.5rem;
        transition: right 0.3s ease;
        z-index: 1050;
        display: flex !important;
        flex-direction: column;
    }

    .navbar-collapse.show {
        right: 0;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .btn-close-nav {
        align-self: flex-end;
        background: none;
        border: none;
        font-size: 1.25rem;
        padding: 0.5rem;
        cursor: pointer;
        color: var(--ria-charcoal);
        margin-bottom: 1rem;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0 !important;
    }

    .navbar-nav .nav-link {
        padding: 0.875rem 0;
        border-bottom: 1px solid var(--ria-border);
        font-size: 1rem;
        font-weight: 500;
        color: var(--ria-charcoal);
    }
}

@media (min-width: 992px) {
    .btn-close-nav { display: none; }
    .nav-overlay { display: none; }

    .nav-link {
        font-weight: 500;
        font-size: 0.9375rem;
        padding: 0.5rem 0.875rem !important;
        border-radius: var(--ria-radius-sm);
        transition: background 0.15s;
    }

    .nav-link:hover {
        background: var(--ria-stone);
        color: var(--ria-charcoal);
    }

    .nav-cta {
        background: var(--ria-brand) !important;
        color: #fff !important;
        border-radius: var(--ria-radius-sm) !important;
        padding: 0.5rem 1.5rem !important;
    }

    .nav-cta:hover {
        background: var(--ria-brand-dark) !important;
    }

    .nav-link:hover {
        background: var(--ria-stone);
        color: var(--ria-charcoal);
    }
}

/* --- Cards (property, neighbourhood) --- */
.property-card {
    background: #fff;
    border-radius: var(--ria-radius);
    box-shadow: var(--ria-card-shadow);
    overflow: hidden;
    border: 1px solid var(--ria-border);
    position: relative;
}

.property-card:hover {
    box-shadow: var(--ria-card-shadow-hover);
}

.property-card .card-img-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--ria-stone);
}

.property-card .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.property-card:hover .card-img-wrap img {
    transform: scale(1.05);
}

/* Subtle gradient overlay at bottom of image for text contrast */
.property-card .card-img-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(transparent, rgba(0,0,0,0.08));
    pointer-events: none;
    z-index: 1;
}

.property-card .card-body {
    padding: 0.875rem 1rem 1rem;
}

.property-card .price {
    font-size: 1.3125rem;
    font-weight: 700;
    color: var(--ria-charcoal);
    letter-spacing: -0.01em;
}

.property-card .price-period {
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--ria-muted);
}

.property-card .prop-details {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.875rem;
    color: var(--ria-muted);
    margin: 0.25rem 0;
}

.property-card .prop-details i {
    font-size: 0.875rem;
}

.property-card .address {
    font-size: 0.875rem;
    color: var(--ria-charcoal);
    margin-bottom: 0.25rem;
}

.property-card .agent-name {
    font-size: 0.75rem;
    color: var(--ria-muted);
}

/* Favourite heart button */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 1rem;
    transition: transform 0.15s, background 0.15s;
    padding: 0;
}

.fav-btn:hover {
    background: rgba(0,0,0,0.5);
    transform: scale(1.1);
}

.fav-btn.favourited {
    color: #ef4444;
    background: rgba(255,255,255,0.9);
}

.fav-btn.favourited:hover {
    background: rgba(255,255,255,1);
}

/* Saved count badge (nav) */
.saved-count-badge {
    background: var(--ria-coral);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -8px;
    left: -4px;
}

/* Featured badge */
.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--ria-coral);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--ria-radius-sm);
    z-index: 2;
    letter-spacing: 0.02em;
}

.property-card.featured {
    border: 2px solid var(--ria-coral);
}

/* Neighbourhood pill on card */
.neighbourhood-badge {
    display: inline-block;
    background: var(--ria-brand-light);
    color: var(--ria-brand);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.625rem;
    border-radius: var(--ria-radius-pill);
    text-decoration: none;
}

.neighbourhood-badge:hover {
    background: var(--ria-brand);
    color: #fff;
}

/* --- Image Carousel (scroll-snap) --- */
.image-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.image-carousel::-webkit-scrollbar { display: none; }

.image-carousel .carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.image-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dot indicators */
.carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.carousel-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: background 0.2s;
}

.carousel-dots .dot.active {
    background: #fff;
}

/* Image counter overlay */
.image-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--ria-radius-sm);
    z-index: 2;
}

/* No-image placeholder / fallback */
.no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ria-stone);
    color: var(--ria-border);
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
}

/* Image error fallback */
.card-img-wrap img[src=""],
.card-img-wrap img:not([src]) {
    display: none;
}

/* --- Hero Section --- */
.hero {
    background: url('/images/hero-aberdeen.jpg') center 25%/cover no-repeat;
    background-color: #4A6670;
    color: #fff;
    padding: 5rem 1.25rem 4rem;
    text-align: center;
    overflow: visible;
    position: relative;
    z-index: 2;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .hero {
        padding: 6rem 2rem 5rem;
        min-height: 500px;
    }
}

.hero h1 {
    font-weight: 800;
    font-size: 2.25rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
    max-width: 600px;
    margin: 0 auto;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
    .hero h1 { font-size: 3rem; }
}

.hero .subtitle {
    font-size: 1.0625rem;
    color: rgba(255,255,255,0.95);
    margin: 0.75rem auto 0;
    font-weight: 400;
    max-width: 460px;
    line-height: 1.5;
    text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.hero-search {
    background: #fff;
    border-radius: var(--ria-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    margin: 2rem auto 0;
    max-width: 680px;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.hero-search .form-control,
.hero-search .form-select {
    border-radius: var(--ria-radius-sm);
    border: 1.5px solid transparent;
    background: var(--ria-input-bg);
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem;
    min-height: 48px;
}

.hero-search .form-control:focus,
.hero-search .form-select:focus {
    background: #fff;
    border-color: var(--ria-primary);
}

.hero-search .btn-search {
    background: var(--ria-brand);
    color: #fff;
    border: none;
    border-radius: var(--ria-radius-sm);
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    min-height: 48px;
    font-size: 1rem;
}

.hero-search .btn-search:hover {
    background: var(--ria-brand-dark);
}

.hero-search .btn-search:active {
    transform: scale(0.98);
}

/* --- Autocomplete --- */
.autocomplete-wrap {
    position: relative;
    overflow: visible;
}

.hero, .hero .container, .hero-search, .hero-search .row, .hero-search .col-12 {
    overflow: visible !important;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    color: var(--ria-charcoal);
    border: 1px solid var(--ria-border);
    border-radius: var(--ria-radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1100;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 0.625rem 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background 0.1s;
    border-bottom: 1px solid var(--ria-border);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item.active,
.autocomplete-item:hover {
    background: var(--ria-stone);
}

.autocomplete-item strong {
    font-weight: 700;
}

.autocomplete-item:hover {
    background: var(--ria-primary-light);
}

/* --- Category tabs (Airbnb-style) --- */
.category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.125rem 0.75rem;
    border-radius: 0;
    text-decoration: none;
    color: var(--ria-muted);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    min-width: 72px;
}

.category-tab i {
    font-size: 1.375rem;
    transition: transform 0.2s ease;
}

.category-tab:hover {
    color: var(--ria-charcoal);
    border-bottom-color: var(--ria-charcoal);
}

.category-tab:hover i {
    transform: translateY(-2px);
}

.category-tab:active {
    color: var(--ria-primary);
    border-bottom-color: var(--ria-primary);
}

/* --- Section headings --- */
.section-heading {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

/* Consistent section spacing */
.container > section,
section.container {
    margin-top: var(--ria-section-gap);
}

/* Alternating section backgrounds (Monzo rhythm) */
.section-alt {
    background: var(--ria-stone);
    padding: 3.5rem 0;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
}

/* --- Horizontal scroll container --- */
.scroll-row {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar { display: none; }

.scroll-row > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Neighbourhood card in scroll row */
.neighbourhood-card {
    width: 200px;
    background: #fff;
    border-radius: var(--ria-radius);
    box-shadow: var(--ria-card-shadow);
    padding: 1.125rem 1.25rem;
    text-decoration: none;
    color: var(--ria-charcoal);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.04);
    border-left: 3px solid transparent;
}

.neighbourhood-card:hover {
    box-shadow: var(--ria-card-shadow-hover);
    transform: translateY(-4px);
    color: var(--ria-charcoal);
    border-left-color: var(--ria-charcoal);
    background: #fff;
}

.neighbourhood-card .n-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.375rem;
}

.neighbourhood-card .n-count {
    font-size: 0.8125rem;
    color: var(--ria-primary);
    font-weight: 600;
}

.neighbourhood-card .n-rent {
    font-size: 0.8125rem;
    color: var(--ria-muted);
}

/* Neighbourhood card v2 (homepage) */
.neighbourhood-card-v2 {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 260px;
    background: #fff;
    border-radius: var(--ria-radius);
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: var(--ria-charcoal);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--ria-card-shadow);
    flex-shrink: 0;
}

.neighbourhood-card-v2:hover {
    box-shadow: var(--ria-card-shadow-hover);
    transform: translateY(-3px);
    color: var(--ria-charcoal);
}

.neighbourhood-card-v2 .nc-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    color: var(--ria-primary-dark);
    transition: transform 0.3s ease;
}

.neighbourhood-card-v2:hover .nc-icon {
    transform: scale(1.08);
}

.neighbourhood-card-v2 .nc-body {
    flex: 1;
    min-width: 0;
}

.neighbourhood-card-v2 .nc-name {
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.neighbourhood-card-v2 .nc-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--ria-muted);
    margin-top: 0.125rem;
}

.neighbourhood-card-v2 .nc-count {
    color: var(--ria-primary);
    font-weight: 600;
}

.neighbourhood-card-v2 .nc-dot {
    opacity: 0.4;
}

.neighbourhood-card-v2 .nc-arrow {
    color: var(--ria-border);
    font-size: 0.875rem;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.neighbourhood-card-v2:hover .nc-arrow {
    color: var(--ria-primary);
    transform: translateX(2px);
}

@media (max-width: 767.98px) {
    .neighbourhood-card-v2 { width: 240px; }
}

/* --- Neighbourhood grid (homepage Zoopla-style) --- */
.neighbourhood-grid-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ria-muted);
    margin-bottom: 0.625rem;
}

.neighbourhood-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--ria-radius-pill);
    border: 1.5px solid var(--ria-border);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ria-charcoal);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.neighbourhood-chip:hover {
    border-color: var(--ria-primary);
    color: var(--ria-primary);
    background: var(--ria-primary-light);
}

.neighbourhood-chip-sm {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
}

.nc-chip-count {
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--ria-primary-light);
    color: var(--ria-primary);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

/* Property card in scroll row */
.scroll-row .property-card {
    width: 300px;
}

@media (max-width: 767.98px) {
    .scroll-row .property-card { width: 85vw; }
}

/* --- SEO content block --- */
.seo-content {
    background: var(--ria-stone);
    padding: 3rem 2rem;
    border-radius: var(--ria-radius);
    margin-top: var(--ria-section-gap);
    border: 1px solid var(--ria-border);
}

@media (min-width: 768px) {
    .seo-content { padding: 2.5rem 2rem; }
}

.seo-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.seo-content p {
    font-size: 0.9375rem;
    color: #5A5A58;
    line-height: 1.75;
}

/* --- Filter Bar (pills) --- */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0;
    scrollbar-width: none;
    position: sticky;
    top: 56px;
    background: #fff;
    z-index: 1020;
    border-bottom: 1px solid var(--ria-border);
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--ria-radius-pill);
    border: 1.5px solid var(--ria-border);
    background: #fff;
    color: var(--ria-charcoal);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--ria-charcoal);
    color: var(--ria-charcoal);
    background: var(--ria-stone);
}

.filter-pill.active {
    background: var(--ria-brand);
    border-color: var(--ria-brand);
    color: #fff;
}

.filter-pill i {
    font-size: 0.75rem;
}

/* --- Price Histogram --- */
.price-histogram {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    margin-bottom: 0.75rem;
    padding: 0 2px;
}

.price-histogram .hist-bar {
    flex: 1;
    background: var(--ria-primary-light);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: background 0.15s;
}

.price-histogram .hist-bar:hover {
    background: var(--ria-primary);
}

/* --- View Toggle --- */
.view-toggle {
    display: inline-flex;
    border-radius: var(--ria-radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--ria-border);
}

.view-toggle .toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: #fff;
    color: var(--ria-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    transition: all 0.15s;
}

.view-toggle .toggle-btn.active {
    background: var(--ria-primary);
    color: #fff;
}

/* --- Bottom Sheet --- */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.bottom-sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--ria-radius) var(--ria-radius) 0 0;
    z-index: 1050;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet .handle {
    width: 40px;
    height: 4px;
    background: #D1D5DB;
    border-radius: 2px;
    margin: 0 auto 1rem;
}

.bottom-sheet h6 {
    font-weight: 600;
    font-size: 1.0625rem;
    margin-bottom: 1rem;
}

.bottom-sheet .btn-apply {
    background: var(--ria-brand);
    color: #fff;
    border: none;
    border-radius: var(--ria-radius-sm);
    font-weight: 600;
    padding: 0.75rem;
    width: 100%;
    min-height: 48px;
    margin-top: 1rem;
}

/* --- Map --- */
.map-container {
    width: 100%;
    height: 50vh;
    min-height: 300px;
    position: relative;
}

@media (max-width: 767.98px) {
    .map-container { height: 55vh; }
}

.map-container .leaflet-container {
    height: 100%;
    width: 100%;
    border-radius: 0;
}

/* Map price pin */
.map-price-pin {
    background: #fff;
    border: 2px solid var(--ria-brand);
    border-radius: var(--ria-radius-pill);
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ria-brand);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-align: center;
}

.map-price-pin.active {
    background: var(--ria-brand);
    color: #fff;
}

/* Card strip below map on mobile */
.map-card-strip {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #fff;
    border-top: 1px solid var(--ria-border);
}

.map-card-strip::-webkit-scrollbar { display: none; }

.map-card-strip .property-card {
    flex: 0 0 85vw;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .map-card-strip .property-card { flex: 0 0 320px; }
}

/* Remove bottom padding on search page */
body:has(.search-split) main {
    padding-bottom: 0;
}

body:has(.search-split) .site-footer {
    margin-top: 0;
}

/* --- Search Layout (Desktop Split — Trulia-style) --- */
@media (min-width: 992px) {
    .search-split {
        display: flex;
        min-height: calc(100vh - 57px);
    }

    .search-split .search-list {
        flex: 1 1 50%;
        overflow-y: auto;
        max-height: calc(100vh - 57px);
        padding: 0 1.25rem 2rem;
    }

    .search-split .search-map {
        flex: 1 1 50%;
        position: sticky;
        top: 57px;
        height: calc(100vh - 57px);
    }

    .search-split .search-map .map-container {
        height: 100%;
        border-radius: 0;
    }

    .map-card-strip { display: none; }

    /* Tighter property grid inside split view */
    .search-split .property-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }
}

/* Property grid (list view, desktop) */
.property-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .property-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .property-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Property Detail --- */
.detail-gallery {
    position: relative;
}

.detail-gallery .image-carousel {
    aspect-ratio: auto;
}

.detail-gallery .carousel-slide {
    aspect-ratio: 16 / 10;
}

@media (max-width: 767.98px) {
    .detail-gallery {
        margin: 0 -0.75rem;
    }
}

/* Desktop gallery grid */
@media (min-width: 768px) {
    .detail-gallery-grid {
        display: grid;
        grid-template-columns: 3fr 2fr;
        gap: 0.5rem;
        border-radius: var(--ria-radius);
        overflow: hidden;
        max-height: 450px;
    }

    .detail-gallery-grid .gallery-main {
        aspect-ratio: auto;
        height: 100%;
    }

    .detail-gallery-grid .gallery-main img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .detail-gallery-grid .gallery-side {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .detail-gallery-grid .gallery-side img {
        width: 100%;
        flex: 1;
        object-fit: cover;
    }
}

.detail-price {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--ria-charcoal);
    letter-spacing: -0.02em;
}

.detail-price-period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--ria-muted);
}

.detail-deposit {
    font-size: 0.875rem;
    color: var(--ria-muted);
}

/* Key detail pills */
.detail-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0;
    scrollbar-width: none;
}

.detail-pills::-webkit-scrollbar { display: none; }

.detail-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    border-radius: var(--ria-radius-pill);
    background: var(--ria-stone);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Description truncation */
.description-truncated {
    position: relative;
    max-height: 6em;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.description-truncated.expanded {
    max-height: none;
}

.description-truncated:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(transparent, #fff);
}

.btn-read-more {
    background: none;
    border: none;
    color: var(--ria-primary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0;
    cursor: pointer;
}

/* Static map thumbnail */
.map-thumbnail {
    aspect-ratio: 16 / 9;
    border-radius: var(--ria-radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.map-thumbnail .leaflet-container {
    height: 100%;
    width: 100%;
}

/* Agent card */
.agent-card {
    background: #fff;
    border-radius: var(--ria-radius);
    box-shadow: var(--ria-card-shadow);
    padding: 1.25rem;
}

.agent-card .agent-name {
    font-weight: 600;
    font-size: 1.0625rem;
}

.agent-card .btn-contact {
    min-height: 44px;
    border-radius: var(--ria-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-call {
    background: var(--ria-brand);
    color: #fff;
    border: none;
}

.btn-call:hover {
    background: var(--ria-brand-dark);
    color: #fff;
}

.btn-email {
    background: transparent;
    color: var(--ria-charcoal);
    border: 1.5px solid var(--ria-border);
}

.btn-email:hover {
    border-color: var(--ria-charcoal);
    background: var(--ria-stone);
    color: var(--ria-charcoal);
}

/* Sticky bottom bar (property detail, mobile) */
.sticky-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    padding: 0.75rem 1rem;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sticky-bottom-bar .bar-price {
    font-weight: 700;
    font-size: 1.125rem;
}

.sticky-bottom-bar .bar-price span {
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--ria-muted);
}

.sticky-bottom-bar .btn-cta {
    background: var(--ria-brand);
    color: #fff;
    border: none;
    border-radius: var(--ria-radius-sm);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    min-height: 48px;
    white-space: nowrap;
}

.sticky-bottom-bar .btn-cta:hover {
    background: var(--ria-brand-dark);
}

.sticky-bottom-bar .btn-cta:active {
    transform: scale(0.97);
}

@media (min-width: 992px) {
    .sticky-bottom-bar { display: none; }
}

/* Detail two-column layout (desktop) */
@media (min-width: 992px) {
    .detail-layout {
        display: flex;
        gap: 2rem;
    }

    .detail-main {
        flex: 1;
        min-width: 0;
    }

    .detail-sidebar {
        flex: 0 0 360px;
        position: sticky;
        top: 73px;
        align-self: flex-start;
    }
}

/* Let agreed / withdrawn banner */
.status-banner {
    background: #FEF3CD;
    border: 1px solid #FFE69C;
    border-radius: var(--ria-radius-sm);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-align: center;
    margin-bottom: 1rem;
}

.status-banner.let-agreed {
    background: #FEF3CD;
    border-color: #FFE69C;
    color: #856404;
}

.status-banner.withdrawn {
    background: #F8D7DA;
    border-color: #F5C2C7;
    color: #842029;
}

/* --- Breadcrumbs --- */
.breadcrumb {
    font-size: 0.8125rem;
    padding: 0.5rem 0;
    margin: 0;
    background: none;
}

.breadcrumb-item a {
    color: var(--ria-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* --- Pagination --- */
.pagination .page-link {
    border-radius: var(--ria-radius-sm);
    border: 1.5px solid var(--ria-border);
    color: var(--ria-charcoal);
    font-weight: 500;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.125rem;
}

.pagination .page-item.active .page-link {
    background: var(--ria-primary);
    border-color: var(--ria-primary);
    color: #fff;
}

/* --- Footer --- */
.site-footer {
    background: #1A1A1A;
    color: #999;
    padding: 4rem 0 0;
    margin-top: auto;
}

.footer-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
}

.footer-brand i {
    color: var(--ria-brand);
    margin-right: 0.125rem;
}

.footer-brand span {
    color: var(--ria-brand);
}

.footer-tagline {
    font-size: 0.875rem;
    color: #71717A;
    line-height: 1.6;
    max-width: 280px;
}

.footer-heading {
    font-weight: 600;
    font-size: 0.75rem;
    color: #E4E4E7;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.875rem;
}

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

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
    color: #9B9B9B;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 0;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #6B6B6B;
}

.footer-bottom a {
    color: #71717A;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.15s;
}

.footer-bottom a:hover {
    color: var(--ria-primary);
}

/* --- Show all photos button (on gallery grid) --- */
.show-all-photos-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: #fff;
    color: var(--ria-charcoal);
    border: 1px solid var(--ria-charcoal);
    border-radius: var(--ria-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
    transition: all var(--ria-transition);
}

.show-all-photos-btn:hover {
    background: var(--ria-charcoal);
    color: #fff;
}

.detail-gallery-grid {
    position: relative;
}

/* --- Photo tour (Airbnb scrollable gallery) --- */
.photo-tour {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 1070;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.photo-tour.active {
    display: flex;
}

.photo-tour-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--ria-border);
    flex-shrink: 0;
}

.photo-tour-close {
    background: none;
    border: none;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ria-charcoal);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--ria-radius-sm);
    transition: background var(--ria-transition);
}

.photo-tour-close:hover {
    background: var(--ria-stone);
}

.photo-tour-count {
    font-size: 0.875rem;
    color: var(--ria-muted);
}

.photo-tour-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.photo-tour-item {
    max-width: 900px;
    width: 100%;
    position: relative;
}

.photo-tour-item img {
    width: 100%;
    border-radius: var(--ria-radius);
    display: block;
}

.photo-tour-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--ria-muted);
    margin-top: 0.5rem;
    font-weight: 500;
}

.photo-tour-number {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.625rem;
    border-radius: var(--ria-radius-sm);
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1060;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox .lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
    min-width: 44px;
    min-height: 44px;
}

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

.lightbox .lightbox-counter {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.lightbox .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 1rem;
    min-width: 44px;
    min-height: 44px;
}

.lightbox .lightbox-prev { left: 0.5rem; }
.lightbox .lightbox-next { right: 0.5rem; }

/* --- Utility --- */
.text-primary { color: var(--ria-brand) !important; }

.bg-primary { background-color: var(--ria-primary) !important; }

.pb-sticky-bar {
    padding-bottom: 80px;
}

@media (min-width: 992px) {
    .pb-sticky-bar { padding-bottom: 0; }
}

/* Form inputs minimum size for mobile */
.form-control, .form-select {
    min-height: 44px;
    font-size: 1rem;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--ria-stone) 25%, #ede9e3 50%, var(--ria-stone) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--ria-radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Cookie Consent Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1070;
    background: var(--ria-charcoal);
    color: #e5e5e5;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
}

.cookie-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .cookie-banner-inner {
        flex-direction: row;
        align-items: center;
    }
}

.cookie-banner-text {
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

.cookie-link {
    color: #8fd3c0;
    text-decoration: underline;
}

.cookie-link:hover {
    color: #fff;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-btn-accept {
    background: var(--ria-brand);
    color: #fff;
    border: none;
    border-radius: var(--ria-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    min-height: 44px;
    white-space: nowrap;
}

.cookie-btn-accept:hover {
    background: var(--ria-brand-dark);
    color: #fff;
}

.cookie-btn-reject {
    background: transparent;
    color: #ccc;
    border: 1.5px solid #666;
    border-radius: var(--ria-radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    min-height: 44px;
    white-space: nowrap;
}

.cookie-btn-reject:hover {
    border-color: #aaa;
    color: #fff;
}

/* --- Empty states (Airbnb-inspired) --- */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    max-width: 420px;
    margin: 0 auto;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--ria-stone);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--ria-muted);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--ria-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.empty-state-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    align-items: center;
}

.empty-state-actions .btn-primary-action,
.btn-primary-action {
    background: var(--ria-brand);
    color: #fff;
    border: none;
    border-radius: var(--ria-radius-sm);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    min-height: 48px;
    font-size: 0.9375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-action:hover {
    background: var(--ria-brand-dark);
    color: #fff;
}

.btn-primary-action:active {
    transform: scale(0.97);
}

.btn-primary-action:focus-visible {
    box-shadow: var(--ria-focus-ring);
}

/* Secondary/outline button */
.btn-secondary-action {
    color: var(--ria-brand);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}

.btn-secondary-action:hover {
    color: var(--ria-brand-dark);
    text-decoration: underline;
}

.empty-state-actions .btn-secondary-action {
    color: var(--ria-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.15s;
}

.empty-state-actions .btn-secondary-action:hover {
    color: var(--ria-primary-dark);
}

.empty-state-suggestions {
    margin-top: 2.5rem;
    text-align: left;
}

.empty-state-suggestions h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ria-muted);
    margin-bottom: 0.75rem;
}

.empty-state-chip {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--ria-radius-pill);
    border: 1.5px solid var(--ria-border);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ria-charcoal);
    text-decoration: none;
    margin: 0.25rem;
    transition: all 0.2s;
}

.empty-state-chip:hover {
    border-color: var(--ria-primary);
    color: var(--ria-primary);
    background: var(--ria-primary-light);
}

/* --- Auth pages (Monzo-inspired) --- */
.auth-page {
    min-height: 100vh;
    display: flex;
}

.auth-panel-brand {
    flex: 0 0 45%;
    background: linear-gradient(160deg, var(--ria-brand) 0%, var(--ria-brand-dark) 60%, #1A1A1A 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-panel-brand { display: flex; }
}

.auth-panel-brand .auth-brand-logo {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.04em;
    z-index: 2;
    opacity: 0.9;
}

.auth-panel-brand .auth-brand-logo:hover { opacity: 1; }

.auth-panel-brand::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.auth-panel-brand::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.auth-panel-brand h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.auth-panel-brand p {
    font-size: 1.0625rem;
    opacity: 0.8;
    line-height: 1.6;
    max-width: 380px;
    position: relative;
    z-index: 1;
}

.auth-panel-brand .brand-features {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    position: relative;
    z-index: 1;
}

.auth-panel-brand .brand-features li {
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-panel-brand .brand-features i {
    font-size: 1.125rem;
    opacity: 0.7;
}

.auth-panel-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    position: relative;
    min-height: 100vh;
}

/* Mobile logo: show above form when brand panel is hidden */
.auth-mobile-logo {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--ria-charcoal);
    text-decoration: none;
    letter-spacing: -0.04em;
}

@media (min-width: 992px) {
    .auth-mobile-logo { display: none; }
    .auth-panel-form { padding: 2rem 3rem; }
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
}

.auth-form-inner h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.375rem;
}

@media (min-width: 992px) {
    .auth-form-inner h1 { font-size: 2rem; }
}

.auth-form-inner .auth-subtitle {
    color: var(--ria-muted);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.auth-form-inner .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.auth-form-inner .form-control {
    border-radius: var(--ria-radius-sm);
    border: 1.5px solid var(--ria-border);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form-inner .form-control:focus {
    border-color: var(--ria-primary);
    box-shadow: 0 0 0 3px rgba(15,110,86,0.1);
}

.auth-form-inner .btn-auth {
    width: 100%;
    background: var(--ria-brand);
    color: #fff;
    border: none;
    border-radius: var(--ria-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    min-height: 52px;
    margin-top: 0.5rem;
}

.auth-form-inner .btn-auth:hover {
    background: var(--ria-brand-dark);
}

.auth-form-inner .btn-auth:active {
    transform: scale(0.98);
}

.auth-form-inner .auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--ria-muted);
}

.auth-form-inner .auth-footer a {
    color: var(--ria-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-form-inner .auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    font-size: 0.8125rem;
    color: var(--ria-muted);
}

.auth-form-inner .auth-divider::before,
.auth-form-inner .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ria-border);
}

/* --- Static page styling --- */
.static-page {
    max-width: 720px;
    margin: 0 auto;
}

.static-page-hero {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ria-border);
}

.static-page-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0;
}

@media (min-width: 768px) {
    .static-page-title { font-size: 2.25rem; }
}

.static-page-subtitle {
    font-size: 1.0625rem;
    color: var(--ria-muted);
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

.static-page-updated {
    font-size: 0.8125rem;
    color: var(--ria-muted);
    margin: 0.75rem 0 0;
}

.static-page-body {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #3A3A38;
}

.static-page-body h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ria-border);
}

.static-page-body h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 1.5rem;
}

.static-page-body h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.static-page-body p {
    margin-bottom: 1rem;
}

.static-page-body ul, .static-page-body ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.static-page-body li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

.static-page-body a {
    color: var(--ria-primary);
    font-weight: 500;
}

.static-page-body a:hover {
    color: var(--ria-primary-dark);
}

.static-page-body table {
    margin: 1rem 0;
}

/* --- Social share buttons (floating bar) --- */
.share-float {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

@media (min-width: 1200px) {
    .share-float {
        position: sticky;
        top: 80px;
        float: left;
        flex-direction: column;
        margin-left: -56px;
        margin-bottom: 0;
        z-index: 10;
    }
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--ria-border);
    background: #fff;
    color: var(--share-color, var(--ria-muted));
    font-size: 1.0625rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.share-btn:hover {
    border-color: currentColor;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Map popup card (Airbnb-style) */
.map-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: var(--ria-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 0;
    overflow: hidden;
}

.map-popup-wrapper .leaflet-popup-content {
    margin: 0;
    width: 100% !important;
}

.map-popup-wrapper .leaflet-popup-tip {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.map-popup-card {
    display: block;
    text-decoration: none;
    color: var(--ria-charcoal);
}

.map-popup-card:hover {
    color: var(--ria-charcoal);
}

.map-popup-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.map-popup-noimg {
    width: 100%;
    height: 100px;
    background: var(--ria-stone);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ria-muted);
    font-size: 1.5rem;
}

.map-popup-body {
    padding: 0.75rem;
}

.map-popup-price {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.map-popup-price span {
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--ria-muted);
}

.map-popup-details {
    font-size: 0.8125rem;
    color: var(--ria-muted);
    margin-top: 0.125rem;
}

.map-popup-address {
    font-size: 0.8125rem;
    color: var(--ria-charcoal);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* School pin on map */
.school-map-pin {
    background: #fff;
    border: 2px solid #4F46E5;
    border-radius: 50%;
    width: 28px !important;
    height: 28px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #4F46E5;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* --- Broadband/connectivity card --- */
.connectivity-card {
    border-radius: var(--ria-radius);
    border: 1px solid var(--ria-border);
    padding: 1rem 1.25rem;
    background: #fff;
}

.connectivity-card .conn-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--ria-border);
    font-size: 0.875rem;
}

.connectivity-card .conn-item:last-child {
    border-bottom: none;
}

.connectivity-card .conn-label {
    color: var(--ria-muted);
}

.connectivity-card .conn-value {
    font-weight: 600;
    color: var(--ria-charcoal);
}

/* --- Agent profile hero --- */
.agent-hero {
    position: relative;
    border-radius: var(--ria-radius);
    overflow: hidden;
}

.agent-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--ria-primary) 0%, var(--ria-primary-dark) 60%, var(--ria-charcoal) 100%);
    opacity: 0.95;
}

.agent-hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 1.5rem;
    color: #fff;
}

@media (min-width: 768px) {
    .agent-hero-content { padding: 2.5rem 2rem; }
}

.agent-hero-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

@media (min-width: 768px) {
    .agent-hero-logo { width: 88px; height: 88px; border-radius: 20px; }
}

.agent-hero-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2rem;
    color: var(--ria-primary);
}

.agent-hero-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
    color: #fff;
}

@media (min-width: 768px) {
    .agent-hero-name { font-size: 2rem; }
}

.agent-hero-subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0.25rem 0 0;
}

/* --- Blog content typography --- */
.blog-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.blog-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-content p {
    margin-bottom: 1.25rem;
}

.blog-content ul, .blog-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.25rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.blog-content blockquote {
    border-left: 3px solid var(--ria-primary);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--ria-stone);
    border-radius: 0 var(--ria-radius-sm) var(--ria-radius-sm) 0;
    font-style: italic;
    color: #5A5A58;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ria-radius);
    margin: 1.5rem 0;
}

.blog-content a {
    color: var(--ria-primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-content a:hover {
    color: var(--ria-primary-dark);
}

/* --- Smooth button press for all primary buttons --- */
.btn-call, .btn-cta, .btn-search, .btn-apply, .cookie-btn-accept {
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-call:active, .btn-cta:active, .btn-search:active, .btn-apply:active, .cookie-btn-accept:active {
    transform: scale(0.97);
}

/* Mobile specific */
@media (max-width: 767.98px) {
    .d-mobile-none { display: none !important; }
    .container { padding-left: 0.75rem; padding-right: 0.75rem; }
}
