/* =============================================================================
   Bernasconi Administración de Propiedades — estilos 2.0
   Bootstrap 5 + capa propia. Color de marca: rojo institucional.
   ============================================================================= */

:root {
    --bn-primary:        #bc322f;
    --bn-primary-dark:   #791925;
    --bn-primary-light:  #d9534f;
    --bn-ink:            #1f1f1f;
    --bn-muted:          #6b6b6b;
    --bn-bg-soft:        #f6f5f4;
    --bn-border:         #e6e3e1;
    --bn-radius:         8px;
    --bn-shadow:         0 2px 14px rgba(0, 0, 0, .08);
    --bn-shadow-hover:   0 10px 30px rgba(0, 0, 0, .14);
}

/* Bootstrap primary override */
.btn-primary {
    --bs-btn-bg: var(--bn-primary);
    --bs-btn-border-color: var(--bn-primary);
    --bs-btn-hover-bg: var(--bn-primary-dark);
    --bs-btn-hover-border-color: var(--bn-primary-dark);
    --bs-btn-active-bg: var(--bn-primary-dark);
    --bs-btn-active-border-color: var(--bn-primary-dark);
    --bs-btn-disabled-bg: var(--bn-primary);
    --bs-btn-disabled-border-color: var(--bn-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--bn-primary);
    --bs-btn-border-color: var(--bn-primary);
    --bs-btn-hover-bg: var(--bn-primary);
    --bs-btn-hover-border-color: var(--bn-primary);
    --bs-btn-active-bg: var(--bn-primary);
    --bs-btn-active-border-color: var(--bn-primary);
}
.text-primary  { color: var(--bn-primary) !important; }
.bg-primary    { background-color: var(--bn-primary) !important; }
.badge.bg-primary { background-color: var(--bn-primary) !important; }
a { color: var(--bn-primary); }
a:hover { color: var(--bn-primary-dark); }

/* Defensive reset — atributo hidden siempre gana (B34) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--bn-ink);
    overflow-x: hidden;
}

/* ----------------------------------------------------------------------------
   Section helpers
   ---------------------------------------------------------------------------- */
.section { padding: 72px 0; }
.section--soft { background: var(--bn-bg-soft); }
.section-title {
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: .5rem;
}
.section-title span { color: var(--bn-primary); }
.section-underline {
    width: 64px; height: 3px; background: var(--bn-primary);
    border: 0; opacity: 1; margin: .75rem auto 1.5rem; border-radius: 2px;
}

/* ----------------------------------------------------------------------------
   Navbar
   ---------------------------------------------------------------------------- */
.bn-navbar {
    background: linear-gradient(180deg, var(--bn-primary), var(--bn-primary-dark));
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.bn-navbar .navbar-brand img { height: 46px; width: auto; }
.bn-navbar .nav-link {
    color: #fff !important;
    font-weight: 600;
    padding: .5rem 1rem !important;
    opacity: .92;
    transition: opacity .2s;
}
.bn-navbar .nav-link:hover,
.bn-navbar .nav-link:focus { opacity: 1; }
.bn-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, .5);
}
.bn-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ----------------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------------- */
.bn-hero {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    isolation: isolate;
    background-color: #1f1f1f;
}
.bn-hero__bg {
    position: absolute; inset: 0; z-index: -2;
    background-size: cover; background-position: center;
    animation: bnKenBurns 26s ease-in-out infinite alternate;
}
.bn-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.35) 40%, rgba(0,0,0,.6));
}
@keyframes bnKenBurns {
    0%   { transform: scale(1); }
    100% { transform: scale(1.1); }
}
.bn-hero__title {
    color: #fff; font-weight: 800; font-size: clamp(1.8rem, 4vw, 3rem);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .4);
}
.bn-hero__subtitle { color: rgba(255, 255, 255, .92); font-size: 1.1rem; }
@media (prefers-reduced-motion: reduce) {
    .bn-hero__bg { animation: none; }
}

/* ----------------------------------------------------------------------------
   Buscador
   ---------------------------------------------------------------------------- */
.bn-search {
    background: rgba(255, 255, 255, .96);
    border-radius: var(--bn-radius);
    box-shadow: var(--bn-shadow);
    padding: 1.25rem;
}
.bn-search .form-label {
    font-size: .8rem; font-weight: 600; color: var(--bn-muted);
    text-transform: uppercase; letter-spacing: .3px; margin-bottom: .25rem;
}
.bn-search .form-select,
.bn-search .form-control { border-radius: 6px; }

/* ----------------------------------------------------------------------------
   Property cards
   ---------------------------------------------------------------------------- */
