/* ==========================================================================
   Sandestin (MLS 290) card + filter-bar design — now1 theme only.

   Loaded ONLY by /search-sandestin and /explore-sandestin-results when
   config('theme_name') == 'now1'. Ported from the designer handoff at
   sandestin-andre/property-search-mockup/styles.css.

   This file is hand-maintained and deliberately NOT part of the per-site
   LESS build (public/pyc/now1/css/build-css.sh) — it must render identically
   on every site, not per theme_color.

   Every rule is scoped to one of three roots so nothing can leak into now1's
   global .card styles:
     #combosearch                 filter bar   (/search-sandestin)
     .combo-results               result cards (/search-sandestin)
     .explore-sandestin-results   result cards (/explore-sandestin iframe)

   It loads from @yield('before-header-end'), i.e. last in <head>, so equal
   specificity beats now-ui-kit.css.
   ========================================================================== */

:root {
	--sd-surface: #ffffff;
	--sd-text: #1a1a1a;
	--sd-text-muted: #6b6b6b;
	--sd-text-light: #9a9a9a;
	--sd-border: #d8d8d8;
	--sd-border-light: #e8e8e8;
	--sd-accent: #e07a4f;
	--sd-accent-hover: #d06a3f;
	--sd-yes: #2d8a4e;
	--sd-yes-bg: #eef7f1;
	--sd-restricted: #c0392b;
	--sd-restricted-bg: #fdf0ef;
	--sd-unrestricted: #d4732a;
	--sd-unrestricted-bg: #fef6ee;
	--sd-bay: #2a6fad;
	--sd-bay-bg: #eef4fa;
	--sd-golf: #2d8a4e;
	--sd-golf-bg: #eef7f1;
	--sd-radius: 6px;
	--sd-card-radius: 8px;
	--sd-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
	--sd-shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   Filter bar — #combosearch
   Markup is unchanged; this restyles the existing .ss-filter-bar structure
   in master/includes/search-sandestin.blade.php.
   -------------------------------------------------------------------------- */

#combosearch {
	background: var(--sd-surface);
	border: 1px solid var(--sd-border-light);
	border-radius: var(--sd-radius);
	box-shadow: var(--sd-shadow-card);
}

/* Sticky filter bar — desktop only. Sits just below the fixed now1 navbar
   (fixed-top, z-index 1030); Select2 dropdowns attach to <body>, so they
   still overlay the stuck bar. Mobile keeps the Show Filters toggle. */
@media (min-width: 992px) {
	#combosearch {
		position: -webkit-sticky;
		position: sticky;
		/* no-JS fallback; the script in search-sandestin.blade.php overrides
		   top with the measured fixed-navbar height (it varies with viewport) */
		top: 90px;
		z-index: 1020;
		transition: background-color 0.15s ease;
	}

	/* .is-stuck is toggled by the scroll handler in search-sandestin.blade.php
	   the moment the bar pins; solid bg so results don't read through it.
	   Full-bleed strip: the negative side margins cancel the element's inline
	   15px margins plus .container2's 15px !important left margin (!important
	   needed to beat the inline style). margin-bottom stays 15px so toggling
	   the class never changes vertical flow — that would jitter the sticky
	   threshold. */
	#combosearch.is-stuck {
		background: #b9b9b9;
		margin: 0 -15px 15px -30px !important;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}

	/* Compact, symmetric inner spacing while stuck. Base state stacks the blade
	   inline style's 15px .ss-filter-bar margin on top of the 12px padding
	   above, which reads too tall pinned; side margins keep the controls
	   aligned with the page content. */
	#combosearch.is-stuck .ss-filter-bar {
		margin: 0 30px;
		padding: 10px 0;
	}
}

/* Hide the Google Maps InfoWindow "speech bubble" (.gm-style-iw-c) and its
   tail (.gm-style-iw-tc) on this page only — marker click still highlights and
   scrolls to the result card (gmap3sandestin.blade.php). This stylesheet loads only
   on search-sandestin, so other pages/sites keep their bubbles. The window
   still opens invisibly: the dialog node stays in the DOM and Maps may still
   auto-pan to fit it. */
