/**
 * Shortcode Renderer Styles v2.2.0
 *
 * Compact search filter bar, pagination, grid layout
 * @package Resales_Modern
 */

:root {
	--rm-sc-gap: var(--rm-grid-gap, 1.5rem);
	--rm-sc-radius: 4px;
	--rm-sc-transition: 0.25s ease;
	--rm-sc-bg-empty: #F1F5F9;
	--rm-sc-text-muted: #64748B;
	--rm-sc-accent: #FFCB3D;
	--rm-sc-primary: #0F1E2E;
	--rm-sc-secondary: #00233C;
}

/* =========================================================================
   GRID WRAPPER
   ========================================================================= */
.rm-property-grid-wrapper {
	position: relative;
	width: 100%;
}

.rm-property-grid-wrapper.rm-grid--loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255,255,255,0.6);
	z-index: 10;
	pointer-events: none;
}

/* =========================================================================
   GRID HEADER (COUNT + SORT)
   ========================================================================= */
.rm-grid-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #e2e8f0;
}

.rm-grid-header__count {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--rm-sc-text-muted);
}

.rm-grid-header__count strong {
	color: var(--rm-sc-primary);
	font-weight: 600;
}

/* =========================================================================
   SORT CONTROL
   ========================================================================= */
.rm-sort-control {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.rm-sort-control__select {
	appearance: none;
	-webkit-appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	padding: 0.5rem 2rem 0.5rem 0.75rem;
	font-size: 0.875rem;
	font-family: inherit;
	color: var(--rm-sc-primary);
	cursor: pointer;
	transition: border-color var(--rm-sc-transition);
	min-width: 180px;
}

.rm-sort-control__select:hover {
	border-color: var(--rm-sc-accent);
}

.rm-sort-control__select:focus-visible {
	outline: 2px solid var(--rm-sc-accent);
	outline-offset: 2px;
}

/* =========================================================================
   SEARCH FILTER BAR — compact multi-column layout
   ========================================================================= */
.rm-search-filters {
	background: var(--rm-sc-primary);
	border-radius: 6px;
	padding: 20px 24px 16px;
	margin-bottom: 1.5rem;
}

.rm-search-filters__form {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 12px 10px;
	align-items: end;
}

.rm-search-filters__field {
	display: flex;
	flex-direction: column;
	gap: 3px;
	grid-column: span 2;
}

/* Smaller fields for Beds / Baths */
.rm-search-filters__field--small {
	grid-column: span 1;
}

.rm-search-filters__label {
	font-size: 11px;
	font-weight: 600;
	color: rgba(255,255,255,0.6);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.rm-search-filters__select,
.rm-search-filters__input {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	padding: 8px 10px;
	font-size: 13px;
	font-family: inherit;
	color: var(--rm-sc-primary);
	background: #fff;
	border: 2px solid transparent;
	border-radius: 4px;
	transition: border-color 0.2s;
	box-sizing: border-box;
	height: 38px;
}

.rm-search-filters__select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	padding-right: 28px;
	cursor: pointer;
}

.rm-search-filters__select:focus,
.rm-search-filters__input:focus {
	outline: none;
	border-color: var(--rm-sc-accent);
}

.rm-search-filters__input::placeholder {
	color: #94A3B8;
}

/* Price pair side by side */
.rm-search-filters__price-row {
	display: flex;
	gap: 8px;
}

.rm-search-filters__price-row .rm-search-filters__input {
	flex: 1;
	min-width: 0;
}

/* Buttons row */
.rm-search-filters__actions {
	display: flex;
	gap: 8px;
	align-items: end;
	grid-column: span 2;
}

.rm-search-filters__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 20px;
	font-size: 13px;
	font-weight: 700;
	font-family: inherit;
	color: #ffffff;
	background: var(--rm-sc-primary);
	border: 2px solid var(--rm-sc-accent);
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s, transform 0.1s;
	white-space: nowrap;
	box-sizing: border-box;
	height: 38px;
}

.rm-search-filters__submit:hover {
	background: var(--rm-sc-accent);
	color: var(--rm-sc-primary);
}

.rm-search-filters__submit:active {
	transform: scale(0.97);
}

.rm-search-filters__submit svg {
	width: 15px;
	height: 15px;
}

.rm-search-filters__reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 500;
	font-family: inherit;
	color: rgba(255,255,255,0.6);
	background: transparent;
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 4px;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s;
	white-space: nowrap;
	text-decoration: none;
	box-sizing: border-box;
	height: 38px;
}

.rm-search-filters__reset:hover {
	color: #fff;
	border-color: rgba(255,255,255,0.4);
}

/* ─── Popular Tags ─── */
.rm-search-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid rgba(255,255,255,0.1);
}

.rm-search-tags__label {
	font-size: 11px;
	font-weight: 600;
	color: rgba(255,255,255,0.5);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	display: flex;
	align-items: center;
	margin-right: 4px;
}

