/* Vacational Rentals Template Styles */

/* Snap scroll on the actual scroll container (html) */
html:has(.vacational-rentals-container) {
	scroll-snap-type: y proximity;
}

.vacational-rentals-container {
	width: 100%;
	min-height: 100vh;
}

/* Search + Results snap panel */
.vr-search-panel {
	scroll-snap-align: start;
	scroll-margin-top: 78px; /* offset for sticky header */
	height: calc(100vh - 78px);
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Editorial Section (matches customer design)
   ========================================================================== */

/* Full-width hero image before editorial */
.vr-hero-image {
	margin-top: 78px; /* Account for fixed header */
	width: 100%;
	line-height: 0; /* Remove gap below img */
}

.vr-hero-image img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	max-height: 70dvh;
	object-position: bottom;
}

.vr-editorial {
	padding: 3rem 0;
	background: #fff;
}

.vr-editorial-inner {
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 2rem;
	color: #1a1a2e;
	font-size: 0.95rem;
	line-height: 1.7;
}

.vr-editorial-inner p {
	margin: 0 0 1.25rem;
}

/* Main title */
.vr-main-title {
	text-align: center;
	font-size: 1.8rem;
	font-weight: 400;
	color: #002349;
	letter-spacing: 0.5px;
	margin: 0 0 0.75rem;
}

/* Simple decorative divider line */
.vr-divider {
	width: 100%;
	height: 1px;
	background: #002349;
	margin: 0 0 2rem;
}

/* Intro paragraph */
.vr-intro {
	font-size: 0.95rem;
	line-height: 1.7;
}

.vr-intro strong,
.vr-editorial-inner strong {
	font-weight: 700;
}

/* Three photos row */
.vr-photo-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin: 2rem 0;
}

.vr-photo {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f0f0f0;
}

.vr-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Section titles */
.vr-section-title {
	font-size: 1rem;
	font-weight: 700;
	color: #002349;
	margin: 2rem 0 0.5rem;
}

.vr-location-title {
	font-size: 0.95rem;
	font-weight: 700;
	color: #002349;
	margin: 1.5rem 0 0.35rem;
}

/* Residences divider with centered heading */
.vr-section-divider {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin: 2.5rem 0 2rem;
}

.vr-divider-line {
	flex: 1;
	height: 1px;
	background: #002349;
}

.vr-section-heading {
	font-size: 1.4rem;
	font-weight: 400;
	color: #002349;
	white-space: nowrap;
	margin: 0;
	letter-spacing: 0.5px;
}

/* Feature bullets */
.vr-feature-list {
	list-style: disc;
	padding-left: 1.25rem;
	margin: 0.75rem 0 1.25rem;
}

.vr-feature-list li {
	margin-bottom: 0.35rem;
	font-size: 0.95rem;
	line-height: 1.6;
}

/* ==========================================================================
   Search Widget Override (no margin-top since editorial is above)
   ========================================================================== */

.vacational-rentals-container .property-search-widget {
	margin-top: 0;
}

.vacational-rentals-container .property-search-widget .buy-rent-toggle,
.vacational-rentals-container .property-search-widget .property-type-dropdown {
	display: none;
}

/* ==========================================================================
   Results Section
   ========================================================================== */

.vr-results-section {
	width: 100%;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.vr-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.75rem 1.5rem;
}

.vr-results-count {
	font-size: 0.95rem;
	color: #666;
	font-weight: 300;
	margin: 0;
}

.vr-results-count span {
	font-weight: 600;
	color: #002349;
}

/* ==========================================================================
   View Toggle
   ========================================================================== */

.vr-view-toggle {
	display: flex;
	gap: 0.5rem;
}

.vr-view-btn {
	background-color: transparent;
	border: 1px solid #ccc;
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
	cursor: pointer;
	transition: all 0.3s;
}

.vr-view-btn.active {
	background-color: #0a2540;
	color: white;
	border-color: #0a2540;
}

/* ==========================================================================
   Results Layout (Map + List Grid)
   ========================================================================== */

.vr-results-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	flex: 1;
	min-height: 0;
}

.vr-map-section {
	position: relative;
	background-color: #f5f5f5;
	transition: grid-column 0.3s ease;
}

.vr-property-map {
	width: 100%;
	height: 100%;
	min-height: 400px;
}

.vr-list-section {
	padding: 1.5rem;
	overflow-y: auto;
}

/* Back to List button (injected by JS on map-only view) */
.vr-back-to-list-btn {
	position: absolute;
	top: 1rem;
	right: 4rem;
	z-index: 10;
	background: #0a2540;
	color: white;
	border: none;
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.vr-back-to-list-btn:hover {
	background: #0d2f52;
}

/* ==========================================================================
   Mobile Floating View Toggle Button
   ========================================================================== */

.vr-mobile-view-toggle,
.mobile-filter-toggle,
.vr-filter-backdrop,
.vr-filter-sheet {
	display: none;
}

/* ==========================================================================
   Property Grid
   ========================================================================== */

.vr-property-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

.vr-property-grid .property-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border: 1px solid #eee;
	transition: box-shadow 0.2s ease;
}

.vr-property-grid .property-card:hover {
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.vr-property-grid .property-card[data-hidden="true"] {
	display: none;
}

.vr-property-grid .property-image {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background-color: #f5f5f5;
}

.vr-property-grid .property-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vr-property-grid .property-image-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #999;
	gap: 0.5rem;
}

.vr-property-grid .favorite-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(255, 255, 255, 0.85);
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.vr-property-grid .favorite-btn:hover {
	background: #fff;
}

.vr-property-grid .property-details {
	padding: 1rem;
}