#map-canvas .gm-style .gm-style-iw-c,
#map-canvas .gm-style .gm-style-iw-tc {
	display: none;
}

#combosearch .ss-filter-bar {
	gap: 10px;
	margin: 0;
	padding: 12px 16px;
}

#combosearch .ss-filter-bar .ss-filter-cell {
	flex: 1 1 120px;
	min-width: 110px;
}

/* Community carries the longest labels and the most simultaneous selections,
   so it gets double the basis of its siblings. Above 992px .ss-filter-bar is
   flex-wrap:nowrap, so the other seven cells shrink proportionally on their
   own — no manual widths anywhere.

   Both classes are required. The base .ss-filter-cell rule is duplicated in an
   inline <style> in the page body (master/includes/search-sandestin.blade.php),
   which beats this stylesheet on document order at equal specificity.

   Guarded to min-width:768px (the complement of the max-width:767px mobile
   rule below): unguarded, this selector's extra class gives it higher
   specificity (1 id, 3 classes) than the mobile rule (1 id, 2 classes), so it
   would win at every width — including mobile — regardless of source order,
   leaving Community stuck double-width there. Scoping it here keeps mobile
   behavior exactly as it was before this change. */
@media (min-width: 768px) {
	#combosearch .ss-filter-bar .ss-filter-cell.ss-filter-cell--wide {
		flex: 2 1 240px;
	}
}

/* Select2's replacement container is inline-block; baseline alignment reserves
   descender space below it in every cell, bottom-padding the whole row (only
   visible once the stuck bar went gray). Block display removes the line box. */
#combosearch .ss-filter-bar .ss-filter-cell .select2-container {
	display: block;
}

/* Native <select> — only visible before Select2 upgrades the field. */
#combosearch .ss-filter-bar .ss-filter-cell .form-control {
	height: 42px;
	padding: 0 32px 0 12px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-color: var(--sd-surface);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius);
	box-shadow: none;
	font-size: 13px;
	font-weight: 500;
	color: var(--sd-text);
	cursor: pointer;
}

/* Select2 4.0.13 replaces the <select> with this structure. */
#combosearch .select2-container--default .select2-selection--single {
	height: 42px;
	background: var(--sd-surface);
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius);
	transition: border-color 0.15s ease;
}

#combosearch .select2-container--default .select2-selection--single:hover {
	border-color: #b0b0b0;
}

#combosearch .select2-container--default.select2-container--focus .select2-selection--single,
#combosearch .select2-container--default.select2-container--open .select2-selection--single {
	border-color: var(--sd-text);
}

#combosearch .select2-container--default .select2-selection--single .select2-selection__rendered {
	padding: 0 30px 0 12px;
	line-height: 40px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sd-text);
}

#combosearch .select2-container--default .select2-selection--single .select2-selection__placeholder {
	color: var(--sd-text) !important;
	font-weight: 500;
}

#combosearch .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 40px;
	width: 28px;
}

/* Swap Select2's CSS-triangle arrow for the mockup's chevron. */
#combosearch .select2-container--default .select2-selection--single .select2-selection__arrow b {
	width: 12px;
	height: 12px;
	margin-top: -6px;
	margin-left: -6px;
	border: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}

#combosearch .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
	transform: rotate(180deg);
}

#combosearch .select2-container--default .select2-selection--single .select2-selection__clear {
	margin-right: 22px;
	color: var(--sd-text-muted);
	font-weight: 400;
}

#combosearch .select2-container--default .select2-selection--multiple {
	min-height: 42px;
	background: var(--sd-surface);
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius);
	transition: border-color 0.15s ease;
}

#combosearch .select2-container--default .select2-selection--multiple:hover {
	border-color: #b0b0b0;
}

#combosearch .select2-container--default.select2-container--focus .select2-selection--multiple,
#combosearch .select2-container--default.select2-container--open .select2-selection--multiple {
	border-color: var(--sd-text);
}

/* Flex-center the chips and inline search field; Select2's defaults float the
   items and push the placeholder input down with margin-top, which left the
   field label sitting high in the 42px box. */
