/* Devenv Flexmls front end. Inherits theme fonts; colors via CSS variables. */
.dfx-listings, .dfx-detail {
	--dfx-primary: var( --wp--preset--color--primary, #1e73be );
	--dfx-accent: var( --wp--preset--color--secondary, #f0a500 );
	--dfx-text: inherit;
	--dfx-muted: rgba( 0, 0, 0, .62 );
	--dfx-border: rgba( 0, 0, 0, .12 );
	--dfx-surface: rgba( 0, 0, 0, .035 );
	--dfx-gap: 1.5rem;
	--dfx-radius: 6px;
	box-sizing: border-box;
}
.dfx-listings *, .dfx-detail * { box-sizing: border-box; }
.dfx-listings img, .dfx-detail img { max-width: 100%; height: auto; display: block; }

/* Grid */
.dfx-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var( --dfx-gap ); grid-template-columns: repeat( var( --dfx-cols, 3 ), minmax( 0, 1fr ) ); }
.dfx-cols-1 { --dfx-cols: 1; } .dfx-cols-2 { --dfx-cols: 2; } .dfx-cols-3 { --dfx-cols: 3; } .dfx-cols-4 { --dfx-cols: 4; }
.dfx-grid__item { margin: 0; padding: 0; display: flex; }
@media ( max-width: 960px ) { .dfx-cols-3, .dfx-cols-4 { --dfx-cols: 2; } }
@media ( max-width: 600px ) { .dfx-grid { grid-template-columns: 1fr; } }

/* Card */
.dfx-card { display: flex; flex-direction: column; width: 100%; border: 1px solid var( --dfx-border ); border-radius: var( --dfx-radius ); overflow: hidden; background: transparent; }
.dfx-card__media { position: relative; display: block; aspect-ratio: 4 / 3; background: var( --dfx-surface ); overflow: hidden; }
.dfx-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.dfx-card:hover .dfx-card__media img { transform: scale( 1.03 ); }
.dfx-card__noimg { display: block; width: 100%; height: 100%; }
.dfx-card__body { padding: 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.dfx-card__price { margin: 0; font-weight: 700; font-size: 1.2em; color: var( --dfx-primary ); }
.dfx-card__title { margin: 0; font-size: 1.05em; line-height: 1.3; }
.dfx-card__title a { color: inherit; text-decoration: none; }
.dfx-card__title a:hover, .dfx-card__title a:focus { text-decoration: underline; }
.dfx-card__location { margin: 0; color: var( --dfx-muted ); font-size: .9em; }
.dfx-card__facts { list-style: none; margin: .4rem 0 0; padding: .6rem 0 0; border-top: 1px solid var( --dfx-border ); display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88em; }
.dfx-card__facts li { margin: 0; }
.dfx-card__label { color: var( --dfx-muted ); }
.dfx-card__excerpt { margin: .4rem 0 0; color: var( --dfx-muted ); font-size: .92em; }
.dfx-badge { position: absolute; top: .75rem; left: .75rem; background: var( --dfx-accent ); color: #fff; font-size: .75em; font-weight: 700; padding: .25em .7em; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }

/* List layout */
.dfx-listings--list .dfx-grid { grid-template-columns: 1fr; }
.dfx-listings--list .dfx-card { flex-direction: row; }
.dfx-listings--list .dfx-card__media { flex: 0 0 38%; aspect-ratio: auto; min-height: 200px; }
@media ( max-width: 600px ) { .dfx-listings--list .dfx-card { flex-direction: column; } .dfx-listings--list .dfx-card__media { aspect-ratio: 4 / 3; min-height: 0; } }

/* Cards layout: image with overlay text */
.dfx-listings--cards .dfx-card { position: relative; border: 0; min-height: 320px; }
.dfx-listings--cards .dfx-card__media { position: absolute; inset: 0; aspect-ratio: auto; }
.dfx-listings--cards .dfx-card__body { position: relative; margin-top: auto; flex: 0; color: #fff; background: linear-gradient( transparent, rgba( 0, 0, 0, .78 ) 35% ); padding-top: 3rem; }
.dfx-listings--cards .dfx-card__price, .dfx-listings--cards .dfx-card__location, .dfx-listings--cards .dfx-card__label { color: #fff; }
.dfx-listings--cards .dfx-card__facts { border-color: rgba( 255, 255, 255, .3 ); }

.dfx-empty { padding: 1.5rem; text-align: center; border: 1px dashed var( --dfx-border ); border-radius: var( --dfx-radius ); }

/* Pagination */
.dfx-pagination { margin-top: var( --dfx-gap ); }
.dfx-pagination ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; justify-content: center; }
.dfx-pagination a, .dfx-pagination span { display: inline-block; padding: .4em .8em; border: 1px solid var( --dfx-border ); border-radius: var( --dfx-radius ); text-decoration: none; }
.dfx-pagination .current { background: var( --dfx-primary ); border-color: var( --dfx-primary ); color: #fff; }

/* Detail */
.dfx-detail { max-width: 1200px; margin: 0 auto; }
.dfx-page { padding: 1.5rem 16px; }
.dfx-detail__title { margin: 0 0 .25rem; }
.dfx-detail__location { margin: 0 0 1rem; color: var( --dfx-muted ); }
.dfx-detail__body { display: grid; gap: calc( var( --dfx-gap ) * 1.5 ); }
.dfx-detail--cols-2 .dfx-detail__body { grid-template-columns: minmax( 0, 2fr ) minmax( 0, 1fr ); align-items: start; }
.dfx-detail--cols-2 .dfx-detail__side { position: sticky; top: 2rem; }
@media ( max-width: 900px ) { .dfx-detail--cols-2 .dfx-detail__body { grid-template-columns: 1fr; } .dfx-detail--cols-2 .dfx-detail__side { position: static; } }
.dfx-section { margin: 0 0 calc( var( --dfx-gap ) * 1.5 ); }
.dfx-section h2 { font-size: 1.3em; margin: 0 0 .75rem; }
.dfx-section h3 { font-size: 1.05em; margin: 1rem 0 .5rem; }
.dfx-notice { padding: .75rem 1rem; background: var( --dfx-surface ); border-left: 4px solid var( --dfx-accent ); }

.dfx-gallery__main { margin: 0; position: relative; border-radius: var( --dfx-radius ); overflow: hidden; background: var( --dfx-surface ); }
.dfx-gallery__main img { width: 100%; max-height: 640px; object-fit: cover; }
.dfx-gallery__open { display: block; cursor: zoom-in; }
.dfx-gallery__count { position: absolute; right: .75rem; bottom: .75rem; background: rgba( 0, 0, 0, .65 ); color: #fff; padding: .2em .7em; border-radius: 999px; font-size: .85em; }
.dfx-gallery__thumbs { list-style: none; display: flex; gap: .5rem; margin: .5rem 0 0; padding: 0 0 .25rem; overflow-x: auto; scroll-snap-type: x proximity; }
.dfx-gallery__thumbs li { flex: 0 0 auto; margin: 0; scroll-snap-align: start; }
.dfx-gallery__thumbs a { display: block; border-radius: calc( var( --dfx-radius ) / 2 ); overflow: hidden; outline-offset: 2px; opacity: .8; }
.dfx-gallery__thumbs a:hover, .dfx-gallery__thumbs a:focus, .dfx-gallery__thumbs a[aria-current="true"] { opacity: 1; }
.dfx-gallery__thumbs img { width: 120px; height: 90px; object-fit: cover; }

.dfx-price { font-size: 1.8em; font-weight: 700; margin: 0; color: var( --dfx-primary ); }
.dfx-summary__meta { margin: .25rem 0 1rem; color: var( --dfx-muted ); }
.dfx-facts { display: grid; grid-template-columns: repeat( auto-fill, minmax( 130px, 1fr ) ); gap: .75rem; margin: 0; }
.dfx-fact { background: var( --dfx-surface ); border-radius: var( --dfx-radius ); padding: .65rem .8rem; }
.dfx-fact dt { font-size: .8em; color: var( --dfx-muted ); }
.dfx-fact dd { margin: 0; font-weight: 600; }
.dfx-specs { display: grid; grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) ); gap: 0 1.5rem; margin: 0; }
.dfx-specs div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var( --dfx-border ); }
.dfx-specs dt { color: var( --dfx-muted ); }
.dfx-specs dd { margin: 0; text-align: right; }
.dfx-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .75rem 0 0; }
.dfx-tags li { margin: 0; padding: .2em .7em; border-radius: 999px; background: var( --dfx-surface ); font-size: .88em; }

.dfx-agent, .dfx-contact { border: 1px solid var( --dfx-border ); border-radius: var( --dfx-radius ); padding: 1.25rem; }
.dfx-agent p { margin: 0 0 .35rem; }
.dfx-agent__name { font-weight: 700; }
.dfx-agent__office { color: var( --dfx-muted ); }
.dfx-form label { display: block; font-size: .9em; margin-bottom: .2rem; }
.dfx-form input[type="text"], .dfx-form input[type="email"], .dfx-form input[type="tel"], .dfx-form textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var( --dfx-border ); border-radius: calc( var( --dfx-radius ) / 1.5 ); font: inherit; background: transparent; color: inherit; }
.dfx-form p { margin: 0 0 .8rem; }
.dfx-button { display: inline-block; background: var( --dfx-primary ); color: #fff; border: 0; border-radius: var( --dfx-radius ); padding: .65rem 1.4rem; font: inherit; font-weight: 600; cursor: pointer; }
.dfx-button:hover, .dfx-button:focus { filter: brightness( .92 ); }
.dfx-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.dfx-alert { padding: .65rem .9rem; border-radius: var( --dfx-radius ); }
.dfx-alert--success { background: #edfaef; color: #00450c; }
.dfx-alert--error { background: #fcf0f1; color: #8a2424; }
.dfx-small { font-size: .85em; color: var( --dfx-muted ); }

.dfx-compliance { margin-top: var( --dfx-gap ); padding-top: 1rem; border-top: 1px solid var( --dfx-border ); font-size: .85em; color: var( --dfx-muted ); }
.dfx-compliance p { margin: 0 0 .4rem; }
.dfx-idx-logo { max-height: 40px; width: auto; margin: .5rem 0; }

/* Lightbox (native <dialog>) */
.dfx-lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba( 0, 0, 0, .92 ); color: #fff; }
.dfx-lightbox::backdrop { background: rgba( 0, 0, 0, .92 ); }
.dfx-lightbox__inner { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.dfx-lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.dfx-lightbox button { position: absolute; background: rgba( 0, 0, 0, .5 ); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; cursor: pointer; line-height: 1; }
.dfx-lightbox button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dfx-lightbox__close { top: 16px; right: 16px; }
.dfx-lightbox__prev { left: 16px; top: 50%; transform: translateY( -50% ); }
.dfx-lightbox__next { right: 16px; top: 50%; transform: translateY( -50% ); }
.dfx-lightbox__pos { position: absolute; bottom: 16px; left: 50%; transform: translateX( -50% ); font-size: .9em; }
@media ( prefers-reduced-motion: reduce ) { .dfx-card__media img { transition: none; } }

/* Search forms (phase 5) */
.dfx-search-wrap { --dfx-primary: var( --wp--preset--color--primary, #1e73be ); --dfx-border: rgba( 0, 0, 0, .12 ); --dfx-muted: rgba( 0, 0, 0, .62 ); --dfx-radius: 6px; }
.dfx-search { margin: 0 0 1.5rem; padding: 1rem; border: 1px solid var( --dfx-border ); border-radius: var( --dfx-radius ); }
.dfx-search__fields { display: grid; gap: .9rem 1rem; grid-template-columns: repeat( var( --dfx-fcols, 4 ), minmax( 0, 1fr ) ); }
.dfx-search--cols-1 { --dfx-fcols: 1; } .dfx-search--cols-2 { --dfx-fcols: 2; } .dfx-search--cols-3 { --dfx-fcols: 3; } .dfx-search--cols-4 { --dfx-fcols: 4; }
@media ( max-width: 900px ) { .dfx-search__fields { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); } }
@media ( max-width: 560px ) { .dfx-search__fields { grid-template-columns: 1fr; } }
.dfx-search__field { margin: 0; border: 0; padding: 0; min-width: 0; }
.dfx-search__field > label, .dfx-search__field legend { display: block; font-size: .88em; margin-bottom: .25rem; padding: 0; }
.dfx-search input[type="search"], .dfx-search input[type="number"], .dfx-search input[type="text"], .dfx-search select, .dfx-search-results select { width: 100%; padding: .5rem .6rem; border: 1px solid var( --dfx-border ); border-radius: calc( var( --dfx-radius ) / 1.5 ); font: inherit; background: transparent; color: inherit; }
.dfx-search__field--checkbox label { display: flex; gap: .4rem; align-items: center; margin-top: 1.6rem; }
.dfx-range { display: flex; align-items: stretch; gap: .5rem; }
.dfx-range__box { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 1px solid var( --dfx-border ); border-radius: calc( var( --dfx-radius ) / 1.5 ); padding: .3rem .6rem; cursor: text; }
.dfx-range__label { font-size: .72em; color: var( --dfx-muted ); }
.dfx-search .dfx-range__box input { border: 0; padding: 0; background: transparent; font-weight: 600; min-width: 0; }
.dfx-search .dfx-range__box input:focus { outline: none; }
.dfx-range__box:focus-within { border-color: var( --dfx-primary ); box-shadow: 0 0 0 1px var( --dfx-primary ); }

/* Button choices (bedrooms, property type…) */
.dfx-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.dfx-pill-opt { position: relative; margin: 0; flex: 1 1 auto; }
.dfx-pill-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.dfx-pill-opt span { display: block; text-align: center; white-space: nowrap; padding: .5rem .9rem; border: 1px solid var( --dfx-border ); border-radius: 999px; font-size: .88em; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; user-select: none; }
.dfx-pill-opt span:hover { border-color: var( --dfx-primary ); }
.dfx-pill-opt input:checked + span { background: var( --dfx-primary ); border-color: var( --dfx-primary ); color: #fff; font-weight: 600; }
.dfx-pill-opt input:focus-visible + span { outline: 2px solid var( --dfx-primary ); outline-offset: 2px; }
.dfx-search__field--toggles .dfx-pill-opt span { border-radius: calc( var( --dfx-radius ) * 1.5 ); }
.dfx-checks { display: flex; flex-wrap: wrap; gap: .25rem .9rem; max-height: 9rem; overflow: auto; }
.dfx-checks label { display: inline-flex; gap: .3rem; align-items: center; font-size: .92em; }
.dfx-search__actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.dfx-search__reset { font-size: .9em; }
.dfx-search .dfx-button, .dfx-search-wrap .dfx-button { display: inline-block; background: var( --dfx-primary ); color: #fff; border: 0; border-radius: var( --dfx-radius ); padding: .6rem 1.4rem; font: inherit; font-weight: 600; cursor: pointer; }
.dfx-search-results { position: relative; transition: opacity .2s; }
.dfx-search-results.dfx-loading { opacity: .5; }
.dfx-search-results__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.dfx-search-results__bar p { margin: 0; }
.dfx-search-results__count { font-weight: 600; }
.dfx-search-results__sort { display: flex; align-items: center; gap: .5rem; }
.dfx-search-results__sort select { width: auto; }

/* Card style for search forms (Searches > Form style) */
.dfx-search--card { background: #fff; color: #1d2433; border: 0; border-radius: 16px; padding: 1.5rem; box-shadow: 0 20px 50px rgba( 9, 20, 45, .25 ); --dfx-border: rgba( 16, 30, 60, .14 ); --dfx-muted: rgba( 16, 30, 60, .6 ); }
.dfx-search--card .dfx-search__field > label, .dfx-search--card legend { font-size: .7em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .45rem; }
.dfx-search--card input[type="search"], .dfx-search--card input[type="text"], .dfx-search--card select { background: #fff; padding: .7rem .8rem; }
.dfx-search--card .dfx-range__box input { padding: 0; }
.dfx-search--card .dfx-search__fields { gap: 1.1rem 1.5rem; }
.dfx-search--card .dfx-search__actions { margin-top: 1.25rem; }
.dfx-search--card .dfx-button { width: 100%; padding: .85rem 1.4rem; border-radius: 10px; }
@media ( max-width: 560px ) { .dfx-search--card { padding: 1rem; } }

/* Maps */
.dfx-map { position: relative; width: 100%; height: var( --dfx-map-h, 360px ); border-radius: var( --dfx-radius ); overflow: hidden; background: var( --dfx-surface, rgba( 0, 0, 0, .035 ) ); z-index: 0; }
.dfx-map-wrap { margin: 0 0 var( --dfx-gap, 1.5rem ); }
.dfx-map__note { margin: .4rem 0 0; font-size: .82em; color: var( --dfx-muted ); }
.dfx-map__fallback { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; padding: 1rem; text-align: center; }
.dfx-marker { background: none; border: 0; }
.dfx-marker span { display: inline-block; transform: translate( -50%, -100% ); white-space: nowrap; background: var( --dfx-primary, #1e73be ); color: #fff; font: 700 12px/1 system-ui, sans-serif; padding: .45em .65em; border-radius: 999px; box-shadow: 0 2px 6px rgba( 0, 0, 0, .3 ); }
.dfx-marker--dot span { display: block; width: 20px; height: 20px; padding: 0; border: 3px solid #fff; transform: translate( -50%, -50% ); }
.dfx-map-pop { width: 200px; font-size: 13px; line-height: 1.35; }
.dfx-map-pop img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; margin-bottom: .4rem; display: block; }
.dfx-map-pop strong { display: block; }
.dfx-map-pop a { display: inline-block; margin-top: .3rem; }

/* Full-width map: breaks out of the content column. */
.dfx-map-wrap--full { position: relative; width: 100vw; max-width: 100vw; margin-left: calc( 50% - 50vw ); margin-right: calc( 50% - 50vw ); }
.dfx-map-wrap--full .dfx-map { border-radius: 0; }
.dfx-map-wrap--full .dfx-map__note { padding: 0 1rem; }
.dfx-map-below { margin-top: var( --dfx-gap, 1.5rem ); }
.dfx-search-results > .dfx-map-wrap { margin-bottom: 1.25rem; }
body:has( .dfx-map-wrap--full ) { overflow-x: clip; }
