/* Property Results Template Styles */

.property-results-container {
	width: 100%;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Search Section */
.search-section {
	background-color: #0a2540;
	color: white;
	padding: 2rem 0;
}

.property-search-widget {
	margin-top: 78px;
	padding: 1rem 0 !important;
	box-shadow: 0 5px 2rem rgba(0,0,0,0.125);
	z-index: 90;
}

.search-wrapper {
	margin: 0 auto;
	padding: 0;
}

.search-prompt {
	margin-bottom: 1.5rem;
}

.prompt-label {
	font-size: 1.1rem;
	font-weight: 300;
}

.prompt-highlight {
	font-size: 1.1rem;
	font-weight: 600;
	margin-left: 0.3rem;
}

.search-controls {
	display: flex;
	gap: 1rem;
	align-items: flex-end;
	flex-wrap: wrap;
}

.property-type-dropdown,
.search-input-wrapper {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.property-type-dropdown label,
.search-input-wrapper label {
	font-size: 0.85rem;
	text-transform: uppercase;
	font-weight: 300;
	letter-spacing: 0.5px;
}

.property-type-dropdown select {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 0.75rem 2rem 0.75rem 1rem;
	font-size: 0.95rem;
	border-radius: 0;
	cursor: pointer;
	min-width: 150px;
	appearance: none;
	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 fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
}

.search-input-wrapper input {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 0.75rem 1rem;
	font-size: 0.85rem;
	border-radius: 0;
	min-width: 300px;
	letter-spacing: 0.5px;
}

.search-input-wrapper input::placeholder {
	color: rgba(255, 255, 255, 0.5);
	letter-spacing: 0.5px;
}

/* Currency and Price Range Group */
.currency-price-group {
	display: flex;
	gap: 1rem;
	align-items: flex-end;
}

.currency-selector {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.currency-selector label {
	font-size: 0.85rem;
	text-transform: uppercase;
	font-weight: 300;
	letter-spacing: 0.5px;
}

.currency-selector select {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 0.75rem 2rem 0.75rem 1rem;
	font-size: 0.95rem;
	border-radius: 0;
	cursor: pointer;
	min-width: 100px;
	appearance: none;
	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 fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
}

.price-range-inputs {
	display: flex;
	gap: 0.75rem;
	align-items: flex-end;
}

.price-input-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.price-input-group label {
	font-size: 0.85rem;
	text-transform: uppercase;
	font-weight: 300;
	letter-spacing: 0.5px;
}

.price-input-group input {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 0.75rem 1rem;
	font-size: 0.85rem;
	border-radius: 0;
	min-width: 140px;
	letter-spacing: 0.5px;
}

.price-input-group input::placeholder {
	color: rgba(255, 255, 255, 0.5);
	letter-spacing: 0.5px;
}

/* Remove number input arrows */
.price-input-group input[type="number"]::-webkit-inner-spin-button,
.price-input-group input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.price-input-group input[type="number"] {
	-moz-appearance: textfield;
}

.buy-rent-toggle {
	display: flex;
	gap: 0;
	margin-left: auto;
}

.toggle-btn {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 0.75rem 1.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s;
	letter-spacing: 0.5px;
}

.toggle-btn:first-child {
	border-right: none;
}

.toggle-btn.active {
	background-color: rgba(255, 255, 255, 0.2);
}

.toggle-btn:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.advanced-search-btn {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	padding: 0.75rem 1.5rem;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background-color 0.3s;
}

.advanced-search-btn:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.search-submit-btn {
	background-color: white;
	border: none;
	color: #0a2540;
	padding: 0.75rem 2rem;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	transition: background-color 0.3s;
	letter-spacing: 0.5px;
}

.search-submit-btn:hover {
	background-color: #f0f0f0;
}

/* Results Layout */
.results-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	flex: 1;
	min-height: 0;
}

/* Map Section */
.map-section {
	position: relative;
	background-color: #f5f5f5;
	transition: grid-column 0.3s ease;
}

.property-map {
	width: 100%;
	height: 100%;
}

.map-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 1.2rem;
}

/* Results Section */
.results-section {
	background-color: #fafafa;
	position: relative;
	transition: grid-column 0.3s ease;
}

.results-scroll-wrapper {
	overflow-y: auto;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

.results-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 1.5rem;
	padding: 2rem 2rem 0 2rem;
}

.results-info h2 {
	font-size: 1.8rem;
	font-weight: 400;
	margin: 0 0 0.5rem 0;
}

.results-note {
	font-size: 0.9rem;
	color: #666;
	margin: 0;
}

.sell-property-btn {
	background-color: #0a2540;
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.3s;
	text-decoration: none;
}

.sell-property-btn:visited {
	color: white;
}

.sell-property-btn:hover {
	background-color: #0d3a5f;
	color: white;
}

.results-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	padding: 0 2rem 1rem 2rem;
	border-bottom: 1px solid #ddd;
}

