/* ==========================================================================
   Single inmueble — Bento 2026
   Reemplaza a single-inmueble.css. Se carga después de single-property*.css,
   por eso algunas reglas heredadas se sobrescriben con más especificidad.
   ========================================================================== */

:root {
    --bx-ink: var(--brand-primary, #042b26);
    --bx-ink-2: var(--brand-tertiary, #0f4c44);
    --bx-accent: var(--brand-secondary, #c6ff00);
    --bx-bg: #f3f6f5;
    --bx-surface: #ffffff;
    --bx-line: rgba(4, 43, 38, .08);
    --bx-text: var(--color-text, #17322e);
    --bx-soft: var(--color-text-soft, #5f7671);
    --bx-radius: 28px;
    --bx-radius-sm: 18px;
    --bx-gap: 16px;
    --bx-shadow: 0 1px 2px rgba(4, 43, 38, .04), 0 12px 32px -12px rgba(4, 43, 38, .14);
    --bx-shadow-hover: 0 2px 4px rgba(4, 43, 38, .05), 0 28px 60px -20px rgba(4, 43, 38, .28);
    --bx-ease: cubic-bezier(.22, 1, .36, 1);
    --bx-top: calc(4.5rem + 12px);
}

main.single-property-container.bx-page,
.bx-page {
    display: block;
    min-width: 0;
    min-height: 0;
    gap: 0;
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(198, 255, 0, .10), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(15, 76, 68, .07), transparent 60%),
        var(--bx-bg);
    color: var(--bx-text);
    font-family: var(--font-base, 'Lexend', system-ui, sans-serif);
    padding-top: calc(4.5rem + 20px);
    overflow-x: clip;
}

.bx-page *,
.bx-page *::before,
.bx-page *::after { box-sizing: border-box; }

.bx-container {
    width: min(1320px, 100% - 48px);
    margin-inline: auto;
}

.bx-ico { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Tipografía ---------- */
.bx-h2 {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -.035em;
    font-weight: 700;
    color: var(--bx-ink);
}

.bx-h3 {
    margin: 0;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    line-height: 1.2;
    letter-spacing: -.02em;
    font-weight: 600;
    color: var(--bx-ink);
}

.bx-lead { margin: 14px 0 0; max-width: 560px; color: var(--bx-soft); font-size: 1.02rem; line-height: 1.6; }

.bx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--bx-ink-2);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.bx-eyebrow--invert { color: rgba(255, 255, 255, .62); }

.bx-split .bx-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.bx-split .bx-word > span { display: inline-block; will-change: transform; }

/* ---------- Chips / botones ---------- */
.bx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.bx-chip--accent { background: var(--bx-accent); color: var(--bx-ink); }
.bx-chip--glass {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.bx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bx-accent); box-shadow: 0 0 0 0 rgba(198, 255, 0, .7); animation: bx-ping 2.2s var(--bx-ease) infinite; }
.bx-status.status-vendido .bx-dot,
.bx-status.status-alquilado .bx-dot { background: #f87171; animation: none; }
.bx-status.status-reservado .bx-dot,
.bx-status.status-pausado .bx-dot { background: #fbbf24; animation: none; }

.bx-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: translate .45s var(--bx-ease), scale .3s var(--bx-ease), box-shadow .45s var(--bx-ease), background-color .3s ease, color .3s ease;
}
.bx-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .35), transparent 60%);
    opacity: 0;
    transition: opacity .3s ease;
}
.bx-btn:hover { translate: 0 -2px; }
.bx-btn:hover::after { opacity: 1; }
.bx-btn:active { translate: 0 0; scale: .97; }
.bx-btn:focus-visible { outline: 3px solid var(--bx-accent); outline-offset: 3px; }
.bx-btn .bx-ico--arrow { transition: transform .45s var(--bx-ease); }
.bx-btn:hover .bx-ico--arrow { transform: translateX(4px); }

.bx-btn--primary { background: var(--bx-ink); color: #fff; box-shadow: 0 12px 28px -12px rgba(4, 43, 38, .6); }
.bx-btn--primary:hover { box-shadow: 0 18px 36px -12px rgba(4, 43, 38, .7); }
.bx-btn--dark { background: var(--bx-ink); color: var(--bx-accent); }
.bx-btn--ghost { background: var(--bx-surface); color: var(--bx-ink); box-shadow: inset 0 0 0 1px var(--bx-line), var(--bx-shadow); }
.bx-btn--wa { background: #25d366; color: #fff; }
.bx-btn--sm { min-height: 40px; padding: 0 16px; font-size: .84rem; }

.bx-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--bx-surface);
    color: var(--bx-ink);
    box-shadow: inset 0 0 0 1px var(--bx-line);
    cursor: pointer;
    transition: rotate .4s var(--bx-ease), scale .4s var(--bx-ease), background-color .3s ease;
}
.bx-icon-btn:hover { rotate: -12deg; scale: 1.08; background: var(--bx-accent); }

/* Favorito del subnav (renderizado por el plugin) con el mismo formato que .bx-icon-btn */
.bx-subnav .btn-fav-desktop {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--bx-surface);
    box-shadow: inset 0 0 0 1px var(--bx-line);
    cursor: pointer;
    transition: rotate .4s var(--bx-ease), scale .4s var(--bx-ease), background-color .3s ease;
}
.bx-subnav .btn-fav-desktop:hover { rotate: -12deg; scale: 1.08; background: var(--bx-accent); }
/* El ícono ocupa todo el círculo: favorites.js solo escucha clics sobre el <img> */
.bx-subnav .btn-fav-desktop img { display: block; width: 42px !important; height: 42px !important; padding: 10px; box-sizing: border-box; object-fit: contain; cursor: pointer; }
.bx-subnav .btn-fav-desktop:focus-visible { outline: 3px solid var(--bx-accent); outline-offset: 3px; }

/* ---------- Tile base (bento) ---------- */
.bx-tile {
    position: relative;
    border-radius: var(--bx-radius);
    background: var(--bx-surface);
    box-shadow: var(--bx-shadow);
    overflow: hidden;
    isolation: isolate;
    transition: translate .6s var(--bx-ease), box-shadow .6s var(--bx-ease);
}
/* Spotlight que sigue al cursor */
.bx-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(198, 255, 0, .14), transparent 55%);
    opacity: 0;
    transition: opacity .5s ease;
}
.bx-tile > * { position: relative; z-index: 1; }
/* EWWW Image Optimizer envuelve cada <img> en <picture> (WebP): el wrapper no debe
   generar caja propia, para que la imagen absoluta se mida contra su tile. */
.bx-page picture,
.bx-fab picture { display: contents; }
@media (hover: hover) {
    .bx-tile:hover { box-shadow: var(--bx-shadow-hover); }
    .bx-tile:hover::before { opacity: 1; }
}
.bx-tile--dark { background: var(--bx-ink); color: #fff; }
.bx-tile--dark::before { background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(198, 255, 0, .22), transparent 60%); }
.bx-tile--accent { background: var(--bx-accent); color: var(--bx-ink); }
.bx-tile--accent::before { background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .55), transparent 60%); }

.bx-tile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.bx-tile-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 14px;
    background: rgba(4, 43, 38, .06);
    color: var(--bx-ink);
    transition: transform .6s var(--bx-ease), background-color .4s ease;
}
.bx-tile:hover .bx-tile-icon { transform: rotate(-8deg) scale(1.08); background: var(--bx-accent); }
.bx-tile-icon--dark { background: var(--bx-ink); color: var(--bx-accent); }
.bx-tile-icon--accent { background: rgba(198, 255, 0, .14); color: var(--bx-accent); }
.bx-tile:hover .bx-tile-icon--dark { background: var(--bx-ink); }
.bx-tile--dark:hover .bx-tile-icon--accent { background: var(--bx-accent); color: var(--bx-ink); }

/* ==========================================================================
   HERO
   ========================================================================== */
.bx-hero { padding: 8px 0 18px; }

.bx-hero-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto 1fr;
    gap: var(--bx-gap);
    height: clamp(560px, calc(100svh - 4.5rem - 110px), 760px);
}

