/* ==========================================================================
   Red Roof Property Search — Design System & Components
   Mobile-first. Reuses Red Roof's warm, trusted-advisor brand language for
   marketing sections, with a denser "data mode" scale for search/listing
   UI (see audit: listing grids need tighter internal card spacing than
   editorial marketing content).

   NOTE ON COLORS/FONTS: values below are inferred from the current live
   site's warm off-white / warm-gray / red-roof-accent palette. Replace the
   --redroof-* custom properties with exact brand hex codes and font-family
   names once provided — every component below references these variables,
   so a correction is a one-place edit.
   ========================================================================== */

:root {
	/* Palette */
	--redroof-bg:            #FAF7F2; /* warm off-white */
	--redroof-surface:       #FFFFFF;
	--redroof-warm-gray:     #F1ECE4;
	--redroof-border:        #E7E0D6;
	--redroof-text:          #2B241E; /* warm near-black */
	--redroof-text-muted:    #7A7166;
	--redroof-accent:        #B23A2E; /* "red roof" accent */
	--redroof-accent-dark:   #8F2E24;
	--redroof-success:       #3B7A57;
	--redroof-whatsapp:      #25D366;
	--redroof-line:          #06C755;

	/* Typography */
	--redroof-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--redroof-font-display: Georgia, "Times New Roman", serif;

	/* Radii / Shadow / Spacing (design directive: rounded, soft shadow, generous marketing spacing, denser data spacing) */
	--redroof-radius-sm: 8px;
	--redroof-radius-md: 14px;
	--redroof-radius-lg: 22px;
	--redroof-shadow-sm: 0 1px 3px rgba(43, 36, 30, 0.06);
	--redroof-shadow-md: 0 8px 24px rgba(43, 36, 30, 0.08);
	--redroof-shadow-lg: 0 16px 40px rgba(43, 36, 30, 0.12);
	--redroof-space-data: 12px;     /* dense: filters, cards */
	--redroof-space-section: 48px;  /* generous: between major sections */
	--redroof-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   1. HERO SEARCH
   ========================================================================== */
.redroof-hero-search {
	padding: 24px 16px 32px;
}

.redroof-hero-search__inner {
	max-width: 1100px;
	margin: 0 auto;
	background: var(--redroof-surface);
	border-radius: var(--redroof-radius-lg);
	box-shadow: var(--redroof-shadow-lg);
	padding: 28px 20px;
}

.redroof-hero-search__title {
	font-family: var(--redroof-font-display);
	font-size: 1.5rem;
	margin: 0 0 20px;
	color: var(--redroof-text);
	text-align: center;
}

.redroof-search-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.redroof-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.redroof-field label {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--redroof-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.redroof-field input,
.redroof-field select {
	appearance: none;
	border: 1px solid var(--redroof-border);
	border-radius: var(--redroof-radius-sm);
	padding: 12px 14px;
	font-size: 1rem;
	background: var(--redroof-bg);
	color: var(--redroof-text);
	transition: border-color var(--redroof-transition), box-shadow var(--redroof-transition);
}

.redroof-field input:focus,
.redroof-field select:focus {
	outline: none;
	border-color: var(--redroof-accent);
	box-shadow: 0 0 0 3px rgba(178, 58, 46, 0.15);
}

.redroof-hero-search__alt {
	text-align: center;
	font-size: 0.85rem;
	color: var(--redroof-text-muted);
	margin-top: 14px;
}
.redroof-hero-search__alt a { color: var(--redroof-accent); text-decoration: none; }
.redroof-hero-search__alt a:hover { text-decoration: underline; }

/* Desktop: single row */
@media (min-width: 900px) {
	.redroof-search-form {
		flex-direction: row;
		align-items: flex-end;
	}
	.redroof-field { flex: 1; }
	.redroof-field--location { flex: 1.4; }
}

/* Mobile: sticky search bar once scrolled */
@media (max-width: 899px) {
	.redroof-hero-search.is-sticky .redroof-hero-search__inner {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 999;
		border-radius: 0;
		padding: 10px 14px;
		box-shadow: var(--redroof-shadow-md);
	}
	.redroof-hero-search.is-sticky .redroof-hero-search__title,
	.redroof-hero-search.is-sticky .redroof-hero-search__alt { display: none; }
}

/* ==========================================================================
   BUTTONS (shared)
   ========================================================================== */
.redroof-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	border-radius: var(--redroof-radius-sm);
	font-size: 0.95rem;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: transform var(--redroof-transition), box-shadow var(--redroof-transition), background var(--redroof-transition);
}
.redroof-btn:hover { transform: translateY(-1px); }
.redroof-btn:active { transform: translateY(0); }

.redroof-btn--primary { background: var(--redroof-accent); color: #fff; box-shadow: var(--redroof-shadow-sm); }
.redroof-btn--primary:hover { background: var(--redroof-accent-dark); }

.redroof-btn--secondary { background: var(--redroof-warm-gray); color: var(--redroof-text); }
.redroof-btn--secondary:hover { background: var(--redroof-border); }

.redroof-btn--ghost { background: transparent; border-color: var(--redroof-border); color: var(--redroof-text); }
.redroof-btn--ghost:hover { background: var(--redroof-warm-gray); }

.redroof-btn--whatsapp { background: var(--redroof-whatsapp); color: #fff; }
.redroof-btn--line { background: var(--redroof-line); color: #fff; }
.redroof-btn--block { width: 100%; margin-bottom: 10px; }

/* ==========================================================================
   4. SMART FILTER CHIPS
   ========================================================================== */
.redroof-quick-filters {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 4px 16px 20px;
	max-width: 1100px;
	margin: 0 auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.redroof-quick-filters::-webkit-scrollbar { display: none; }

.redroof-chip {
	flex: 0 0 auto;
	background: var(--redroof-surface);
	border: 1px solid var(--redroof-border);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 0.85rem;
	white-space: nowrap;
	cursor: pointer;
	transition: all var(--redroof-transition);
}
.redroof-chip[aria-pressed="true"] {
	background: var(--redroof-accent);
	border-color: var(--redroof-accent);
	color: #fff;
}

/* ==========================================================================
   3. SEARCH LAYOUT + SIDEBAR
   ========================================================================== */
.redroof-search-layout {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 16px 60px;
}

@media (min-width: 1024px) {
	.redroof-search-layout {
		flex-direction: row;
		align-items: flex-start;
	}
}

.redroof-mobile-only { display: inline-flex; }
@media (min-width: 1024px) { .redroof-mobile-only { display: none; } }

.redroof-filters-sidebar {
	background: var(--redroof-surface);
	border-radius: var(--redroof-radius-md);
	box-shadow: var(--redroof-shadow-sm);
	padding: 20px;
	display: none;
	flex: 0 0 280px;
}
@media (min-width: 1024px) { .redroof-filters-sidebar { display: block; position: sticky; top: 20px; } }

.redroof-filters-sidebar.is-open {
	display: block;
	position: fixed;
	inset: 0;
	z-index: 1000;
	border-radius: 0;
	overflow-y: auto;
}

.redroof-filters-group { margin-bottom: var(--redroof-space-data); padding-bottom: var(--redroof-space-data); border-bottom: 1px solid var(--redroof-border); }
.redroof-filters-group:last-of-type { border-bottom: none; }
.redroof-filters-group h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--redroof-text-muted); margin: 0 0 10px; }

.redroof-filters-group select[multiple] { width: 100%; border-radius: var(--redroof-radius-sm); border: 1px solid var(--redroof-border); padding: 6px; }
.redroof-checkbox, .redroof-radio { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 6px; cursor: pointer; }
.redroof-range-inputs { display: flex; align-items: center; gap: 8px; }
.redroof-range-inputs input { width: 100%; border: 1px solid var(--redroof-border); border-radius: var(--redroof-radius-sm); padding: 8px; }

.redroof-pill-group { display: flex; gap: 6px; }
.redroof-pill {
	flex: 1;
	padding: 8px 0;
	border-radius: var(--redroof-radius-sm);
	border: 1px solid var(--redroof-border);
	background: var(--redroof-bg);
	cursor: pointer;
	transition: all var(--redroof-transition);
}
.redroof-pill.is-active { background: var(--redroof-accent); border-color: var(--redroof-accent); color: #fff; }

.redroof-filters-advanced summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--redroof-text); }
.redroof-filters-group--checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

/* ==========================================================================
   RESULTS: toolbar, grid, skeleton loading
   ========================================================================== */
.redroof-results { flex: 1; min-width: 0; }

.redroof-results__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.redroof-results__count { font-weight: 600; color: var(--redroof-text); margin: 0; }
.redroof-results__controls { display: flex; align-items: center; gap: 10px; }
.redroof-results__controls select { border: 1px solid var(--redroof-border); border-radius: var(--redroof-radius-sm); padding: 8px 10px; }

.redroof-view-toggle { display: flex; border: 1px solid var(--redroof-border); border-radius: var(--redroof-radius-sm); overflow: hidden; }
.redroof-view-btn { border: none; background: var(--redroof-surface); padding: 8px 14px; cursor: pointer; }
.redroof-view-btn.is-active { background: var(--redroof-accent); color: #fff; }

.redroof-results__split { display: flex; gap: 20px; align-items: flex-start; }
.redroof-results__grid-wrap { flex: 1; min-width: 0; transition: opacity var(--redroof-transition); }
.redroof-results__grid-wrap.is-loading { opacity: 0.4; pointer-events: none; }

.redroof-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--redroof-space-data);
}
@media (min-width: 640px) { .redroof-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .redroof-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .redroof-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* Map split view: grid narrows when map is shown alongside on desktop */
.redroof-results__split.map-active .redroof-grid { grid-template-columns: 1fr; }
@media (min-width: 1024px) {
	.redroof-results__split.map-active .redroof-results__grid-wrap { flex: 0 0 42%; max-height: 80vh; overflow-y: auto; }
	.redroof-results__split.map-active #redroof-map { flex: 1; }
}

.redroof-no-results { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--redroof-text-muted); }

/* Skeleton loading */
.redroof-skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--redroof-space-data); }
.redroof-skeleton-card { height: 320px; border-radius: var(--redroof-radius-md); background: linear-gradient(100deg, var(--redroof-warm-gray) 30%, var(--redroof-border) 50%, var(--redroof-warm-gray) 70%); background-size: 200% 100%; animation: redroof-shimmer 1.4s infinite; }
@keyframes redroof-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==========================================================================
   5. PROPERTY CARD
   ========================================================================== */
