/* ==========================================================================
   Habita · mapa público
   ========================================================================== */

.public-app {
    height: 100%;
    overflow: hidden;
    background: #e8e6df;
}

.map-app {
    position: relative;
    height: 100dvh;
    min-height: 560px;
    overflow: hidden;
    isolation: isolate;
}

.map-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #e6e4dc;
}

html[data-theme="dark"] .map-canvas {
    background: #121814;
}

/* Cargador --------------------------------------------------------------- */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 18px;
    color: var(--ink);
    background:
        radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 34%),
        var(--canvas);
    transition: opacity 500ms var(--ease), visibility 500ms;
}

.app-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loader__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    animation: fadeUp 500ms var(--ease) both;
}

.app-loader__brand .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: calc((28px) * var(--text-scale, 1));
}

.app-loader__brand .brand-name {
    font-size: calc((34px) * var(--text-scale, 1));
}

.app-loader__line {
    width: 150px;
    height: 2px;
    overflow: hidden;
    border-radius: var(--r-pill);
    background: var(--line);
}

.app-loader__line span {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    animation: loaderBar 1.15s ease-in-out infinite;
}

.app-loader p {
    color: var(--muted);
    font-size: calc((10px) * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

@keyframes loaderBar {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(340%); }
}

.noscript-banner {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 9999;
    padding: 12px;
    color: #fff;
    background: var(--danger);
    font-size: calc((13px) * var(--text-scale, 1));
    text-align: center;
}

/* Barra superior --------------------------------------------------------- */
.public-topbar {
    position: absolute;
    z-index: 1000;
    top: 18px;
    right: 20px;
    left: 20px;
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(340px, 620px) minmax(160px, 1fr);
    align-items: start;
    gap: 20px;
    pointer-events: none;
}

.public-topbar > * {
    pointer-events: auto;
}

.brand--floating {
    display: inline-flex;
    width: max-content;
    height: 50px;
    padding: 0 15px 0 7px;
    border-radius: 16px;
    background: var(--surface-glass);
    transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.brand--floating:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.brand--floating .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: calc((23px) * var(--text-scale, 1));
}

.brand--floating .brand-name {
    font-size: calc((25px) * var(--text-scale, 1));
}

.search-cluster {
    position: relative;
    width: 100%;
}

.search-bar {
    display: flex;
    height: 56px;
    align-items: center;
    gap: 9px;
    padding: 6px 7px 6px 8px;
    border-radius: 18px;
    background: var(--surface-glass-strong);
    box-shadow:
        0 16px 40px -18px rgba(18, 30, 24, 0.4),
        0 2px 6px rgba(18, 30, 24, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

html[data-theme="dark"] .search-bar {
    box-shadow:
        0 20px 50px -18px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-bar:focus-within {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
    box-shadow:
        0 22px 55px -18px rgba(18, 30, 24, 0.44),
        0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.search-icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    color: var(--muted-strong);
    transition: color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.search-icon-button:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.search-icon-button .icon {
    width: 18px;
    height: 18px;
}

.search-divider {
    width: 1px;
    height: 22px;
    flex: 0 0 auto;
    background: var(--line);
}

.search-leading {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.search-leading .icon {
    width: 19px;
    height: 19px;
}

.search-input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: calc((13px) * var(--text-scale, 1));
    font-weight: 550;
    letter-spacing: -0.005em;
}

.search-input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

.search-input::-webkit-search-cancel-button {
    display: none;
}

.search-kbd {
    display: inline-flex;
    height: 25px;
    align-items: center;
    padding: 0 8px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface-muted);
    font-family: var(--font-sans);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.search-clear {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
}

.search-clear:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.search-clear .icon {
    width: 15px;
    height: 15px;
}

.search-submit {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: var(--inverse-ink);
    background: var(--ink);
    box-shadow: 0 5px 14px -7px rgba(20, 33, 26, 0.45);
    transition: transform var(--speed) var(--ease), background var(--speed) var(--ease);
}

.search-submit:hover {
    background: var(--forest);
    transform: translateY(-1px);
}

.search-submit .icon {
    width: 17px;
    height: 17px;
}

.search-popover {
    position: absolute;
    z-index: 1100;
    top: calc(100% + 9px);
    right: 0;
    left: 0;
    max-height: min(460px, calc(100dvh - 160px));
    padding: 8px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-glass-strong);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    animation: popoverIn 200ms var(--ease) both;
}

@keyframes popoverIn {
    from { opacity: 0; transform: translateY(-5px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.search-popover__label {
    padding: 9px 12px 6px;
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.search-result-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    padding: 8px;
    border-radius: 12px;
    text-align: left;
    transition: background var(--speed) var(--ease);
}

.search-result-item:hover,
.search-result-item.is-focused {
    background: var(--surface-muted);
}

.search-result-item__thumb {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface-muted);
}

.search-result-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-item__copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.search-result-item__copy strong {
    overflow: hidden;
    font-size: calc((12px) * var(--text-scale, 1));
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-item__copy span {
    overflow: hidden;
    color: var(--muted);
    font-size: calc((10.5px) * var(--text-scale, 1));
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-item__price {
    margin-left: auto;
    padding-left: 10px;
    color: var(--ink);
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 800;
    white-space: nowrap;
}

.search-suggestion-action {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 12px;
    text-align: left;
    transition: background var(--speed) var(--ease);
}

.search-suggestion-action:hover {
    background: var(--surface-muted);
}

.search-suggestion-action__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    color: var(--accent-ink);
    background: var(--accent-soft);
}

.search-suggestion-action__icon .icon {
    width: 16px;
    height: 16px;
}

.search-suggestion-action span {
    font-size: calc((12px) * var(--text-scale, 1));
    font-weight: 650;
}

.search-suggestion-action small {
    margin-left: auto;
    color: var(--muted);
    font-size: calc((10px) * var(--text-scale, 1));
}

.search-popover__empty {
    padding: 24px 16px;
    color: var(--muted);
    font-size: calc((12px) * var(--text-scale, 1));
    text-align: center;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.top-actions .icon-button {
    width: 44px;
    height: 44px;
    background: var(--surface-glass-strong);
}

.theme-toggle .theme-icon {
    display: grid;
    place-items: center;
}

.theme-toggle .theme-icon--dark {
    display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon--light {
    display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon--dark {
    display: grid;
}

.top-contact {
    height: 44px;
    padding: 0 17px;
    gap: 8px;
    background: var(--ink);
    box-shadow:
        0 10px 24px -10px rgba(20, 33, 26, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.top-contact .icon {
    width: 16px;
    height: 16px;
}

/* Panel explorador ------------------------------------------------------- */
.explore-panel {
    position: absolute;
    z-index: 800;
    top: 90px;
    bottom: 18px;
    left: 18px;
    display: flex;
    width: var(--panel-width);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 80%, white);
    border-radius: var(--r-xl);
    background: var(--surface-glass-strong);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(30px) saturate(1.18);
    -webkit-backdrop-filter: blur(30px) saturate(1.18);
    animation: panelIn 520ms var(--ease) both;
    transition:
        transform 420ms var(--ease),
        opacity 300ms var(--ease),
        visibility 420ms;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.explore-panel.is-hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateX(calc(-100% - 34px));
}

.panel-scroll {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
}

.panel-hero {
    position: relative;
    flex: 0 0 auto;
    padding: 25px 24px 19px;
    background:
        radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 58%),
        linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 58%, transparent), transparent);
}

.panel-hero::after {
    position: absolute;
    right: 24px;
    bottom: 0;
    left: 24px;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--line) 16%, var(--line) 84%, transparent);
}

.panel-hero__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 40px;
}

.panel-updated {
    display: inline-flex;
    align-items: center;
    height: 21px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.panel-hero h1 {
    max-width: 320px;
    margin-top: 10px;
    font-family: var(--font-display);
    font-size: calc((clamp(31px, 2.4vw, 37px)) * var(--text-scale, 1));
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.panel-hero__sub {
    max-width: 310px;
    margin-top: 9px;
    color: var(--muted-strong);
    font-size: calc((11.5px) * var(--text-scale, 1));
    line-height: 1.55;
}

.panel-stats {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 16px;
}

.panel-stat {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.panel-stat strong {
    font-size: calc((14px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: -0.02em;
}

.panel-stat span {
    color: var(--muted);
    font-size: calc((9.5px) * var(--text-scale, 1));
    font-weight: 600;
}

.panel-stat-divider {
    width: 1px;
    height: 11px;
    background: var(--line-strong);
}

.panel-collapse {
    position: absolute;
    z-index: 2;
    top: 20px;
    right: 18px;
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    transition: color var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.panel-collapse:hover {
    color: var(--ink);
    background: var(--surface-elevated);
    transform: translateX(-1px);
}

.panel-collapse .icon {
    width: 14px;
    height: 14px;
}

.panel-grabber {
    display: none;
}

.panel-tools {
    flex: 0 0 auto;
    padding: 14px 18px 8px;
}

.operation-switch {
    display: flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface-muted);
    overflow-x: auto;
    scrollbar-width: none;
}

.operation-switch::-webkit-scrollbar {
    display: none;
}

.operation-switch button {
    flex: 1 1 0;
    min-width: 64px;
    min-height: 33px;
    padding: 0 10px;
    border-radius: 9px;
    color: var(--muted-strong);
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 700;
    white-space: nowrap;
    transition: color var(--speed) var(--ease), background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.operation-switch button:hover {
    color: var(--ink);
}

.operation-switch button.is-active {
    color: var(--inverse-ink);
    background: var(--ink);
    box-shadow: 0 4px 10px -5px rgba(20, 33, 26, 0.4);
}

.type-strip {
    display: flex;
    gap: 7px;
    margin: 12px -2px 0;
    padding: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.type-strip::-webkit-scrollbar {
    display: none;
}

.type-chip {
    display: inline-flex;
    height: 34px;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--ink-soft);
    background: color-mix(in srgb, var(--surface-elevated) 72%, transparent);
    font-size: calc((10.5px) * var(--text-scale, 1));
    font-weight: 700;
    white-space: nowrap;
    transition:
        color var(--speed) var(--ease),
        background var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        transform var(--speed) var(--ease);
}

.type-chip .icon {
    width: 14px;
    height: 14px;
    color: var(--chip-color, var(--muted));
}

.type-chip:hover {
    border-color: var(--line-strong);
    background: var(--surface-elevated);
    transform: translateY(-1px);
}

.type-chip.is-active {
    color: var(--inverse-ink);
    border-color: var(--ink);
    background: var(--ink);
}

.type-chip.is-active .icon {
    color: var(--inverse-ink);
}

.type-chip__count {
    display: inline-grid;
    min-width: 16px;
    height: 16px;
    place-items: center;
    padding: 0 4px;
    border-radius: var(--r-pill);
    color: var(--muted);
    background: var(--surface-muted);
    font-size: calc((8.5px) * var(--text-scale, 1));
}

.type-chip.is-active .type-chip__count {
    color: var(--inverse-ink);
    background: rgba(255, 255, 255, 0.14);
}

.type-chip.skeleton {
    width: 78px;
    border-color: transparent;
    background: var(--surface-muted);
    pointer-events: none;
}

.type-chip.skeleton:nth-child(2) {
    width: 98px;
}

.type-chip.skeleton:nth-child(3) {
    width: 70px;
}

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.results-count {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 5px;
}

.results-count strong {
    font-size: calc((14px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: -0.02em;
}

.results-count span {
    overflow: hidden;
    color: var(--muted);
    font-size: calc((10px) * var(--text-scale, 1));
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

.filter-trigger {
    display: inline-flex;
    height: 32px;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--ink-soft);
    background: transparent;
    font-size: calc((10px) * var(--text-scale, 1));
    font-weight: 750;
    transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.filter-trigger:hover {
    border-color: var(--line-strong);
    background: var(--surface-muted);
}

.filter-trigger[aria-pressed="true"] {
    border-color: var(--forest);
    color: var(--inverse-ink);
    background: var(--forest);
}

.filter-trigger[aria-pressed="true"]:hover {
    border-color: var(--forest);
    background: var(--forest);
}

.favorites-trigger .icon {
    color: var(--accent);
}

.favorites-trigger[aria-pressed="true"] .icon {
    color: inherit;
}

.favorites-trigger[aria-pressed="true"] .filter-badge {
    color: var(--forest);
    background: var(--inverse-ink);
}

.filter-badge {
    display: inline-grid;
    min-width: 16px;
    height: 16px;
    place-items: center;
    padding: 0 4px;
    border-radius: var(--r-pill);
    color: var(--surface);
    background: var(--accent);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 800;
}

.sort-control {
    position: relative;
    display: inline-flex;
    height: 32px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted-strong);
    background: transparent;
    transition: border-color var(--speed) var(--ease);
}

.sort-control:hover {
    border-color: var(--line-strong);
}

.sort-control select {
    height: 100%;
    padding: 0 26px 0 11px;
    border: 0;
    outline: 0;
    color: inherit;
    background: transparent;
    font-size: calc((10px) * var(--text-scale, 1));
    font-weight: 700;
    appearance: none;
    cursor: pointer;
}

.sort-control select option {
    color: var(--ink);
    background: var(--surface);
}

.sort-control > .icon {
    position: absolute;
    right: 8px;
    width: 12px;
    height: 12px;
    pointer-events: none;
}

.active-filters {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.active-filters::-webkit-scrollbar {
    display: none;
}

.active-filter {
    display: inline-flex;
    height: 25px;
    align-items: center;
    gap: 5px;
    padding: 0 7px 0 10px;
    flex: 0 0 auto;
    border: 0;
    border-radius: var(--r-pill);
    color: var(--accent-ink);
    background: var(--accent-soft);
    font-size: calc((9.5px) * var(--text-scale, 1));
    font-weight: 700;
}

.active-filter .icon {
    width: 11px;
    height: 11px;
}

.active-filter:hover {
    filter: brightness(0.97);
}

/* Resultados ------------------------------------------------------------- */
.results-scroll {
    min-height: 0;
    flex: 1;
    padding: 6px 10px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-card {
    position: relative;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 17px;
    text-align: left;
    background: transparent;
    cursor: pointer;
    transition:
        background var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        transform var(--speed) var(--ease);
    animation: cardIn 360ms var(--ease) both;
    animation-delay: var(--delay, 0ms);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.property-card:hover {
    border-color: var(--line);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.property-card.is-selected {
    border-color: color-mix(in srgb, var(--ink) 12%, var(--line));
    background: var(--surface-elevated);
    box-shadow: var(--shadow-md);
}

.property-card.is-selected::before {
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: -1px;
    width: 3px;
    content: "";
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.property-card__thumb {
    position: relative;
    width: 112px;
    height: 105px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--surface-muted);
}

.property-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 550ms var(--ease);
}

.property-card:hover .property-card__thumb img {
    transform: scale(1.045);
}

.property-card__thumb-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--muted);
    background:
        linear-gradient(135deg, var(--surface-muted), color-mix(in srgb, var(--accent) 7%, var(--surface-muted)));
}

.property-card__thumb-placeholder .icon {
    width: 26px;
    height: 26px;
    opacity: 0.55;
}

.card-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-flex;
    height: 20px;
    align-items: center;
    gap: 4px;
    padding: 0 7px;
    border-radius: 6px;
    color: var(--inverse-ink);
    background: rgba(255, 253, 249, 0.92);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.card-badge--featured {
    color: #fff;
    background: rgba(24, 34, 29, 0.78);
}

.card-badge--reserved {
    color: #5f4615;
    background: rgba(251, 238, 209, 0.95);
}

.card-favorite {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255, 253, 249, 0.9);
    box-shadow: 0 2px 8px rgba(13, 22, 17, 0.16);
    backdrop-filter: blur(8px);
    transition: transform var(--speed) var(--ease-spring), background var(--speed) var(--ease);
}

.card-favorite:hover {
    transform: scale(1.08);
}

.card-favorite .icon {
    width: 13px;
    height: 13px;
}

.card-favorite.is-favorite {
    color: var(--accent);
    background: #fff;
}

.card-favorite.is-favorite .icon {
    fill: currentColor;
}

.property-card__favorite {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}

.property-card__copy {
    display: flex;
    min-width: 0;
    padding: 3px 4px 3px 0;
    flex-direction: column;
}

.property-card__type-row {
    display: flex;
    min-height: 17px;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding-right: 26px;
}

.property-card__type {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    color: var(--muted-strong);
    font-size: calc((8.5px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.075em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.property-card__type-dot {
    width: 5px;
    height: 5px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--type-color, var(--accent));
}

.property-card__code {
    color: var(--muted);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: 0.04em;
}

.property-card__title {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: var(--ink);
    font-size: calc((12.5px) * var(--text-scale, 1));
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -0.012em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.property-card__location {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    color: var(--muted);
    font-size: calc((9.5px) * var(--text-scale, 1));
    font-weight: 500;
}

.property-card__location .icon {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
}

.property-card__location span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.property-card__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 7px;
}

.property-card__price {
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    gap: 3px;
    font-size: calc((13px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: -0.035em;
}

.property-card__price small {
    color: var(--muted);
    font-size: calc((8.5px) * var(--text-scale, 1));
    font-weight: 600;
    letter-spacing: 0;
}

.property-card__specs {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: calc((8.5px) * var(--text-scale, 1));
    font-weight: 650;
}

.property-card__specs span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.property-card__specs .icon {
    width: 11px;
    height: 11px;
}

.results-empty {
    padding-top: 32px;
}

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 8px 10px;
    color: var(--muted);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 600;
    letter-spacing: 0.02em;
}

.panel-footer__note {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-skeleton {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 8px;
}

.result-skeleton__thumb {
    width: 112px;
    height: 105px;
    border-radius: 12px;
}

.result-skeleton__copy {
    display: flex;
    padding-top: 6px;
    flex-direction: column;
    gap: 9px;
}

.result-skeleton__copy .skeleton {
    display: block;
}

.panel-restore {
    position: absolute;
    z-index: 800;
    top: 92px;
    left: 18px;
    display: inline-flex;
    height: 44px;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border-radius: var(--r-pill);
    color: var(--ink);
    box-shadow: var(--shadow-md);
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 700;
    animation: fadeUp 260ms var(--ease) both;
}

.panel-restore .icon {
    width: 16px;
    height: 16px;
}

.panel-restore strong {
    font-weight: 850;
}

/* Controles de mapa ------------------------------------------------------ */
.map-controls {
    position: absolute;
    z-index: 900;
    top: 92px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 6px;
    border-radius: 18px;
    background: var(--surface-glass-strong);
    box-shadow: var(--shadow-md);
}

.basemap-switch {
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
}

.basemap-switch button {
    display: inline-flex;
    height: 31px;
    align-items: center;
    gap: 5px;
    padding: 0 9px;
    border-radius: 8px;
    color: var(--muted-strong);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 700;
    transition: color var(--speed) var(--ease), background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.basemap-switch button .icon {
    width: 14px;
    height: 14px;
}

.basemap-switch button:hover {
    color: var(--ink);
}

.basemap-switch button.is-active {
    color: var(--ink);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-xs);
}

.map-controls__divider {
    width: 1px;
    height: 23px;
    margin: 0 2px;
    flex: 0 0 auto;
    background: var(--line);
}

.map-tool {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: var(--ink-soft);
    transition: color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.map-tool:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.map-tool.is-tracking,
.map-tool.is-tracking:hover {
    color: var(--inverse-ink);
    background: var(--forest);
}

.map-tool.map-follow[aria-pressed="true"],
.map-tool.map-follow[aria-pressed="true"]:hover {
    color: var(--accent-ink);
    background: var(--accent-soft);
}

.map-tool.map-follow[hidden] {
    display: none;
}

.map-tool .icon {
    width: 17px;
    height: 17px;
}

.map-tool.is-loading .icon {
    display: none;
}

.map-tool.is-loading::after {
    width: 14px;
    height: 14px;
    content: "";
    border: 2px solid color-mix(in srgb, var(--ink) 20%, transparent);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.zoom-control {
    display: flex;
    width: 36px;
    flex-direction: column;
    align-items: center;
}

.zoom-control .map-tool {
    height: 28px;
    border-radius: 7px;
}

.zoom-control > span {
    width: 18px;
    height: 1px;
    margin: 1px 0;
    background: var(--line);
}

.map-helper {
    position: absolute;
    z-index: 700;
    bottom: 24px;
    left: 50%;
    display: inline-flex;
    height: 34px;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--r-pill);
    color: rgba(255, 255, 255, 0.92);
    background: rgba(23, 33, 27, 0.78);
    box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.45);
    font-size: calc((9.5px) * var(--text-scale, 1));
    font-weight: 600;
    letter-spacing: 0.01em;
    pointer-events: none;
    backdrop-filter: blur(14px);
    transform: translateX(-50%);
    transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.map-helper__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8ddbb0;
    box-shadow: 0 0 0 3px rgba(141, 219, 176, 0.15);
}

.map-location-chip {
    position: absolute;
    z-index: 700;
    bottom: 18px;
    left: calc(var(--panel-width) + 38px);
    display: inline-flex;
    height: 34px;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    color: var(--muted-strong);
    background: var(--surface-glass);
    box-shadow: var(--shadow-sm);
    font-size: calc((9.5px) * var(--text-scale, 1));
    font-weight: 650;
    transition: left 420ms var(--ease);
}

body.panel-collapsed .map-location-chip {
    left: 18px;
}

/* Leaflet ---------------------------------------------------------------- */
.leaflet-container {
    background: #e7e5dd;
    font-family: var(--font-sans);
    outline: none;
}

html[data-theme="dark"] .leaflet-container {
    background: #101612;
}

.leaflet-container a {
    color: inherit;
}

.leaflet-control-attribution {
    padding: 2px 7px !important;
    border-radius: 5px 0 0 0;
    color: rgba(43, 57, 49, 0.68) !important;
    background: rgba(255, 253, 249, 0.72) !important;
    font-size: calc((8px) * var(--text-scale, 1)) !important;
    line-height: 1.5 !important;
    backdrop-filter: blur(6px);
}

html[data-theme="dark"] .leaflet-control-attribution {
    color: rgba(235, 238, 235, 0.65) !important;
    background: rgba(17, 24, 20, 0.72) !important;
}

.leaflet-control-attribution a {
    color: inherit !important;
}

html[data-theme="light"] .leaflet-container[data-basemap="map"] .leaflet-tile {
    filter: saturate(0.52) contrast(0.94) brightness(1.045);
}

html[data-theme="dark"] .leaflet-container[data-basemap="map"] .leaflet-tile {
    filter: saturate(0.72) brightness(1.02);
}

.leaflet-container .leaflet-interactive:focus {
    outline: none;
}

/* Marcadores ------------------------------------------------------------- */
.habita-marker {
    border: 0 !important;
    background: transparent !important;
}

.price-pin {
    position: absolute;
    left: 0;
    bottom: 0;
    width: max-content;
    transform: translateX(-50%);
    filter: drop-shadow(0 7px 8px rgba(15, 25, 19, 0.26));
    transform-origin: bottom center;
}

.price-pin__inner {
    display: flex;
    align-items: center;
    flex-direction: column;
    transform-origin: bottom center;
    animation: markerIn 380ms var(--ease-spring) backwards;
}

@keyframes markerIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.82); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.price-pin__pill {
    display: inline-flex;
    height: 34px;
    align-items: center;
    gap: 5px;
    padding: 0 11px 0 4px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: var(--r-pill);
    color: var(--pin-ink, #fff);
    background: var(--pin-color, var(--forest));
    font-size: calc((10.5px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1;
    white-space: nowrap;
    transition: transform var(--speed) var(--ease-spring), box-shadow var(--speed) var(--ease);
}

.price-pin__icon {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.price-pin__icon .icon {
    width: 13px;
    height: 13px;
}

.price-pin__tail {
    width: 9px;
    height: 9px;
    margin-top: -5px;
    border-right: 2px solid rgba(255, 255, 255, 0.92);
    border-bottom: 2px solid rgba(255, 255, 255, 0.92);
    background: var(--pin-color, var(--forest));
    transform: rotate(45deg);
}

.price-pin:hover .price-pin__inner,
.price-pin.is-active .price-pin__inner {
    transform: translateY(-3px) scale(1.055);
}

.price-pin.is-active {
    z-index: 10 !important;
    filter: drop-shadow(0 10px 15px rgba(15, 25, 19, 0.36));
}

.price-pin.is-active .price-pin__pill {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin-color) 30%, transparent);
}

.price-pin[data-status="reservado"] .price-pin__pill {
    opacity: 0.84;
}

.price-pin__status {
    position: absolute;
    top: -6px;
    right: -4px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: #e4a933;
}

.leaflet-marker-icon:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: var(--r-pill);
}

.map-cluster-icon {
    border: 0;
    background: transparent;
}

.map-cluster {
    display: grid;
    width: calc((52px) * var(--text-scale, 1));
    height: calc((52px) * var(--text-scale, 1));
    place-content: center;
    border: 3px solid rgba(255, 253, 249, 0.94);
    border-radius: 50%;
    color: #f8f5ee;
    background: var(--forest);
    box-shadow:
        0 0 0 5px rgba(28, 73, 58, 0.18),
        0 10px 24px -8px rgba(16, 31, 23, 0.54);
    text-align: center;
    transition: transform var(--speed) var(--ease-spring), background var(--speed) var(--ease);
}

.map-cluster:hover {
    background: var(--ink);
    transform: scale(1.05);
}

.map-cluster strong {
    font-size: calc((14px) * var(--text-scale, 1));
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.map-cluster span {
    margin-top: 2px;
    font-size: calc((6.5px) * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.72;
    text-transform: uppercase;
}

.user-location-dot {
    border: 0;
    background: transparent;
}

.user-location-dot__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(36, 109, 224, 0.2);
    animation: userPulse 2s ease-out infinite;
}

.user-location-dot__core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15px;
    height: 15px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 2px 8px rgba(17, 44, 88, 0.4);
    transform: translate(-50%, -50%);
}

@keyframes userPulse {
    0% { opacity: 0.85; transform: scale(0.35); }
    80%, 100% { opacity: 0; transform: scale(1); }
}

/* Detalle de propiedad --------------------------------------------------- */
.property-drawer {
    position: absolute;
    z-index: 950;
    top: 90px;
    right: 18px;
    bottom: 18px;
    width: var(--detail-width);
    overflow: hidden;
    visibility: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 80%, white);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(calc(100% + 32px));
    transition:
        transform 430ms var(--ease),
        opacity 280ms var(--ease),
        visibility 430ms;
}

.property-drawer.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
}

.property-drawer__scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.property-drawer__grabber {
    display: none;
}

.detail-gallery {
    position: relative;
    height: 286px;
    overflow: hidden;
    background: var(--surface-muted);
}

.detail-gallery__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 420ms var(--ease);
}

.detail-gallery__slide {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 0 0 100%;
    overflow: hidden;
}

.detail-gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-gallery__slide--placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    background:
        linear-gradient(135deg, var(--surface-muted), color-mix(in srgb, var(--accent) 9%, var(--surface-muted)));
}

.detail-gallery__slide--placeholder .icon {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.detail-gallery::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background:
        linear-gradient(180deg, rgba(9, 16, 12, 0.32) 0%, transparent 22%, transparent 67%, rgba(9, 16, 12, 0.56) 100%);
    pointer-events: none;
}

.gallery-top {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    left: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.gallery-actions {
    display: flex;
    gap: 6px;
}

.gallery-top .gallery-circle,
.gallery-action {
    display: inline-flex;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #fff;
    background: rgba(18, 27, 22, 0.44);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(10px);
    transition: background var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.gallery-top .gallery-circle:hover,
.gallery-action:hover {
    background: rgba(18, 27, 22, 0.7);
    transform: scale(1.04);
}

.gallery-action.is-favorite {
    color: #ffb09c;
    background: rgba(255, 253, 249, 0.94);
}

.gallery-action.is-favorite .icon {
    fill: currentColor;
}

.gallery-action .icon,
.gallery-circle .icon {
    width: 16px;
    height: 16px;
}

.gallery-close {
    display: inline-flex;
    height: 35px;
    align-items: center;
    gap: 6px;
    padding: 0 13px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--r-pill);
    color: #fff;
    background: rgba(18, 27, 22, 0.44);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 700;
    backdrop-filter: blur(10px);
    transition: background var(--speed) var(--ease);
}

.gallery-close:hover {
    background: rgba(18, 27, 22, 0.7);
}

.gallery-close .icon {
    width: 14px;
    height: 14px;
}

.gallery-bottom {
    position: absolute;
    z-index: 3;
    right: 17px;
    bottom: 14px;
    left: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.gallery-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-dot {
    width: 5px;
    height: 5px;
    padding: 0;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.5);
    transition: width var(--speed) var(--ease), background var(--speed) var(--ease);
}

.gallery-dot.is-active {
    width: 17px;
    background: #fff;
}

.gallery-counter {
    color: rgba(255, 255, 255, 0.88);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: 0.03em;
}

.gallery-nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(18, 27, 22, 0.38);
    opacity: 0;
    backdrop-filter: blur(8px);
    transform: translateY(-50%);
    transition: opacity var(--speed) var(--ease), background var(--speed) var(--ease);
}

.gallery-nav:hover {
    background: rgba(18, 27, 22, 0.65);
}

.gallery-nav--prev {
    left: 12px;
}

.gallery-nav--next {
    right: 12px;
}

.detail-gallery:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav .icon {
    width: 16px;
    height: 16px;
}

.detail-status {
    position: absolute;
    z-index: 3;
    top: 60px;
    left: 15px;
}

.detail-status .status-badge {
    color: #174b35;
    background: rgba(228, 242, 234, 0.94);
    backdrop-filter: blur(8px);
}

.detail-status .status-badge--reserved {
    color: #6a4c13;
    background: rgba(247, 237, 216, 0.95);
}

.detail-body {
    padding: 21px 23px 26px;
}

.detail-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.detail-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-strong);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.detail-type__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--type-color);
}

.detail-code {
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 650;
    letter-spacing: 0.06em;
}

.detail-title {
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: calc((clamp(27px, 2.2vw, 32px)) * var(--text-scale, 1));
    font-weight: 400;
    line-height: 1.03;
    letter-spacing: -0.03em;
}

.detail-location {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 9px;
    color: var(--muted);
    font-size: calc((10.5px) * var(--text-scale, 1));
    line-height: 1.45;
}

.detail-location .icon {
    width: 13px;
    height: 13px;
    margin-top: 1px;
    flex: 0 0 auto;
}

.detail-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.detail-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    font-size: calc((25px) * var(--text-scale, 1));
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.045em;
}

.detail-price small {
    color: var(--muted);
    font-size: calc((10px) * var(--text-scale, 1));
    font-weight: 600;
    letter-spacing: 0;
}

.detail-price-note {
    margin-top: 5px;
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
}

.detail-share-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted-strong);
    font-size: calc((9.5px) * var(--text-scale, 1));
    font-weight: 700;
}

.detail-share-text:hover {
    color: var(--ink);
}

.detail-share-text .icon {
    width: 14px;
    height: 14px;
}

.detail-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 16px;
}

.detail-feature {
    display: flex;
    min-height: 65px;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    flex-direction: column;
    gap: 5px;
    text-align: center;
}

.detail-feature .icon {
    width: 17px;
    height: 17px;
    color: var(--muted-strong);
}

.detail-feature strong {
    font-size: calc((11.5px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: -0.02em;
}

.detail-feature span {
    color: var(--muted);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 650;
    text-transform: uppercase;
}

.detail-section {
    margin-top: 23px;
}

.detail-section h3 {
    font-size: calc((10px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.detail-description {
    margin-top: 9px;
    color: var(--muted-strong);
    font-size: calc((11.5px) * var(--text-scale, 1));
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.detail-description > :first-child {
    margin-top: 0;
}

.detail-description > :last-child {
    margin-bottom: 0;
}

.detail-description p {
    margin: 0 0 0.85em;
}

.detail-description strong,
.detail-description b {
    color: var(--ink);
    font-weight: 750;
}

.detail-description ul,
.detail-description ol {
    margin: 0.55em 0 0.85em;
    padding-left: 1.35em;
}

.detail-description li {
    margin: 0.2em 0;
}

.detail-description a {
    color: var(--forest);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.detail-description blockquote {
    margin: 0.8em 0;
    padding: 0.1em 0 0.1em 0.9em;
    border-left: 3px solid var(--accent);
    color: var(--ink-soft);
}

.detail-description h3,
.detail-description h4 {
    margin: 1em 0 0.4em;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.4em;
    line-height: 1.2;
}

.detail-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.detail-amenity {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted-strong);
    background: var(--surface-muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 650;
}

.detail-amenity .icon {
    width: 11px;
    height: 11px;
    color: var(--success);
}

.detail-address {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-muted);
}

.detail-address .icon {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex: 0 0 auto;
    color: var(--muted);
}

.detail-address strong {
    display: block;
    font-size: calc((10.5px) * var(--text-scale, 1));
    font-weight: 750;
}

.detail-address span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: calc((9.5px) * var(--text-scale, 1));
}

.detail-agent {
    position: relative;
    margin-top: 23px;
    padding: 18px;
    overflow: hidden;
    border-radius: 18px;
    color: #f3f0e8;
    background:
        radial-gradient(130% 140% at 100% 0%, rgba(214, 90, 56, 0.4), transparent 52%),
        #1c4033;
}

.detail-agent::after {
    position: absolute;
    right: -24px;
    bottom: -48px;
    width: 130px;
    height: 130px;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.detail-agent__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-agent__avatar {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-family: var(--font-display);
    font-size: calc((17px) * var(--text-scale, 1));
}

.detail-agent strong {
    display: block;
    font-size: calc((10.5px) * var(--text-scale, 1));
    font-weight: 750;
}

.detail-agent small {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    color: rgba(244, 241, 233, 0.62);
    font-size: calc((8.5px) * var(--text-scale, 1));
}

.detail-agent small::before {
    width: 4px;
    height: 4px;
    content: "";
    border-radius: 50%;
    background: #8cd8ad;
}

.detail-agent p {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    color: rgba(244, 241, 233, 0.7);
    font-size: calc((10px) * var(--text-scale, 1));
    line-height: 1.55;
}

.detail-agent__actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 7px;
    margin-top: 14px;
}

.detail-agent__actions .btn {
    min-height: 38px;
    font-size: calc((10.5px) * var(--text-scale, 1));
}

.detail-agent__actions .btn-primary {
    flex: 1;
    color: #1a2b23;
    background: #f7f2e7;
    box-shadow: none;
}

.detail-agent__actions .btn-primary:hover {
    background: #fff;
}

.detail-agent__actions .btn-wa {
    width: 38px;
    min-width: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #f3f0e8;
    background: rgba(255, 255, 255, 0.08);
}

.detail-agent__actions .btn-wa:hover {
    background: rgba(255, 255, 255, 0.15);
}

.detail-footnote {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 17px;
    color: var(--muted);
    font-size: calc((8.5px) * var(--text-scale, 1));
}

.detail-footnote span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.detail-footnote .icon {
    width: 11px;
    height: 11px;
}

/* Diálogo de filtros ----------------------------------------------------- */
.filter-body {
    display: flex;
    flex-direction: column;
    gap: 23px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.filter-section__head h3 {
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 800;
}

.filter-section__head span {
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.price-range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.price-range-grid .field > span:first-child {
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

.price-input .price-prefix {
    position: absolute;
    left: 13px;
    z-index: 1;
    color: var(--muted);
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 700;
}

.price-input .input {
    padding-left: 32px;
    font-size: calc((12px) * var(--text-scale, 1));
}

.pill-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill-options button {
    height: 35px;
    min-width: 49px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted-strong);
    background: var(--surface-muted);
    font-size: calc((10.5px) * var(--text-scale, 1));
    font-weight: 700;
    transition: color var(--speed) var(--ease), background var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.pill-options button:hover {
    border-color: var(--line-strong);
}

.pill-options button.is-active {
    color: var(--inverse-ink);
    border-color: var(--ink);
    background: var(--ink);
}

.filter-currency {
    color: var(--muted);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 750;
    letter-spacing: 0.1em;
}

/* Formulario de contacto ------------------------------------------------- */
.contact-dialog {
    --dialog-width: min(580px, calc(100vw - 32px));
}

.contact-dialog__head .eyebrow {
    color: var(--accent-ink);
}

.contact-dialog .dialog-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.contact-form-grid .field {
    min-width: 0;
}

.contact-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.field-optional {
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.contact-consent {
    margin-top: 1px;
}

.contact-form-error {
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--danger) 18%, transparent);
    border-radius: var(--r-sm);
    color: var(--danger);
    background: var(--danger-soft);
    font-size: calc((11px) * var(--text-scale, 1));
    font-weight: 600;
}

.contact-dialog__foot {
    justify-content: space-between;
}

.contact-privacy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: calc((9px) * var(--text-scale, 1));
    font-weight: 600;
}

.contact-privacy .icon {
    width: 13px;
    height: 13px;
}

.contact-success {
    padding-bottom: 4px;
}

.contact-success .dialog-body {
    align-items: center;
    padding-top: 34px;
    padding-bottom: 34px;
    text-align: center;
}

.contact-success__icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 50%;
    color: var(--success);
    background: var(--success-soft);
}

.contact-success h3 {
    margin-top: 16px;
    font-family: var(--font-display);
    font-size: calc((29px) * var(--text-scale, 1));
    font-weight: 400;
    letter-spacing: -0.025em;
}

.contact-success p {
    max-width: 370px;
    margin-top: 7px;
    color: var(--muted);
    font-size: calc((12px) * var(--text-scale, 1));
    line-height: 1.6;
}

.contact-success__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    flex-wrap: wrap;
}

/* Error de carga --------------------------------------------------------- */
.map-error {
    position: absolute;
    z-index: 1200;
    top: 50%;
    left: 50%;
    display: grid;
    width: min(340px, calc(100vw - 32px));
    padding: 30px 24px;
    justify-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: translate(-50%, -50%);
}

.map-error h2 {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: calc((26px) * var(--text-scale, 1));
    font-weight: 400;
}

.map-error p {
    color: var(--muted);
    font-size: calc((11px) * var(--text-scale, 1));
}

.map-error .btn {
    margin-top: 6px;
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1280px) {
    :root {
        --panel-width: 376px;
        --detail-width: 410px;
    }

    .public-topbar {
        grid-template-columns: minmax(140px, 1fr) minmax(300px, 540px) minmax(140px, 1fr);
        gap: 14px;
    }

    .search-kbd {
        display: none;
    }

    .panel-hero {
        padding-right: 20px;
        padding-left: 20px;
    }

    .panel-hero h1 {
        font-size: calc((32px) * var(--text-scale, 1));
    }
}

@media (max-width: 1080px) {
    :root {
        --panel-width: 356px;
        --detail-width: 390px;
    }

    .public-topbar {
        grid-template-columns: auto minmax(280px, 1fr) auto;
        gap: 10px;
    }

    .brand--floating .brand-name {
        display: none;
    }

    .brand--floating {
        width: 50px;
        padding: 0;
        justify-content: center;
    }

    .brand--floating .brand-mark {
        width: 35px;
        height: 35px;
    }

    .top-contact {
        width: 44px;
        padding: 0;
    }

    .top-contact span {
        display: none;
    }

    .map-helper {
        left: calc(50% + 70px);
    }

    .map-location-chip {
        display: none;
    }

    .detail-gallery {
        height: 258px;
    }
}

@media (max-width: 900px) {
    :root {
        --panel-width: 100%;
        --detail-width: 100%;
    }

    .map-helper,
    .map-location-chip,
    .panel-collapse {
        display: none;
    }

    .public-topbar {
        top: 10px;
        right: 10px;
        left: 10px;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
    }

    .brand--floating {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .brand--floating .brand-mark {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: calc((21px) * var(--text-scale, 1));
    }

    .search-bar {
        height: 48px;
        border-radius: 15px;
        padding: 5px;
        gap: 3px;
    }

    .search-icon-button {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .search-divider {
        height: 18px;
    }

    .search-leading {
        display: none;
    }

    .search-input {
        padding-left: 6px;
        font-size: calc((12px) * var(--text-scale, 1));
    }

    .search-submit {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .search-kbd {
        display: none;
    }

    .top-actions {
        gap: 5px;
    }

    .top-actions .icon-button {
        width: 38px;
        height: 38px;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .top-actions .icon-button .icon {
        width: 19px;
        height: 19px;
    }

    .top-contact {
        display: none;
    }

    .top-actions .theme-toggle {
        border: 1px solid var(--line) !important;
        background: var(--surface-glass-strong) !important;
        box-shadow: var(--shadow-sm) !important;
    }

    .panel-grabber {
        display: inline-flex;
        height: 25px;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 0 0 auto;
        color: var(--muted);
        font-size: calc((8px) * var(--text-scale, 1));
        font-weight: 650;
    }

    .panel-grabber > span:first-child {
        width: 34px;
        height: 4px;
        border-radius: var(--r-pill);
        background: var(--line-strong);
    }

    .panel-grabber__label {
        display: none;
    }

    .panel-grabber .icon {
        width: 12px;
        height: 12px;
        transition: transform var(--speed) var(--ease);
    }

    .explore-panel {
        top: auto;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        height: min(48dvh, 460px);
        border-radius: 23px;
        animation: sheetIn 480ms var(--ease) both;
        transition:
            height 400ms var(--ease),
            transform 400ms var(--ease),
            opacity var(--speed) var(--ease),
            visibility 400ms;
    }

    @keyframes sheetIn {
        from { opacity: 0; transform: translateY(calc(100% + 12px)); }
        to { opacity: 1; transform: none; }
    }

    .explore-panel.is-expanded {
        height: min(82dvh, 760px);
    }

    .explore-panel.is-hidden {
        visibility: hidden;
        opacity: 0;
        transform: translateY(calc(100% + 16px));
    }

    .panel-hero {
        display: none;
    }

    .panel-tools {
        padding: 3px 13px 7px;
    }

    .operation-switch {
        padding: 2px;
    }

    .operation-switch button {
        min-height: 31px;
    }

    .type-strip {
        margin-top: 9px;
    }

    .type-chip {
        height: 31px;
        padding: 0 10px;
        font-size: calc((10px) * var(--text-scale, 1));
    }

    .results-toolbar {
        margin-top: 10px;
    }

    .results-scroll {
        padding: 2px 7px 0;
    }

    .property-card {
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 10px;
        padding: 7px;
    }

    .property-card__thumb {
        width: 100px;
        height: 96px;
    }

    .results-list {
        gap: 3px;
    }

    .panel-footer {
        padding-bottom: 12px;
    }

    .map-location-chip,
    .map-helper {
        display: none;
    }

    .panel-restore {
        top: auto;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
    }

    .property-drawer {
        z-index: 1300;
        top: 68px;
        right: 8px;
        bottom: 0;
        left: 8px;
        width: auto;
        border-radius: 24px 24px 0 0;
        border-bottom: 0;
        transform: translateY(calc(100% + 20px));
    }

    .property-drawer.is-open {
        transform: none;
    }

    .property-drawer.is-sheet-dragging {
        transition: none;
    }

    .property-drawer__grabber {
        position: absolute;
        z-index: 4;
        top: 8px;
        left: 50%;
        display: block;
        width: 42px;
        height: 5px;
        border-radius: var(--r-pill);
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 0 0 1px rgba(9, 19, 13, 0.08), 0 1px 5px rgba(9, 19, 13, 0.38);
        transform: translateX(-50%);
        pointer-events: none;
    }

    .detail-gallery {
        height: min(32dvh, 290px);
        min-height: 220px;
    }

    .detail-body {
        padding-bottom: calc(26px + env(safe-area-inset-bottom));
    }

    .gallery-nav {
        opacity: 1;
    }

    body.has-active-detail .map-controls {
        visibility: hidden;
        opacity: 0;
    }

    .search-popover {
        right: -44px;
        left: -50px;
        max-height: 55dvh;
    }

    .top-actions {
        gap: 2px;
    }

    .app-loader__brand .brand-mark {
        width: 40px;
        height: 40px;
    }

    dialog.app-dialog {
        position: fixed;
        inset: auto 8px 8px;
        width: auto;
        margin: 0 auto;
        max-height: calc(100dvh - 20px);
        border-radius: 24px;
    }

    .filter-dialog,
    .contact-dialog {
        width: auto;
    }
}

@media (max-width: 560px) {
    .public-topbar {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 6px;
    }

    .brand--floating {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .brand--floating .brand-mark {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: calc((20px) * var(--text-scale, 1));
    }

    .top-actions .icon-button {
        width: 38px;
        height: 38px;
    }

    .top-login {
        display: inline-grid;
    }

    .search-bar {
        height: 45px;
        padding: 4px;
    }

    .search-filter-button {
        width: 31px;
        height: 31px;
    }

    .search-input {
        font-size: calc((11.5px) * var(--text-scale, 1));
    }

    .search-input::placeholder {
        font-size: calc((11px) * var(--text-scale, 1));
    }

    .search-submit {
        width: 34px;
        height: 34px;
    }

    .search-clear {
        width: 24px;
        height: 24px;
    }

    .search-popover {
        right: -46px;
        left: -46px;
        border-radius: 17px;
    }

    .filter-trigger span:not(.filter-badge) {
        display: none;
    }

    .filter-trigger {
        width: 31px;
        padding: 0;
        justify-content: center;
    }

    .sort-control select {
        max-width: 126px;
        padding-left: 9px;
        font-size: calc((9px) * var(--text-scale, 1));
    }

    .results-count span {
        font-size: calc((9px) * var(--text-scale, 1));
    }

    .results-count strong {
        font-size: calc((13px) * var(--text-scale, 1));
    }

    .type-chip {
        height: 30px;
        font-size: calc((9.5px) * var(--text-scale, 1));
    }

    .property-card__title {
        font-size: calc((12px) * var(--text-scale, 1));
    }

    .property-card__specs span:nth-child(3) {
        display: none;
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
    }

    .contact-dialog__foot {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .contact-dialog__foot .btn {
        width: 100%;
    }

    .contact-privacy {
        justify-content: center;
    }

    .price-range-grid {
        grid-template-columns: 1fr;
    }

    .dialog-head {
        padding-top: 19px;
        padding-bottom: 15px;
    }

    .filter-body {
        gap: 19px;
    }

    .detail-features {
        gap: 5px;
    }

    .detail-feature {
        min-height: 59px;
    }

    .detail-feature strong {
        font-size: calc((10.5px) * var(--text-scale, 1));
    }

    .detail-body {
        padding-right: 17px;
        padding-left: 17px;
    }

    .gallery-close span {
        display: none;
    }

    .gallery-close {
        width: 35px;
        padding: 0;
        justify-content: center;
    }

    .panel-grabber {
        height: 22px;
    }

    .explore-panel {
        height: min(49dvh, 430px);
    }

    .explore-panel.is-expanded {
        height: 84dvh;
    }

    .search-popover {
        max-height: 58dvh;
    }
}

@media (max-height: 740px) and (min-width: 901px) {
    .panel-hero {
        padding-top: 20px;
        padding-bottom: 14px;
    }

    .panel-hero h1 {
        font-size: calc((30px) * var(--text-scale, 1));
    }

    .panel-hero__sub {
        display: none;
    }

    .panel-stats {
        margin-top: 11px;
    }
}

@media (pointer: coarse) {
    .gallery-nav {
        opacity: 1;
    }
}

.property-card__title-button {
    display: -webkit-box;
    width: 100%;
    padding: 0;
    overflow: hidden;
    color: inherit;
    background: transparent;
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.property-card__title-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Atribución visible por encima de la hoja móvil */
@media (max-width: 900px) {
    .leaflet-bottom.leaflet-right {
        bottom: 50dvh;
        transition: bottom 400ms var(--ease);
    }

    body.sheet-expanded .leaflet-bottom.leaflet-right {
        bottom: calc(82dvh + 10px);
    }

    .leaflet-control-attribution {
        font-size: calc((7px) * var(--text-scale, 1)) !important;
        padding: 1px 5px !important;
        border-radius: 4px 0 0 0;
        opacity: 0.82;
    }
}

/* ==========================================================================
   Interacciones y medios · filtros, galería, video, QR, PWA y hoja móvil
   ========================================================================== */

/* Carrusel de filtros ---------------------------------------------------- */
.type-strip-shell {
    position: relative;
    margin: 12px -2px 0;
}

.type-strip-shell .type-strip {
    margin: 0;
    padding: 2px 3px;
    scroll-behavior: smooth;
    scroll-padding-inline: 24px;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.type-strip-shell.is-dragging .type-strip,
.type-strip.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.type-strip.is-dragging .type-chip {
    pointer-events: none;
}

.type-strip-nav {
    position: absolute;
    z-index: 4;
    top: 50%;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink-soft);
    background: var(--surface-elevated);
    box-shadow: 0 4px 12px -6px rgba(18, 30, 23, 0.35);
    transform: translateY(-50%);
    transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease), background var(--speed) var(--ease);
}

.type-strip-nav:hover {
    color: var(--ink);
    background: var(--surface);
    transform: translateY(-50%) scale(1.05);
}

.type-strip-nav .icon {
    width: 14px;
    height: 14px;
}

.type-strip-nav--prev {
    left: -5px;
}

.type-strip-nav--next {
    right: -5px;
}

.type-strip-shell.has-left-overflow::before,
.type-strip-shell.has-right-overflow::after {
    position: absolute;
    z-index: 2;
    top: 1px;
    bottom: 1px;
    width: 25px;
    content: "";
    pointer-events: none;
}

.type-strip-shell.has-left-overflow::before {
    left: 0;
    background: linear-gradient(90deg, var(--surface-glass-strong), transparent);
}

.type-strip-shell.has-right-overflow::after {
    right: 0;
    background: linear-gradient(-90deg, var(--surface-glass-strong), transparent);
}

/* Galería: arrastre y navegación ---------------------------------------- */
.detail-gallery {
    cursor: default;
    touch-action: pan-y;
}

.detail-gallery__track {
    will-change: transform;
}

.detail-gallery.is-dragging {
    cursor: grabbing;
}

.detail-gallery.is-dragging img {
    pointer-events: none;
    user-select: none;
}

.detail-gallery__slide img {
    -webkit-user-drag: none;
    user-select: none;
}

.detail-gallery .gallery-nav {
    opacity: 0.92;
    background: rgba(14, 24, 18, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.detail-gallery .gallery-nav:hover {
    opacity: 1;
    background: rgba(14, 24, 18, 0.76);
}

.detail-gallery .gallery-nav .icon {
    width: 16px;
    height: 16px;
}

.detail-video-poster {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, rgba(10, 18, 14, 0.08), rgba(10, 18, 14, 0.55));
    pointer-events: none;
}

.detail-video-play {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255, 253, 249, 0.9);
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    backdrop-filter: blur(12px);
    transition: transform var(--speed) var(--ease-spring), background var(--speed) var(--ease);
}

.detail-video-play:hover {
    background: #fff;
    transform: scale(1.07);
}

.detail-video-play .icon {
    width: 23px;
    height: 23px;
    margin-left: 3px;
    fill: currentColor;
    stroke: none;
}

.detail-video-poster__label {
    position: absolute;
    bottom: 50px;
    left: 17px;
    display: inline-flex;
    height: 25px;
    align-items: center;
    gap: 4px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--r-pill);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(12, 21, 15, 0.52);
    font-size: calc((8px) * var(--text-scale, 1));
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.detail-video-poster__label .icon {
    width: 10px;
    height: 10px;
    fill: currentColor;
    stroke: none;
}

.detail-gallery__slide--video {
    background: #0b120e;
}

.detail-video-player {
    width: 100%;
    height: 100%;
    background: #0b120e;
    object-fit: contain;
}

.detail-video-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #0b120e;
}

.detail-share-cluster {
    display: flex;
    align-items: center;
    gap: 11px;
}

/* Contacto por propiedad ------------------------------------------------- */
.detail-agent__contact {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
}

.detail-agent__contact a {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-pill);
    color: rgba(247, 243, 234, 0.72);
    background: rgba(255, 255, 255, 0.06);
    font-size: calc((8px) * var(--text-scale, 1));
    text-decoration: none;
    overflow-wrap: anywhere;
}

.detail-agent__contact a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
}

.detail-agent__contact .icon {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
}

/* Código QR -------------------------------------------------------------- */
.qr-dialog {
    --dialog-width: min(460px, calc(100vw - 32px));
}

.qr-dialog__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background:
        radial-gradient(75% 55% at 50% 0%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 68%),
        var(--surface);
}

.qr-card {
    width: min(100%, 350px);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    color: var(--ink);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--surface-elevated)), var(--surface-elevated) 42%);
    box-shadow: var(--shadow-lg);
}

.qr-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 17px;
    color: var(--inverse-ink);
    background:
        radial-gradient(80% 180% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
        var(--forest);
}

.qr-card__brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.qr-card__brand .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: inherit;
    font-size: calc((18px) * var(--text-scale, 1));
    background: color-mix(in srgb, var(--inverse-ink) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--inverse-ink) 16%, transparent);
    box-shadow: none;
}

.qr-card__site {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: calc((19px) * var(--text-scale, 1));
    letter-spacing: -0.03em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-card__tag {
    height: 19px;
    padding: 4px 7px 0;
    border: 1px solid color-mix(in srgb, var(--inverse-ink) 18%, transparent);
    border-radius: var(--r-pill);
    color: color-mix(in srgb, var(--inverse-ink) 64%, transparent);
    font-size: calc((6px) * var(--text-scale, 1));
    font-weight: 750;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-transform: uppercase;
}

.qr-card__body {
    padding: 20px 22px 19px;
    text-align: center;
}

.qr-card__body h3 {
    max-width: 290px;
    margin: 0 auto;
    font-family: var(--font-display);
    font-size: calc((26px) * var(--text-scale, 1));
    font-weight: 400;
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.qr-card__meta {
    max-width: 290px;
    margin: 7px auto 0;
    color: var(--muted-strong);
    font-size: calc((9px) * var(--text-scale, 1));
    line-height: 1.5;
}

.qr-canvas-shell {
    width: min(224px, 75%);
    margin: 17px auto 12px;
    padding: 9px;
    border: 1px solid var(--line-strong);
    border-radius: max(6px, calc(var(--r-md) - 2px));
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.qr-canvas-holder {
    display: block;
    width: 100%;
    aspect-ratio: 1;
}

.qr-canvas-holder canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.qr-card__code {
    display: inline-flex;
    height: 20px;
    align-items: center;
    padding: 0 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    color: var(--muted-strong);
    font-family: var(--font-mono, "SFMono-Regular", Consolas, monospace);
    font-size: calc((7.5px) * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: 0.05em;
}

.qr-card__hint {
    max-width: 240px;
    margin: 9px auto 0;
    color: var(--muted);
    font-size: calc((8px) * var(--text-scale, 1));
    line-height: 1.55;
}

.qr-dialog__actions {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
}

.qr-dialog__actions .btn {
    min-height: 37px;
    flex: 1;
    min-width: 150px;
    font-size: calc((9px) * var(--text-scale, 1));
}

/* PWA ------------------------------------------------------------------- */
.pwa-install {
    color: var(--forest) !important;
}

@media (max-width: 560px) {
    .qr-dialog__actions .btn {
        min-width: 0;
    }

    .qr-card {
        max-width: 310px;
    }

    .qr-card__body h3 {
        font-size: calc((23px) * var(--text-scale, 1));
    }

    .detail-share-cluster {
        gap: 7px;
    }

    .detail-share-text {
        font-size: calc((8.5px) * var(--text-scale, 1));
    }
}

/* Bottom sheet con snap nativo ------------------------------------------ */
@media (max-width: 900px) {
    .map-app {
        /* En móvil apaisado el alto real manda; evita que el sheet quede fuera. */
        min-height: 0;
    }

    .explore-panel {
        height: var(--sheet-height, 42dvh);
        transition:
            height 380ms var(--ease),
            transform 400ms var(--ease),
            opacity var(--speed) var(--ease),
            visibility 400ms;
    }

    .explore-panel.is-expanded {
        height: var(--sheet-height, 86dvh);
    }

    .explore-panel.is-sheet-dragging {
        transition: none;
    }

    .panel-grabber {
        width: 100%;
        height: 27px;
        flex: 0 0 auto;
        cursor: grab;
        touch-action: none;
    }

    .panel-grabber:active {
        cursor: grabbing;
    }

    .panel-grabber > span:first-child {
        transition: width var(--speed) var(--ease), background var(--speed) var(--ease);
    }

    .explore-panel.is-expanded .panel-grabber > span:first-child {
        width: 24px;
        background: var(--muted);
    }

    .panel-grabber .icon {
        pointer-events: none;
    }

    .leaflet-bottom.leaflet-right {
        bottom: calc(var(--sheet-height, 42dvh) + 10px);
        transition: bottom 380ms var(--ease);
    }

    body.sheet-expanded .leaflet-bottom.leaflet-right {
        bottom: calc(var(--sheet-height, 42dvh) + 10px);
    }
}

@media (max-width: 900px) {
    .explore-panel {
        z-index: 950;
    }

    .explore-panel.is-expanded ~ .map-controls {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity 180ms var(--ease), visibility 180ms var(--ease), transform 180ms var(--ease);
    }
}

/* Logo personalizado en el encabezado móvil ------------------------------ */
@media (max-width: 1080px) {
    #appShell > .public-topbar > .brand--floating {
        width: 50px;
        height: 50px;
        padding: 0;
        justify-content: center;
        overflow: hidden;
    }

    #appShell > .public-topbar > .brand--floating .brand-logo-wrap {
        width: 100%;
        height: 100%;
        max-width: 100%;
    }

    #appShell > .public-topbar > .brand--floating .brand-logo {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
}

@media (max-width: 900px) {
    #appShell > .public-topbar > .brand--floating {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 560px) {
    #appShell > .public-topbar > .brand--floating {
        width: 38px;
        height: 38px;
    }
}

/* Selector de idioma del panel público ----------------------------------- */
.panel-footer__languages {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.panel-footer__languages a {
    padding: 1px 4px;
    border-radius: 4px;
    color: var(--muted);
    font-size: calc((7px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.panel-footer__languages a:hover {
    color: var(--ink);
}

.panel-footer__languages a.is-active {
    color: var(--inverse-ink);
    background: var(--ink);
}

/* Panel de escritorio expandible ----------------------------------------- */
@media (min-width: 901px) {
    .panel-grabber {
        display: flex;
        height: 28px;
        align-items: center;
        justify-content: center;
        gap: 7px;
        flex: 0 0 auto;
        color: var(--muted);
        font-size: calc((8px) * var(--text-scale, 1));
        font-weight: 700;
        letter-spacing: 0.02em;
        cursor: pointer;
    }

    .panel-grabber > span:first-child {
        width: 36px;
        height: 4px;
        border-radius: var(--r-pill);
        background: var(--line-strong);
        transition: width var(--speed) var(--ease), background var(--speed) var(--ease);
    }

    .panel-grabber__label {
        display: inline;
    }

    .panel-grabber .icon {
        width: 12px;
        height: 12px;
        transition: transform var(--speed) var(--ease);
    }

    .panel-grabber:hover > span:first-child {
        background: var(--muted);
    }

    .explore-panel.is-list-expanded .panel-grabber > span:first-child {
        width: 26px;
        background: var(--muted);
    }

    .explore-panel.is-list-expanded .panel-grabber .icon {
        transform: rotate(180deg);
    }

    .panel-hero-shell {
        display: grid;
        flex: 0 0 auto;
        min-height: 0;
        grid-template-rows: 1fr;
        opacity: 1;
        transition:
            grid-template-rows 380ms var(--ease),
            opacity 240ms var(--ease);
    }

    .panel-hero {
        min-height: 0;
        overflow: hidden;
        transition: padding 380ms var(--ease);
    }

    .explore-panel.is-list-expanded .panel-hero-shell {
        grid-template-rows: 0fr;
        opacity: 0;
        pointer-events: none;
    }

    .explore-panel.is-list-expanded .panel-hero {
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Áreas dibujadas en el mapa público ------------------------------------- */
.map-area-chip-wrap {
    border: 0 !important;
    background: transparent !important;
}

.map-area-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 10px;
    border: 2px solid rgba(255, 253, 249, 0.94);
    border-radius: var(--r-pill);
    color: #fff;
    background: var(--area-color, var(--forest));
    font-size: calc((8.5px) * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(5, 12, 8, 0.35);
    box-shadow: 0 7px 18px -7px rgba(10, 22, 15, 0.6);
    cursor: pointer;
    transform: translate(-50%, calc(-100% - 24px));
    transform-origin: 50% 100%;
    transition: transform var(--speed) var(--ease-spring), box-shadow var(--speed) var(--ease);
}

.map-area-chip::after {
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 7px;
    height: 7px;
    content: "";
    border-right: 2px solid rgba(255, 253, 249, 0.94);
    border-bottom: 2px solid rgba(255, 253, 249, 0.94);
    background: var(--area-color, var(--forest));
    transform: translateX(-50%) rotate(45deg);
}

.map-area-chip:hover,
.map-area-chip.is-active {
    transform: translate(-50%, calc(-100% - 24px)) scale(1.06);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--area-color, var(--forest)) 28%, transparent),
        0 9px 22px -8px rgba(10, 22, 15, 0.66);
}

.map-area-chip__count {
    display: inline-flex;
    min-width: 17px;
    height: 17px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.22);
    font-size: calc((7.5px) * var(--text-scale, 1));
}

/* Ubicación del visitante ------------------------------------------------- */
.geo-dialog {
    width: min(480px, calc(100vw - 26px));
}

.geo-dialog__body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.geo-dialog__icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: var(--accent-ink);
    background: var(--accent-soft);
}

.geo-dialog__icon .icon {
    width: 18px;
    height: 18px;
}

.geo-dialog__note {
    color: var(--muted-strong);
    font-size: calc((10px) * var(--text-scale, 1));
    line-height: 1.55;
}

.geo-dialog__fine {
    max-width: 220px;
    color: var(--muted);
    font-size: calc((8px) * var(--text-scale, 1));
    line-height: 1.4;
}

.geo-dialog .dialog-foot {
    align-items: center;
}

.geo-dialog .dialog-foot__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 560px) {
    .geo-dialog .dialog-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .geo-dialog__fine {
        max-width: none;
    }

    .geo-dialog .dialog-foot__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* Menú compacto de la barra superior en móvil ---------------------------- */
.mobile-top-menu {
    position: relative;
    display: none;
}

.mobile-top-menu__panel {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 9px);
    right: 0;
    display: flex;
    width: min(242px, calc(100vw - 20px));
    flex-direction: column;
    gap: 2px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-glass-strong);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-top-menu__panel[hidden] {
    display: none;
}

.mobile-top-menu__panel a,
.mobile-top-menu__panel button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    color: var(--ink-soft);
    background: transparent;
    font-size: calc((10px) * var(--text-scale, 1));
    font-weight: 650;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition:
        color var(--speed) var(--ease),
        background var(--speed) var(--ease);
}

.mobile-top-menu__panel a:hover,
.mobile-top-menu__panel button:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.mobile-top-menu__panel .icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: var(--muted);
}

.mobile-top-menu__panel a[hidden],
.mobile-top-menu__panel button[hidden] {
    display: none;
}

@media (max-width: 560px) {
    .top-actions > #themeToggle,
    .top-actions > .top-login,
    .top-actions > #helpToggle,
    .top-actions > #installAppButton,
    .top-actions > .top-contact {
        display: none;
    }

    .mobile-top-menu {
        display: block;
    }

    .mobile-top-menu__trigger {
        width: 38px !important;
        height: 38px !important;
        border: 1px solid var(--line) !important;
        background: var(--surface-glass-strong) !important;
        box-shadow: var(--shadow-sm) !important;
    }
}

/* Controles del mapa en móvil: una fila compacta y separada del buscador - */
@media (max-width: 900px) {
    .map-controls {
        top: 84px;
        right: 8px;
        gap: 2px;
        padding: 4px;
        border-radius: 16px;
        background: var(--surface-glass);
    }

    .basemap-switch {
        gap: 1px;
        padding: 2px;
    }

    .basemap-switch button {
        width: 31px;
        height: 31px;
        padding: 0;
        justify-content: center;
    }

    .basemap-switch button span {
        display: none;
    }

    .map-controls__divider {
        display: none;
    }

    .map-tool {
        width: 31px;
        height: 31px;
    }

    .zoom-control {
        width: auto;
        flex-direction: row;
        gap: 1px;
    }

    .zoom-control .map-tool {
        height: 31px;
    }

    .zoom-control > span {
        width: 1px;
        height: 16px;
        margin: 0 1px;
    }
}
