/* ═══════════════════════════════════════════════════════════════════════════
   Portada: los 10 «estilos» del producto web llave en mano.

   Solo se carga en la portada (`Flavor_Assets::enqueue()`). Mobile-first;
   los tres anchos de referencia del tema son 390 / 834 / 1440.
   ═══════════════════════════════════════════════════════════════════════════ */

.home-main { overflow-x: hidden; }

/* ── Hero: base común a las 6 variantes ─────────────────────────────────── */

.home-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-base);
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
    background: var(--color-surface);
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-base);
    max-width: 760px;
    width: 100%;
}

.home-hero-title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    font-size: var(--font-size-3xl);
    line-height: var(--line-height-tight);
    color: inherit;
}

.home-hero-subtitle {
    margin: 0;
    font-size: var(--font-size-lg);
    color: inherit;
    opacity: 0.88;
    max-width: 52ch;
}

/* Hero con fotografía de fondo: velo degradado para que el titular siga
   siendo legible sobre cualquier foto, y texto fijo claro. */
.home-hero.has-image {
    background-image: linear-gradient(to bottom, var(--color-overlay), var(--color-overlay)), var(--hero-image);
    background-size: cover;
    background-position: center;
    color: var(--color-hero-text);
    min-height: 420px;
    justify-content: center;
}
.home-hero.has-image .home-hero-subtitle { opacity: 0.92; }

/* — buscador integrado en el hero — */
.home-hero-search,
.home-hero-inner > form.home-search { width: 100%; max-width: 720px; }

/* — titular (metropoli, cimientos) — */
.home-hero-titular.is-enorme .home-hero-title { font-size: clamp(2.5rem, 2rem + 3vw, 4rem); }
.home-hero-photo {
    width: 100%;
    max-width: var(--max-width-wide);
    aspect-ratio: 16 / 7;
    border-radius: var(--radius-panel);
    overflow: hidden;
}
.home-hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* — dividido (llave): imagen a la izquierda, tarjeta de búsqueda a la derecha — */
.home-hero-dividido {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    text-align: left;
    min-height: 480px;
}
.home-hero-media { flex: 1 1 55%; min-width: 0; }
.home-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-hero-card {
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-base);
    padding: var(--space-2xl);
    background: var(--color-surface-alt);
}
.home-hero-card .home-hero-title,
.home-hero-card .home-hero-subtitle { text-align: left; }

/* — foto alta sin buscador (hacienda) — */
.home-hero-foto.is-tall { min-height: 560px; }

/* hero-foto va siempre bajo la cabecera transparente (litoral, hacienda, campiña),
   que flota encima: sin este hueco, en móvil el titular quedaba pegado a la marca. */
.home-hero-foto { padding-top: calc(var(--space-2xl) + 72px); }

/* — mapa (plano) — */
.home-hero-mapa { padding-bottom: 0; }
.home-hero-map,
.home-map {
    width: 100%;
    max-width: var(--max-width-wide);
    height: 420px;
    border-radius: var(--radius-panel);
    overflow: hidden;
    box-shadow: var(--shadow-border);
}

/* — agente (firma) — */
.home-hero-agente .home-hero-inner {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: var(--space-xl);
    max-width: 920px;
}
.home-hero-agent-photo {
    flex: none;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-border);
}
.home-hero-agent-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-hero-agent-text { display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
.home-hero-agent-text .home-hero-title,
.home-hero-agent-text .home-hero-subtitle { text-align: left; }
.home-hero-agent-name {
    margin: 0;
    font-size: var(--font-size-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-accent);
}
.home-hero-agent-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent-dark);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

/* ── Formulario de búsqueda del hero ────────────────────────────────────── */

.home-search {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: var(--space-sm);
    background: var(--color-surface-alt);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-lg);
}
.home-search-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 150px;
    min-width: 0;
    text-align: left;
    padding: 4px 10px;
}
.home-search-field select,
.home-search-field input { min-width: 0; max-width: 100%; }
.home-search-field label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.home-search-field select,
.home-search-field input {
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--color-text);
    padding: 0;
}
.home-search-field select:focus,
.home-search-field input:focus { outline: none; }
.home-search-submit { flex: none; border-radius: var(--radius-pill); padding: 0 22px; height: 46px; }