.redroof-card {
	background: var(--redroof-surface);
	border-radius: var(--redroof-radius-md);
	overflow: hidden;
	box-shadow: var(--redroof-shadow-sm);
	transition: transform var(--redroof-transition), box-shadow var(--redroof-transition);
}
.redroof-card:hover { transform: translateY(-4px); box-shadow: var(--redroof-shadow-md); }
.redroof-card.is-highlighted { box-shadow: 0 0 0 3px var(--redroof-accent); }

.redroof-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.redroof-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.redroof-card:hover .redroof-card__media img { transform: scale(1.05); }
.redroof-card__media-placeholder { width: 100%; height: 100%; background: var(--redroof-warm-gray); }

.redroof-card__favorite {
	position: absolute; top: 10px; right: 10px;
	background: rgba(255,255,255,0.9); border: none; border-radius: 50%;
	width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
	cursor: pointer; box-shadow: var(--redroof-shadow-sm);
}
.redroof-card__favorite svg { fill: none; stroke: var(--redroof-text); stroke-width: 2; }
.redroof-card__favorite[aria-pressed="true"] svg { fill: var(--redroof-accent); stroke: var(--redroof-accent); }

.redroof-card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.redroof-badge { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; }
.redroof-badge--type { background: rgba(255,255,255,0.92); color: var(--redroof-text); }
.redroof-badge--luxury { background: var(--redroof-text); color: #fff; }
.redroof-badge--featured { background: var(--redroof-accent); color: #fff; }

.redroof-card__body { padding: 16px; }
.redroof-card__price { font-size: 1.15rem; font-weight: 700; color: var(--redroof-accent); }
.redroof-card__title { font-size: 1rem; margin: 4px 0; }
.redroof-card__title a { color: var(--redroof-text); text-decoration: none; }
.redroof-card__title a:hover { text-decoration: underline; }
.redroof-card__location { font-size: 0.85rem; color: var(--redroof-text-muted); margin: 0 0 10px; }

.redroof-card__specs { display: flex; gap: 14px; list-style: none; padding: 0; margin: 0 0 10px; font-size: 0.85rem; color: var(--redroof-text); }

.redroof-card__highlights { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.redroof-tag { font-size: 0.72rem; background: var(--redroof-warm-gray); color: var(--redroof-text-muted); padding: 3px 9px; border-radius: 999px; }

.redroof-card__actions { display: flex; gap: 8px; }
.redroof-card__actions .redroof-btn { flex: 1; padding: 10px 12px; font-size: 0.85rem; }

/* ==========================================================================
   6. SINGLE PROPERTY DETAIL
   ========================================================================== */
.redroof-single-property { max-width: 1300px; margin: 0 auto; padding: 20px 16px 60px; }

.redroof-gallery__main img { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--redroof-radius-lg); }
.redroof-gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; }
.redroof-gallery__thumb { width: 90px; height: 66px; object-fit: cover; border-radius: var(--redroof-radius-sm); cursor: pointer; opacity: 0.7; }
.redroof-gallery__thumb:hover { opacity: 1; }

.redroof-single-layout { display: flex; flex-direction: column; gap: 30px; margin-top: 30px; }
@media (min-width: 1024px) { .redroof-single-layout { flex-direction: row; } }

.redroof-single-main { flex: 1; min-width: 0; }
.redroof-single-header h1 { font-family: var(--redroof-font-display); font-size: 1.8rem; margin: 10px 0 4px; }
.redroof-single-location { color: var(--redroof-text-muted); }

.redroof-single-specs { display: flex; flex-wrap: wrap; gap: 16px; padding: 18px 0; border-top: 1px solid var(--redroof-border); border-bottom: 1px solid var(--redroof-border); margin: 20px 0; }
.redroof-spec { display: flex; flex-direction: column; }
.redroof-spec__label { font-size: 0.75rem; color: var(--redroof-text-muted); text-transform: uppercase; }
.redroof-spec__value { font-weight: 700; }

.redroof-single-description, .redroof-single-details, .redroof-single-facilities, .redroof-single-map { margin-bottom: var(--redroof-space-section); }
.redroof-single-description h2, .redroof-single-details h2, .redroof-single-facilities h2, .redroof-single-map h2, .redroof-related h2 {
	font-family: var(--redroof-font-display); font-size: 1.3rem; margin-bottom: 14px;
}

.redroof-detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.redroof-detail-list div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--redroof-border); padding-bottom: 6px; }
.redroof-detail-list dt { color: var(--redroof-text-muted); }
.redroof-detail-list dd { margin: 0; font-weight: 600; }