.bx-hero-media {
    grid-column: 1 / 9;
    grid-row: 1 / 4;
    margin: 0;
    cursor: zoom-in;
    background: #0b1f1c;
}
.bx-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: 50% 60%;
    transition: scale 1.6s var(--bx-ease);
    will-change: transform;
    z-index: 0 !important;
}
@media (hover: hover) { .bx-hero-media:hover .bx-hero-img { scale: 1.04; } }
.bx-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(2, 20, 18, .45) 0%, rgba(2, 20, 18, 0) 26%),
        linear-gradient(0deg, rgba(2, 20, 18, .86) 0%, rgba(2, 20, 18, .35) 34%, rgba(2, 20, 18, 0) 60%);
    pointer-events: none;
}
.bx-hero-media::before { display: none; }

.bx-hero-top {
    position: absolute !important;
    top: 22px;
    left: 22px;
    right: 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.bx-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.bx-hero-caption {
    position: absolute !important;
    left: clamp(22px, 3vw, 40px);
    right: clamp(22px, 3vw, 40px);
    bottom: clamp(22px, 3vw, 38px);
    color: #fff;
}
.bx-hero-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
}
.bx-hero-location .bx-ico { color: var(--bx-accent); }
.bx-hero-title {
    margin: 0;
    max-width: 18ch;
    color: #fff;
    font-size: clamp(2rem, 4.4vw, 4rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.04em;
    text-wrap: balance;
}
.bx-hero-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease, translate .45s var(--bx-ease);
}
.bx-hero-hint:hover,
.bx-hero-hint:focus-visible { background: var(--bx-accent); color: var(--bx-ink); translate: 0 -2px; outline: none; }

/* Precio */
.bx-price {
    grid-column: 9 / 13;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    padding: 26px 28px;
}
.bx-price .bx-eyebrow { margin-bottom: 8px; }
.bx-price .property-price-operation,
.bx-page .bx-price .property-price-operation {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 4px 10px;
    width: auto;
    margin: 0;
    padding: 0 !important;
    border: 0;
    background: none;
    box-shadow: none;
    text-align: left;
}
.bx-price__value {
    color: var(--bx-accent);
    font-size: clamp(2rem, 3vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1;
}
.bx-price__op { color: rgba(255, 255, 255, .7); font-size: .95rem; font-weight: 500; }
.bx-price__unit { margin-top: 8px; color: rgba(255, 255, 255, .55); font-size: .8rem; }
.bx-price__hook {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font: inherit;
    font-size: .85rem;
    text-align: left;
    cursor: pointer;
    transition: background-color .3s ease, border-color .3s ease;
}
.bx-price__hook b { color: var(--bx-accent); }
.bx-price__hook span { flex: 1; }
.bx-price__hook .bx-ico--arrow { transition: transform .45s var(--bx-ease); }
.bx-price__hook:hover { background: rgba(198, 255, 0, .1); border-color: rgba(198, 255, 0, .4); }
.bx-price__hook:hover .bx-ico--arrow { transform: translateX(4px); }

/* Datos clave */
.bx-facts {
    grid-column: 9 / 13;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    padding: 0;
    background: var(--bx-line);
}
.bx-facts::before { display: none; }
.bx-fact {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon value" "icon label";
    column-gap: 12px;
    row-gap: 4px;
    align-items: center;
    padding: 18px 20px;
    background: var(--bx-surface);
    transition: background-color .4s ease;
}
.bx-fact:hover { background: #f7fbf3; }
/* Con un número impar de datos, el último ocupa toda la fila (sin celda vacía) */
.bx-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
.bx-fact__icon {
    grid-area: icon;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(4, 43, 38, .06);
    color: var(--bx-ink);
    transition: transform .6s var(--bx-ease), background-color .4s ease;
}
.bx-fact:hover .bx-fact__icon { transform: translateY(-3px) rotate(-6deg); background: var(--bx-accent); }
.bx-fact__value { grid-area: value; display: flex; align-items: baseline; gap: 3px; color: var(--bx-ink); line-height: 1; }
.bx-fact__value b { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bx-fact__value small { color: var(--bx-soft); font-size: .78rem; font-weight: 600; }
.bx-fact__label { grid-area: label; overflow: hidden; color: var(--bx-soft); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }

/* Miniaturas */
.bx-hero-thumbs {
    grid-column: 9 / 13;
    grid-row: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bx-gap);
    min-height: 0;
}
.bx-hero-thumb {
    padding: 0;
    border: 0;
    cursor: zoom-in;
    min-height: 0;
}
.bx-hero-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--bx-ease), filter .6s ease;
}
.bx-hero-thumb:hover img { transform: scale(1.1); filter: saturate(1.15); }
.bx-hero-thumb__more {
    position: absolute !important;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(4, 43, 38, .55);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    backdrop-filter: blur(2px);
    transition: background-color .4s ease;
}
.bx-hero-thumb:hover .bx-hero-thumb__more { background: rgba(4, 43, 38, .35); }
.bx-hero-grid:not(.has-thumbs) .bx-facts { grid-row: 2 / 4; }

/* ==========================================================================
   SUBNAV
   ========================================================================== */
.bx-subnav {
    position: sticky;
    top: var(--bx-top);
    z-index: 60;
    margin-bottom: 18px;
    transition: top .32s cubic-bezier(.22, .8, .22, 1);
}
.bx-subnav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), var(--bx-shadow);
}
.bx-subnav__links { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.bx-subnav__links::-webkit-scrollbar { display: none; }
.bx-subnav__links a {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--bx-soft);
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color .35s ease;
}
.bx-subnav__links a:hover { color: var(--bx-ink); }
.bx-subnav__links a.is-active { color: var(--bx-accent); }
.bx-subnav__ink {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    height: 100%;
    width: var(--ink-w, 0);
    border-radius: 999px;
    background: var(--bx-ink);
    transform: translateX(var(--ink-x, 0));
    opacity: var(--ink-o, 0);
    transition: transform .55s var(--bx-ease), width .55s var(--bx-ease), opacity .3s ease;
}
.bx-subnav__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.bx-subnav__actions .js-like-property,
.bx-subnav__actions [class*="fav"] { flex: none; }

/* ==========================================================================
   LAYOUT CONTENIDO + ASIDE
   ========================================================================== */
.bx-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: var(--bx-gap);
    align-items: start;
    padding-bottom: 40px;
}

.bx-main {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--bx-gap);
    grid-auto-flow: dense;
}
.bx-main > .bx-tile { grid-column: span 6; padding: 30px; }
.bx-main > .bx-amen { grid-column: span 6; }
.bx-main > .bx-activity { grid-column: span 3; }
.bx-main > .bx-calc { grid-column: span 3; }
.bx-main > .bx-plans { grid-column: span 3; }
.bx-main > .bx-video { grid-column: span 6; padding: 0; }
.bx-main > .bx-tile.bx-span-full { grid-column: span 6; }