.rm-search-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 500;
	color: rgba(255,255,255,0.85);
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.15);
	border-radius: 20px;
	text-decoration: none;
	transition: all 0.2s;
	white-space: nowrap;
}

.rm-search-tag:hover {
	background: var(--rm-sc-accent);
	color: var(--rm-sc-primary);
	border-color: var(--rm-sc-accent);
}

.rm-search-tag.active {
	background: var(--rm-sc-accent);
	color: var(--rm-sc-primary);
	border-color: var(--rm-sc-accent);
	font-weight: 700;
}

.rm-search-tag svg {
	width: 12px;
	height: 12px;
}

/* =========================================================================
   PAGINATION
   ========================================================================= */
.rm-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-top: 2rem;
	padding-top: 1.5rem;
	flex-wrap: wrap;
}

.rm-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 0.5rem;
	font-size: 0.9375rem;
	font-weight: 500;
	font-family: inherit;
	color: #0F1E2E;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
}

.rm-pagination__btn:hover:not(.rm-pagination__btn--active):not(:disabled) {
	background: #FFCB3D;
	border-color: #FFCB3D;
	color: #0F1E2E;
}

.rm-pagination__btn--active {
	background: #0F1E2E;
	border-color: #0F1E2E;
	color: #ffffff;
	font-weight: 700;
	cursor: default;
}

.rm-pagination__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.rm-pagination__btn--prev,
.rm-pagination__btn--next {
	font-weight: 600;
	gap: 4px;
	padding: 0 12px;
}

.rm-pagination__btn svg,
.rm-pagination svg {
	width: 16px !important;
	height: 16px !important;
	max-width: 16px !important;
	max-height: 16px !important;
	flex-shrink: 0;
	display: inline-block;
	vertical-align: middle;
}

.rm-pagination__ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 42px;
	font-size: 0.9375rem;
	color: var(--rm-sc-text-muted);
}

.rm-pagination__info {
	width: 100%;
	text-align: center;
	margin-top: 0.5rem;
	font-size: 0.8125rem;
	color: var(--rm-sc-text-muted);
}

/* =========================================================================
   LOAD MORE (legacy, hidden by default)
   ========================================================================= */
.rm-load-more-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	margin-top: 2rem;
}

.rm-load-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 2rem;
	font-size: 0.9375rem;
	font-weight: 600;
	font-family: inherit;
	color: var(--rm-sc-primary);
	background: #fff;
	border: 2px solid var(--rm-sc-primary);
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.25s;
}

.rm-load-more-btn:hover:not(:disabled) {
	background: var(--rm-sc-primary);
	color: #fff;
}

.rm-load-more-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.rm-load-more-btn__spinner {
	display: inline-flex;
	animation: rm-spin 1s linear infinite;
}

@keyframes rm-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

.rm-load-more-wrapper__progress {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--rm-sc-text-muted);
}

/* =========================================================================
   EMPTY & ERROR STATES
   ========================================================================= */
.rm-grid-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 4rem 2rem;
	background: var(--rm-sc-bg-empty);
	border-radius: var(--rm-sc-radius);
}

.rm-grid-empty__icon { width: 64px; height: 64px; color: var(--rm-sc-text-muted); margin-bottom: 1rem; opacity: 0.5; }
.rm-grid-empty__title { margin: 0 0 0.5rem; font-size: 1.25rem; font-weight: 600; color: var(--rm-sc-primary); }
.rm-grid-empty__description { margin: 0; font-size: 0.9375rem; color: var(--rm-sc-text-muted); max-width: 400px; }

.rm-grid-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 3rem 2rem;
	background: #FFF5F5;
	border: 1px solid #FED7D7;
	border-radius: var(--rm-sc-radius);
}

