/* =====================================================================
   INFINITY EXIST — "Estate" Design System (v1)
   Full-rewrite foundation: tokens + reset + shared components + chrome.
   Loaded ONLY on redesigned pages (replaces the legacy RealHomes theme CSS).
   Presentation only — no markup/logic assumptions beyond .est-* classes.
   ===================================================================== */

:root {
    /* Surfaces */
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-alt: #f1f3f6;

    /* Text ramp */
    --ink: #1f2a37;          /* headings */
    --body: #46505c;         /* paragraph */
    --muted: #6b7280;        /* meta / labels */
    --border: #e6e8ec;

    /* Brand accent (teal) */
    --accent: #1ea69a;
    --accent-dark: #178a7f;
    --accent-soft: #e8f5f3;
    --accent-ring: rgba(30, 166, 154, .18);

    /* Footer (dark) */
    --footer-bg: #14202b;
    --footer-ink: #eaf0f4;
    --footer-muted: #9aa7b4;
    --footer-line: rgba(255, 255, 255, .09);

    /* Signals */
    --gold: #ffb300;
    --success: #1e9e6a;
    --danger: #e2452b;

    /* Shape */
    --r: 16px;
    --r-sm: 10px;
    --r-lg: 22px;
    --r-pill: 999px;

    /* Elevation */
    --shadow-card: 0 8px 30px -12px rgba(20, 30, 45, .18);
    --shadow-float: 0 24px 60px -24px rgba(20, 30, 45, .28);
    --shadow-sm: 0 2px 10px -4px rgba(20, 30, 45, .18);

    /* Layout */
    --container: 1200px;
    --gap: 28px;

    --sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset (scoped to redesigned pages) ---------- */
.est *, .est *::before, .est *::after { box-sizing: border-box; }
.est {
    font-family: var(--sans);
    color: var(--body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body:has(.est) { margin: 0; background: var(--bg); }
.est img { max-width: 100%; display: block; }
.est a { text-decoration: none; color: inherit; }
.est h1, .est h2, .est h3, .est h4, .est p { margin: 0; }
.est button { font-family: inherit; cursor: pointer; }

/* Neutralize leftover legacy chrome injected by the shared layout body */
.rh_wrapper_floating_features,
#rh_progress,
#ajaxloader { display: none !important; }

/* ---------- Container ---------- */
.est-container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

/* ---------- Buttons ---------- */
.est-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: var(--r-pill);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.est-btn svg { width: 18px; height: 18px; }
.est-btn--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px -12px var(--accent);
}
.est-btn--primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -14px var(--accent);
}
.est-btn--ghost {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--border);
}
.est-btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.est-btn--light {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(6px);
}
.est-btn--light:hover { background: rgba(255, 255, 255, .24); transform: translateY(-2px); }
.est-btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- Section heading ---------- */
.est-sectionhead { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.est-sectionhead__eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.est-sectionhead__title {
    font-size: 34px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -.02em;
    position: relative;
    padding-bottom: 16px;
}
.est-sectionhead__title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 56px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}
.est-sectionhead__sub { margin-top: 14px; color: var(--muted); font-size: 16px; }

/* ---------- Badges ---------- */
.est-badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.est-badge--featured { background: var(--accent); color: #fff; }

/* ---------- Property card ---------- */
.est-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.est-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
    border-color: transparent;
}
.est-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-alt);
}
.est-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.est-card:hover .est-card__media img { transform: scale(1.06); }
.est-card__badge { position: absolute; top: 14px; left: 14px; }
.est-card__fav {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    border: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    box-shadow: var(--shadow-sm);
    transition: color .18s ease, transform .18s ease;
}
.est-card__fav:hover { color: var(--danger); transform: scale(1.08); }
.est-card__fav.is-active { color: var(--danger); }
.est-card__fav svg { width: 18px; height: 18px; }

.est-card__body { padding: 20px 20px 6px; display: flex; flex-direction: column; gap: 6px; }
.est-card__title {
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
    line-height: 1.3;
}
.est-card__title a:hover { color: var(--accent); }
.est-card__loc {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}
.est-card__loc svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.est-card__excerpt {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.est-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}
.est-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--body);
    font-size: 13px;
    font-weight: 500;
}
.est-card__meta svg { width: 16px; height: 16px; color: var(--muted); }
.est-card__price {
    margin-left: auto;
    color: var(--accent);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.01em;
}
.est-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

