:root {
    --ba-red: #9a3624;
    --ba-gray: #5e5c5c;
    --ba-light: #fafafa;
    --ba-lighter: #f5f5f5;
    --ba-surface: #F8F9FB;
    --ba-border: #e5e7eb;
    --ba-text: #1f2937;
    --ba-muted: #6b7280;
    --ba-dark: #111827;

    --step-0: clamp(16px, 1.1vw + 13px, 18px);
    --step-1: clamp(18px, 1.3vw + 14px, 20px);
    --step-2: clamp(20px, 1.6vw + 14px, 24px);
    --step-3: clamp(24px, 2.2vw + 12px, 36px);
    --step-4: clamp(32px, 2.8vw + 16px, 48px);

    --space-3: clamp(8px, 0.8vw, 12px);
    --space-4: clamp(12px, 1vw, 16px);
    --space-6: clamp(16px, 1.2vw, 24px);
    --space-8: clamp(24px, 1.6vw, 32px);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-size: var(--step-0);
}

.hero-banner {
    height: 300px !important;
    min-height: 300px;
}

@media (min-width: 768px) {
    .hero-banner {
        height: 360px !important;
        min-height: 360px;
    }
}

@media (min-width: 1024px) {
    .hero-banner {
        height: 420px !important;
        min-height: 420px;
    }
}

#interest-form {
    scroll-margin-top: 140px;
}

@media (min-width: 1024px) {
    #interest-form {
        scroll-margin-top: 180px;
    }
}

h1 {
    font-size: var(--step-4);
}

h2 {
    font-size: var(--step-3);
}

h3 {
    font-size: var(--step-2);
}


.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #f3f4f6;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background-color: white;
}

.carousel-dot:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

nav a {
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--ba-red);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

a,
button {
    transition: all 0.3s ease;
}

:focus-visible {
    outline: 2px solid var(--ba-red);
    outline-offset: 2px;
}

#mobile-menu {
    transition: max-height 0.3s ease-out;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(154, 54, 36, 0.1);
}

button,
.button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

button::after,
.button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::after,
.button:hover::after {
    width: 300px;
    height: 300px;
}


.absolute.inset-0 {
    object-fit: cover;
    width: 100%;
    height: 100%;
}


@media print {

    header,
    aside,
    .carousel-dot {
        display: none !important;
    }

    main {
        max-width: 100% !important;
    }

    footer,
    footer * {
        color: #000 !important;
    }

    footer {
        background: none !important;
    }

    footer a {
        text-decoration: underline;
    }
}

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

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .carousel {
        height: 400px;
    }

    .text-hero-mobile {
        font-size: 2.5rem;
    }

    header {
        position: sticky;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 640px) {
    .max-w-banner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (prefers-contrast: high) {
    :root {
        --ba-red: #8a2214;
        --ba-border: #000;
    }

    a {
        text-decoration: underline;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --ba-light: #0b0b0c;
        --ba-lighter: #111317;
        --ba-surface: #1a1b1f;
        --ba-border: #22252a;
        --ba-text: #e7e7ea;
        --ba-muted: #a1a1aa;
    }

    body {
        background-color: var(--ba-light);
        color: var(--ba-text);
    }

    .bg-white {
        background-color: var(--ba-lighter);
    }

    .bg-ba-surface {
        background-color: var(--ba-surface);
    }

    .text-ba-dark {
        color: var(--ba-text);
    }

    .shadow-inset-card {
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.shadow-sm {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--ba-lighter);
}

::-webkit-scrollbar-thumb {
    background: var(--ba-muted);
    border-radius: 6px;
    border: 2px solid var(--ba-lighter);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ba-gray);
}

::selection {
    background-color: var(--ba-red);
    color: white;
}

::-moz-selection {
    background-color: var(--ba-red);
    color: white;
}

.map-preview {
    width: 100%;
    min-height: 320px;
}

.map-extra {
    margin-bottom: 1.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

@media (max-width: 639px) {
    .map-preview {
        min-height: 260px;
    }
}

@media (min-width: 1024px) {
    .map-preview {
        min-height: 450px;
    }
}

@media (min-width: 900px) {
    .map-container {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }
}

@media (max-width: 899px) {
    .map-sidebar {
        display: none;
    }
}

.map-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    z-index: 60;
}

.map-overlay.hidden {
    display: none;
}

.map-overlay.active {
    display: flex;
}

.map-overlay__content {
    width: min(95vw, 1100px);
    height: min(85vh, 720px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 50px -12px rgba(17, 24, 39, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.map-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.map-overlay__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.map-overlay__subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.map-overlay__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-overlay__close:hover {
    background: #f3f4f6;
    color: #111827;
}

.map-overlay__map {
    flex: 1;
    min-height: 0;
}

.map-popup {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-width: 220px;
}

/* Fix Google Maps close button positioning */
.gm-style-iw-c {
    padding: 12px !important;
    overflow: visible !important;
}

.gm-style-iw-d {
    overflow: visible !important;
}

.gm-style-iw-chr {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    transform: translate(35%, -35%) !important;
    z-index: 1000 !important;
    overflow: visible !important;
}

.gm-style-iw-chr button {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    width: 32px !important;
    height: 32px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.gm-style-iw-chr button span {
    margin: 0 !important;
}

.gm-style-iw-chr button:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25) !important;
}

.gm-style .gm-style-iw-t::after {
    display: none !important;
}

.map-popup__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.1rem;
}

.map-popup__meta {
    font-size: 0.75rem;
    color: #4b5563;
    margin: 0;
}

.map-popup__cta {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9a3624;
    text-decoration: none;
}

.map-popup__cta:hover {
    text-decoration: underline;
}

.map-popup__cta svg {
    width: 14px;
    height: 14px;
    margin-left: 0.25rem;
}


.map-popup__image {
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 6px;
    width: 60px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

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

.map-popup__header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.map-popup__summary {
    flex: 1;
    min-width: 0;
}

.map-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.25rem;
}

.map-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.map-filter-chip.active {
    border-color: #9a3624;
    background-color: rgba(154, 54, 36, 0.08);
    color: #9a3624;
}

.map-filter-chip:hover {
    border-color: #9a3624;
    color: #9a3624;
}

.map-filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    display: inline-flex;
}

.map-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4b5563;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
}