/* Descripción (sobrescribe estilos heredados) */
.bx-desc .description-text,
.bx-desc .description-text.collapsed,
.bx-desc .description-text.expanded {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--bx-text);
    font-size: 1rem;
    line-height: 1.75;
}
.bx-desc .description-text.collapsed {
    -webkit-line-clamp: 6;
    line-clamp: 6;
    mask-image: linear-gradient(180deg, #000 55%, transparent);
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.bx-desc .description-text p { margin: 0 0 1em; }
.bx-desc .read-more-btn,
.bx-desc .read-more-btn.collapsed,
.bx-desc .read-more-btn.expanded {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: rgba(4, 43, 38, .06);
    color: var(--bx-ink) !important;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .3s ease, transform .45s var(--bx-ease);
}
.bx-desc .read-more-btn:hover { background: var(--bx-accent); transform: translateX(4px); text-decoration: none; }

/* Amenidades */
.bx-amen-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.bx-amen-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 10px 10px;
    border-radius: 16px;
    background: #f5f8f7;
    font-size: .88rem;
    font-weight: 500;
    color: var(--bx-text);
    transition: translate .5s var(--bx-ease), background-color .35s ease, box-shadow .5s var(--bx-ease);
}
.bx-amen-item:hover { translate: 0 -3px; background: #fff; box-shadow: 0 14px 28px -16px rgba(4, 43, 38, .35); }
.bx-amen-item .ame-small-icon,
.bx-amen-item svg,
.bx-amen-item img {
    width: 38px !important;
    height: 38px !important;
    flex: none;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
    transition: transform .6s var(--bx-ease), background-color .35s ease;
}
.bx-amen-item:hover .ame-small-icon,
.bx-amen-item:hover svg,
.bx-amen-item:hover img { transform: rotate(-10deg) scale(1.08); background: var(--bx-accent); }

/* Actividad */
.bx-stats { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bx-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f5f8f7;
    color: var(--bx-text);
    font-size: .88rem;
    transition: translate .5s var(--bx-ease), background-color .3s ease;
}
.bx-stat .bx-ico { color: var(--bx-ink-2); }
.bx-stat b { font-variant-numeric: tabular-nums; }
.bx-stat:hover { translate: 4px 0; background: #edf3f1; }
.bx-stat.is-accent { background: rgba(198, 255, 0, .32); }
.bx-stat.is-accent .bx-ico { color: var(--bx-ink); }

/* Calculadora */
.bx-calc { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.bx-calc__hook { margin: 0; font-size: 1rem; line-height: 1.5; }
.bx-calc__hook b { font-size: 1.35rem; letter-spacing: -.02em; }
.bx-calc .bx-btn { margin-top: auto; }
.bx-page .bx-calc .bx-btn--dark.btn-open-calc {
    width: auto;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--bx-ink);
    color: var(--bx-accent);
    box-shadow: 0 14px 30px -14px rgba(4, 43, 38, .6);
}

/* Planos */
.bx-plans { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.bx-plans p { margin: 0; color: var(--bx-soft); }
.bx-plans .btn-blueprint,
.bx-page .bx-plans .btn-blueprint { width: auto; margin-top: auto; padding: 0 22px; border: 0; border-radius: 999px; }
.bx-plans__grid {
    position: absolute !important;
    inset: 0;
    z-index: 0 !important;
    background-image:
        linear-gradient(rgba(4, 43, 38, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(4, 43, 38, .06) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at 100% 0%, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 100% 0%, #000, transparent 70%);
    transition: background-size 1.2s var(--bx-ease);
}
.bx-plans:hover .bx-plans__grid { background-size: 26px 26px; }

/* Video */
.bx-video .video-container { aspect-ratio: 16 / 9; height: auto; margin: 0; border-radius: inherit; overflow: hidden; }
.bx-video .video-placeholder { position: relative; width: 100%; height: 100%; background-size: cover; background-position: center; transition: transform 1.4s var(--bx-ease); }
.bx-video:hover .video-placeholder { transform: scale(1.04); }
.bx-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border: 0;
    border-radius: 50%;
    background: var(--bx-accent);
    color: var(--bx-ink);
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform .5s var(--bx-ease);
}
.bx-play:hover { transform: translate(-50%, -50%) scale(1.1); }
.bx-video .bx-play.play-button { background: var(--bx-accent); border: 0; opacity: 1; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .45); }
.bx-play .bx-ico { margin-left: 4px; fill: currentColor; }
.bx-play__ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--bx-accent); animation: bx-ring-out 2.4s var(--bx-ease) infinite; }
.bx-video__label { position: absolute; left: 18px; bottom: 18px; }

/* ---------- Aside de contacto ---------- */
.bx-aside { position: relative; align-self: stretch; }
.bx-aside__sticky { position: sticky; top: calc(var(--bx-top) + 78px); transition: top .32s cubic-bezier(.22, .8, .22, 1); }

.bx-contact,
#perfil-vendedor .contact-card-refined.bx-contact {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 22px;
    border: 0;
    border-radius: var(--bx-radius);
    background: var(--bx-surface);
    box-shadow: var(--bx-shadow-hover);
    top: 0;        /* el legado le daba top:20px y la desalineaba de la Descripción */
    margin-top: 0;
}
.bx-contact::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--bx-angle, 0deg), transparent 0 70%, var(--bx-accent) 85%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: bx-spin-border 6s linear infinite;
    opacity: .9;
}
@property --bx-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.bx-contact__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f4;
    color: var(--bx-ink);
    cursor: pointer;
    transition: transform .4s var(--bx-ease), background-color .3s ease;
}
.bx-contact__close:hover { transform: rotate(90deg); background: var(--bx-accent); }

.bx-seller { margin: 0 0 16px; padding: 0; border: 0; background: none; }
.bx-seller__btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 10px;
    margin: -10px;
    width: calc(100% + 20px);
    border: 0;
    border-radius: 20px;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .3s ease;
}
.bx-seller__btn:hover { background: #f5f8f7; }
.bx-seller__avatar { position: relative; flex: none; }
.bx-seller__avatar img { width: 56px; height: 56px; border-radius: 18px; object-fit: cover; transition: transform .6s var(--bx-ease), border-radius .6s var(--bx-ease); }
.bx-seller__btn:hover .bx-seller__avatar img { transform: scale(1.05) rotate(-3deg); border-radius: 50%; }
.bx-seller__avatar i { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #22c55e; }
.bx-seller__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bx-seller__text small { color: var(--bx-soft); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.bx-seller__text strong { overflow: hidden; color: var(--bx-ink); font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.bx-seller__text > span { display: inline-flex; align-items: center; gap: 4px; color: var(--bx-ink-2); font-size: .78rem; font-weight: 600; }
.bx-seller__btn:hover .bx-seller__text > span .bx-ico { transform: translateX(3px); }
.bx-seller__text .bx-ico { transition: transform .4s var(--bx-ease); }

.bx-contact__title { margin: 0 0 4px; padding-top: 14px; border-top: 1px solid var(--bx-line); color: var(--bx-ink); font-size: .95rem; font-weight: 600; }

/* Orden: perfil → título → campos → botones (el legado forzaba los botones antes) */
#perfil-vendedor .contact-card-refined.bx-contact > .seller-profile-card { order: 1; }
#perfil-vendedor .contact-card-refined.bx-contact > .bx-contact__title { order: 2; }
#perfil-vendedor .contact-card-refined.bx-contact > #contact-modal { order: 3; }
#perfil-vendedor .contact-card-refined.bx-contact > .grid-agent { display: block; order: 4; margin-top: 12px; }
.bx-actions,
#perfil-vendedor .action-buttons-group.bx-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin: 0;
}
#perfil-vendedor .bx-actions .bx-btn,
.bx-actions .bx-btn { min-height: 52px; width: 100%; padding: 0 18px; border-radius: 18px; font-size: .92rem; }
#perfil-vendedor .bx-actions .bx-btn::before { display: none; }
#perfil-vendedor .bx-actions .bx-btn img { width: 20px !important; height: 20px !important; filter: none !important; }
#perfil-vendedor .bx-actions .btn-wa-action .hide-into-mobile,
#perfil-vendedor .bx-actions .btn-email-action span { display: inline; max-width: none; opacity: 1; transform: none; }
button#open-contact-modal.bx-btn--primary { background: var(--bx-ink); border: 0; color: #fff; box-shadow: 0 14px 30px -14px rgba(4, 43, 38, .7); }
button#open-contact-modal.bx-btn--primary:hover { background: var(--bx-ink-2); }
button#open-contact-modal .bx-ico { color: var(--bx-accent); transition: transform .5s var(--bx-ease); }
button#open-contact-modal:hover .bx-ico { transform: translate(3px, -3px) rotate(8deg); }

/* Formulario dentro de la tarjeta (escritorio) */
@media (min-width: 769px) {
    .bx-contact .contact-form-panel {
        display: block !important;
        position: static;
        order: 4;
        width: 100%;
        max-width: none;
        height: auto;
        margin: 0;
        background: transparent;
        backdrop-filter: none;
    }
    .bx-contact .contact-form-panel .modal-window {
        width: 100%;
        max-width: none;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        animation: none;
    }
    .bx-contact .contact-form-panel .modal-window::before,
    .bx-contact .contact-form-panel .close-modal,
    .bx-contact .contact-form-panel .modal-header { display: none; }
    .bx-contact #contact-submit-btn { display: none; }
}
.bx-contact .seller-profile-card { order: 1; }
.bx-contact .bx-contact__title { order: 2; }

#contact-form-modal,
#perfil-vendedor #contact-form-modal { display: grid !important; gap: 10px; margin-top: 12px; }
#contact-form-modal .form-group,
#contact-form-modal .form-row-custom { display: grid; gap: 10px; margin: 0; }
#contact-form-modal #contact-form-msg:empty { display: none !important; }
#contact-form-modal input[name="website"] { display: none !important; } /* campo trampa antispam */
#contact-form-modal input,
#contact-form-modal textarea {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: #f3f6f5;
    box-shadow: none;
    color: var(--bx-text);
    font: inherit;
    font-size: .92rem;
    line-height: 1.45;
    transition: border-color .3s ease, background-color .3s ease, box-shadow .4s var(--bx-ease), transform .4s var(--bx-ease);
}
#contact-form-modal textarea { min-height: 96px; resize: vertical; }
#contact-form-modal input::placeholder,
#contact-form-modal textarea::placeholder { color: #8a9a96; opacity: 1; }
#contact-form-modal input:hover,
#contact-form-modal textarea:hover { background: #edf2f0; }
#contact-form-modal input:focus,
#contact-form-modal textarea:focus {
    outline: none;
    border-color: var(--bx-ink-2);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(198, 255, 0, .45);
    transform: translateY(-1px);
}
#contact-form-modal input[readonly] { color: var(--bx-soft); }
#contact-submit-btn {
    min-height: 50px;
    border-radius: 16px;
    background: var(--bx-ink);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
}
.form-response-msg { font-size: .85rem; }

