/* fmstudio-public.css - BEM Architecture */

:root {
	/* These are overridden by inline styles from the plugin settings */
	--fm-primary: #2563EB;
	--fm-secondary: #0F172A;
	--fm-radius: 14px;
	
	/* Internal vars for UI */
	--fm-text-muted: #64748b;
	--fm-border-color: #e2e8f0;
	--fm-bg-light: #f8fafc;
	--fm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--fm-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--fm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--fm-transition: all 0.3s ease;
}

/* =========================================
   1. SEARCH BAR (.fm-search-form)
========================================= */

.fm-search-wrapper {
	background: #ffffff;
	border-radius: var(--fm-radius);
	padding: 24px;
	box-shadow: var(--fm-shadow-md);
	margin-bottom: 40px;
	border: 1px solid var(--fm-border-color);
}

.fm-search-form__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	align-items: end;
}

.fm-search-form__group {
	display: flex;
	flex-direction: column;
}

.fm-search-form__group--price {
	grid-column: span 1;
}

@media (min-width: 768px) {
	.fm-search-form__group--price {
		grid-column: span 2;
	}
}

.fm-search-form__label {
	font-size: 0.75rem;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--fm-text-muted);
	margin-bottom: 8px;
	letter-spacing: 0.05em;
}

.fm-search-form__input {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--fm-border-color);
	border-radius: 8px;
	font-size: 0.95rem;
	color: var(--fm-secondary);
	background-color: var(--fm-bg-light);
	transition: var(--fm-transition);
	box-sizing: border-box;
}

.fm-search-form__input:focus-visible {
	outline: none;
	border-color: var(--fm-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
	background-color: #ffffff;
}

.fm-search-form__price-range {
	display: flex;
	align-items: center;
	gap: 10px;
}

@media (max-width: 500px) {
	.fm-search-form__price-range {
		flex-direction: column;
		gap: 20px;
	}
}

.fm-search-form__actions {
	display: flex;
	gap: 12px;
	height: 44px; /* Align with inputs */
}

.fm-search-form__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 20px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: var(--fm-transition);
	border: none;
}

.fm-search-form__btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

.fm-search-form__btn--primary {
	background-color: var(--fm-btn-bg);
	color: var(--fm-btn-text);
	flex: 1;
}

.fm-search-form__btn--primary:hover {
	background-color: var(--fm-btn-hover);
	transform: translateY(-1px);
}

.fm-search-form__btn--ghost {
	background-color: transparent;
	color: var(--fm-text-muted);
	border: 1px solid transparent;
}

.fm-search-form__btn--ghost:hover {
	background-color: var(--fm-bg-light);
	color: var(--fm-secondary);
}


/* =========================================
   2. PROPERTY CARDS (.fm-prop-grid)
========================================= */

.fm-prop-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 30px;
	margin-bottom: 40px;
}

.fm-prop-card {
	background: #ffffff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--fm-shadow-sm);
	border: 1px solid var(--fm-border-color);
	transition: var(--fm-transition);
	position: relative;
	display: flex;
	flex-direction: column;
}

.fm-prop-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--fm-shadow-lg);
}

.fm-prop-card__image-wrapper {
	position: relative;
	width: 100%;
	padding-top: 66.66%; /* 3:2 Aspect Ratio */
	overflow: hidden;
	background: var(--fm-bg-light);
}

.fm-prop-card__image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.fm-prop-card:hover .fm-prop-card__image {
	transform: scale(1.05);
}

.fm-prop-card__image--placeholder {
	background: linear-gradient(45deg, #f1f5f9, #e2e8f0);
}

.fm-prop-card__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(4px);
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.fm-prop-card__body {
	padding: 20px;
	flex-grow: 1;
}

.fm-prop-card__price {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--fm-secondary);
	margin-bottom: 8px;
}

.fm-prop-card__title {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--fm-secondary);
	margin: 0 0 10px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fm-prop-card__location {
	display: flex;
	align-items: center;
	color: var(--fm-text-muted);
	font-size: 0.9rem;
}

.fm-prop-card__location svg {
	width: 16px;
	height: 16px;
	margin-right: 6px;
	stroke-width: 2.5;
}

.fm-prop-card__footer {
	display: flex;
	border-top: 1px solid var(--fm-border-color);
	padding: 15px 20px;
	gap: 20px;
	background: #ffffff;
}

.fm-prop-card__meta {
	display: flex;
	align-items: center;
	color: var(--fm-text-muted);
	font-size: 0.9rem;
	font-weight: 500;
}

.fm-prop-card__meta svg {
	width: 18px;
	height: 18px;
	margin-right: 8px;
	color: var(--fm-primary);
}

.fm-prop-grid__empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	background: var(--fm-bg-light);
	border-radius: 16px;
	color: var(--fm-text-muted);
	border: 1px dashed var(--fm-border-color);
}

/* =========================================
   3. PAGINATION
========================================= */

.fm-prop-pagination {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.fm-prop-pagination ul {
	display: flex;
	list-style: none;
	padding: 0;
	margin: 0;
	gap: 8px;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
}

.fm-prop-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	background: #ffffff;
	border: 1px solid var(--fm-border-color);
	border-radius: 8px;
	color: var(--fm-secondary);
	text-decoration: none;
	font-weight: 500;
	transition: var(--fm-transition);
}

.fm-prop-pagination .page-numbers:hover {
	border-color: var(--fm-primary);
	color: var(--fm-primary);
}

.fm-prop-pagination .page-numbers.current {
	background: var(--fm-primary);
	border-color: var(--fm-primary);
	color: #ffffff;
}