#combosearch .select2-container--default .select2-selection--multiple .select2-selection__rendered {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	min-height: 40px;
	padding: 2px 8px;
}

#combosearch .select2-container--default .select2-selection--multiple .select2-search--inline {
	display: flex;
	align-items: center;
	float: none;
}

#combosearch .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
	margin-top: 0;
	height: 26px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sd-text);
}

#combosearch .select2-container--default .select2-selection--multiple .select2-search__field::placeholder {
	color: var(--sd-text);
	font-weight: 500;
	opacity: 1;
}

#combosearch .select2-container--default .select2-selection--multiple .select2-search__field::-webkit-input-placeholder {
	color: var(--sd-text);
	font-weight: 500;
}

#combosearch .select2-container--default .select2-selection--multiple .select2-selection__choice {
	margin: 2px 6px 2px 0;
}

/* Buttons — override Bootstrap's .btn-danger / .btn-primary / .btn-warning. */
#combosearch #complete_reset,
#combosearch #save_the_search,
#combosearch #ss_save_search,
#combosearch #combosearchclose .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	padding: 0 20px !important;
	border-radius: var(--sd-radius) !important;
	font-size: 12px !important;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1 !important;
	text-transform: uppercase;
	white-space: nowrap;
	transition: background 0.15s ease;
}

#combosearch #complete_reset {
	background: var(--sd-surface) !important;
	border: 1px solid var(--sd-text) !important;
	color: var(--sd-text) !important;
}

#combosearch #complete_reset:hover,
#combosearch #complete_reset:focus {
	background: #f7f7f7 !important;
}

#combosearch #save_the_search,
#combosearch #ss_save_search {
	background: var(--sd-accent) !important;
	border: 1px solid var(--sd-accent) !important;
	color: #ffffff !important;
}

#combosearch #save_the_search:hover,
#combosearch #save_the_search:focus,
#combosearch #ss_save_search:hover,
#combosearch #ss_save_search:focus {
	background: var(--sd-accent-hover) !important;
	border-color: var(--sd-accent-hover) !important;
}

#combosearch #combosearchclose .btn {
	background: var(--sd-surface) !important;
	border: 1px solid var(--sd-border) !important;
	color: var(--sd-text-muted) !important;
}

/* --------------------------------------------------------------------------
   Result cards — .combo-results (search) and .explore-sandestin-results (explore)
   -------------------------------------------------------------------------- */

.combo-results .card,
.explore-sandestin-results .card {
	display: flex;
	flex-direction: column;
	margin-bottom: 18px;
	background: var(--sd-surface);
	border: 0;
	border-radius: var(--sd-card-radius);
	overflow: hidden;
	box-shadow: var(--sd-shadow-card);
	transition: box-shadow 0.2s ease;
}

.combo-results .card:hover,
.explore-sandestin-results .card:hover {
	box-shadow: var(--sd-shadow-card-hover);
}

/* now-ui-kit sets .card .card-image { min-height: 40vh } — reset and pin 16:10.
   padding-top is the fallback; @supports upgrades to aspect-ratio below. */
.combo-results .card .card-image,
.explore-sandestin-results .card .card-image {
	position: relative;
	min-height: 0;
	height: auto;
	padding-top: 62.5%;
	overflow: hidden;
	background: #dddddd;
}

/* The photo link stretches to fill the frame. :not(.btn-favorite) matters —
   the favourite button is also a direct <a> child of .card-image, and without
   the exclusion this rule outranks it and drags it to the top-left corner. */
.combo-results .card .card-image > a:not(.btn-favorite),
.explore-sandestin-results .card .card-image > a:not(.btn-favorite) {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
}