.redroof-facility-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0 0 12px; }
.redroof-facility-list li { background: var(--redroof-warm-gray); padding: 8px 12px; border-radius: var(--redroof-radius-sm); font-size: 0.9rem; }

#redroof-single-map { height: 340px; border-radius: var(--redroof-radius-md); overflow: hidden; }

/* Sticky sidebar */
.redroof-single-sidebar { flex: 0 0 320px; }
.redroof-sidebar-card {
	background: var(--redroof-surface);
	border-radius: var(--redroof-radius-md);
	box-shadow: var(--redroof-shadow-md);
	padding: 22px;
	position: static;
}
@media (min-width: 1024px) { .redroof-sidebar-card { position: sticky; top: 20px; } }
.redroof-sidebar-card__price { font-size: 1.4rem; font-weight: 700; color: var(--redroof-accent); margin-bottom: 12px; }
.redroof-sidebar-card__agent { font-size: 0.85rem; color: var(--redroof-text-muted); margin-bottom: 14px; }
.redroof-mortgage-placeholder { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--redroof-border); }
.redroof-mortgage-placeholder h3 { font-size: 0.9rem; margin: 0 0 4px; }
.redroof-placeholder-note { font-size: 0.78rem; color: var(--redroof-text-muted); }

.redroof-related { margin-top: var(--redroof-space-section); }

.redroof-consultation-nudge { text-align: center; margin-top: 30px; color: var(--redroof-text-muted); font-size: 0.9rem; }
.redroof-consultation-nudge a { color: var(--redroof-accent); }

.redroof-breadcrumbs { font-size: 0.8rem; color: var(--redroof-text-muted); padding: 16px; max-width: 1300px; margin: 0 auto; }
.redroof-breadcrumbs a { color: var(--redroof-text-muted); }

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.redroof-chip:focus-visible,
.redroof-btn:focus-visible,
.redroof-pill:focus-visible,
.redroof-view-btn:focus-visible,
.redroof-card__favorite:focus-visible {
	outline: 3px solid var(--redroof-accent);
	outline-offset: 2px;
}
