/* R Enterprises Ambulance Listings - all styles scoped to .rea-* */

.rea-app {
	--rea-primary: #1aab8a;
	--rea-primary-dark: #0f5132;
	--rea-bg: #ffffff;
	--rea-bg-soft: #f9fafb;
	--rea-border: #e5e7eb;
	--rea-text: #1f2937;
	--rea-text-muted: #6b7280;
	--rea-radius: 8px;
	--rea-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	--rea-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.08);
	color: var(--rea-text);
	font-family: inherit;
}

/* ----------- Filter bar ----------- */

.rea-filters {
	background: var(--rea-bg-soft);
	border: 1px solid var(--rea-border);
	border-radius: var(--rea-radius);
	padding: 1rem 1rem .85rem;
	margin: 0 0 1.5rem;
}

.rea-filter-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: .75rem;
	margin-bottom: .85rem;
}

.rea-filter {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	min-width: 0;
}

.rea-filter-label {
	font-size: .7rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--rea-text-muted);
	font-weight: 700;
}

.rea-filters select,
.rea-filters input[type="number"] {
	width: 100%;
	padding: .55rem .7rem;
	border: 1px solid var(--rea-border);
	border-radius: 6px;
	background: var(--rea-bg);
	font-size: .9rem;
	color: var(--rea-text);
	font-family: inherit;
	line-height: 1.2;
	box-shadow: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
	box-sizing: border-box;
}

.rea-filters select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7280' d='M6 8L0 0h12z'/></svg>");
	background-repeat: no-repeat;
	background-position: right .75rem center;
	padding-right: 2rem;
	cursor: pointer;
}

.rea-filters select:focus,
.rea-filters input:focus {
	outline: none;
	border-color: var(--rea-primary);
	box-shadow: 0 0 0 3px rgba(26, 171, 138, 0.18);
}

.rea-price-inputs {
	display: flex;
	align-items: center;
	gap: .45rem;
}

.rea-price-inputs span {
	color: var(--rea-text-muted);
	font-size: .9rem;
}

.rea-price-inputs input {
	flex: 1 1 0;
	min-width: 0;
}

.rea-filter-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.rea-toggle {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-size: .875rem;
	color: var(--rea-text-muted);
	cursor: pointer;
	user-select: none;
}

.rea-toggle input {
	margin: 0;
	accent-color: var(--rea-primary);
}

.rea-clear {
	background: transparent;
	border: 1px solid var(--rea-border);
	border-radius: 6px;
	padding: .4rem .9rem;
	font-size: .8125rem;
	color: var(--rea-text-muted);
	cursor: pointer;
	font-family: inherit;
	transition: border-color .15s, color .15s, background .15s;
}

.rea-clear:hover {
	border-color: var(--rea-primary);
	color: var(--rea-primary);
	background: rgba(26, 171, 138, 0.06);
}

.rea-submit {
	background: var(--rea-primary);
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: .5rem 1rem;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
}

/* ----------- Results ----------- */

.rea-meta {
	font-size: .875rem;
	color: var(--rea-text-muted);
	margin: 0 0 1rem;
}

.rea-results {
	transition: opacity .2s;
}

.rea-app.is-loading .rea-results {
	opacity: .5;
	pointer-events: none;
}

.rea-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}

.rea-empty {
	background: var(--rea-bg-soft);
	border: 1px dashed var(--rea-border);
	border-radius: var(--rea-radius);
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: var(--rea-text-muted);
}

.rea-empty p {
	margin: .35rem 0;
}

/* ----------- Card ----------- */

.rea-card {
	background: var(--rea-bg);
	border: 1px solid var(--rea-border);
	border-radius: var(--rea-radius);
	overflow: hidden;
	transition: transform .15s, box-shadow .15s, border-color .15s;
	box-shadow: var(--rea-shadow);
	display: flex;
	flex-direction: column;
}

.rea-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--rea-shadow-hover);
	border-color: #d1d5db;
}

.rea-card.is-sold {
	opacity: .82;
}

.rea-card.is-sold .rea-card-img {
	filter: grayscale(.5) brightness(.95);
}

.rea-card-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.rea-card-media {
	position: relative;
	background: var(--rea-bg-soft);
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.rea-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}

.rea-card:hover .rea-card-img {
	transform: scale(1.04);
}

.rea-card-img-placeholder {
	background: repeating-linear-gradient(
		135deg,
		#f3f4f6,
		#f3f4f6 12px,
		#e5e7eb 12px,
		#e5e7eb 13px
	);
}

.rea-badge {
	position: absolute;
	top: .75rem;
	left: .75rem;
	padding: .3rem .7rem;
	font-size: .68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	border-radius: 4px;
	z-index: 1;
}

.rea-badge-sold {
	background: #1f2937;
	color: #fff;
}

.rea-brand-badge {
	position: absolute;
	top: .75rem;
	right: .75rem;
	background: #fff;
	padding: .3rem .55rem;
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
	display: inline-flex;
	align-items: center;
	height: 34px;
	z-index: 1;
}

.rea-brand-badge img {
	max-height: 22px;
	max-width: 80px;
	width: auto;
	height: auto;
	display: block;
}

.rea-card-body {
	padding: 1rem 1rem 1.1rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.rea-card-title {
	font-size: 1rem;
	line-height: 1.35;
	margin: 0 0 .75rem;
	font-weight: 600;
	color: var(--rea-text);
}

.rea-card-specs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .35rem .85rem;
	margin: 0 0 1rem;
	font-size: .82rem;
}

.rea-spec dt {
	display: inline;
	font-weight: 400;
	color: var(--rea-text-muted);
}

.rea-spec dt::after {
	content: ": ";
}

.rea-spec dd {
	display: inline;
	margin: 0;
	font-weight: 600;
	color: var(--rea-text);
}

.rea-card-price {
	margin-top: auto;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--rea-primary-dark);
}

.rea-card-price .woocommerce-Price-amount {
	color: inherit;
}

.rea-price-callout {
	color: var(--rea-text-muted);
	font-weight: 500;
	font-size: .95rem;
}

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

@media (max-width: 720px) {
	.rea-filter-row {
		grid-template-columns: 1fr 1fr;
	}
	.rea-filter-price {
		grid-column: 1 / -1;
	}
	.rea-filter-actions {
		justify-content: space-between;
	}
}

@media (max-width: 440px) {
	.rea-filter-row {
		grid-template-columns: 1fr;
	}
	.rea-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
}