.home-search-tabs { display: flex; gap: 4px; padding: 4px; }
.home-search-tab {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.home-search-tab input { position: absolute; opacity: 0; pointer-events: none; }
.home-search-tab:has(input:checked) { background: var(--color-chip); color: var(--color-text); font-weight: var(--font-weight-semibold); }

.home-hero-card .home-search { flex-direction: column; align-items: stretch; box-shadow: none; background: var(--color-surface); }

/* ── Secciones genéricas ─────────────────────────────────────────────────── */

.home-section {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-base);
    margin-bottom: var(--space-lg);
}

.home-section-title {
    margin: 0 0 var(--space-lg);
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    font-size: var(--font-size-2xl);
    color: var(--color-text);
}
.home-section-head .home-section-title { margin-bottom: 0; }

.home-section-link {
    flex: none;
    color: var(--color-accent-dark);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    white-space: nowrap;
}
.home-section-link:hover { text-decoration: underline; }

/* — tipos / zonas / operaciones: tarjetas en rejilla — */

.home-tipos-grid,
.home-zonas-grid,
.home-operaciones-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-base);
}
@media (min-width: 640px) {
    .home-tipos-grid,
    .home-zonas-grid,
    .home-operaciones-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.home-tipo-card,
.home-zona-card,
.home-operacion-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-card);
    text-decoration: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.home-tipo-card:hover,
.home-zona-card:hover,
.home-operacion-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-sm); }

.home-tipo-name,
.home-zona-name,
.home-operacion-name {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    color: var(--color-text);
}
.home-tipo-count,
.home-zona-count,
.home-operacion-count { font-size: var(--font-size-sm); }

/* — destacadas — */

.home-destacadas.is-grande .home-destacadas-grid.property-list-grid { grid-template-columns: 1fr; }
@media (min-width: 950px) {
    .home-destacadas.is-grande .home-destacadas-grid.property-list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* — cifras — */

.home-cifras-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
    text-align: center;
}
@media (min-width: 640px) {
    .home-cifras-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
.home-cifra { display: flex; flex-direction: column; gap: 4px; }
.home-cifra-value {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-3xl);
    color: var(--color-accent-dark);
}
.home-cifra-label { font-size: var(--font-size-sm); }

/* — servicios — */

.home-servicios-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}
@media (min-width: 640px) {
    .home-servicios-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .home-servicios-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.home-servicio-card {
    padding: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-card);
}
.home-servicio-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-button);
    background: var(--color-chip);
    color: var(--color-accent-dark);
}
.home-servicio-title { margin: 0 0 4px; font-size: var(--font-size-lg); font-family: var(--font-heading); }
.home-servicio-text { margin: 0; font-size: var(--font-size-sm); }

/* — sobre nosotros — */

.home-sobre-nosotros-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    align-items: center;
}
@media (min-width: 768px) {
    .home-sobre-nosotros-grid { grid-template-columns: 1fr 1.2fr; }
}
.home-sobre-nosotros-photo {
    border-radius: var(--radius-panel);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.home-sobre-nosotros-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-sobre-nosotros-text p { color: var(--color-text-muted); line-height: var(--line-height-relaxed); }

/* — vender — */

.home-vender { text-align: center; }
.home-vender-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-base);
}

/* — contacto — */

.home-contacto-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}
@media (min-width: 768px) {
    .home-contacto-grid { grid-template-columns: 1fr 1.3fr; }
}
.home-contacto-info {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-base);
}
.home-contacto-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
}
.home-contacto-info a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    text-decoration: none;
}
.home-contacto-info a:hover { color: var(--color-accent-dark); }
.home-contacto-form { display: flex; flex-direction: column; gap: var(--space-sm); }