.filter-dropdown select {
	padding: 0.5rem 2rem 0.5rem 1rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9rem;
	cursor: pointer;
	background-color: white;
	appearance: none;
	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 fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
}

.view-toggle {
	display: flex;
	gap: 0.5rem;
}

.view-btn {
	background-color: transparent;
	border: 1px solid #ccc;
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
	cursor: pointer;
	transition: all 0.3s;
}

.view-btn.active {
	background-color: #0a2540;
	color: white;
	border-color: #0a2540;
}

.property-count {
	margin-bottom: 1.5rem;
	padding: 0 2rem;
}

.property-count h3 {
	font-size: 1.3rem;
	font-weight: 500;
	margin: 0;
}

/* Property Grid */
.property-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
	padding: 0 2rem;
}

.property-card {
	background-color: white;
	border-radius: 0;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s, box-shadow 0.3s;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
}

.property-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.property-image {
	position: relative;
	width: 100%;
	height: 200px;
	overflow: hidden;
	background-color: #f5f5f5;
}

.property-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s, opacity 0.3s ease;
	opacity: 0;
}

.property-image img.loaded {
	opacity: 1;
}

.property-card:hover .property-image img {
	transform: scale(1.05);
}

.property-image-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 100%);
	color: #999;
	gap: 0.5rem;
}

.property-image-placeholder svg {
	opacity: 0.5;
}

.property-image-placeholder span {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.7;
}

.favorite-btn {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background-color: rgba(255, 255, 255, 0.9);
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 1.2rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s;
}

.favorite-btn:hover {
	background-color: white;
}

.property-details {
	padding: 1.25rem;
}

.property-title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.property-location {
	font-size: 0.85rem;
	color: #666;
	margin: 0 0 1rem 0;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.property-price {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.price-main {
	font-size: 1.1rem;
	font-weight: 600;
	color: #0a2540;
}

.price-secondary {
	font-size: 0.9rem;
	color: #666;
}

/* Preferred currency (set by preferences-apply.js) */
.price-preferred {
	font-size: 1.1rem;
	font-weight: 600;
	color: #0a2540;
	order: -1;
}

.price-other {
	font-size: 0.9rem;
	color: #666;
	font-weight: 400;
}

/* Pagination */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 2rem;
	padding: 2rem 0;
}

.pagination-btn {
	background-color: #0a2540;
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background-color 0.3s;
}

.pagination-btn:hover:not(:disabled) {
	background-color: #0d3a5f;
}

.pagination-btn:disabled {
	background-color: #ccc;
	cursor: not-allowed;
}

.pagination-info {
	font-size: 0.95rem;
	color: #666;
}

/* Infinite Scroll Loading Indicator */
#loading-indicator {
	text-align: center;
	padding: 3rem 2rem;
	background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1), rgba(255,255,255,0));
	margin: 2rem 0;
}

#loading-indicator p {
	margin-top: 1.5rem;
	color: #0a2540;
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: 0.5px;
}

.spinner {
	width: 60px;
	height: 60px;
	margin: 0 auto;
	border: 6px solid #e0e0e0;
	border-top: 6px solid #0a2540;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

#end-of-results {
	text-align: center;
	padding: 3rem 2rem;
	margin: 2rem 0;
}

#end-of-results p {
	color: #0a2540;
	font-size: 1rem;
	font-weight: 500;
	padding: 1.5rem 2rem;
	background-color: #f8f8f8;
	border-radius: 4px;
	display: inline-block;
	border: 2px solid #e0e0e0;
}

/* Mobile Floating Buttons (hidden on desktop) */
.mobile-view-toggle,
.mobile-filter-toggle,
.filter-backdrop,
.filter-sheet {
	display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
	.results-layout {
		grid-template-columns: 1fr;
		flex: none;
	}

	.map-section {
		height: 400px;
	}

	.property-grid {
		grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	}
}

