/* Ring Francés México - Resultados (front)
 * Hereda variables globales de Elementor cuando existen y cae a defaults del sitio (amarillo / oscuro).
 */

.rfm-frontend {
	--rfm-color-accent: var(--e-global-color-accent, var(--e-global-color-primary, #f5c518));
	--rfm-color-accent-strong: var(--e-global-color-primary, #f5c518);
	--rfm-color-text: var(--e-global-color-text, #1a1a1a);
	--rfm-color-bg: var(--e-global-color-secondary, #1a1a1a);
	--rfm-color-card: #ffffff;
	--rfm-color-border: rgba(0,0,0,0.08);
	--rfm-color-muted: #6b6b6b;
	--rfm-radius: 8px;
	--rfm-shadow: 0 2px 12px rgba(0,0,0,0.06);
	--rfm-font: var(--e-global-typography-text-font-family, inherit);
	font-family: var(--rfm-font);
	color: var(--rfm-color-text);
	width: 100%;
}

.rfm-frontend * { box-sizing: border-box; }

.rfm-frontend-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	background: var(--rfm-color-bg);
	color: #fff;
	padding: 14px 16px;
	border-radius: var(--rfm-radius);
	margin-bottom: 22px;
	align-items: center;
	box-shadow: var(--rfm-shadow);
}
.rfm-frontend-filters select,
.rfm-frontend-filters input[type="search"] {
	padding: 8px 12px;
	border-radius: 4px;
	border: 1px solid rgba(255,255,255,0.15);
	background: rgba(255,255,255,0.06);
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	min-width: 160px;
}
.rfm-frontend-filters input[type="search"]::placeholder { color: rgba(255,255,255,0.6); }
.rfm-frontend-filters select option { color: #1a1a1a; }
.rfm-btn {
	background: var(--rfm-color-accent-strong);
	color: #1a1a1a;
	border: none;
	padding: 9px 18px;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	border-radius: 4px;
	cursor: pointer;
	font-family: inherit;
	transition: transform .15s ease, box-shadow .15s ease;
}
.rfm-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

.rfm-comp-group {
	background: var(--rfm-color-card);
	border-radius: var(--rfm-radius);
	box-shadow: var(--rfm-shadow);
	margin-bottom: 28px;
	overflow: hidden;
}
.rfm-comp-header {
	background: var(--rfm-color-bg);
	color: #fff;
	padding: 14px 18px;
	border-left: 6px solid var(--rfm-color-accent-strong);
}
.rfm-comp-header h3 { margin: 0; font-size: 18px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: #fff; }
.rfm-comp-header .rfm-meta { color: rgba(255,255,255,0.7); font-weight: 400; font-size: 13px; }

.rfm-cat-block { padding: 10px 18px 22px; }
.rfm-cat-title {
	margin: 16px 0 10px;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	background: #f8f8f6;
	border-left: 5px solid var(--rfm-color-accent-strong);
	color: #1a1a1a;
	border-radius: 4px;
}
.rfm-cat-csau .rfm-cat-title { border-left-color: #6c757d; }
.rfm-cat-brevet .rfm-cat-title { border-left-color: #17a2b8; }
.rfm-cat-ring_i .rfm-cat-title { border-left-color: #ffc107; }
.rfm-cat-ring_ii .rfm-cat-title { border-left-color: #fd7e14; }
.rfm-cat-ring_iii .rfm-cat-title { border-left-color: #dc3545; }

.rfm-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	font-size: 14px;
	margin: 0;
}
.rfm-table thead th {
	background: #1a1a1a;
	color: var(--rfm-color-accent-strong);
	font-weight: 700;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.6px;
	padding: 10px 12px;
	text-align: left;
	border: 0;
}
.rfm-table tbody td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--rfm-color-border);
	vertical-align: middle;
}
.rfm-table tbody tr:nth-child(even) { background: #fafafa; }
.rfm-table tbody tr:hover { background: #fff8d6; }
.rfm-table tbody tr.rfm-first { background: linear-gradient(90deg, #fff5b3, #ffffff); border-left: 4px solid var(--rfm-color-accent-strong); }
.rfm-table tbody tr.rfm-first td:first-child { font-weight: 800; color: #b8860b; font-size: 18px; }
.rfm-table-rank tbody tr.rfm-first td:nth-child(2) { color: #1a1a1a; font-weight: 800; }

.rfm-pill {
	display: inline-block;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	border-radius: 999px;
	background: #efefef;
	color: #333;
	white-space: nowrap;
}
.rfm-pill-warn { background: #ffe8a3; color: #6b4d00; }
.rfm-pill-preselectivo { background: #fff3cd; color: #7a5b00; }
.rfm-pill-final_regional { background: #ffe1a8; color: #6b3d00; }
.rfm-pill-selectivo { background: #d8e8ff; color: #07399a; }
.rfm-pill-final_nacional { background: #ffd6d6; color: #8a0a0a; }
.rfm-pill-internacional { background: #e0d6ff; color: #4a0e9a; }
.rfm-pill-campeonato { background: #1a1a1a; color: var(--rfm-color-accent-strong); }
.rfm-pill-copa { background: #c0c0c0; color: #1a1a1a; }

.rfm-empty {
	text-align: center;
	padding: 24px;
	color: var(--rfm-color-muted);
	font-style: italic;
}

.rfm-meta { color: var(--rfm-color-muted); font-weight: 400; font-size: 12px; }

.rfm-section-title {
	margin-top: 30px;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 0.4px;
	border-bottom: 3px solid var(--rfm-color-accent-strong);
	padding-bottom: 8px;
	color: var(--rfm-color-text);
}
.rfm-help { color: var(--rfm-color-muted); font-size: 13px; margin-bottom: 16px; }

/* Buscador */
.rfm-buscar-wrap { background: var(--rfm-color-bg); padding: 22px; border-radius: var(--rfm-radius); margin-bottom: 22px; }
.rfm-buscar-label { display: block; font-weight: 700; color: var(--rfm-color-accent-strong); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; margin-bottom: 10px; }
.rfm-buscar-input-wrap { position: relative; }
.rfm-buscar-input {
	width: 100%;
	padding: 14px 18px;
	font-size: 16px;
	border: 2px solid var(--rfm-color-accent-strong);
	border-radius: 4px;
	font-family: inherit;
	background: #fff;
	color: #1a1a1a;
}
.rfm-suggest-public {
	position: absolute;
	top: calc(100% + 4px);
	left: 0; right: 0;
	background: #fff;
	border: 1px solid var(--rfm-color-border);
	border-radius: 4px;
	max-height: 320px;
	overflow-y: auto;
	margin: 0; padding: 0;
	list-style: none;
	z-index: 50;
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
	display: none;
}
.rfm-suggest-public li { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f3f3f3; font-size: 14px; }
.rfm-suggest-public li:hover, .rfm-suggest-public li.active { background: #fff5b3; }

/* Detalle de perro */
.rfm-perro-card { background: #fff; border-radius: var(--rfm-radius); box-shadow: var(--rfm-shadow); overflow: hidden; }
.rfm-perro-header { background: var(--rfm-color-bg); color: #fff; padding: 22px 24px; border-left: 6px solid var(--rfm-color-accent-strong); }
.rfm-perro-header h2 { color: #fff; margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: 0.5px; }
.rfm-perro-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: rgba(255,255,255,0.85); }
.rfm-perro-meta strong { color: var(--rfm-color-accent-strong); font-weight: 700; }

.rfm-perro-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 18px 24px; background: #fafaf6; border-bottom: 1px solid var(--rfm-color-border); }
.rfm-stat { display: flex; flex-direction: column; align-items: center; padding: 12px; background: #fff; border-radius: 4px; border-left: 4px solid var(--rfm-color-accent-strong); }
.rfm-stat-num { font-size: 26px; font-weight: 800; color: #1a1a1a; }
.rfm-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--rfm-color-muted); margin-top: 4px; }

/* Línea de jueces / hombres de ataque en encabezado de competencia */
.rfm-comp-staff {
	display: flex; flex-wrap: wrap; gap: 6px 22px;
	margin-top: 8px; font-size: 13px; color: rgba(255,255,255,0.85);
}
.rfm-comp-staff strong { color: var(--rfm-color-accent-strong); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.6px; }
.rfm-comp-staff a.rfm-staff-link {
	color: #fff; text-decoration: underline;
	text-decoration-color: rgba(245,197,24,0.5);
	text-underline-offset: 3px;
	transition: color .15s ease;
}
.rfm-comp-staff a.rfm-staff-link:hover { color: var(--rfm-color-accent-strong); }

/* Modal de detalle de staff */
.rfm-modal { position: fixed; inset: 0; z-index: 99999; }
.rfm-modal[hidden] { display: none; }
.rfm-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.rfm-modal-dialog {
	position: relative; max-width: 900px; width: calc(100% - 32px);
	margin: 5vh auto; max-height: 90vh; overflow-y: auto;
	background: #fff; border-radius: var(--rfm-radius, 8px);
	box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.rfm-modal-close {
	position: absolute; top: 12px; right: 12px; z-index: 5;
	width: 36px; height: 36px; border: 0; border-radius: 50%;
	background: var(--rfm-color-accent-strong, #f5c518); color: #1a1a1a;
	font-size: 22px; line-height: 1; cursor: pointer; font-weight: 700;
}
.rfm-modal-close:hover { transform: scale(1.06); }
body.rfm-modal-open { overflow: hidden; }
.rfm-staff-card .rfm-perro-header { padding-right: 60px; }

.rfm-public-wrap { position: relative; transition: opacity .15s ease; }
.rfm-public-wrap.rfm-loading { opacity: .55; pointer-events: none; }
.rfm-public-wrap.rfm-loading::after {
	content: ''; position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
	width: 32px; height: 32px; border: 3px solid rgba(0,0,0,0.1);
	border-top-color: var(--rfm-color-accent-strong);
	border-radius: 50%; animation: rfm-spin 0.7s linear infinite;
	z-index: 10;
}
@keyframes rfm-spin { to { transform: translateX(-50%) rotate(360deg); } }

/* Encabezados ordenables (directorio de jueces / hombres de ataque) */
.rfm-table-sortable thead th {
	cursor: pointer;
	user-select: none;
	position: relative;
	padding-right: 28px;
}
.rfm-table-sortable thead th::after {
	content: "⇅";
	position: absolute;
	right: 10px;
	opacity: .4;
	font-size: 11px;
}
.rfm-table-sortable thead th[data-sort-dir="asc"]::after { content: "▲"; opacity: 1; }
.rfm-table-sortable thead th[data-sort-dir="desc"]::after { content: "▼"; opacity: 1; }
.rfm-table-sortable thead th:hover { background: #2a2a2a; }
.rfm-table a.rfm-staff-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(245,197,24,0.6); text-underline-offset: 3px; }
.rfm-table a.rfm-staff-link:hover { color: #b8860b; }

/* Contenedor con scroll horizontal: respaldo para tablets / tablas anchas */
.rfm-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
}
.rfm-table-wrap .rfm-table { min-width: 560px; }

@media (max-width: 720px) {
	.rfm-frontend-filters { padding: 10px; }
	.rfm-frontend-filters select, .rfm-frontend-filters input[type="search"] { min-width: 0; flex: 1 1 130px; }
	.rfm-table { font-size: 13px; }
	.rfm-table thead th, .rfm-table tbody td { padding: 8px 6px; }
	.rfm-comp-header h3 { font-size: 16px; }
	.rfm-perro-header h2 { font-size: 22px; }
	.rfm-comp-staff { flex-direction: column; gap: 4px; }
}

/* Móvil: cada fila se convierte en tarjeta con pares etiqueta-valor */
@media (max-width: 640px) {
	.rfm-table-wrap { overflow-x: visible; }
	.rfm-table-wrap .rfm-table { min-width: 0; }

	.rfm-frontend .rfm-table thead { display: none; }
	.rfm-frontend .rfm-table,
	.rfm-frontend .rfm-table tbody,
	.rfm-frontend .rfm-table tr,
	.rfm-frontend .rfm-table td { display: block; width: 100%; }

	.rfm-frontend .rfm-table tbody tr {
		background: #fff;
		border: 1px solid var(--rfm-color-border);
		border-left: 4px solid var(--rfm-color-accent-strong);
		border-radius: 8px;
		margin-bottom: 12px;
		padding: 4px 0;
		box-shadow: 0 1px 6px rgba(0,0,0,0.05);
	}
	.rfm-frontend .rfm-table tbody tr:nth-child(even) { background: #fff; }
	.rfm-frontend .rfm-table tbody tr:hover { background: #fff; }
	.rfm-frontend .rfm-table tbody tr.rfm-first {
		background: linear-gradient(180deg, #fff5b3, #ffffff);
		border-left-color: #b8860b;
	}
	.rfm-frontend .rfm-table tbody tr.rfm-first td:first-child { font-size: 15px; }

	.rfm-frontend .rfm-table tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 14px;
		padding: 8px 14px;
		border-bottom: 1px dashed rgba(0,0,0,0.07);
		text-align: right;
	}
	.rfm-frontend .rfm-table tbody td:last-child { border-bottom: 0; }

	.rfm-frontend .rfm-table tbody td[data-label]::before {
		content: attr(data-label);
		font-weight: 700;
		font-size: 10px;
		letter-spacing: 0.6px;
		text-transform: uppercase;
		color: var(--rfm-color-muted);
		text-align: left;
		flex: 0 0 auto;
	}

	/* Celdas vacías o de mensaje: sin etiqueta, texto centrado */
	.rfm-frontend .rfm-table tbody td.rfm-empty,
	.rfm-frontend .rfm-table tbody td[colspan] {
		justify-content: center;
		text-align: center;
	}
	.rfm-frontend .rfm-table tbody td.rfm-empty::before { content: none; }

	/* Modal a pantalla casi completa en móvil */
	.rfm-modal-dialog { width: calc(100% - 16px); margin: 8px auto; max-height: calc(100vh - 16px); }
	.rfm-perro-stats { grid-template-columns: repeat(2, 1fr); padding: 12px; }
}
