/**
 *    Nombre:       campos.css
 *    Descripcion:  Estilos para la seccion de campos en venta
 *    Version:      0.2.3
 *    Creado:       18-03-2026
 *    Modificado:   27-03-2026
 *    Autor:        Sebastian Toyos
 */

/* Pills de tipo */
.campos-pills {
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.campos-pill {
	padding: 8px 20px;
	border-radius: 25px;
	border: 1px solid #D1D5DB;
	background: white;
	color: #374151;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.campos-pill:hover {
	border-color: #00482A;
	color: #00482A;
}

.campos-pill.activa {
	background: #00482A;
	color: white;
	border-color: #00482A;
}

/* Barra de filtros */
.campos-filtros-barra {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 15px 0;
}

.campos-buscador {
	flex: 1;
}

.campos-filtros-barra .md-form {
	margin: 0;
	padding: 0;
}

.campos-filtros-der {
	display: flex;
	align-items: center;
	gap: 10px;
}

.campos-provincia-select {
	min-width: 180px;
	margin: 0;
}

.campos-contador {
	font-size: 0.85rem;
	color: #6B7280;
	white-space: nowrap;
}

/* Layout split view */
.campos-wrapper {
	display: flex;
	min-height: calc(100vh - 160px);
	transition: all 0.3s ease;
}

.campos-lista {
	width: 100%;
	transition: width 0.3s ease;
	overflow-y: auto;
	padding: 0 15px;
}

.campos-lista.comprimida {
	width: 380px;
	min-width: 380px;
	border-right: 1px solid #E5E7EB;
	max-height: calc(100vh - 160px);
}

.campos-detalle {
	display: none;
	flex: 1;
	overflow-y: auto;
	max-height: calc(100vh - 160px);
	padding: 20px 30px;
}

.campos-detalle.visible {
	display: block;
}

/* Grilla de cards */
.campos-grilla {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: 18px;
}

.campos-lista.comprimida .campos-grilla {
	grid-template-columns: 1fr;
	gap: 10px;
}

/* Card */
.campo-card {
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.2s ease;
	background: white;
}

.campo-card:hover {
	box-shadow: 0 4px 15px rgba(0,0,0,0.1);
	transform: translateY(-2px);
}

.campo-card.activo {
	border-color: #00482A;
	box-shadow: 0 0 0 2px #00482A;
}

.campo-card-img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	background: #FAFAF5;
}

.campos-lista.comprimida .campo-card-img,
.campos-lista.comprimida .campo-sin-foto {
	height: 120px;
}

.campo-sin-foto {
	width: 100%;
	height: 160px;
	background: #FAFAF5;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #6B7280;
	font-size: 2rem;
}

.campo-card-body {
	padding: 11px 13px;
}

/* Badges de tipo */
.campo-card-tipo {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 2px 8px;
	border-radius: 4px;
	color: white;
}