/* ---------- Pagination (styles Laravel's bootstrap-4 markup) ---------- */
.est-pagination { display: flex; justify-content: center; margin-top: 44px; }
.est-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.est-pagination .page-item .page-link {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--body);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.est-pagination .page-item .page-link:hover { border-color: var(--accent); color: var(--accent); }
.est-pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.est-pagination .page-item.disabled .page-link { opacity: .45; pointer-events: none; }

/* =====================================================================
   SEARCH BAR + ADVANCED FILTERS (shared component — used on search,
   property-detail, and any page that @includes partials/estate-searchbar)
   ===================================================================== */
.est-searchbar { background: #fff; border-radius: var(--r); box-shadow: var(--shadow-float); display: flex; align-items: stretch; padding: 8px; }
.est-sb-field { flex: 1; min-width: 0; padding: 12px 18px; display: flex; flex-direction: column; gap: 5px; position: relative; }
.est-sb-field + .est-sb-field { border-left: 1px solid var(--border); }
.est-sb-field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.est-sb-field select, .est-sb-field input { border: 0; border-bottom: 1px solid var(--border); background: transparent; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink); padding: 4px 0; outline: none; width: 100%; }
.est-sb-field input { font-weight: 500; }
.est-sb-field input::placeholder { color: #9aa1ac; font-weight: 500; }
.est-sb-field select:focus, .est-sb-field input:focus { border-bottom-color: var(--accent); }
.est-sb-field--sel select { -webkit-appearance: none; appearance: none; padding-right: 18px; cursor: pointer; }
.est-sb-field--sel::after { content: ""; position: absolute; right: 20px; bottom: 16px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.est-sb-actions { display: flex; align-items: center; gap: 10px; padding: 8px; }
.est-sb-geo, .est-sb-filter { width: 54px; height: 54px; flex: none; border-radius: 12px; display: grid; place-items: center; cursor: pointer; background: #fff; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.est-sb-geo { border: 1px solid var(--accent); color: var(--accent); }
.est-sb-geo:hover { background: var(--accent-soft); }
.est-sb-filter { border: 1px solid var(--border); color: var(--muted); }
.est-sb-filter:hover, .est-sb-filter.is-open { border-color: var(--accent); color: var(--accent); }
.est-sb-geo svg, .est-sb-filter svg { width: 20px; height: 20px; }
.est-sb-search { height: 54px; padding: 0 30px; border-radius: 12px; }
.est-adv { display: none; margin-top: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 20px; }
.est-adv.is-open { display: block; }
.est-adv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.est-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.est-fld label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.est-fld select, .est-fld input { height: 46px; width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 13px; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: #fff; outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.est-fld select:focus, .est-fld input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.est-adv-features { margin-top: 18px; }
.est-adv-features > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.est-features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 18px; }
.est-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--body); cursor: pointer; }
.est-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.est-adv__footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.est-adv-clear { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--border); background: #fff; color: var(--body); font-size: 14px; font-weight: 600; transition: border-color .16s ease, color .16s ease; }
.est-adv-clear:hover { border-color: var(--danger); color: var(--danger); }
.est-adv-clear svg { width: 15px; height: 15px; }
@media (max-width: 1100px) {
    .est-searchbar { flex-wrap: wrap; }
    .est-sb-field { flex: 1 1 30%; }
    .est-sb-field + .est-sb-field { border-left: 0; }
    .est-sb-actions { flex: 1 1 100%; justify-content: flex-end; }
    .est-adv-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .est-sb-field { flex: 1 1 100%; }
    .est-adv-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   HEADER (global chrome)
   ===================================================================== */
.est-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.est-header__wrap {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 76px;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}
.est-brand { display: flex; align-items: center; gap: 12px; }
.est-brand__img { height: 60px; width: auto; display: block; }
.est-footer__brand .est-brand__img { height: 66px; }
.est-brand__mark { width: 34px; height: 34px; color: var(--accent); flex: none; }
.est-brand__name { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: .01em; line-height: 1; }
.est-brand__tag { font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

.est-nav { display: flex; align-items: center; flex-wrap: nowrap; gap: 22px; margin-inline: auto; }
.est-nav a {
    font-size: 15px;
    font-weight: 500;
    color: var(--body);
    position: relative;
    padding: 6px 0;
    white-space: nowrap;
    transition: color .16s ease;
}
.est-nav a:hover, .est-nav a.is-active { color: var(--accent); }
.est-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
/* dynamic menu dropdowns (items with children) */
.est-nav__item { position: relative; display: flex; align-items: center; }
.est-nav__item > a { display: inline-flex; align-items: center; gap: 5px; }
.est-nav__item > a svg { width: 14px; height: 14px; }
.est-nav__sub {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, transform .16s ease;
    z-index: 60;
}
/* invisible bridge across the gap so hover isn't lost while moving to the submenu */
.est-nav__sub::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
}
.est-nav__item:hover .est-nav__sub,
.est-nav__sub:hover { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.est-nav .est-nav__sub a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--body); white-space: nowrap; }
.est-nav .est-nav__sub a::after { display: none; }
.est-nav .est-nav__sub a:hover { background: var(--surface-alt); color: var(--accent); }
.est-header__actions { display: flex; align-items: center; gap: 16px; }
.est-usericon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--body);
    background: #fff;
    transition: border-color .16s, color .16s;
}
.est-usericon:hover { border-color: var(--accent); color: var(--accent); }
.est-usericon svg { width: 20px; height: 20px; }
.est-burger {
    display: none;
    width: 42px; height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    place-items: center;
}
.est-burger svg { width: 22px; height: 22px; }