.map-filter-toggle input {
    accent-color: #9a3624;
}

.map-filter-reset {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    background-color: transparent;
    transition: all 0.2s ease;
}

.map-filter-reset:hover {
    color: #9a3624;
    border-color: rgba(154, 54, 36, 0.25);
}

.map-fold-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #9a3624;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}

.map-fold-button svg {
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

.map-fold-button[aria-expanded="true"] svg {
    transform: rotate(90deg);
}

.map-fold-button--expanded {
    color: #111827;
}

.map-fold-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    text-align: left;
    line-height: 1.35;
}

.map-fold-text-desktop {
    display: none;
}

.map-fold-text-mobile {
    display: inline;
}

@media (min-width: 640px) {
    .map-fold-text {
        flex-direction: row;
        align-items: center;
        gap: 0.35rem;
    }

    .map-fold-text-desktop {
        display: inline;
    }

    .map-fold-text-mobile {
        display: none;
    }
}

.map-wrapper.collapsed .map-extra,
.map-wrapper.collapsed .map-preview {
    display: none;
}

.hero-banner .hero-content {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.hero-banner .hero-content.text-left {
    text-align: left;
    margin-left: 0;
    margin-right: auto;
}

.hero-banner .hero-content h1 {
    font-size: clamp(1.65rem, 2vw + 0.85rem, 2.6rem);
    line-height: 1.1;
    margin-bottom: clamp(0.5rem, 1.5vw, 1.25rem);
}

.hero-banner .hero-content p {
    font-size: clamp(0.95rem, 1.2vw + 0.4rem, 1.15rem);
    line-height: 1.55;
    margin-bottom: clamp(0.75rem, 1.5vw, 1.5rem);
}

.hero-banner .hero-content .hero-actions {
    gap: clamp(0.5rem, 1vw, 0.75rem);
}

/* Map Expanded Fullscreen Styles */
.map-wrapper {
    position: relative;
    transition: all 0.3s ease;
}

.map-wrapper--fixed-overlay {
    position: fixed;
    top: 90px;
    /* Increased to clear header */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    /* Below header z-index */
    background-color: white;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 90px) !important;
    width: 100vw !important;
}

.map-wrapper--fixed-overlay .map-preview {
    flex: 1;
    height: auto !important;
    min-height: 0;
}

.map-wrapper--fixed-overlay #unitsMapFullscreenClose {
    top: 1rem;
    right: 1rem;
    z-index: 60;
    display: flex !important;
    /* Force show on mobile fixed overlay */
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.map-wrapper--fixed-overlay .map-extra>* {
    pointer-events: auto;
}

.map-wrapper--fixed-overlay #unitsMapFilters,
.map-wrapper--fixed-overlay #propertiesMapFilters {
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    align-items: flex-start;
}

.map-wrapper--fixed-overlay #unitsMapIntro,
.map-wrapper--fixed-overlay #propertiesMapIntro {
    display: none;
}

.map-wrapper--fixed-overlay .map-extra {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 4rem;
    /* Leave space for close button */
    z-index: 10;
    pointer-events: none;
}