.property-card {
    border: 1px solid var(--bn-border);
    border-radius: var(--bn-radius);
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
    isolation: isolate; /* contiene cualquier z-index interno (B11) */
}
.property-card:hover {
    box-shadow: var(--bn-shadow-hover);
    transform: translateY(-3px);
}
.property-card__media {
    position: relative;
    overflow: hidden;
}
.property-card__img {
    transition: transform .5s ease;
}
.property-card:hover .property-card__img {
    transform: scale(1.07);
}
/* Badge va FUERA del .ratio (hermano), nunca hijo directo (B39) */
.property-card__badge {
    position: absolute; top: .6rem; left: .6rem; z-index: 2;
    background: var(--bn-primary); color: #fff;
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    padding: .3rem .6rem; border-radius: 4px; letter-spacing: .3px;
}
.property-card__price {
    color: var(--bn-primary); font-weight: 800; font-size: 1.15rem;
}
.property-card__title {
    font-size: 1rem; font-weight: 700; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.property-card__feat {
    color: var(--bn-muted); font-size: .85rem;
}
.property-card__feat i { color: var(--bn-primary); }

/* ----------------------------------------------------------------------------
   Detalle
   ---------------------------------------------------------------------------- */
.bn-detail-hero { background: var(--bn-bg-soft); padding: 2rem 0 1.25rem; }
.bn-detail-price {
    display: inline-block; background: var(--bn-primary); color: #fff;
    font-weight: 800; font-size: 1.25rem; padding: .45rem 1.1rem; border-radius: 6px;
}
.bn-gallery .carousel-item img {
    width: 100%; height: 460px; object-fit: cover; border-radius: var(--bn-radius);
}
.bn-amenities { columns: 2; column-gap: 2rem; }
.bn-amenities li { break-inside: avoid; padding: .25rem 0; }
.bn-amenities i { color: var(--bn-primary); margin-right: .4rem; }
.bn-feature-box {
    background: #fff; border: 1px solid var(--bn-border); border-radius: 6px;
    padding: 1rem .5rem; text-align: center;
}
.bn-feature-box i { font-size: 1.4rem; color: var(--bn-primary); }
.bn-feature-box .v { font-weight: 700; font-size: 1.05rem; }
.bn-feature-box .l { font-size: .78rem; color: var(--bn-muted); text-transform: uppercase; }
.bn-map iframe { width: 100%; height: 420px; border: 0; border-radius: var(--bn-radius); }
.contact-sidebar { position: sticky; top: 90px; }

/* ----------------------------------------------------------------------------
   Contact form propio
   ---------------------------------------------------------------------------- */
.rf-contact-form .form-label { font-weight: 600; font-size: .85rem; }
.rf-contact-form .required { color: var(--bn-primary); }
.rf-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rf-contact-submit {
    width: 100%; border: 0; border-radius: 6px;
    background: var(--bn-primary); color: #fff; font-weight: 700;
    padding: .7rem 1rem; transition: background .2s;
}
.rf-contact-submit:hover { background: var(--bn-primary-dark); }
.rf-contact-submit .spinner {
    display: inline-block; width: 1rem; height: 1rem;
    border: 2px solid rgba(255,255,255,.5); border-top-color: #fff;
    border-radius: 50%; animation: bnSpin .7s linear infinite; vertical-align: -2px;
}
@keyframes bnSpin { to { transform: rotate(360deg); } }
.rf-contact-feedback { margin-top: .75rem; padding: .6rem .8rem; border-radius: 6px; font-size: .9rem; }
.rf-contact-feedback.ok  { background: #e7f6ec; color: #1b7a3d; }
.rf-contact-feedback.err { background: #fdecec; color: #b02a2a; }

/* ----------------------------------------------------------------------------
   WhatsApp FAB
   ---------------------------------------------------------------------------- */
.wa-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 1030;
    width: 56px; height: 56px; border-radius: 50%;
    background: #25d366; color: #fff; font-size: 1.7rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    text-decoration: none; transition: transform .2s;
    animation: bnBob 2.6s ease-in-out infinite;
}
.wa-fab:hover { transform: scale(1.08); color: #fff; }
.wa-fab .wa-tooltip {
    position: absolute; right: 70px; white-space: nowrap;
    background: #1f1f1f; color: #fff; font-size: .8rem; padding: .35rem .6rem;
    border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.wa-fab:hover .wa-tooltip { opacity: 1; }
@keyframes bnBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .wa-fab { animation: none; } }

/* ----------------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------------- */
.bn-footer {
    background: linear-gradient(180deg, var(--bn-primary-dark), #5a1019);
    color: rgba(255, 255, 255, .9);
    padding: 56px 0 0;
}
.bn-footer a { color: #fff; text-decoration: none; opacity: .9; }
.bn-footer a:hover { opacity: 1; color: #fff; text-decoration: underline; }
.bn-footer h4 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 1rem; }
.bn-footer img.bn-footer__logo { max-width: 180px; }
.bn-footer__list li { padding: .2rem 0; }
.bn-footer__list i { width: 1.4rem; color: #fff; }
.bn-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, .15);
    margin-top: 2rem; padding: 1rem 0; font-size: .85rem;
}
.footer__gvamax { color: #fff; font-weight: 700; }
.footer__gvamax:hover { color: var(--bn-primary-light); }

/* Asociados (cámaras) */
.bn-brands img { max-height: 70px; width: auto; filter: grayscale(1); opacity: .7; transition: .25s; }
.bn-brands img:hover { filter: none; opacity: 1; }

/* ----------------------------------------------------------------------------
   Entrance animations (solo contenido server-rendered, NO fetch — B38)
   ---------------------------------------------------------------------------- */
[data-animate] { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
[data-animate].in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-animate] { opacity: 1 !important; transform: none !important; }
}

/* ----------------------------------------------------------------------------
   Mobile — padding lateral 10px (mata las 3 capas BS5, B14b)
   ---------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .section { padding: 44px 0; }
    .container, .container-fluid {
        padding-left: 12px !important; padding-right: 12px !important;
    }
    .row { --bs-gutter-x: .75rem; }
    .bn-hero { min-height: 460px; }
    .bn-gallery .carousel-item img { height: 280px; }
    .contact-sidebar { position: static; top: auto; }
    .bn-amenities { columns: 1; }
}