/* Tarjeta acoplada (flotante) al salir de vista */
.bx-aside__sticky.is-docked {
    position: fixed;
    top: auto;
    right: 24px;
    bottom: 24px;
    z-index: 9500;
    width: min(400px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: var(--bx-radius);
    animation: bx-dock-in .7s var(--bx-ease) both;
    scrollbar-width: thin;
}
.bx-aside__sticky.is-docked .bx-contact__close { display: grid; }
.bx-aside__sticky.is-docked .bx-contact { box-shadow: 0 40px 90px -20px rgba(4, 43, 38, .5); }

/* FAB flotante (escritorio) */
.bx-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9400;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 7px 8px 7px 7px;
    border: 0;
    border-radius: 999px;
    background: var(--brand-primary, #042b26);
    color: #fff;
    box-shadow: 0 24px 50px -16px rgba(4, 43, 38, .65);
    font-family: var(--font-base, 'Lexend', system-ui, sans-serif);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    translate: 0 30px;
    scale: .9;
    transition: opacity .45s var(--bx-ease), translate .6s var(--bx-ease), scale .6s var(--bx-ease), visibility 0s linear .6s, box-shadow .4s ease;
}
.bx-fab.is-visible { opacity: 1; visibility: visible; translate: 0 0; scale: 1; transition-delay: 0s; }
.bx-fab img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand-secondary, #c6ff00); }
.bx-fab__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.bx-fab__text small { color: rgba(255, 255, 255, .6); font-size: .7rem; }
.bx-fab__text b { font-size: .9rem; font-weight: 600; }
.bx-fab__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-secondary, #c6ff00); color: var(--brand-primary, #042b26); transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.bx-fab:hover .bx-fab__icon { transform: rotate(-14deg) scale(1.08); }
.bx-fab__pulse { position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(198, 255, 0, .55); animation: bx-ping-lg 2.6s cubic-bezier(.22, 1, .36, 1) infinite; pointer-events: none; }
@media (min-width: 769px) { .bx-fab { display: inline-flex; } }
.bx-fab { padding: 7px; }
.bx-fab__text { padding-right: 4px; }

/* Botón global "volver arriba" (footer.php): misma altura y lenguaje que el FAB,
   y el FAB se corre a su izquierda cuando ambos están visibles. */
@media (min-width: 769px) {
    body.single-inmueble .scroll-top-btn {
        right: 24px;
        bottom: 24px;
        width: 56px;
        height: 56px;
        border: 0;
        background: rgba(255, 255, 255, .92);
        color: var(--bx-ink);
        box-shadow: inset 0 0 0 1px var(--bx-line), 0 24px 50px -18px rgba(4, 43, 38, .45);
    }
    body.single-inmueble .scroll-top-btn:hover { background: var(--bx-ink); color: var(--bx-accent); }
    body.single-inmueble .scroll-top-btn svg { width: 22px; height: 22px; }
    body.single-inmueble:has(.scroll-top-btn.show) .bx-fab { right: calc(24px + 56px + 12px); }
    .bx-fab { transition: opacity .45s var(--bx-ease), translate .6s var(--bx-ease), scale .6s var(--bx-ease), right .5s var(--bx-ease), visibility 0s linear .6s, box-shadow .4s ease; }
    .bx-fab.is-visible { transition-delay: 0s; }
    html.bx-card-docked .scroll-top-btn { opacity: 0 !important; visibility: hidden !important; pointer-events: none; }
}

/* ==========================================================================
   SECCIONES GRANDES
   ========================================================================== */
.bx-section { position: relative; padding: clamp(56px, 8vw, 110px) 0; }
.bx-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: clamp(26px, 4vw, 44px);
}
.bx-section-head--invert .bx-h2 { color: #fff; }
.bx-section-head--invert .bx-eyebrow { color: var(--bx-accent); }
.bx-section-head--invert .bx-lead { color: rgba(255, 255, 255, .7); }
.bx-footnote { margin: 22px 0 0; color: var(--bx-soft); font-size: .78rem; }
.bx-footnote--invert { color: rgba(255, 255, 255, .5); }
.bx-anchor { display: block; height: 0; scroll-margin-top: 90px; }
.bx-page [id] { scroll-margin-top: 110px; }

/* ---------- Galería ---------- */
.bx-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: clamp(170px, 17vw, 250px);
    grid-auto-flow: dense;
    gap: var(--bx-gap);
}
.bx-gal-hidden { display: none !important; }
.bx-gal-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--bx-radius);
    background: #dfe8e5;
    cursor: zoom-in;
    isolation: isolate;
    box-shadow: var(--bx-shadow);
    transition: box-shadow .6s var(--bx-ease);
}
.bx-gal-media { position: absolute; inset: -8% 0; display: block; }
.bx-gal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 1.4s var(--bx-ease), filter .6s ease;
}
.bx-gal-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 20, 18, .55), transparent 45%);
    opacity: 0;
    transition: opacity .5s ease;
}
.bx-gal-tile:hover { box-shadow: var(--bx-shadow-hover); }
.bx-gal-tile:hover .bx-gal-media img { scale: 1.08; filter: saturate(1.12); }
.bx-gal-tile:hover::after { opacity: 1; }
.bx-gal-zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bx-accent);
    color: var(--bx-ink);
    opacity: 0;
    transform: scale(.5) rotate(-45deg);
    transition: opacity .4s ease, transform .6s var(--bx-ease);
}
.bx-gal-tile:hover .bx-gal-zoom,
.bx-gal-tile:focus-visible .bx-gal-zoom { opacity: 1; transform: scale(1) rotate(0); }
.bx-gal-index {
    position: absolute;
    left: 16px;
    bottom: 14px;
    z-index: 2;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .4s ease, transform .5s var(--bx-ease);
}
.bx-gal-tile:hover .bx-gal-index { opacity: 1; transform: none; }
.bx-gal-more {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(4, 43, 38, .62);
    backdrop-filter: blur(3px);
    color: #fff;
    font-size: .85rem;
    transition: background-color .5s ease;
}
.bx-gal-more b { font-size: 2.4rem; line-height: 1; letter-spacing: -.03em; color: var(--bx-accent); }
.bx-gal-tile:hover .bx-gal-more { background: rgba(4, 43, 38, .4); }
.bx-gal-tile:focus-visible { outline: 3px solid var(--bx-accent); outline-offset: 3px; }

/* Patrón bento por posición (7 piezas) */
.bx-gallery-grid > .bx-gal-tile:nth-of-type(1) { grid-column: span 2; grid-row: span 2; }
.bx-gallery-grid > .bx-gal-tile:nth-of-type(3) { grid-row: span 2; }
.bx-gallery-grid > .bx-gal-tile:nth-of-type(5) { grid-column: span 2; }
/* Ajustes con pocas fotos */
.bx-gallery-grid--n1 > .bx-gal-tile:nth-of-type(1) { grid-column: 1 / -1; grid-row: span 2; }
.bx-gallery-grid--n2 > .bx-gal-tile { grid-column: span 2 !important; grid-row: span 2 !important; }
.bx-gallery-grid--n3 > .bx-gal-tile:nth-of-type(2),
.bx-gallery-grid--n3 > .bx-gal-tile:nth-of-type(3) { grid-column: span 2; grid-row: span 1; }
.bx-gallery-grid--n4 > .bx-gal-tile:nth-of-type(4) { grid-column: span 1; }
.bx-gallery-grid--n5 > .bx-gal-tile:nth-of-type(5) { grid-column: span 1; }
.bx-gallery-grid--n6 > .bx-gal-tile:nth-of-type(6) { grid-column: span 2; }

