/* ============================================================
   HomeAccess — hoja de estilos del sitio público
   Sistema visual moderno: superficies redondeadas, sombras
   suaves y tipografía editorial (Source Sans 3 + Source Serif 4).
   Los colores de marca (--primary-color / --secondary-color)
   se heredan del encabezado y provienen de la configuración.
   ============================================================ */

:root {
    --ink: var(--ha-ink, #1c2430);
    --muted: var(--ha-muted, #64707f);
    --line: var(--ha-line, #e7e5e0);
    --paper: var(--ha-bg, #f5f4f1);
    --card: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--ha-font, "Source Sans 3", "Segoe UI", sans-serif);
    color: var(--ink);
    background: var(--paper);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.ha-wrap {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

/* ------------------------------------------------------------
   Tipografía editorial
   ------------------------------------------------------------ */
.ha-kicker {
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--secondary-color, #9a1c1a);
    font-weight: 700;
    margin: 0 0 10px;
}

.ha-title {
    font-family: var(--ha-font-display, Georgia, "Times New Roman", serif);
    font-weight: 600;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 12px;
    color: var(--ink);
}

.ha-lead {
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.65;
    max-width: 44rem;
    margin: 0;
}

/* ---------- Portada ---------- */
.ha-hero {
    background: var(--ha-bg, #f5f4f1);
    padding: 20px 20px 0;
    line-height: 0;
}

.ha-hero img,
.ha-hero video {
    width: 100%;
    height: auto;
    max-height: 74vh;
    object-fit: cover;
    object-position: center center;
    display: block;
    margin: 0 auto;
    border-radius: var(--ha-radius-xl, 24px);
    box-shadow: var(--ha-shadow, 0 10px 30px rgba(16, 24, 40, 0.09));
}

/* ---------- Buscador flotante ---------- */
.ha-finder {
    background: transparent;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

.ha-finder-inner {
    width: min(1120px, 100%);
    margin: -38px auto 0;
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 14px;
    align-items: end;
    background: var(--primary-color, #11181f);
    border-radius: var(--ha-radius-lg, 18px);
    box-shadow: var(--ha-shadow-lg, 0 22px 60px rgba(16, 24, 40, 0.14));
}

.ha-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 7px;
}

.ha-field select,
.ha-field input,
.ha-search input {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0 15px;
    font: inherit;
    font-size: 15px;
    border-radius: var(--ha-radius-sm, 10px);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ha-field select option {
    color: #1c2430;
}

.ha-field select:focus,
.ha-field input:focus,
.ha-search input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.ha-field input::placeholder,
.ha-search input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.ha-finder-actions {
    display: flex;
    gap: 10px;
}

/* ---------- Botones ---------- */
.ha-btn {
    height: 50px;
    padding: 0 22px;
    border: 1px solid var(--primary-color, #1c2430);
    background: var(--primary-color, #1c2430);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--ha-radius-sm, 10px);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ha-btn:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.22);
}

.ha-btn-ghost {
    background: #fff;
    color: var(--ink);
    border-color: var(--ha-line-strong, #d9d5cd);
}

.ha-btn-ghost:hover {
    background: var(--ha-surface-2, #f7f6f3);
    color: var(--ink);
}

.ha-finder .ha-btn {
    background: var(--secondary-color, #e21f1d);
    border-color: var(--secondary-color, #e21f1d);
}

.ha-finder .ha-btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.ha-finder .ha-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ---------- Tipos de propiedad ---------- */
.ha-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 28px 0 0;
    justify-content: center;
}

.ha-type {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--ha-pill, 999px);
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ha-type:hover {
    border-color: var(--primary-color, #1c2430);
    color: var(--primary-color, #1c2430);
    transform: translateY(-1px);
    box-shadow: var(--ha-shadow-sm, 0 2px 8px rgba(16, 24, 40, 0.06));
    text-decoration: none;
}

/* ---------- Secciones ---------- */
.ha-section {
    padding: 72px 0;
}

.ha-section[style*="padding-top:0"],
.ha-section[style*="padding-top: 0"] {
    padding-top: 0;
}

.ha-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 30px;
}

.ha-section-head .ha-title {
    margin-bottom: 0;
}

.ha-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

/* ---------- Tarjetas de propiedad ---------- */
.ha-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--ha-radius-lg, 18px);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.ha-card:hover {
    color: inherit;
    text-decoration: none;
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: var(--ha-shadow, 0 10px 30px rgba(16, 24, 40, 0.09));
}

.ha-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #e9e7e2;
    overflow: hidden;
}

.ha-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ha-card:hover .ha-card-media img {
    transform: scale(1.05);
}

.ha-nophoto {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.ha-badge {
    position: absolute;
    left: 14px;
    top: 14px;
    background: var(--primary-color, #1c2430);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--ha-pill, 999px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    z-index: 2;
}

.ha-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ha-price {
    font-family: var(--ha-font-display, Georgia, serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ink);
}

.ha-price span {
    font-family: var(--ha-font, sans-serif);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--muted);
    margin-left: 4px;
}

.ha-card h3 {
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    min-height: 2.7em;
    color: var(--ink);
}

.ha-meta {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.ha-more {
    color: var(--secondary-color, #9a1c1a);
    font-size: 13px;
    font-weight: 700;
}

/* ---------- Bloque editorial (imagen + texto) ---------- */
.ha-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.ha-split > img,
.ha-split > div > img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    display: block;
    border-radius: var(--ha-radius-lg, 18px);
    box-shadow: var(--ha-shadow, 0 10px 30px rgba(16, 24, 40, 0.09));
}

.ha-points {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}

.ha-points li {
    position: relative;
    padding: 11px 0 11px 36px;
    font-size: 1rem;
}

.ha-points li + li {
    border-top: 1px solid var(--line);
}

.ha-points li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary-color, #9a1c1a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* ---------- Contacto ---------- */
.ha-contact {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 32px;
    align-items: stretch;
}

.ha-contact > img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    display: block;
    border-radius: var(--ha-radius-lg, 18px);
    box-shadow: var(--ha-shadow, 0 10px 30px rgba(16, 24, 40, 0.09));
}

.ha-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--ha-radius-lg, 18px);
    padding: 30px;
    box-shadow: var(--ha-shadow-sm, 0 2px 8px rgba(16, 24, 40, 0.06));
}

.ha-form h2 {
    font-family: var(--ha-font-display, Georgia, serif);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.ha-form p {
    color: var(--muted);
    margin: 0 0 20px;
    font-size: 0.96rem;
}

.ha-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.ha-form label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--ink);
}

.ha-form input,
.ha-form textarea {
    width: 100%;
    border: 1px solid #d8d5cd;
    background: #fff;
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    border-radius: var(--ha-radius-sm, 10px);
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ha-form input:focus,
.ha-form textarea:focus {
    outline: none;
    border-color: var(--primary-color, #1c2430);
    box-shadow: 0 0 0 4px rgba(17, 24, 31, 0.08);
}

.ha-form textarea {
    min-height: 130px;
    resize: vertical;
}

.ha-form .full,
.ha-form .ha-date {
    grid-column: 1 / -1;
}

.ha-form .ha-date {
    max-width: 300px;
}

.ha-form-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.ha-note {
    font-size: 12px;
    color: var(--muted);
    margin: 12px 0 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .ha-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ha-finder-inner {
        grid-template-columns: 1fr 1fr;
    }

    .ha-split,
    .ha-contact {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 640px) {
    .ha-wrap {
        width: min(100%, calc(100% - 32px));
    }

    .ha-hero {
        height: clamp(260px, 78vw, 400px);
    }

    .ha-section {
        padding: 52px 0;
    }

    .ha-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ha-grid,
    .ha-finder-inner,
    .ha-form-grid {
        grid-template-columns: 1fr;
    }

    .ha-finder-inner {
        margin-top: -18px;
        padding: 18px;
    }

    .ha-finder-actions {
        flex-direction: column;
    }

    .ha-btn {
        width: 100%;
    }

    .ha-field select,
    .ha-field input,
    .ha-search input,
    .ha-form input,
    .ha-form textarea,
    .ha-form textarea {
        font-size: 16px;
    }

    .ha-form {
        padding: 20px;
    }

    .ha-form .ha-date {
        max-width: 100%;
    }

    .ha-form-foot {
        flex-direction: column;
        align-items: stretch;
    }
}