/* Mobile nav drawer (hidden on desktop; opened via .is-open) */
.est-mobile-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 10px 24px 22px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.est-mobile-nav.is-open { display: flex; }
.est-mobile-nav a { padding: 12px 4px; font-size: 16px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--border); }
.est-mobile-nav a:last-child { border-bottom: 0; }

/* =====================================================================
   FOOTER (global chrome)
   ===================================================================== */
.est-footer { background: var(--footer-bg); color: var(--footer-muted); }
.est-footer__top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.4fr;
    gap: 40px;
    max-width: var(--container);
    margin-inline: auto;
    padding: 64px 24px 48px;
}
.est-footer__brand .est-brand__name,
.est-footer__brand .est-brand__mark { color: #fff; }
.est-footer__brand .est-brand__tag { color: var(--footer-muted); }
.est-footer__about { margin: 18px 0 20px; font-size: 14px; line-height: 1.7; max-width: 300px; }
.est-social { display: flex; gap: 12px; }
.est-social a {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    display: grid;
    place-items: center;
    color: var(--footer-ink);
    transition: background .18s ease, transform .18s ease;
}
.est-social a:hover { background: var(--accent); transform: translateY(-2px); }
.est-social svg { width: 17px; height: 17px; }

.est-footer__col h4 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: .01em;
}
.est-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.est-footer__col a { font-size: 14px; color: var(--footer-muted); transition: color .16s ease, padding-left .16s ease; }
.est-footer__col a:hover { color: #fff; padding-left: 4px; }

.est-news p { font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.est-news__form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--footer-line);
    border-radius: var(--r-pill);
    padding: 5px 5px 5px 18px;
}
.est-news__form input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-size: 14px;
    min-width: 0;
}
.est-news__form input::placeholder { color: var(--footer-muted); }
.est-news__form button {
    width: 40px; height: 40px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    transition: background .16s ease;
}
.est-news__form button:hover { background: var(--accent-dark); }
.est-news__form button svg { width: 17px; height: 17px; }

.est-footer__bottom {
    border-top: 1px solid var(--footer-line);
}
.est-footer__bottom-wrap {
    max-width: var(--container);
    margin-inline: auto;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}
.est-footer__legal { display: flex; gap: 26px; }
.est-footer__legal a:hover { color: #fff; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 992px) {
    .est-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .est-footer__top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 820px) {
    .est-nav { display: none; }
    .est-burger { display: grid; }
    .est-header__actions .est-btn--primary { display: none; }
}
@media (max-width: 640px) {
    .est-cards-grid { grid-template-columns: 1fr; }
    .est-sectionhead__title { font-size: 27px; }
    .est-footer__top { grid-template-columns: 1fr; }
    .est-footer__bottom-wrap { flex-direction: column; text-align: center; }
}