/* ---------- Entorno ---------- */
.bx-env {
    margin: 0 clamp(0px, 1.5vw, 24px);
    border-radius: clamp(28px, 4vw, 48px);
    background: var(--bx-ink);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
.bx-env-aurora {
    position: absolute;
    inset: -20%;
    z-index: -1;
    background:
        radial-gradient(40% 35% at 20% 20%, rgba(198, 255, 0, .18), transparent 70%),
        radial-gradient(35% 40% at 85% 30%, rgba(74, 222, 128, .16), transparent 70%),
        radial-gradient(45% 40% at 60% 95%, rgba(15, 118, 110, .35), transparent 70%);
    filter: blur(20px);
    animation: bx-aurora 18s ease-in-out infinite alternate;
}
.bx-env-badges { display: flex; flex-wrap: wrap; gap: 8px; }

.bx-env-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--bx-gap);
    perspective: 1200px;
}
.bx-env .bx-tile {
    background: rgba(255, 255, 255, .05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.bx-env .bx-tile::before { background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(198, 255, 0, .16), transparent 60%); }
.bx-env .bx-tile:hover { box-shadow: inset 0 0 0 1px rgba(198, 255, 0, .35), 0 30px 60px -30px rgba(0, 0, 0, .6); translate: 0 -4px; }

.bx-env-score {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    background: linear-gradient(150deg, rgba(198, 255, 0, .16), rgba(255, 255, 255, .04) 55%) !important;
}
.bx-env-score__label { color: var(--bx-accent); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.bx-ring { position: relative; width: clamp(170px, 16vw, 220px); aspect-ratio: 1; margin: 22px 0; }
.bx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.bx-ring__track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 10; }
.bx-ring__bar { fill: none; stroke: url(#bxRingGrad); stroke-width: 10; stroke-linecap: round; filter: drop-shadow(0 0 10px rgba(198, 255, 0, .45)); }
.bx-ring__value { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 34%; gap: 4px; }
.bx-ring__value b { font-size: clamp(3rem, 5vw, 4.4rem); font-weight: 700; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.bx-ring__value span { color: rgba(255, 255, 255, .55); font-size: 1rem; font-weight: 600; }
.bx-env-score__title { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.bx-env-score__desc { margin: 8px 0 0; max-width: 36ch; color: rgba(255, 255, 255, .65); line-height: 1.55; }
.bx-env-score__total { display: flex; align-items: baseline; gap: 10px; margin-top: auto; padding-top: 22px; }
.bx-env-score__total b { color: var(--bx-accent); font-size: 2rem; font-weight: 700; letter-spacing: -.03em; }
.bx-env-score__total span { color: rgba(255, 255, 255, .65); font-size: .9rem; }

.bx-env-card { display: flex; flex-direction: column; padding: 22px; min-height: 230px; transform-style: preserve-3d; }
.bx-env-grid > .bx-env-card:nth-of-type(6),
.bx-env-grid > .bx-env-card:nth-of-type(7) { grid-column: span 2; }
.bx-env-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bx-env-card__icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .92);
    transition: transform .7s var(--bx-ease), border-radius .7s var(--bx-ease), background-color .4s ease;
}
.bx-env-card:hover .bx-env-card__icon { transform: rotate(-10deg) scale(1.1); border-radius: 50%; background: var(--bx-accent); }
.bx-env-card__count { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
.bx-env-card__count b { font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.bx-env-card__count span { color: rgba(255, 255, 255, .55); font-size: .78rem; }
.bx-env-card__name { margin: 10px 0 0; color: #fff; font-size: 1.02rem; font-weight: 600; }
.bx-env-card__desc { margin: 6px 0 0; color: rgba(255, 255, 255, .58); font-size: .82rem; line-height: 1.5; }
.bx-env-card__bar { display: block; height: 4px; margin-top: auto; padding-top: 0; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bx-env-card__desc + .bx-env-card__bar { margin-top: 18px; }
.bx-env-card__bar i { display: block; width: var(--w, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4ade80, var(--bx-accent)); transform-origin: left; }
.bx-env-card.is-top { box-shadow: inset 0 0 0 1px rgba(198, 255, 0, .4) !important; }
.bx-env-card.is-empty { opacity: .55; }

.bx-env--processing { background: var(--bx-ink); }
.bx-env-processing { padding: 60px 24px; text-align: center; }
.bx-env-processing .bx-h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.bx-env-processing p { max-width: 600px; margin: 14px auto 0; color: rgba(255, 255, 255, .7); }
.bx-env-spinner { display: inline-block; width: 52px; height: 52px; margin-bottom: 20px; border: 3px solid rgba(198, 255, 0, .15); border-top-color: var(--bx-accent); border-radius: 50%; animation: bx-spin 1s linear infinite; }

/* ---------- Ubicación ---------- */
.bx-loc-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: var(--bx-gap);
    height: clamp(480px, 62vh, 620px);
}
.bx-loc-map { grid-column: 1 / 9; grid-row: 1 / 4; padding: 0; background: #dfe8e5; }
.bx-loc-map::before { display: none; }
.bx-loc-map #property-map,
#map-fullscreen-container.bx-loc-map #property-map {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    z-index: 0 !important;
}
/* Anula .map-container / #map-fullscreen-btn heredados (margin 30px, overflow visible,
   top:100px) para que el mapa llene su celda y alinee con la columna derecha. */
.bx-loc-grid > #map-fullscreen-container.bx-loc-map:not(.is-pseudo-fs) {
    order: 0;
    margin: 0 !important;
    width: auto;
    max-width: none;
    border: 0;
    border-radius: var(--bx-radius);
    overflow: hidden !important;
    box-shadow: var(--bx-shadow);
}
.bx-loc-grid > #map-fullscreen-container.bx-loc-map:fullscreen { border-radius: 0; }
.bx-loc-map:not(.is-pseudo-fs) #map-fullscreen-btn.bx-map-fs {
    top: 16px !important;
    right: 16px !important;
    height: auto;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    box-shadow: var(--bx-shadow);
}
.bx-loc-map .leaflet-control-zoom { border: 0 !important; box-shadow: var(--bx-shadow) !important; border-radius: 14px !important; overflow: hidden; }
.bx-map-fs {
    position: absolute !important;
    top: 16px;
    right: 16px;
    z-index: 500 !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    color: var(--bx-ink);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    box-shadow: var(--bx-shadow);
    cursor: pointer;
    transition: background-color .3s ease, transform .45s var(--bx-ease);
}
.bx-map-fs:hover { background: var(--bx-accent); transform: translateY(-2px); }
.bx-radar {
    position: absolute !important;
    top: 50%;
    left: 50%;
    z-index: 400 !important;
    width: 0;
    height: 0;
    pointer-events: none;
    transition: opacity .8s ease;
}
.bx-radar i {
    position: absolute;
    left: -120px;
    top: -120px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 2px solid rgba(4, 43, 38, .35);
    background: radial-gradient(circle, rgba(198, 255, 0, .28), transparent 65%);
    transform: scale(.1);
    opacity: 0;
    animation: bx-radar 3.6s var(--bx-ease) infinite;
}
.bx-radar i:nth-child(2) { animation-delay: 1.2s; }
.bx-radar i:nth-child(3) { animation-delay: 2.4s; }
.bx-loc-map.is-touched .bx-radar { opacity: 0; }
.bx-loc-map .leaflet-marker-icon.custom-div-icon { animation: bx-pin-drop 1s var(--bx-ease) both .6s; }

.bx-loc-info { grid-column: 9 / 13; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: flex-start; padding: 28px; }
.bx-loc-info .bx-tile-icon { margin-bottom: auto; }
.bx-loc-info .bx-eyebrow { margin: 22px 0 6px; }
.bx-loc-info__main { color: #fff; font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.bx-loc-info__sub { margin-top: 6px; color: var(--bx-accent); font-size: 1rem; font-weight: 500; }

.bx-loc-link {
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    color: var(--bx-ink);
    text-decoration: none;
}
.bx-loc-grid > .bx-loc-link:last-child { grid-column: 11 / 13; }
.bx-loc-grid > .bx-loc-link:nth-last-child(2) { grid-column: 9 / 11; }
.bx-loc-link__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: #eef4f3; transition: transform .6s var(--bx-ease); }
.bx-loc-link__icon--waze { color: #33ccff; }
.bx-loc-link__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.bx-loc-link__text small { color: var(--bx-soft); font-size: .72rem; }
.bx-loc-link__text b { font-size: .95rem; }
.bx-loc-link .bx-ico--arrow { margin-left: auto; transition: transform .5s var(--bx-ease); }
.bx-loc-link:hover { translate: 0 -4px; }
.bx-loc-link:hover .bx-loc-link__icon { transform: rotate(-12deg) scale(1.1); }
.bx-loc-link:hover .bx-ico--arrow { transform: translateX(4px) rotate(-45deg); }

/* ---------- Análisis comparativo ---------- */
.bx-cmp { padding-top: clamp(40px, 6vw, 80px); }
.bx-cmp-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.bx-chip--soft { background: var(--bx-surface); color: var(--bx-ink); box-shadow: inset 0 0 0 1px var(--bx-line), var(--bx-shadow); }

.bx-cmp-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--bx-gap);
    perspective: 1400px;
}

/* Radar */
.bx-cmp-radar {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    min-height: 560px;
    padding: 28px;
    background:
        radial-gradient(70% 60% at 50% 55%, rgba(198, 255, 0, .10), transparent 70%),
        linear-gradient(160deg, #06352f, var(--bx-ink) 60%);
}
.bx-cmp-radar__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bx-cmp-radar__head .bx-eyebrow { margin: 0; color: var(--bx-accent); }
.bx-cmp-radar__canvas { position: relative; flex: 1; min-height: 360px; margin: 10px 0; }
.bx-cmp-radar__canvas canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
/* Barrido de radar que gira detrás del gráfico */
.bx-cmp-radar__sweep {
    position: absolute !important;
    z-index: 0 !important;
    top: 52%;
    left: 50%;
    width: min(92%, 640px);
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(198, 255, 0, .10), rgba(198, 255, 0, 0) 18%, transparent);
    -webkit-mask: radial-gradient(circle, #000 0 69%, transparent 70%);
            mask: radial-gradient(circle, #000 0 69%, transparent 70%);
    animation: bx-sweep 7s linear infinite;
    pointer-events: none;
}
.bx-cmp-legend { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 0; padding: 0; list-style: none; }
.bx-cmp-legend li { display: flex; align-items: flex-start; gap: 10px; max-width: 300px; color: rgba(255, 255, 255, .62); font-size: .8rem; line-height: 1.45; }
.bx-cmp-legend b { color: #fff; font-weight: 600; }
.bx-cmp-legend i { flex: none; width: 22px; height: 0; margin-top: .6em; border-top: 3px solid var(--bx-accent); border-radius: 3px; box-shadow: 0 0 10px rgba(198, 255, 0, .6); }
.bx-cmp-legend i.is-avg { border-top: 2px dashed rgba(255, 255, 255, .7); box-shadow: none; }

/* Insight */
.bx-cmp-insight { grid-column: 8 / 13; grid-row: 1; display: flex; flex-direction: column; padding: 28px; }
.bx-cmp-insight__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bx-cmp-insight__kicker { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.bx-cmp-insight__delta { display: flex; align-items: baseline; margin-top: 18px; color: var(--bx-ink); line-height: .9; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.bx-cmp-insight__delta b { font-size: clamp(4rem, 7vw, 6rem); font-weight: 700; }
.bx-cmp-insight__sign,
.bx-cmp-insight__delta > span:last-child { font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 700; }
.bx-cmp-insight__title { margin: 14px 0 0; color: var(--bx-ink); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.bx-cmp-insight__body { margin: 6px 0 0; color: rgba(4, 43, 38, .75); font-size: .92rem; line-height: 1.5; }
.bx-cmp-insight.is-down { background: #e9efe9; }

/* Versus */
.bx-cmp-versus { grid-column: 8 / 13; grid-row: 2; display: flex; flex-direction: column; padding: 28px; }
.bx-cmp-vs { display: grid; gap: 18px; margin: 22px 0 18px; }
.bx-cmp-vs__label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--bx-soft); font-size: .86rem; }
.bx-cmp-vs__label b { color: var(--bx-ink); font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bx-cmp-vs__row.is-avg .bx-cmp-vs__label b { color: var(--bx-soft); }
.bx-cmp-versus__note { margin: auto 0 0; color: var(--bx-soft); font-size: .78rem; }

/* Barras compartidas */
.bx-cmp-bar { position: relative; display: block; height: 10px; border-radius: 99px; background: rgba(4, 43, 38, .07); overflow: hidden; }
.bx-cmp-bar i { display: block; width: var(--w, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--bx-ink-2), var(--bx-ink)); transform-origin: left; }
.is-mine > .bx-cmp-bar i,
.is-mine .bx-cmp-bar i { background: linear-gradient(90deg, #4ade80, var(--bx-accent)); box-shadow: 0 0 12px rgba(198, 255, 0, .5); }
.is-avg > .bx-cmp-bar i,
.is-avg .bx-cmp-bar i { background: repeating-linear-gradient(90deg, #9fb3ae 0 8px, #c3d1cd 8px 12px); }

/* Categorías */
.bx-cmp-cat { grid-column: span 2; display: flex; flex-direction: column; padding: 20px; min-height: 0; }
.bx-cmp-cat__top { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.bx-cmp-cat__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: #eef4f3; transition: transform .7s var(--bx-ease), border-radius .7s var(--bx-ease), background-color .4s ease; }
.bx-cmp-cat:hover .bx-cmp-cat__icon { transform: rotate(-10deg) scale(1.1); border-radius: 50%; background: var(--bx-accent); }
.bx-cmp-cat__name { margin: 0; color: var(--bx-ink); font-size: .95rem; font-weight: 600; line-height: 1.25; }
.bx-cmp-cat__bars { display: grid; gap: 12px; margin: 18px 0 16px; }
.bx-cmp-cat__line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 10px; }
.bx-cmp-cat__lbl { color: var(--bx-soft); font-size: .74rem; line-height: 1.2; }
.bx-cmp-cat__line b { color: var(--bx-ink); font-size: .95rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bx-cmp-cat__line.is-mine .bx-cmp-cat__lbl { color: var(--bx-ink); font-weight: 600; }
.bx-cmp-cat__line.is-avg b { color: var(--bx-soft); font-weight: 500; }
.bx-cmp-cat__line .bx-cmp-bar { grid-column: 1 / -1; height: 7px; }
.bx-cmp-cat__verdict { display: flex; align-items: center; gap: 6px; margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--bx-line); color: var(--bx-soft); font-size: .8rem; font-weight: 600; line-height: 1.3; }
.bx-cmp-cat__verdict svg { flex: none; }
.bx-cmp-cat.is-up .bx-cmp-cat__verdict { color: #15803d; }
.bx-cmp-cat.is-down .bx-cmp-cat__verdict { color: #b42318; }
.bx-cmp-cat:hover,
.bx-cmp-versus:hover,
.bx-cmp-insight:hover { translate: 0 -4px; }


/* ---------- Alerta: login requerido para favoritos ---------- */
.bx-login-modal.active { display: flex; align-items: center; justify-content: center; padding: 20px; }
.bx-login-modal *,
.bx-login-modal *::before,
.bx-login-modal *::after { box-sizing: border-box; }
.bx-login-modal .ubihome-modal-overlay {
    background: rgba(2, 24, 21, .55);
    backdrop-filter: blur(8px) saturate(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    animation: bx-fade-in .35s ease both;
}
.bx-login-modal .bx-login {
    position: relative;
    z-index: 2;
    width: min(420px, 100%);
    max-width: none;
    padding: 34px 30px 28px;
    border-radius: 32px;
    background:
        radial-gradient(120% 70% at 50% -10%, rgba(198, 255, 0, .22), transparent 60%),
        var(--bx-surface);
    box-shadow: 0 50px 100px -30px rgba(2, 24, 21, .55), inset 0 0 0 1px var(--bx-line);
    text-align: center;
    font-family: var(--font-base, 'Lexend', system-ui, sans-serif);
    color: var(--bx-text);
    animation: bx-login-in .7s var(--bx-ease) both;
}
.bx-login__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f5f4;
    color: var(--bx-ink);
    cursor: pointer;
    transition: rotate .4s var(--bx-ease), background-color .3s ease;
}
.bx-login__close:hover { rotate: 90deg; background: var(--bx-accent); }

.bx-login__badge {
    position: relative;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 26px;
    background: var(--bx-ink);
    color: var(--bx-accent);
    box-shadow: 0 18px 36px -14px rgba(4, 43, 38, .7);
    animation: bx-login-badge .9s var(--bx-ease) .15s both;
}
.bx-login__badge svg { animation: bx-login-bookmark 2.8s var(--bx-ease) 1s infinite; }
/* chispas alrededor del ícono */
.bx-login__badge i {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bx-accent);
    opacity: 0;
    animation: bx-login-spark 2.8s var(--bx-ease) 1s infinite;
}
.bx-login__badge i:nth-of-type(1) { top: -6px; right: -4px; }
.bx-login__badge i:nth-of-type(2) { bottom: 4px; left: -10px; width: 6px; height: 6px; animation-delay: 1.15s; }
.bx-login__badge i:nth-of-type(3) { top: 10px; left: -6px; width: 5px; height: 5px; background: #4ade80; animation-delay: 1.3s; }

.bx-login__eyebrow { display: flex; justify-content: center; margin-bottom: 8px; }
.bx-login__title { margin: 0; color: var(--bx-ink); font-size: clamp(1.5rem, 4vw, 1.85rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.bx-login__text { max-width: 30ch; margin: 10px auto 0; color: var(--bx-soft); font-size: .95rem; line-height: 1.55; }

.bx-login__item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 0;
    padding: 10px;
    border-radius: 20px;
    background: #f3f6f5;
    text-align: left;
    animation: bx-login-up .7s var(--bx-ease) .3s both;
}
.bx-login__item img { flex: none; width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.bx-login__item div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bx-login__item strong { overflow: hidden; color: var(--bx-ink); font-size: .92rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bx-login__item span { overflow: hidden; color: var(--bx-soft); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }

.bx-login__actions { display: grid; gap: 10px; margin-top: 22px; animation: bx-login-up .7s var(--bx-ease) .4s both; }
.bx-login .btn-login-required.bx-btn {
    display: inline-flex;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 0 22px;
    border-radius: 18px;
    background: var(--bx-ink);
    color: #fff;
    font-size: .98rem;
}
.bx-login .btn-login-required .bx-ico { color: var(--bx-accent); }
.bx-login .btn-login-required:hover { background: var(--bx-ink-2); }
.bx-login__later.bx-btn { width: 100%; min-height: 48px; border-radius: 18px; box-shadow: none; background: transparent; color: var(--bx-soft); }
.bx-login__later.bx-btn:hover { background: #f1f5f4; color: var(--bx-ink); }

@keyframes bx-fade-in { from { opacity: 0; } }
@keyframes bx-login-in { from { opacity: 0; translate: 0 40px; scale: .92; } }
@keyframes bx-login-up { from { opacity: 0; translate: 0 14px; } }
@keyframes bx-login-badge { 0% { opacity: 0; scale: .4; rotate: -20deg; } 60% { opacity: 1; scale: 1.08; rotate: 6deg; } 100% { scale: 1; rotate: 0deg; } }
@keyframes bx-login-bookmark { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 0 -5px; } 90% { translate: 0 1px; } }
@keyframes bx-login-spark { 0%, 72% { opacity: 0; scale: .2; } 82% { opacity: 1; scale: 1.2; } 100% { opacity: 0; scale: .6; } }

@media (max-width: 768px) {
    .bx-login-modal.active { align-items: flex-end; padding: 0; }
    .bx-login-modal .bx-login {
        width: 100%;
        padding: 30px 22px calc(22px + env(safe-area-inset-bottom));
        border-radius: 32px 32px 0 0;
        animation-name: bx-login-sheet;
    }
    .bx-login-modal .bx-login::before {
        content: "";
        position: absolute;
        top: 10px;
        left: 50%;
        width: 44px;
        height: 5px;
        border-radius: 99px;
        background: rgba(4, 43, 38, .15);
        translate: -50% 0;
    }
}
@keyframes bx-login-sheet { from { translate: 0 100%; } }
@media (prefers-reduced-motion: reduce) {
    .bx-login-modal *, .bx-login-modal .bx-login, .bx-login-modal .ubihome-modal-overlay { animation: none !important; }
}

/* ---------- Relacionadas + CTA ---------- */
.bx-related { padding-top: 20px; }
.bx-related__list { margin-bottom: var(--bx-gap); }
.bx-related .suggested-title { margin: 0 0 24px; color: var(--bx-ink); font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.03em; }
.bx-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(26px, 4vw, 44px); }
.bx-cta .bx-h3 { color: #fff; font-size: clamp(1.4rem, 2.4vw, 2rem); }
.bx-cta p { margin: 8px 0 0; color: rgba(255, 255, 255, .7); }

/* ---------- Heredados que siguen vivos ---------- */
.agent-details-source { display: none; }
.seller-profile-modal .modal-window { width: min(92vw, 680px); max-height: 86vh; overflow: auto; text-align: left; border-radius: 24px; }
.seller-profile-modal__head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid #e2e8f0; }
.seller-profile-modal__head img { width: 68px; height: 68px; border-radius: 999px; object-fit: cover; }
.seller-profile-modal__eyebrow { display: block; margin-bottom: 4px; color: #64748b; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.seller-profile-modal__name { margin: 0; color: #0f172a; font-size: 1.35rem; line-height: 1.15; }
/* Tarjeta de compartir: el contenido fluye dentro de la card (sin posiciones fijas por viewport) */
#share-card-render .share-card-content { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: clamp(18px, 6vw, 30px); }
#share-card-render .share-card-main-info { position: static; inset: auto; min-width: 0; width: 100%; }
#share-card-render .share-card-info { min-width: 0; }
#share-card-render #share-card-price { font-size: clamp(24px, 8vw, 32px) !important; line-height: 1.05; overflow-wrap: anywhere; }
#share-card-render .share-loc { overflow-wrap: anywhere; }
#share-card-render .share-card-footer { gap: 12px; margin-top: clamp(14px, 4vw, 30px) !important; }
#share-card-render .share-agent-box { min-width: 0; flex: 1 1 auto; }
#share-card-render .share-agent-photo { flex: none; }
#share-card-render .share-agent-meta { min-width: 0; }
#share-card-render .share-agent-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#share-card-render .share-qr-box { flex: none; width: clamp(64px, 20vw, 85px) !important; height: clamp(64px, 20vw, 85px) !important; }
.share-modal-overlay .share-modal-container { max-height: calc(100dvh - 40px); }
@media (max-width: 480px) {
    .share-modal-overlay { padding: 64px 16px 16px; align-items: flex-start; overflow-y: auto; }
    .share-modal-overlay .share-modal-close { top: 12px; right: 12px; }
}

@media (min-width: 992px) {
    #masthead { transition: transform .32s cubic-bezier(.22, .8, .22, 1), visibility 0s linear 0s; will-change: transform; }
    #masthead.is-scroll-hidden {
        transition: transform .32s cubic-bezier(.22, .8, .22, 1), visibility 0s linear .32s;
        visibility: hidden;
        pointer-events: none;
        transform: translate3d(0, -110%, 0);
    }
    html.bx-header-hidden { --bx-top: 12px; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1180px) {
    .bx-cmp-cat { grid-column: span 4; }
    .bx-layout { grid-template-columns: minmax(0, 1fr) 360px; }
    .bx-main > .bx-activity,
    .bx-main > .bx-calc,
    .bx-main > .bx-plans { grid-column: span 6; }
}

@media (max-width: 991px) {
    .bx-cmp-radar { grid-column: 1 / -1; grid-row: auto; min-height: 520px; }
    .bx-cmp-insight { grid-column: 1 / 7; grid-row: auto; }
    .bx-cmp-versus { grid-column: 7 / 13; grid-row: auto; }
    .bx-cmp-cat { grid-column: span 4; }
    .bx-hero-grid { grid-template-rows: auto; height: auto; }
    .bx-hero-media { grid-column: 1 / -1; grid-row: auto; height: min(68svh, 620px); }
    .bx-price { grid-column: 1 / 7; grid-row: auto; }
    .bx-facts { grid-column: 7 / 13; grid-row: auto !important; }
    .bx-hero-thumbs { display: none; }
    .bx-subnav__links a span { display: none; }
    .bx-subnav__links a { padding: 11px 14px; }
    .bx-layout { grid-template-columns: minmax(0, 1fr); }
    .bx-aside__sticky { position: static; }
    .bx-env-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bx-env-score { grid-row: auto; }
    .bx-loc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; height: auto; }
    .bx-loc-map { grid-column: 1 / -1; grid-row: auto; height: 420px; }
    .bx-loc-info { grid-column: 1 / -1; grid-row: auto; }
    .bx-loc-grid > .bx-loc-link:nth-last-child(2),
    .bx-loc-grid > .bx-loc-link:last-child { grid-column: span 1; grid-row: auto; }
    .bx-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bx-gallery-grid > .bx-gal-tile:nth-of-type(3) { grid-row: span 1; }
}

@media (max-width: 768px) {
    /* La foto principal sube hasta el borde: la barra móvil (volver/compartir/favorito) flota encima */
    main.single-property-container.bx-page { padding-top: 0; }
    :root { --bx-radius: 22px; --bx-gap: 12px; }
    .bx-container { width: calc(100% - 32px); }
    .bx-hero { padding-top: 0; }
    .bx-hero-grid { gap: 12px; }
    .bx-hero-media { margin-inline: -16px; width: calc(100% + 32px); max-width: none; height: 78svh; border-radius: 0 0 32px 32px; }
    .bx-hero-top { top: 76px; left: 16px; right: 16px; }
    .bx-hero-count { display: none; }
    .bx-hero-caption { left: 20px; right: 20px; bottom: 24px; }
    .bx-hero-title { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
    .bx-price { grid-column: 1 / -1; padding: 22px; }
    .bx-facts { grid-column: 1 / -1; }
    .bx-subnav { position: relative; top: 0; }
    .bx-subnav__inner { padding: 6px; }
    .bx-subnav__actions { display: none; }
    .bx-subnav__links { width: 100%; justify-content: space-between; }
    .bx-main > .bx-tile { padding: 22px; }
    .bx-contact,
    #perfil-vendedor .contact-card-refined.bx-contact { box-shadow: var(--bx-shadow); }
    .bx-contact::after { display: none; }
    .bx-contact .grid-agent,
    .bx-contact .bx-contact__title { display: none; }
    .bx-contact .bx-seller { margin-bottom: 0; }
    .bx-section-head { flex-direction: column; align-items: flex-start; }
    .bx-env { margin: 0; border-radius: 32px; }
    .bx-env-grid { grid-template-columns: minmax(0, 1fr); }
    .bx-env-score,
    .bx-env-grid > .bx-env-card:nth-of-type(6),
    .bx-env-grid > .bx-env-card:nth-of-type(7) { grid-column: auto; }
    .bx-env-card { min-height: 0; }
    .bx-gallery-grid { grid-auto-rows: 44vw; }
    .bx-gallery-grid > .bx-gal-tile:nth-of-type(1) { grid-column: 1 / -1; grid-row: span 1; }
    .bx-gal-zoom, .bx-gal-index { opacity: 1; transform: none; }
    .bx-loc-map { height: 360px; }
    .bx-cta { flex-direction: column; align-items: flex-start; }
    .bx-cmp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bx-cmp-radar,
    .bx-cmp-insight,
    .bx-cmp-versus { grid-column: 1 / -1; grid-row: auto; }
    .bx-cmp-radar { min-height: 0; padding: 22px 18px; }
    .bx-cmp-radar__canvas { min-height: 320px; }
    .bx-cmp-cat { grid-column: span 1; min-height: 0; padding: 18px 16px; }
    .bx-cmp-insight, .bx-cmp-versus { padding: 24px 22px; }

    /* Dock de contacto móvil siempre visible */
    body.bx-has-dock { padding-bottom: 92px; }
    .bx-mobile-dock.action-buttons-group {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 9000;
        display: grid !important;
        grid-template-columns: auto 1fr;
        gap: 8px;
        margin: 0;
        padding: 8px;
        border-radius: 24px;
        background: rgba(4, 43, 38, .92);
        backdrop-filter: blur(16px) saturate(1.4);
        -webkit-backdrop-filter: blur(16px) saturate(1.4);
        box-shadow: 0 24px 50px -16px rgba(4, 43, 38, .7);
        transform: translateY(140%);
        transition: transform .7s cubic-bezier(.22, 1, .36, 1);
    }
    .bx-mobile-dock.action-buttons-group.is-visible { transform: translateY(0); }
    .bx-mobile-dock .bx-btn { min-height: 52px; border-radius: 18px; padding: 0 18px; font-size: .92rem; }
    .bx-mobile-dock .btn-wa-action { width: 56px; padding: 0; }
    .bx-mobile-dock .btn-wa-action .hide-into-mobile { display: none; }
    .bx-mobile-dock .btn-wa-action img { width: 22px !important; height: 22px !important; filter: none !important; }
    .bx-mobile-dock button#open-contact-modal { background: var(--brand-secondary, #c6ff00); color: var(--brand-primary, #042b26); box-shadow: none; }
    .bx-mobile-dock button#open-contact-modal .bx-ico { color: var(--brand-primary, #042b26); }

    /* Modal de contacto (móvil) */
    #contact-modal.contact-form-panel.is-open { align-items: flex-end; }
    #contact-modal.contact-form-panel .modal-window {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 26px 20px calc(24px + env(safe-area-inset-bottom, 0px));
        border-radius: 28px 28px 0 0;
        background: #fff;
        animation: bx-sheet-up .55s cubic-bezier(.22, 1, .36, 1) both;
    }
    #contact-modal .modal-header h3 { margin: 0 40px 6px 0; font-size: 1.15rem; color: var(--brand-primary, #042b26); }
    #contact-modal .close-modal { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f5f4; font-size: 22px; line-height: 1; }
    #contact-modal #contact-submit-btn { display: block; width: 100%; margin-top: 6px; }
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes bx-sweep { to { rotate: 360deg; } }
@keyframes bx-ping { 0% { box-shadow: 0 0 0 0 rgba(198, 255, 0, .7); } 80%, 100% { box-shadow: 0 0 0 10px rgba(198, 255, 0, 0); } }
@keyframes bx-ping-lg { 0% { box-shadow: 0 0 0 0 rgba(198, 255, 0, .5); } 70%, 100% { box-shadow: 0 0 0 18px rgba(198, 255, 0, 0); } }
@keyframes bx-ring-out { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes bx-spin { to { transform: rotate(360deg); } }
@keyframes bx-spin-border { to { --bx-angle: 360deg; } }
@keyframes bx-aurora { 0% { translate: 0 0; rotate: 0deg; } 100% { translate: 4% -3%; rotate: 8deg; } }
@keyframes bx-radar { 0% { transform: scale(.1); opacity: 0; } 15% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
/* Leaflet posiciona el marcador con transform: animamos solo `translate` */
@keyframes bx-pin-drop { 0% { translate: 0 -60px; opacity: 0; } 60% { translate: 0 6px; opacity: 1; } 100% { translate: 0 0; opacity: 1; } }
@keyframes bx-dock-in { 0% { opacity: 0; transform: translateY(40px) scale(.94); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes bx-sheet-up { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .bx-page *,
    .bx-page *::before,
    .bx-page *::after,
    .bx-fab,
    .bx-fab * { animation: none !important; transition-duration: .01ms !important; }
    .bx-cmp-radar__sweep { display: none; }
    .bx-mobile-dock.action-buttons-group { transition: none !important; }
    #masthead { transition: none !important; }
}

/* Barra móvil: compartir con el mismo tamaño que favoritos (el legado le daba
   padding 4px 14px 4px 16px y en móviles reales el ícono se encogía a ~10px) */
@media (max-width: 768px) {
    .mobile-property-bar .btn-back-top-bar,
    .mobile-property-bar .mobile-actions .btn-share,
    .mobile-property-bar .mobile-actions .fav-mobile {
        display: grid !important;
        place-items: center;
        flex: none;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border-radius: 50%;
    }
    /* Volver: el legado le daba padding 6px/14px y quedaba corrido a la izquierda */
    .mobile-property-bar .btn-back-top-bar img {
        width: 24px !important;
        height: 24px !important;
        max-width: none !important;
        flex: none;
    }
    .mobile-property-bar .mobile-actions .btn-share img {
        width: 26px !important;
        height: 26px !important;
        max-width: none !important;
        flex: none;
    }
    .mobile-property-bar .mobile-actions .fav-mobile img {
        width: 32px !important;
        height: 32px !important;
        max-width: none !important;
    }
}