.tipo-1 { background: #2E7D32; }
.tipo-2 { background: #F9A825; color: #333; }
.tipo-3 { background: #1565C0; }
.tipo-4 { background: #4E342E; }
.tipo-5 { background: #6A1B9A; }

/* Badges de estado (solo staff) */
.campo-card-estado {
	display: inline-block;
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 3px;
	margin-left: 5px;
}

.estado-0 { background: #E0E0E0; color: #616161; }
.estado-1 { background: #C8E6C9; color: #2E7D32; }
.estado-2 { background: #FFCDD2; color: #C62828; }
.estado-3 { background: #FFF9C4; color: #F57F17; }

/* Datos de la card */
.campo-card-titulo {

	font-size: 1.05rem;
	color: #2D2D2D;
	margin: 6px 0 4px;
	line-height: 1.3;
}

.campos-lista.comprimida .campo-card-titulo {
	font-size: 0.9rem;
}

.campo-card-datos {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
}

.campo-card-hectareas {
	color: #2D2D2D;
	font-weight: 600;
}

.campo-card-precio {
	color: #00482A;
	font-weight: 700;
}

.btn-nuevo-campo {
	font-size: 0.8rem;
}

.detalle-titulo {

	font-size: 1.8rem;
	color: #00482A;
	margin-bottom: 10px;
}

.detalle-descripcion {
	color: #4B5563;
	font-size: 0.9rem;
	line-height: 1.6;
	margin-bottom: 20px;
}

/* Detalle - 3 cajas en fila */
.detalle-datos-fila {
	display: flex;
	gap: 15px;
	margin-bottom: 25px;
}

.detalle-dato-caja {
	flex: 1;
	background: #FAFAF5;
	border-radius: 8px;
	padding: 15px;
	text-align: center;
}

.detalle-dato-precio {
	background: #00482A;
	color: white;
}

.detalle-dato-precio .detalle-dato-label {
	color: rgba(255,255,255,0.7);
}

.detalle-dato-precio .detalle-dato-valor {
	color: white;
}

.detalle-dato-label {
	font-size: 0.7rem;
	color: #6B7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 5px;
}

.detalle-dato-valor {
	font-size: 1.1rem;
	font-weight: 700;
	color: #2D2D2D;
}

/* Detalle - caracteristicas en 2 columnas */
.detalle-caracteristicas-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 5px 20px;
}

/* Detalle - galeria */
.detalle-galeria-principal {
	width: 80%;
	max-height: 380px;
	object-fit: cover;
	border-radius: 10px;
	margin: 0 auto 10px;
	display: block;
}

.detalle-galeria-thumbs {
	display: flex;
	justify-content: center;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 5px;
}

.detalle-galeria-thumb {
	width: 96px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: border-color 0.2s;
}

.detalle-galeria-thumb:hover,
.detalle-galeria-thumb.activa {
	border-color: #00482A;
}

/* Detalle - secciones */
.detalle-seccion {
	margin-bottom: 25px;
}

.detalle-seccion h5 {

	color: #00482A;
	font-size: 1.1rem;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid #E5E7EB;
}

.detalle-caracteristica {
	display: flex;
	align-items: center;
	padding: 6px 0;
	font-size: 0.9rem;
}

.detalle-caracteristica i {
	width: 24px;
	color: #00482A;
	margin-right: 10px;
}

/* Mapa */
.detalle-mapa {
	border-radius: 10px;
}

.editor-titulo {

	font-size: 1.2rem;
	color: #00482A;
	margin-right: 10px;
}

.editor-seccion {
	margin-bottom: 20px;
}

.editor-seccion-titulo {
	font-size: 0.85rem;
	font-weight: 600;
	color: #00482A;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid #E5E7EB;
}

.editor-fotos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Fotos en edicion */
.foto-edicion {
	position: relative;
	display: inline-block;
}

.foto-edicion img {
	width: 100px;
	height: 75px;
	object-fit: cover;
	border-radius: 6px;
}

.foto-edicion .btn-eliminar-foto {
	position: absolute;
	top: -5px;
	right: -5px;
	background: #DC3545;
	color: white;
	border: none;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	font-size: 0.7rem;
	cursor: pointer;
	line-height: 1;
}

.foto-agregar {
	width: 100px;
	height: 75px;
	border: 2px dashed #D1D5DB;
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #9CA3AF;
	cursor: pointer;
	transition: border-color 0.2s;
}

.foto-agregar:hover {
	border-color: #00482A;
	color: #00482A;
}

/* Sin resultados - centrado en pagina */
.campos-vacio {
	text-align: center;
	padding: 120px 20px;
	color: #6B7280;
	grid-column: 1 / -1;
}

.campos-vacio i {
	font-size: 3rem;
	margin-bottom: 15px;
	color: #D1D5DB;
}

.campos-vacio h5 {
	color: #9CA3AF;
	font-weight: 400;
	font-size: 1.3rem;
	margin-bottom: 8px;
}

.campos-vacio p {
	color: #9CA3AF;
	font-size: 0.9rem;
}

/* Loading */
.campos-loading {
	text-align: center;
	padding: 40px;
	color: #6B7280;
	grid-column: 1 / -1;
}

.campos-loading .spinner-border {
	color: #00482A;
}

/* Responsive */
@media (max-width: 991px) {
	.campos-lista.comprimida {
		display: none;
	}

	.campos-detalle.visible {
		width: 100%;
		max-height: none;
		overflow-y: visible;
		padding-bottom: 80px;
	}

	.campos-grilla {
		grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	}

	.detalle-datos-fila {
		flex-direction: column;
	}

	.detalle-caracteristicas-grid {
		grid-template-columns: 1fr;
	}

	.campos-filtros-barra {
		flex-direction: column;
		align-items: stretch;
	}

	.campos-filtros-der {
		flex-wrap: wrap;
	}

	.campos-provincia-select {
		min-width: 100%;
	}
}