.vr-property-grid .property-title {
	font-size: 1rem;
	font-weight: 500;
	margin: 0 0 0.25rem;
	color: #002349;
}

.vr-property-grid .property-location {
	font-size: 0.8rem;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin: 0 0 0.5rem;
}

.vr-property-grid .property-price {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.vr-property-grid .price-main {
	font-size: 1rem;
	font-weight: 600;
	color: #002349;
}

.vr-property-grid .price-secondary {
	font-size: 0.85rem;
	color: #888;
}

/* Preferred currency (set by preferences-apply.js) */
.vr-property-grid .price-preferred {
	font-size: 1rem;
	font-weight: 600;
	color: #002349;
	order: -1;
}

.vr-property-grid .price-other {
	font-size: 0.85rem;
	color: #888;
	font-weight: 400;
}

/* No results message */
.vr-property-grid .no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem;
	color: #666;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet: single column layout, map on top */
@media (max-width: 1200px) {
	.vr-results-layout {
		grid-template-columns: 1fr;
	}

	.vr-map-section {
		height: 400px;
	}

	.vr-list-section {
		max-height: none;
		overflow-y: visible;
	}
}

@media (max-width: 1024px) {
	.vr-property-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.5rem;
	}
}

@media (max-width: 768px) {
	html:has(.vacational-rentals-container) {
		scroll-snap-type: y proximity;
	}

	.vr-hero-image {
		margin-top: 60px;
	}

	.vr-hero-image img {
		max-height: 50dvh;
	}

	.vr-search-panel {
		scroll-margin-top: 60px;
		height: auto;
	}

	.vr-editorial {
		padding: 2rem 0;
	}

	.vr-editorial-inner {
		padding: 0 1.25rem;
		font-size: 0.9rem;
	}

	.vr-main-title {
		font-size: 1.3rem;
	}

	.vr-photo-row {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}

	.vr-photo {
		aspect-ratio: 16 / 9;
	}

	.vr-section-divider {
		gap: 1rem;
	}

	.vr-section-heading {
		font-size: 1.1rem;
	}

	.vr-results-header {
		flex-direction: column;
		gap: 1rem;
		align-items: flex-start;
		padding: 0.75rem 0;
	}

	/* Hide desktop view toggle on mobile */
	.vr-view-toggle {
		display: none;
	}

	/* Hide map by default on mobile */
	.vr-map-section {
		display: none;
		height: auto;
	}

	.vr-list-section {
		display: block;
		padding: 0;
	}

	.vr-property-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.vr-results-section {
		padding: 1.5rem 1rem;
	}

	/* When map is active on mobile (toggled via floating button) */
	.vr-results-layout.vr-mobile-map-active .vr-map-section {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 999;
	}

	.vr-results-layout.vr-mobile-map-active .vr-map-section .vr-property-map {
		width: 100%;
		height: 100%;
	}

	.vr-results-layout.vr-mobile-map-active .vr-list-section {
		display: none;
	}

	/* Floating toggle button */
	.vr-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;
	}

	.vr-mobile-view-toggle:hover {
		background-color: #0d2f52;
	}

	/* ======================================
	   Mobile Filter Bottom Sheet (VR only)
	   ====================================== */

	/* Hide search widget entirely on mobile — filters live in bottom sheet */
	.vacational-rentals-container .property-search-widget.search-section {
		display: none;
	}

	/* Bottom sheet backdrop */
	.vr-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;
	}

	.vr-filter-backdrop.active {
		opacity: 1;
		visibility: visible;
	}

	/* Bottom sheet panel */
	.vr-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);
	}

	.vr-filter-sheet.active {
		transform: translateY(0);
	}

	/* Drag handle */
	.vr-filter-sheet-handle {
		display: flex;
		justify-content: center;
		padding: 12px 0 4px;
		flex-shrink: 0;
	}

	.vr-filter-sheet-handle span {
		width: 36px;
		height: 4px;
		background: #ccc;
		border-radius: 2px;
	}

	/* Sheet header */
	.vr-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;
	}

	.vr-filter-sheet-title {
		font-size: 1rem;
		font-weight: 600;
		color: #002349;
		margin: 0;
	}

	.vr-filter-sheet-close {
		background: none;
		border: none;
		color: #666;
		cursor: pointer;
		padding: 4px;
		display: flex;
		align-items: center;
	}

	/* Sheet body — scrollable area for filter controls */
	.vr-filter-sheet-body {
		padding: 1.25rem;
		overflow-y: auto;
		flex: 1;
		min-height: 0;
	}

	.vr-filter-sheet-body .search-controls {
		display: flex !important;
		flex-direction: column;
		gap: 1.25rem;
	}

	.vr-filter-sheet-body .search-control,
	.vr-filter-sheet-body .search-input-wrapper,
	.vr-filter-sheet-body .currency-price-group {
		width: 100%;
	}

	.vr-filter-sheet-body .currency-price-group {
		flex-direction: column;
	}

	.vr-filter-sheet-body .slider-wrapper {
		width: 100%;
		padding: 0;
		flex: 1;
	}

	.vr-filter-sheet-body .search-input-wrapper input {
		width: 100%;
		min-width: 0;
	}

	.vr-filter-sheet-body .search-submit-btn {
		width: 100%;
		justify-content: center;
		padding: 0.85rem 2rem;
	}

	/* Hide elements not needed in VR sheet */
	.vr-filter-sheet-body .buy-rent-toggle,
	.vr-filter-sheet-body .property-type-dropdown,
	.vr-filter-sheet-body .advanced-search-btn,
	.vr-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.vr-sheet-open .mobile-filter-toggle,
	body.vr-sheet-open .vr-mobile-view-toggle {
		display: none;
	}
}
