/**
 * Tarjetas y archivo de caballos — Total Child Theme
 *
 * Estilos del listado "Caballos en venta" (ver archive-caballo.php /
 * templates/caballo-card.php). Todos los selectores van prefijados con
 * "caballo-" para no colisionar con otros componentes del tema. La paleta
 * (verde profundo) reproduce la referencia del cliente.
 */

:root {
	--caballo-green: #1d4d2f;            /* verde principal: botones / paginación */
	--caballo-green-hover: #143721;
	--caballo-gold: #b8894a;             /* acento dorado (header, fuera de este listado) */
	--caballo-border: #e6e8e4;
	--caballo-bg: #f5f6f3;
	--caballo-card-bg: #ffffff;
	--caballo-radius: 12px;
	--caballo-radius-card: 10px;
	--caballo-shadow: 0 6px 18px rgba( 20, 40, 20, 0.06 );
	--caballo-shadow-hover: 0 12px 28px rgba( 20, 40, 20, 0.13 );
	--caballo-title-color: #1c3a26;      /* títulos (verde oscuro) */
	--caballo-meta-color: #7a807a;       /* metadatos / textos secundarios */
	--caballo-text-color: #333a33;
	--caballo-serif: Georgia, "Times New Roman", serif;
}

/* ---------- Sección de listado ---------- */

.caballo-archive {
	background: var( --caballo-bg );
	padding: 56px 0 72px;
}

.caballo-archive__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Cabecera / breadcrumb ---------- */

.caballo-archive__header {
	text-align: left;
	margin-bottom: 30px;
}

.caballo-archive__breadcrumb {
	font-size: 13px;
	line-height: 1;
	color: var( --caballo-meta-color );
	margin: 0 0 14px;
}

.caballo-archive__breadcrumb a {
	color: var( --caballo-meta-color );
	text-decoration: none;
	transition: color .2s ease;
}

.caballo-archive__breadcrumb a:hover {
	color: var( --caballo-green );
}

.caballo-archive__breadcrumb-sep {
	margin: 0 8px;
	opacity: .55;
}

.caballo-archive__breadcrumb-current {
	color: var( --caballo-meta-color );
}

.caballo-archive__title {
	font-family: var( --caballo-serif );
	font-size: 40px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -.3px;
	color: var( --caballo-title-color );
	margin: 0;
}

/* ---------- Barra de filtros ---------- */

/* T25: compactado moderado del bloque de filtros (menor relleno vertical,
   menor separación entre filas y entre etiqueta/selector). Alturas de
   select y botón (46px) sin tocar para conservar el área de pulsación. */
.caballo-filters {
	background: #ffffff;
	border: 1px solid var( --caballo-border );
	border-radius: var( --caballo-radius );
	padding: 18px 24px;
	margin-bottom: 24px;
}

.caballo-filters__grid {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 14px;
}

.caballo-filters__field {
	flex: 1 1 150px;
	min-width: 132px;
}

.caballo-filters__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .3px;
	color: var( --caballo-meta-color );
	margin-bottom: 6px;
}

.caballo-filters__select {
	position: relative;
}

.caballo-filters__select select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	width: 100%;
	height: 46px;
	box-sizing: border-box;
	background: #ffffff;
	border: 1px solid var( --caballo-border );
	border-radius: 8px;
	padding: 0 38px 0 14px;
	font-size: 14px;
	color: var( --caballo-text-color );
	cursor: pointer;
	transition: border-color .2s ease;
}

.caballo-filters__select select:hover,
.caballo-filters__select select:focus {
	border-color: var( --caballo-green );
	outline: none;
}

.caballo-filters__select::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid #8a8f8a;
	border-bottom: 2px solid #8a8f8a;
	transform: translateY( -65% ) rotate( 45deg );
	pointer-events: none;
}

.caballo-filters__action {
	flex: 0 0 auto;
	align-self: flex-end;
}

.caballo-filters__btn {
	height: 46px;
	box-sizing: border-box;
	background: var( --caballo-green );
	color: #ffffff;
	border: none;
	border-radius: 8px;
	padding: 0 30px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .2s ease;
}

.caballo-filters__btn:hover,
.caballo-filters__btn:focus-visible {
	background: var( --caballo-green-hover );
	color: #ffffff;
	outline: none;
}

.caballo-filters__reset {
	margin-top: 14px;
}

.caballo-filters__reset-link {
	font-size: 13px;
	color: var( --caballo-meta-color );
	text-decoration: none;
	transition: color .2s ease;
}

.caballo-filters__reset-link:hover {
	color: var( --caballo-green );
	text-decoration: underline;
}

/* ---------- Contador de resultados + orden ---------- */

.caballo-archive__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: 28px;
}

.caballo-archive__count {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var( --caballo-meta-color );
}

.caballo-archive__sort {
	display: flex;
	align-items: center;
	gap: 10px;
}

.caballo-archive__sort-label {
	font-size: 14px;
	color: var( --caballo-meta-color );
}

.caballo-archive__sort-select {
	position: relative;
}

.caballo-archive__sort-select select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	height: 40px;
	box-sizing: border-box;
	background: #ffffff;
	border: 1px solid var( --caballo-border );
	border-radius: 8px;
	padding: 0 34px 0 14px;
	font-size: 14px;
	color: var( --caballo-text-color );
	cursor: pointer;
	transition: border-color .2s ease;
}

