/* Widget "Casas destacadas" (templates/homes/widgets/featured.html).
   Colores del theme de la agencia (--brand-*); el fondo de la sección lo arma el grupo. */
.hf {
    --hf-ink: var(--brand-ink, #16213e);
    --hf-accent: var(--brand-accent, #c0336d);
    --hf-btn-bg: var(--brand-btn-bg, var(--brand-accent, #c0336d));
    --hf-btn-text: var(--brand-btn-text, #fff);
    --hf-muted: #5d6878;
    --hf-gap: 20px;
    padding: 44px 0;
}
.hf--bg { padding: 56px 0; }
.hf-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.hf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 0 0 24px; }
.hf-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; color: var(--hf-title, var(--hf-ink)); }
.hf-subtitle { margin: 8px 0 0; font-size: 1.05rem; color: var(--hf-text, var(--hf-muted)); max-width: 680px; }
.hf-more { font-weight: 800; color: var(--hf-title, var(--hf-accent)); text-decoration: none; white-space: nowrap; }
.hf-more::after { content: " \2192"; }
.hf-more:hover { text-decoration: underline; color: var(--hf-title, var(--hf-accent)); }
.hf-note { margin: 18px 0 0; font-size: .85rem; color: var(--hf-text, var(--hf-muted)); opacity: .85; }

/* ---------- tarjeta ---------- */
.hf-card { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden; min-width: 0;
           box-shadow: 0 10px 30px rgba(16, 24, 40, .08); transition: transform .2s ease, box-shadow .2s ease; color: var(--hf-ink); }
.hf-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(16, 24, 40, .14); }
.hf-card__link { position: absolute; inset: 0; z-index: 2; }
.hf-card__link:focus-visible { outline: 3px solid var(--hf-accent); outline-offset: -3px; border-radius: 20px; }
.hf-card__media { position: relative; aspect-ratio: 4 / 3; background: #eef0f4; overflow: hidden; }
.hf-card__track { position: relative; z-index: 3; display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: pointer; }
.hf-card__track::-webkit-scrollbar { display: none; }
.hf-card__track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; display: block; }
.hf-card__dots { position: absolute; z-index: 4; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.hf-card__dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); transition: background .2s ease, transform .2s ease; }
.hf-card__dots span.is-on { background: #fff; transform: scale(1.25); }
.hf-card__badges { position: absolute; z-index: 4; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.hf-badge { background: rgba(255, 255, 255, .94); color: var(--hf-ink); font-size: .74rem; font-weight: 800; padding: 5px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.hf-badge--accent { background: var(--hf-accent); color: #fff; }

.hf-card__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.hf-card__place { margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--hf-accent); }
.hf-card__title { margin: 0; font-size: 1.08rem; font-weight: 900; line-height: 1.25; color: var(--hf-ink); }
.hf-specs { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; font-size: .9rem; color: var(--hf-muted); }
.hf-specs strong { color: var(--hf-ink); }
.hf-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; }
.hf-tags li { background: #f2f4f7; border-radius: 8px; padding: 3px 9px; font-size: .78rem; font-weight: 700; color: var(--hf-ink); }
.hf-card__summary { margin: 4px 0 0; color: var(--hf-muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hf-card__foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #eef0f4; }
.hf-price { margin: 0; display: flex; flex-direction: column; line-height: 1.15; font-size: .8rem; color: var(--hf-muted); }
.hf-price strong { font-size: 1.15rem; font-weight: 900; color: var(--hf-ink); }
.hf-price--muted { font-weight: 700; }
.hf-btn { flex: 0 0 auto; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 12px; background: var(--hf-btn-bg); color: var(--hf-btn-text);
          font-weight: 800; font-size: .9rem; white-space: nowrap; }

/* ---------- mosaico: 1 grande + hasta 4 ---------- */
.hf-mosaic { display: grid; gap: var(--hf-gap); grid-template-columns: 1.6fr 1fr 1fr; grid-auto-rows: minmax(0, 1fr); }
.hf-mosaic .hf-card--big { grid-row: span 2; }
.hf-mosaic .hf-card--big .hf-card__media { aspect-ratio: auto; flex: 1 1 auto; min-height: 340px; }
.hf-mosaic .hf-card--big .hf-card__body { flex: 0 0 auto; }
.hf-mosaic .hf-card--big .hf-card__title { font-size: 1.45rem; }
.hf-mosaic:not(.hf-mosaic--1) .hf-card:not(.hf-card--big) .hf-card__media { aspect-ratio: 16 / 10; }
.hf-mosaic:not(.hf-mosaic--1) .hf-card:not(.hf-card--big) .hf-tags,
.hf-mosaic:not(.hf-mosaic--1) .hf-card:not(.hf-card--big) .hf-card__place { display: none; }
.hf-mosaic--1 { grid-template-columns: 1fr; }
.hf-mosaic--2 { grid-template-columns: 1.6fr 1fr; }
.hf-mosaic--2 .hf-card--big { grid-row: auto; }
.hf-mosaic--3 { grid-template-columns: 1.6fr 1fr; }
.hf-mosaic--4 { grid-template-columns: 1.6fr 1fr; }
.hf-mosaic--4 .hf-card--big { grid-row: span 3; }

/* ---------- fila ---------- */
.hf-row { display: grid; gap: var(--hf-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hf-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- carrusel ---------- */
.hf-carousel { position: relative; }
.hf-strip { display: flex; gap: var(--hf-gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 18px; }
.hf-strip::-webkit-scrollbar { display: none; }
.hf-carousel .hf-card { flex: 0 0 calc((100% - 3 * var(--hf-gap)) / 4); scroll-snap-align: start; }
.hf-nav { position: absolute; top: 34%; z-index: 6; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--hf-ink);
          font-size: 1.8rem; line-height: 1; box-shadow: 0 6px 20px rgba(16, 24, 40, .18); }
.hf-nav--prev { left: -14px; }
.hf-nav--next { right: -14px; }
.hf-nav[disabled] { opacity: 0; pointer-events: none; }

/* ---------- destacada única ---------- */
.hf--single .hf-card--big { flex-direction: row; }
.hf--single .hf-card--big .hf-card__media { flex: 0 0 58%; aspect-ratio: auto; min-height: 420px; }
.hf--single .hf-card--big .hf-card__body { padding: 30px 32px; gap: 12px; flex: 1; }
.hf--single .hf-card--big .hf-card__title { font-size: 1.8rem; letter-spacing: -.02em; }
.hf--single .hf-card--big .hf-specs { font-size: 1rem; }
.hf--single .hf-card--big .hf-price strong { font-size: 1.5rem; }
.hf--single .hf-card--big .hf-btn { height: 50px; padding: 0 24px; font-size: 1rem; }

@media (max-width: 991.98px) {
    .hf-row, .hf-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hf-carousel .hf-card { flex-basis: calc((100% - var(--hf-gap)) / 2); }
    .hf-mosaic, .hf-mosaic--4 { grid-template-columns: 1fr 1fr; }
    .hf-mosaic .hf-card--big { grid-column: 1 / -1; grid-row: auto; }
    .hf-mosaic .hf-card--big .hf-card__media { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
    .hf-mosaic .hf-card--big .hf-card__body { flex: 1; }
}
@media (max-width: 767.98px) {
    .hf { padding: 32px 0; }
    .hf-wrap { padding: 0 16px; }
    .hf-mosaic, .hf-row, .hf-row--3 { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
                                       margin: 0 -16px; padding: 4px 16px 16px; }
    .hf-mosaic::-webkit-scrollbar, .hf-row::-webkit-scrollbar { display: none; }
    .hf-mosaic .hf-card, .hf-row .hf-card, .hf-carousel .hf-card { flex: 0 0 84%; scroll-snap-align: start; }
    .hf-mosaic .hf-card--big .hf-card__media, .hf-mosaic:not(.hf-mosaic--1) .hf-card:not(.hf-card--big) .hf-card__media { aspect-ratio: 4 / 3; }
    .hf-mosaic .hf-card .hf-tags, .hf-mosaic .hf-card .hf-card__place { display: flex; }
    .hf-mosaic .hf-card--big .hf-card__title { font-size: 1.08rem; }
    .hf-strip { margin: 0 -16px; padding: 4px 16px 16px; gap: 14px; }
    .hf-nav { display: none; }
    .hf--single .hf-card--big { flex-direction: column; }
    .hf--single .hf-card--big .hf-card__media { flex: none; min-height: 0; aspect-ratio: 4 / 3; }
    .hf--single .hf-card--big .hf-card__body { padding: 18px; }
    .hf--single .hf-card--big .hf-card__title { font-size: 1.3rem; }
    .hf-card:hover { transform: none; }
}