/* =========================================
   4. SINGLE PROPERTY (.fm-single)
========================================= */

.fm-single {
	background: #ffffff;
	border-radius: var(--fm-radius);
	box-shadow: var(--fm-shadow-sm);
	border: 1px solid var(--fm-border-color);
	overflow: hidden;
	margin-bottom: 40px;
}

.fm-single__gallery-wrapper {
	position: relative;
	width: 100%;
}

.fm-single__slider {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
	aspect-ratio: 16 / 9;
}

.fm-single__slider::-webkit-scrollbar {
	display: none; /* Chrome/Safari */
}

.fm-single__slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	object-fit: cover;
	scroll-snap-align: start;
}

.fm-single__slide--placeholder {
	background: linear-gradient(45deg, #f1f5f9, #e2e8f0);
}

.fm-slider-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(4px);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--fm-secondary);
	cursor: pointer;
	box-shadow: var(--fm-shadow-md);
	transition: var(--fm-transition);
	z-index: 10;
}

.fm-slider-nav:hover {
	background: #ffffff;
	transform: translateY(-50%) scale(1.1);
}

.fm-slider-prev {
	left: 20px;
}

.fm-slider-next {
	right: 20px;
}

.fm-single__content {
	padding: 30px;
}

.fm-single__header {
	margin-bottom: 20px;
}

.fm-single__badge {
	display: inline-block;
	background: var(--fm-primary);
	color: #ffffff;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 12px;
}

.fm-single__title {
	font-size: 2rem;
	font-weight: 800;
	color: var(--fm-secondary);
	margin: 0 0 10px 0;
	line-height: 1.2;
}

.fm-single__location {
	display: flex;
	align-items: center;
	color: var(--fm-text-muted);
	font-size: 1.05rem;
}

.fm-single__location svg {
	width: 18px;
	height: 18px;
	margin-right: 8px;
}

.fm-single__price-box {
	background: var(--fm-bg-light);
	padding: 20px;
	border-radius: 12px;
	border: 1px solid var(--fm-border-color);
	margin-bottom: 24px;
	display: inline-block;
}

.fm-single__price {
	font-size: 2.2rem;
	font-weight: 800;
	color: var(--fm-secondary);
	line-height: 1;
}

.fm-single__features {
	background: #ffffff;
	border: 1px solid var(--fm-border-color);
	border-radius: var(--fm-radius);
	padding: 24px;
	margin-bottom: 30px;
}

.fm-single__section-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--fm-secondary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	display: flex;
	align-items: center;
	margin: 0 0 24px 0;
}

.fm-single__section-accent {
	display: inline-block;
	width: 6px;
	height: 20px;
	background-color: var(--fm-primary);
	margin-right: 12px;
	border-radius: 4px;
}

.fm-single__meta-grid {
	/* Las columnas (grid-template-columns) y el gap ahora se inyectan dinámicamente desde el backend en PHP */
}

.fm-single__meta-item {
	display: flex;
	flex-direction: column;
}

.fm-single__meta-label {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--fm-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 8px;
}

.fm-single__meta-val {
	display: flex;
	align-items: center;
	font-size: 1.05rem;
	color: var(--fm-secondary);
}

.fm-single__meta-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background-color: var(--fm-bg-light);
	border-radius: 50%;
	margin-right: 12px;
	color: var(--fm-primary);
}

.fm-single__meta-icon svg {
	width: 16px;
	height: 16px;
}

.fm-single__description {
	color: #475569;
	line-height: 1.7;
	font-size: 1.05rem;
}


/* =========================================
   5. CONTACT FORM (.fmstudio-contact-form-wrapper)
========================================= */

.fmstudio-contact-form-wrapper {
	background: #ffffff;
	padding: 30px;
	border-radius: var(--fm-radius);
	margin-top: 40px;
	border: 1px solid var(--fm-border-color);
	box-shadow: var(--fm-shadow-sm);
}

.fm-contact-form__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (max-width: 600px) {
	.fm-contact-form__grid {
		grid-template-columns: 1fr;
	}
}

.fm-form-group {
	display: flex;
	flex-direction: column;
}

.fm-form-group--full {
	grid-column: 1 / -1;
}

.fm-form-group--captcha {
	background: var(--fm-bg-light);
	padding: 12px;
	border-radius: 8px;
	border: 1px dashed #cbd5e1;
	margin-top: 5px;
}

.fm-form-group label {
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--fm-secondary);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.fm-form-group input,
.fm-form-group textarea {
	width: 100%;
	border: 1px solid var(--fm-border-color);
	border-radius: 6px;
	box-sizing: border-box;
	background: #ffffff;
	transition: var(--fm-transition);
	font-size: 0.95rem;
}

.fm-form-group input {
	height: 44px;
	padding: 0 14px;
}

.fm-form-group textarea {
	padding: 12px 14px;
}

.fm-form-group input:focus,
.fm-form-group textarea:focus {
	outline: none;
	border-color: var(--fm-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.fm-form-response {
	margin-top: 20px;
	padding: 15px;
	display: none;
	border-radius: 8px;
	font-weight: 500;
}
.fm-form-response.success {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #bbf7d0;
}
.fm-form-response.error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.fm-submit-btn {
	background-color: var(--fm-btn-bg);
	color: var(--fm-btn-text);
	border: none;
	padding: 12px 20px;
	border-radius: var(--fm-radius);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--fm-transition);
}

.fm-submit-btn:hover {
	background-color: var(--fm-btn-hover);
	transform: translateY(-2px);
}