.caballo-archive__sort-select select:hover,
.caballo-archive__sort-select select:focus {
	border-color: var( --caballo-green );
	outline: none;
}

.caballo-archive__sort-select::after {
	content: "";
	position: absolute;
	right: 14px;
	top: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid #8a8f8a;
	border-bottom: 2px solid #8a8f8a;
	transform: translateY( -65% ) rotate( 45deg );
	pointer-events: none;
}

/* ---------- Estado vacío ---------- */

.caballo-archive__empty {
	text-align: center;
	color: var( --caballo-meta-color );
	padding: 48px 0 16px;
	font-size: 16px;
}

.caballo-archive__reset-btn {
	display: inline-block;
	margin-top: 16px;
	background: var( --caballo-green );
	color: #ffffff;
	text-decoration: none;
	text-transform: uppercase;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	padding: 11px 24px;
	border-radius: 8px;
	transition: background .2s ease;
}

.caballo-archive__reset-btn:hover {
	background: var( --caballo-green-hover );
}

/* ---------- Cuadrícula ---------- */

.caballo-cards {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 28px;
}

/* ---------- Tarjeta ---------- */

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

.caballo-card:hover {
	box-shadow: var( --caballo-shadow-hover );
	transform: translateY( -3px );
}

.caballo-card__media {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #e9ece8;
}

.caballo-card__media img,
.caballo-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform .4s ease;
}

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

.caballo-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 100%;
	color: #9aa09a;
	font-size: 13px;
	letter-spacing: .5px;
	text-transform: uppercase;
}

.caballo-card__body {
	padding: 22px 24px 26px;
	display: flex;
	flex-direction: column;
	flex: 1 0 auto;
}

.caballo-card__title {
	font-family: var( --caballo-serif );
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	color: var( --caballo-title-color );
	margin: 0 0 12px;
}

.caballo-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color .2s ease;
}

.caballo-card__title a:hover {
	color: var( --caballo-green );
}

.caballo-card__meta {
	font-size: 14px;
	line-height: 1.6;
	color: var( --caballo-meta-color );
	margin: 0 0 6px;
}

.caballo-card__meta--secondary {
	margin-bottom: 0;
}

/* ---------- Rango de precio (tarjeta) ---------- */

/* T25: el bloque de precio se ancla al fondo de la tarjeta (margin-top: auto)
   para que el rango de precio y el botón "VER FICHA" queden alineados entre
   tarjetas de distinto alto. El valor gana jerarquía (18px serif verde) sin
   recuadro, manteniendo la etiqueta gris y la composición compacta. */
.caballo-card__price {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: auto 0 0;
	padding-top: 14px;
	border-top: 1px solid var( --caballo-border );
}

.caballo-card__price-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: var( --caballo-meta-color );
}

.caballo-card__price-value {
	font-family: var( --caballo-serif );
	font-size: 18px;
	font-weight: 700;
	color: var( --caballo-green );
	text-align: right;
}

/* Estado sin rango: "Consultar" en gris, no en verde. */
.caballo-card__price-value--empty {
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	font-style: italic;
	color: var( --caballo-meta-color );
}

/* T25: botón "VER FICHA" — radio 8px (coherencia con los controles de
   filtros, 8px) y margen superior 16px para un espaciado interior coherente
   con el bloque de precio. El hover permanece discreto. */
.caballo-card__btn {
	margin-top: 16px;
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var( --caballo-green );
	color: #ffffff;
	text-decoration: none;
	text-transform: uppercase;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	padding: 13px 22px;
	border-radius: 8px;
	transition: background .2s ease;
}

.caballo-card__btn:hover,
.caballo-card__btn:focus-visible {
	background: var( --caballo-green-hover );
	color: #ffffff;
}

.caballo-card__arrow {
	font-size: 15px;
	line-height: 1;
}

/* ---------- Paginación ---------- */

.caballo-pagination {
	margin-top: 48px;
	text-align: center;
}

.caballo-pagination ul {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 8px;
}

.caballo-pagination__item {
	display: inline-flex;
}

.caballo-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 6px;
	color: var( --caballo-title-color );
	text-decoration: none;
	font-size: 14px;
	transition: background .2s ease, color .2s ease;
}

.caballo-pagination .page-numbers:hover {
	background: #ffffff;
	color: var( --caballo-green );
}

.caballo-pagination .page-numbers.current {
	background: var( --caballo-green );
	color: #ffffff;
}

.caballo-pagination .page-numbers.dots {
	pointer-events: none;
	opacity: .5;
}

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

@media ( max-width: 992px ) {
	.caballo-cards {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 768px ) {
	.caballo-filters {
		padding: 20px;
	}
	.caballo-filters__action {
		flex: 1 1 100%;
	}
	.caballo-filters__btn {
		width: 100%;
	}
	.caballo-archive__title {
		font-size: 34px;
	}
}

@media ( max-width: 640px ) {
	.caballo-archive {
		padding: 40px 0 48px;
	}
	.caballo-archive__inner {
		padding: 0 18px;
	}
	.caballo-cards {
		grid-template-columns: 1fr;
	}
	.caballo-archive__title {
		font-size: 30px;
	}
	.caballo-filters__field {
		flex: 1 1 100%;
	}
	.caballo-archive__meta {
		justify-content: flex-start;
	}
	.caballo-archive__sort {
		width: 100%;
	}
	.caballo-archive__sort-select {
		flex: 1 1 auto;
	}
	.caballo-archive__sort-select select {
		width: 100%;
	}
}