.combo-results .card .card-image .propertyimg,
.explore-sandestin-results .card .card-image .propertyimg {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@supports (aspect-ratio: 16 / 10) {
	.combo-results .card .card-image,
	.explore-sandestin-results .card .card-image {
		padding-top: 0;
		aspect-ratio: 16 / 10;
	}
}

.combo-results .card .badge-status,
.explore-sandestin-results .card .badge-status {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 5px 10px;
	background: rgba(20, 20, 20, 0.72);
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffffff;
	z-index: 2;
}

/* now-ui-kit's `.card a:not(.btn):not(.nav-link):not([data-toggle='collapse'])
   :not(.footer-link)` reset is (0,5,1) and adds a 2px transparent bottom border,
   which knocks the glyph off centre inside a border-box circle. Hence !important
   on border rather than a specificity arms race. */
.combo-results .card .card-image > a.btn-favorite,
.explore-sandestin-results .card .card-image > a.btn-favorite {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: #ffffff;
	border: 0 !important;
	border-radius: 50%;
	line-height: 28px;
	text-align: center;
	color: var(--sd-text) !important;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	z-index: 2;
	transition: transform 0.15s ease, color 0.15s ease;
}

/* Keep the glyph metrically neutral so flex centring is exact. */
.combo-results .card .btn-favorite .fa,
.explore-sandestin-results .card .btn-favorite .fa {
	display: block;
	width: auto;
	margin: 0;
	font-size: 13px;
	line-height: 1;
	vertical-align: middle;
}

.combo-results .card .btn-favorite:hover,
.explore-sandestin-results .card .btn-favorite:hover {
	transform: scale(1.06);
	color: var(--sd-restricted) !important;
}

/* Saved state — the .removeProperty variant renders a filled heart in red. */
.combo-results .card .btn-favorite.removeProperty,
.explore-sandestin-results .card .btn-favorite.removeProperty {
	color: var(--sd-restricted) !important;
}

.combo-results .card .card-body,
.explore-sandestin-results .card .card-body {
	display: block;
	padding: 14px 16px 12px;
}

.combo-results .card .card-price,
.explore-sandestin-results .card .card-price {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var(--sd-text);
}

.combo-results .card .card-address,
.explore-sandestin-results .card .card-address {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--sd-text);
}

.combo-results .card .card-address a,
.explore-sandestin-results .card .card-address a {
	color: var(--sd-text);
}

.combo-results .card .card-address a:hover,
.explore-sandestin-results .card .card-address a:hover {
	color: var(--sd-text);
	text-decoration: underline;
}

.combo-results .card .card-subdivision,
.explore-sandestin-results .card .card-subdivision {
	margin: 6px 0 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.3;
	color: var(--sd-text-light);
	text-transform: uppercase;
}

/* Tag block — reuses the existing .card-title-290 hook.
   Spacing lives on .tag-row, not the wrapper, so a listing with none of the
   curated 290 fields leaves a genuinely zero-height block rather than a gap. */
.combo-results .card .card-title-290,
.explore-sandestin-results .card .card-title-290 {
	margin: 0;
}

.combo-results .card .tag-row,
.explore-sandestin-results .card .tag-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px 8px;
	margin-top: 6px;
}

.combo-results .card .tag-row:first-child,
.explore-sandestin-results .card .tag-row:first-child {
	margin-top: 10px;
}

.combo-results .card .tag-label,
.explore-sandestin-results .card .tag-label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--sd-text-muted);
	text-transform: uppercase;
}

.combo-results .card .tag-stars,
.explore-sandestin-results .card .tag-stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	color: var(--sd-text);
	font-size: 11px;
	line-height: 1;
}

.combo-results .card .tag-stars .fa-star-o,
.explore-sandestin-results .card .tag-stars .fa-star-o {
	color: #d0d0d0;
}

.combo-results .card .tag-pill,
.explore-sandestin-results .card .tag-pill {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border: 1.5px solid;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.5;
	text-transform: uppercase;
}

.combo-results .card .tag-yes,
.explore-sandestin-results .card .tag-yes {
	color: var(--sd-yes);
	border-color: var(--sd-yes);
	background: var(--sd-yes-bg);
}

.combo-results .card .tag-restricted,
.explore-sandestin-results .card .tag-restricted {
	color: var(--sd-restricted);
	border-color: var(--sd-restricted);
	background: var(--sd-restricted-bg);
}

.combo-results .card .tag-unrestricted,
.explore-sandestin-results .card .tag-unrestricted {
	color: var(--sd-unrestricted);
	border-color: var(--sd-unrestricted);
	background: var(--sd-unrestricted-bg);
}