@media (max-width: 768px) {
	.results-layout {
		margin-top: 59px;
	}

	.results-header {
		flex-direction: column;
		gap: 1rem;
	}

	.sell-property-btn {
		width: 100%;
		text-decoration: none;
		color: white;
	}

	.property-grid {
		grid-template-columns: 1fr;
	}

	.results-controls {
		flex-direction: column;
		gap: 1rem;
		align-items: stretch;
	}

	/* Hide desktop view toggle on mobile */
	.view-toggle {
		display: none;
	}

	/* Hide map by default on mobile, show properties */
	.map-section {
		display: none;
		height: auto;
	}

	.results-section {
		display: block;
	}

	/* Results scroll wrapper: normal flow on mobile */
	.results-scroll-wrapper {
		position: static;
		overflow-y: visible;
		height: auto;
	}

	/* When map is active on mobile */
	.results-layout.mobile-map-active .map-section {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 999;
	}

	.results-layout.mobile-map-active .map-section .property-map {
		width: 100%;
		height: 100%;
	}

	.results-layout.mobile-map-active .results-section {
		display: none;
	}

	/* Floating map/list toggle button */
	.mobile-view-toggle {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		position: fixed;
		bottom: 1.5rem;
		left: 50%;
		transform: translateX(-50%);
		z-index: 1000;
		background-color: #0a2540;
		color: white;
		border: none;
		padding: 0.75rem 1.5rem;
		font-size: 0.9rem;
		font-weight: 600;
		letter-spacing: 0.5px;
		cursor: pointer;
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
		border-radius: 50px;
		transition: background-color 0.3s;
	}

	.mobile-view-toggle:hover {
		background-color: #0d2f52;
	}

	/* ======================================
	   Mobile Filter Bottom Sheet
	   ====================================== */

	/* Hide search widget on mobile — filters live in bottom sheet */
	.property-results-container .property-search-widget.search-section {
		display: none;
	}

	/* Bottom sheet backdrop */
	.filter-backdrop {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.5);
		z-index: 1100;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}

	.filter-backdrop.active {
		opacity: 1;
		visibility: visible;
	}

	/* Bottom sheet panel */
	.filter-sheet {
		display: flex;
		flex-direction: column;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 85vh;
		background: #fff;
		z-index: 1101;
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
		transform: translateY(100%);
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	}

	.filter-sheet.active {
		transform: translateY(0);
	}

	.filter-sheet-handle {
		display: flex;
		justify-content: center;
		padding: 12px 0 4px;
		flex-shrink: 0;
	}

	.filter-sheet-handle span {
		width: 36px;
		height: 4px;
		background: #ccc;
		border-radius: 2px;
	}

	.filter-sheet-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 8px 1.25rem 12px;
		border-bottom: 1px solid #eee;
		flex-shrink: 0;
	}

	.filter-sheet-title {
		font-size: 1rem;
		font-weight: 600;
		color: #002349;
		margin: 0;
	}

	.filter-sheet-close {
		background: none;
		border: none;
		color: #666;
		cursor: pointer;
		padding: 4px;
		display: flex;
		align-items: center;
	}

	/* Sheet body — scrollable filter controls */
	.filter-sheet-body {
		margin: 0;
		padding: 1.25rem 1.25rem 2rem !important;
		overflow-y: auto;
		flex: 1;
		min-height: 0;
	}

	.filter-sheet-body .search-controls {
		display: flex !important;
		flex-direction: column;
		gap: 1.25rem;
	}

	.filter-sheet-body .search-control,
	.filter-sheet-body .search-input-wrapper,
	.filter-sheet-body .currency-price-group {
		width: 100%;
	}

	.filter-sheet-body .currency-price-group {
		flex-direction: column;
	}

	.filter-sheet-body .slider-wrapper {
		width: 100%;
		padding: 0;
		flex: 1;
	}

	.filter-sheet-body .search-control select {
		width: 100%;
		min-width: 0;
	}

	.filter-sheet-body .search-input-wrapper input {
		width: 100%;
		min-width: 0;
	}

	.filter-sheet-body .search-submit-btn {
		width: 100%;
		justify-content: center;
		padding: 0.85rem 2rem;
	}

	.filter-sheet-body .advanced-search-btn {
		width: 100%;
		text-align: center;
	}

	.filter-sheet-body .currency-selector {
		display: none;
	}

	/* Floating filter button */
	.mobile-filter-toggle {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		position: fixed;
		top: 4.5rem;
		right: 1.5rem;
		z-index: 1000;
		background-color: #0a2540;
		color: white;
		border: none;
		padding: 0.75rem 1.5rem;
		font-size: 0.9rem;
		font-weight: 600;
		letter-spacing: 0.5px;
		cursor: pointer;
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
		border-radius: 50px;
		transition: background-color 0.3s;
	}

	.mobile-filter-toggle:hover {
		background-color: #0d2f52;
	}

	.mobile-filter-toggle .toggle-label {
		font-size: 0.85rem;
	}

	/* Hide floating buttons when sheet is open */
	body.filter-sheet-open .mobile-filter-toggle,
	body.filter-sheet-open .mobile-view-toggle {
		display: none;
	}
}

/* Footer inside results area */
.results-footer {
	margin-top: 3rem;
}

/* Reset Elementor footer styles when inside results */
.results-footer .elementor-location-footer,
.results-footer footer {
	position: relative !important;
	width: 100% !important;
}

/* ==========================================================================
   Map InfoWindow — even out Google's default asymmetric side padding
   ========================================================================== */

/* Google delegates the right-side padding to a scroll gutter on
   .gm-style-iw-d, which makes the right padding look wider than the left.
   Remove the gutter and let .map-info-window own the horizontal padding so
   both sides match. Vertical spacing (incl. the close button) is left as-is. */
.gm-style .gm-style-iw-c {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.gm-style .gm-style-iw-d {
	overflow: hidden !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	max-width: none !important;
}

.map-info-window {
	padding: 0 14px 14px !important;
	box-sizing: border-box;
}