.rm-grid-error__icon { width: 48px; height: 48px; color: #E53E3E; margin-bottom: 1rem; }
.rm-grid-error__title { margin: 0 0 0.5rem; font-size: 1.125rem; font-weight: 600; color: #C53030; }
.rm-grid-error__description { margin: 0; font-size: 0.9375rem; color: #718096; max-width: 400px; }
.rm-grid-error__details { margin-top: 1rem; text-align: left; max-width: 600px; }
.rm-grid-error__details summary { cursor: pointer; font-size: 0.8125rem; color: #A0AEC0; }
.rm-grid-error__details pre { margin-top: 0.5rem; padding: 0.75rem; background: #FFF; border: 1px solid #E2E8F0; border-radius: 4px; font-size: 0.75rem; white-space: pre-wrap; word-break: break-all; }

.rm-shortcode-error {
	padding: 1rem 1.5rem;
	background: #FFFBEB;
	border: 1px solid #FED7AA;
	border-radius: 4px;
	color: #9A3412;
	font-size: 0.875rem;
}

/* =========================================================================
   LISTING PAGE HEADER
   ========================================================================= */
.rm-listing-page__header {
	text-align: center;
	margin-bottom: 2rem;
}

.rm-listing-page__label {
	margin: 0 0 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--rm-sc-accent);
}

.rm-listing-page__title {
	margin: 0;
	font-size: 2rem;
	font-weight: 700;
	color: var(--rm-sc-primary);
	line-height: 1.2;
}

.rm-listing-page__count {
	color: var(--rm-sc-accent);
}

/* =========================================================================
   LOCATION TABS (hidden)
   ========================================================================= */
.rm-location-tabs { display: none; }

/* =========================================================================
   CARD FOOTER / VIEW DETAILS — theme button style
   ========================================================================= */
.rm-property-card__footer {
	padding: 0.75rem 1rem;
	border-top: 1px solid #f1f5f9;
}

.rm-card__view-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	width: 100%;
	padding: 0.6rem 1rem;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--rm-sc-primary);
	background: var(--rm-sc-accent);
	border-radius: 4px;
	transition: background 0.2s, color 0.2s;
}

.rm-card__view-btn:hover,
.rm-card__view-btn:focus {
	background: var(--rm-sc-secondary);
	color: #fff;
}

/* =========================================================================
   HIDDEN ELEMENTS
   ========================================================================= */
.rm-card__reference { display: none; }

/* Image swap transition */
.rm-property-card__image {
	transition: transform 0.4s ease, opacity 0.2s ease;
}

/* =========================================================================
   PROPERTY COUNT
   ========================================================================= */
.rm-property-count {
	font-weight: 700;
	color: var(--rm-sc-primary);
}

/* =========================================================================
   FAVORITES BAR
   ========================================================================= */
.rm-favorites-bar {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	background: var(--rm-sc-primary);
	color: #fff;
	border-radius: 50px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.2);
	z-index: 100;
	cursor: pointer;
}

.rm-favorites-bar:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

.rm-favorites-bar__icon { font-size: 1.125rem; color: #E53E3E; }
.rm-favorites-bar__count { font-weight: 700; font-size: 0.9375rem; }
.rm-favorites-bar__text { font-size: 0.8125rem; font-weight: 500; }

/* =========================================================================
   RESPONSIVE — SEARCH FILTERS
   ========================================================================= */
@media (max-width: 1023px) {
	.rm-search-filters__form {
		grid-template-columns: repeat(4, 1fr);
	}
	.rm-search-filters__field {
		grid-column: span 2;
	}
	.rm-search-filters__field--small {
		grid-column: span 1;
	}
	.rm-search-filters__actions {
		grid-column: span 2;
	}
}

@media (max-width: 767px) {
	.rm-search-filters {
		padding: 16px;
	}

	.rm-search-filters__form {
		grid-template-columns: repeat(2, 1fr);
	}

	.rm-search-filters__field {
		grid-column: span 2;
	}

	.rm-search-filters__field--small {
		grid-column: span 1;
	}

	.rm-search-filters__actions {
		grid-column: span 2;
		justify-content: stretch;
	}

	.rm-search-filters__submit {
		flex: 1;
	}

	.rm-search-tags {
		gap: 6px;
	}

	.rm-search-tag {
		font-size: 11px;
		padding: 4px 10px;
	}
}

@media (max-width: 479px) {
	.rm-search-filters__form {
		grid-template-columns: 1fr;
	}

	.rm-search-filters__field,
	.rm-search-filters__field--small {
		grid-column: span 1;
	}

	.rm-search-filters__actions {
		grid-column: span 1;
	}

	.rm-listing-page__title {
		font-size: 1.5rem;
	}
}

/* =========================================================================
   RESPONSIVE — GENERAL
   ========================================================================= */
@media (max-width: 768px) {
	.rm-grid-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.rm-sort-control__select {
		width: 100%;
		min-width: unset;
	}

	.rm-pagination { gap: 3px; }
	.rm-pagination__btn { min-width: 34px; height: 34px; font-size: 0.8125rem; }
	.rm-pagination__btn--prev span,
	.rm-pagination__btn--next span { display: none; }

	.rm-favorites-bar { bottom: 1rem; right: 1rem; }
	.rm-favorites-bar__text { display: none; }
}

/* =========================================================================
   PRINT / MOTION / CONTRAST
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
	.rm-load-more-btn__spinner { animation: none; }
}

@media (prefers-contrast: high) {
	.rm-sort-control__select,
	.rm-pagination__btn { border-width: 2px; }
}

@media print {
	.rm-load-more-wrapper,
	.rm-sort-control,
	.rm-favorites-bar,
	.rm-card__image-actions,
	.rm-card__nav-arrows,
	.rm-card__gallery-dots,
	.rm-search-filters,
	.rm-pagination,
	.rm-card__contact-buttons { display: none !important; }
}
