/* ══════════════════════════════════════════════════════════════
   INOVA — Viviendas Promoción · Frontend Styles
   ══════════════════════════════════════════════════════════════ */

/* ---------- RESET / BASE ------------------------------------ */
.inova-viviendas *,
.inova-viviendas *::before,
.inova-viviendas *::after {
	box-sizing: border-box;
}
.inova-viviendas {
	font-family: inherit;
	max-width: 1120px;
	margin: 0 auto;
	color: #222;
}

/* ---------- LEYENDA ----------------------------------------- */
.inova-leyenda {
	display: flex;
	gap: 10px;
	margin-bottom: 18px;
	flex-wrap: wrap;
	align-items: center;
}

/* ---------- BADGES ------------------------------------------ */
.inova-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 13px;
	border-radius: 20px;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.4px;
	color: #fff;
	line-height: 1;
	white-space: nowrap;
}
.inova-badge.disponible { background: #27ae60; }
.inova-badge.reservada  { background: #e67e22; }
.inova-badge.vendida    { background: #c0392b; }

/* ---------- TABLA CONTENEDOR -------------------------------- */
.inova-tabla {
	border: 1px solid #e2e2e2;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 3px 12px rgba(0,0,0,.07);
	background: #fff;
}

/* Cabecera de tabla */
.inova-tabla-header {
	display: grid;
	grid-template-columns: 1.1fr 1fr 1fr 1.2fr 1.1fr 1.5fr;
	padding: 13px 22px;
	background: #f4f6f9;
	border-bottom: 1px solid #e2e2e2;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #667;
}

/* ---------- CABECERA DE GRUPO ------------------------------- */
.inova-grupo-header {
	display: grid;
	grid-template-columns: 1.1fr 1fr 1fr 1.2fr 1.1fr 1.5fr;
	align-items: center;
	padding: 10px 22px;
	background: #f0f4f9;
	border-bottom: 1px solid #d8e2ef;
	border-top: 2px solid #c2d0e3;
	font-size: 0.82em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #3a5068;
}
/* El nombre del grupo ocupa las primeras 5 columnas */
.inova-grupo-header > span:first-child {
	grid-column: 1 / 6;
}
/* El badge de disponibles queda en la columna 6, alineado con las filas */
.inova-grupo-badge {
	font-size: 0.85em;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 12px;
	color: #fff;
}
.inova-grupo-badge.disponible { background: #27ae60; }
.inova-grupo-badge.vendida    { background: #e74c3c; }

/* Subtipologías: indicador visual sin desplazar columnas */
.inova-tipologia-row.inova-subtipo > .inova-tipologia-header {
	border-left: 3px solid #c2d0e3;
}

/* ---------- FILA DE TIPOLOGÍA ------------------------------- */
.inova-tipologia-row {
	border-bottom: 1px solid #efefef;
}
.inova-tipologia-row:last-child {
	border-bottom: none;
}

.inova-tipologia-header {
	display: grid;
	grid-template-columns: 1.1fr 1fr 1fr 1.2fr 1.1fr 1.5fr;
	padding: 18px 22px;
	align-items: center;
	cursor: pointer;
	background: #fff;
	transition: background 0.15s;
	outline: none;
}
.inova-tipologia-header:hover,
.inova-tipologia-header:focus-visible {
	background: #f9fafb;
}
.inova-tipologia-row.abierto > .inova-tipologia-header {
	background: #f5f8ff;
	border-bottom: 1px solid #e2e2e2;
}

/* Badge de tipología */
.inova-tip-badge {
	display: inline-block;
	padding: 5px 15px;
	border-radius: 20px;
	color: #fff;
	font-weight: 700;
	font-size: 0.9em;
	letter-spacing: 0.5px;
}

/* Botón plano en tabla */
.inova-btn-plano {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	background: #f0f2f5;
	border: 1px solid #dde0e6;
	border-radius: 7px;
	font-size: 0.82em;
	color: #334;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
}
.inova-btn-plano:hover { background: #e3e7ee; }

/* Disponibilidad + flecha */
.inova-disponibilidad {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: space-between;
}
.inova-toggle-icon {
	font-size: 0.72em;
	color: #aab;
	transition: transform 0.25s;
	flex-shrink: 0;
}
.inova-tipologia-row.abierto .inova-toggle-icon {
	transform: rotate(180deg);
}

/* ---------- PANEL EXPANDIBLE ------------------------------- */
.inova-tipologia-panel {
	background: #f7f8fa;
	padding: 26px 24px;
}
.inova-tipologia-panel[hidden] {
	display: none;
}

/* ---------- MAPA ------------------------------------------- */
.inova-mapa-section {
	margin-bottom: 28px;
}
.inova-mapa-section h4,
.inova-unidades-section h4 {
	margin: 0 0 13px;
	font-size: 0.92em;
	color: #556;
	font-weight: 600;
}

/* Contenedor con scroll horizontal en móvil */
.inova-mapa-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: 10px;
	/* Sombra derecha sutil para indicar scroll */
	background:
		linear-gradient(to right, #f7f8fa, #f7f8fa),
		linear-gradient(to right, rgba(0,0,0,.06), transparent);
	background-attachment: local, scroll;
	background-size: 20px 100%, 8px 100%;
	background-repeat: no-repeat;
	background-position: right, right;
}

.inova-mapa-hint {
	display: none; /* Solo visible en móvil */
	font-size: 0.78em;
	color: #889;
	margin: 0 0 8px;
}

.inova-mapa-wrap {
	position: relative;
	display: inline-block;
	/* Anchura mínima: el mapa nunca se encoge por debajo de esto */
	min-width: 700px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #dce0e8;
	box-shadow: 0 2px 10px rgba(0,0,0,.09);
	background: #eee;
}
.inova-mapa-img {
	display: block;
	max-width: 100%;
	height: auto;
	pointer-events: none;
}

/* Marcadores sobre el mapa */
.inova-mapa-marker {
	position: absolute;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 8px;
	font-weight: 800;
	color: #fff;
	border: 2px solid rgba(255,255,255,.85);
	box-shadow: 0 2px 7px rgba(0,0,0,.28);
	transition: opacity 0.2s, filter 0.2s, transform 0.15s;
	cursor: default;
	line-height: 1;
}
.inova-mapa-marker.tip-activa {
	opacity: 1;
	filter: none;
	z-index: 2;
	width: 30px;
	height: 30px;
	font-size: 9px;
	box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
.inova-mapa-marker.tip-apagada {
	opacity: 0.18;
	filter: grayscale(1);
	z-index: 1;
}

/* Leyenda del mapa */
.inova-mapa-legend {
	display: flex;
	gap: 16px;
	margin-top: 10px;
	flex-wrap: wrap;
	font-size: 0.8em;
	color: #557;
}
.inova-ldot {
	display: inline-block;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	margin-right: 4px;
	vertical-align: middle;
	font-style: normal;
	border: 1px solid rgba(0,0,0,.12);
}

/* ---------- FILTROS ---------------------------------------- */
.inova-filtros {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
	align-items: center;
}

.inova-filtro {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1.5px solid #d0d4de;
	border-radius: 20px;
	background: #fff;
	color: #445;
	font-size: 0.84em;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.14s, border-color 0.14s, color 0.14s;
	white-space: nowrap;
}
.inova-filtro:hover {
	border-color: #1a6eb5;
	color: #1a6eb5;
	background: #f0f6ff;
}
.inova-filtro.activo {
	background: #1a6eb5;
	border-color: #1a6eb5;
	color: #fff;
}
.inova-filtro.activo:hover {
	background: #155999;
}

.inova-filtro-n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: rgba(0,0,0,.1);
	font-size: 0.85em;
	font-weight: 700;
	line-height: 1;
}
.inova-filtro.activo .inova-filtro-n {
	background: rgba(255,255,255,.25);
}

.inova-filtro-empty {
	color: #889;
	font-size: 0.9em;
	font-style: italic;
	margin: 8px 0 16px;
}

/* ---------- GRID DE UNIDADES ------------------------------- */
.inova-unidades-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 14px;
}

/* Tarjeta de unidad */
.inova-unidad-card {
	background: #fff;
	border-radius: 11px;
	padding: 16px;
	border: 2px solid #e5e7eb;
	box-shadow: 0 1px 5px rgba(0,0,0,.05);
	transition: box-shadow 0.2s, transform 0.15s;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.inova-unidad-card:hover {
	box-shadow: 0 5px 18px rgba(0,0,0,.1);
	transform: translateY(-1px);
}
.inova-unidad-card.estado-disponible { border-color: #a8dfbf; }
.inova-unidad-card.estado-reservada  { border-color: #f5cc93; }
.inova-unidad-card.estado-vendida    { border-color: #f0a09a; opacity: 0.68; }

.inova-card-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}
.inova-unidad-num {
	font-weight: 700;
	font-size: 1em;
}

.inova-card-body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 5px 10px;
	font-size: 0.84em;
	color: #445;
	flex: 1;
}
.inova-precio {
	grid-column: 1 / -1;
	font-size: 1.08em;
	font-weight: 700;
	color: #1a3a6e;
	padding-top: 7px;
	border-top: 1px solid #f0f0f0;
	margin-top: 3px;
}

/* Botón solicitar */
.inova-btn-solicitar {
	width: 100%;
	padding: 10px 8px;
	background: #1a6eb5;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 0.87em;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s;
	font-family: inherit;
	letter-spacing: 0.2px;
}
.inova-btn-solicitar:hover { background: #155999; }
.inova-btn-solicitar:focus-visible {
	outline: 3px solid #90bbf0;
	outline-offset: 2px;
}

.inova-label-vendida {
	display: block;
	text-align: center;
	color: #c0392b;
	font-size: 0.84em;
	font-weight: 700;
	padding: 6px 0;
}
.inova-empty {
	color: #889;
	font-size: 0.9em;
	font-style: italic;
}

/* ---------- MARCADOR CLICABLE ------------------------------ */
.inova-mapa-marker.tip-activa {
	cursor: pointer;
}
.inova-mapa-marker.tip-activa:hover {
	transform: translate(-50%, -50%) scale(1.2);
	z-index: 5;
	box-shadow: 0 4px 14px rgba(0,0,0,.4);
}

/* ---------- TARJETA RESALTADA (clic desde mapa) ------------ */
@keyframes inovaResaltar {
	0%   { box-shadow: 0 0 0 0   rgba(26,110,181,.6); }
	40%  { box-shadow: 0 0 0 10px rgba(26,110,181,.15); }
	100% { box-shadow: 0 0 0 4px rgba(26,110,181,.25); }
}
.inova-card-resaltada {
	border-color: #1a6eb5 !important;
	animation: inovaResaltar 0.55s ease forwards;
}

/* ---------- MODAL BASE ------------------------------------- */
.inova-modal {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.52);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	backdrop-filter: blur(2px);
}
.inova-modal[hidden] {
	display: none;
}

.inova-modal-box {
	background: #fff;
	border-radius: 14px;
	padding: 32px 28px;
	max-width: 480px;
	width: 100%;
	max-height: 92vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 24px 64px rgba(0,0,0,.28);
}

.inova-modal-plano-box {
	max-width: 720px;
}

.inova-modal-cerrar {
	position: absolute;
	top: 14px;
	right: 14px;
	background: #f0f2f5;
	border: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	font-size: 0.9em;
	cursor: pointer;
	color: #445;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}
.inova-modal-cerrar:hover { background: #e0e3e9; }

.inova-modal-box h3 {
	margin: 0 0 10px;
	font-size: 1.15em;
	color: #1a2540;
}

.inova-modal-viv-info {
	background: #eef4ff;
	border-left: 4px solid #1a6eb5;
	border-radius: 5px;
	padding: 10px 14px;
	font-size: 0.88em;
	color: #334;
	margin-bottom: 20px;
}

/* ---------- FORMULARIO MODAL ------------------------------- */
.inova-field {
	margin-bottom: 15px;
}
.inova-field label {
	display: block;
	font-weight: 600;
	font-size: 0.88em;
	color: #334;
	margin-bottom: 5px;
}
.inova-field label span { color: #c0392b; }
.inova-field input[type="text"],
.inova-field input[type="email"],
.inova-field input[type="tel"],
.inova-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid #dde0e8;
	border-radius: 8px;
	font-size: 0.94em;
	font-family: inherit;
	color: #222;
	transition: border-color 0.15s, box-shadow 0.15s;
	background: #fff;
}
.inova-field input:focus,
.inova-field textarea:focus {
	outline: none;
	border-color: #1a6eb5;
	box-shadow: 0 0 0 3px rgba(26,110,181,.12);
}
.inova-field textarea { resize: vertical; }

.inova-rgpd label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-weight: 400;
	cursor: pointer;
}
.inova-rgpd input[type="checkbox"] {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	margin-top: 2px;
	cursor: pointer;
}
.inova-rgpd a { color: #1a6eb5; }

.inova-btn-enviar {
	width: 100%;
	padding: 13px;
	background: #1a6eb5;
	color: #fff;
	border: none;
	border-radius: 9px;
	font-size: 0.97em;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s;
	font-family: inherit;
	letter-spacing: 0.2px;
	margin-top: 6px;
}
.inova-btn-enviar:hover  { background: #155999; }
.inova-btn-enviar:disabled { background: #9ab4d4; cursor: not-allowed; }

.inova-msg-resultado {
	margin-top: 14px;
	padding: 11px 14px;
	border-radius: 8px;
	font-size: 0.9em;
	font-weight: 600;
}
.inova-msg-resultado[hidden] { display: none; }
.inova-ok    { background: #d4edda; color: #155724; }
.inova-error { background: #f8d7da; color: #721c24; }

/* ---------- RESPONSIVE ------------------------------------- */
@media (max-width: 860px) {
	.inova-tabla-header {
		display: none; /* Ocultamos cabecera tabla en móvil */
	}
	.inova-tipologia-header {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto;
		gap: 8px;
		padding: 14px 16px;
	}
	.inova-tipologia-header > div:nth-child(2),
	.inova-tipologia-header > div:nth-child(3),
	.inova-tipologia-header > div:nth-child(4),
	.inova-tipologia-header > div:nth-child(5) {
		display: none;
	}
	.inova-tipologia-header > div:nth-child(6) {
		grid-column: 2;
		grid-row: 1;
	}

	/* Mapa: mostrar hint de scroll y agrandar marcadores */
	.inova-mapa-hint {
		display: block;
	}
	.inova-mapa-marker {
		width: 32px;
		height: 32px;
		font-size: 10px;
		font-weight: 900;
	}
	.inova-mapa-marker.tip-activa {
		width: 36px;
		height: 36px;
		font-size: 11px;
	}
}

@media (max-width: 600px) {
	.inova-tipologia-panel { padding: 16px; }
	.inova-unidades-grid {
		grid-template-columns: 1fr 1fr;
	}
	.inova-modal-box {
		padding: 22px 18px;
	}
}

@media (max-width: 420px) {
	.inova-unidades-grid { grid-template-columns: 1fr; }
}