/* View pill defaults to the mockup's blue; Golf/Gulf views switch to green.
   Driven off data-view so the same rule works for both the Blade card and the
   Mustache card without adding a precomputed class to the /map-results-api payload. */
.combo-results .card .tag-view,
.explore-sandestin-results .card .tag-view {
	color: var(--sd-bay);
	border-color: var(--sd-bay);
	background: var(--sd-bay-bg);
}

.combo-results .card .tag-view[data-view*="golf" i],
.explore-sandestin-results .card .tag-view[data-view*="golf" i] {
	color: var(--sd-golf);
	border-color: var(--sd-golf);
	background: var(--sd-golf-bg);
}

.combo-results .card .card-specs,
.explore-sandestin-results .card .card-specs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 10px 0;
	border-top: 1px solid var(--sd-border-light);
	border-bottom: 1px solid var(--sd-border-light);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--sd-text);
	text-transform: uppercase;
}

/* Dividers are generated between adjacent specs rather than emitted as markup,
   so a listing missing acres (or baths) never leaves a dangling separator —
   Mustache is logic-less and cannot decide that on its own. */
.combo-results .card .card-specs > span + span::before,
.explore-sandestin-results .card .card-specs > span + span::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 12px;
	margin-right: 8px;
	background: var(--sd-border);
	vertical-align: -2px;
}

/* now-ui-kit sets .card .card-footer { margin-top: 15px } and
   .card .card-footer div { display: inline-block } — both reset here. */
.combo-results .card .card-footer,
.explore-sandestin-results .card .card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
	padding: 0;
	background: transparent;
	border: 0;
	font-size: 10px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--sd-text-light);
}

.combo-results .card .card-footer div,
.explore-sandestin-results .card .card-footer div {
	display: block;
}

.combo-results .card .card-footer .card-office,
.explore-sandestin-results .card .card-footer .card-office {
	text-align: right;
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.combo-results {
	padding-top: 4px;
}

/* Sort header on the explore iframe, restyled to sit with the new cards. */
.explore-sandestin-results .esandestin-results-header h4 {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.explore-sandestin-results .esandestin-results-header small {
	color: var(--sd-text-light);
	font-size: 12px;
}

.explore-sandestin-results #esandestin_sort {
	height: 38px;
	border: 1px solid var(--sd-border);
	border-radius: var(--sd-radius);
	box-shadow: none;
	font-size: 13px;
	color: var(--sd-text);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	#combosearch .ss-filter-bar {
		padding: 12px;
	}

	#combosearch .ss-filter-bar .ss-filter-cell {
		flex: 1 1 100%;
	}

	#combosearch #complete_reset,
	#combosearch #save_the_search,
	#combosearch #ss_save_search,
	#combosearch #combosearchclose .btn {
		flex: 1 1 auto;
	}

	.combo-results .card .card-price,
	.explore-sandestin-results .card .card-price {
		font-size: 20px;
	}
}

/* --------------------------------------------------------------------------
   Save Search modal (#ss-save-modal in master/includes/search-sandestin)
   -------------------------------------------------------------------------- */

.ss-save-modal {
	display: none;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2000; /* over the fixed navbar (1030) and stuck filter bar (1020) */
	align-items: center;
	justify-content: center;
	padding: 15px;
	background: rgba(0, 0, 0, 0.45);
}

.ss-save-modal.is-open {
	display: flex;
}

.ss-save-modal .ss-save-modal-box {
	width: 100%;
	max-width: 360px;
	padding: 20px;
	background: #ffffff;
	border-radius: var(--sd-radius);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.ss-save-modal .ss-save-modal-title {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--sd-text);
}

.ss-save-modal .ss-save-modal-error {
	display: none;
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--sd-restricted);
}

.ss-save-modal .ss-save-modal-error.is-visible {
	display: block;
}

.ss-save-modal .ss-save-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 15px;
}

.ss-save-modal .ss-save-modal-actions .btn {
	padding: 6px 12px;
	font-size: 13px;
	line-height: 1.2;
	border-radius: 3px;
}
