/* =========================================================
   Buscador de referencia cruzada — [rga_buscador]
   Pares fondo/texto explícitos; contraste AA verificado.
   ========================================================= */

.rga-bus {
	--bus-bg:      var(--steel, #0b4f7a);
	--bus-fg:      #ffffff;
	--bus-card:    #ffffff;
	--bus-ink:     var(--ink, #1f1f1f);
	--bus-muted:   var(--muted, #595959);
	--bus-line:    var(--line, #e3e3e3);
	--bus-accent:  var(--brand, #c8102e);

	background: var(--bus-bg);
	color: var(--bus-fg);
	border-radius: var(--radius-lg, 8px);
	padding: clamp(20px, 3vw, 34px);
	margin: 0 0 32px;
	box-sizing: border-box;
}

.rga-bus__head { margin-bottom: 18px; }
.rga-bus__title {
	color: var(--bus-fg);
	font-size: clamp(20px, 2.4vw, 28px);
	font-weight: 700;
	margin: 0 0 6px;
}
.rga-bus__sub {
	color: #dbe7f0; /* sobre #0b4f7a = 9.3:1 */
	margin: 0;
	font-size: 15px;
	max-width: 62ch;
}

/* --- pestañas --- */
.rga-bus__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}
.rga-bus__tab {
	appearance: none;
	background: rgba(255, 255, 255, .12);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: var(--radius, 4px);
	padding: 9px 16px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
}
.rga-bus__tab:hover { background: rgba(255, 255, 255, .22); }
.rga-bus__tab.is-active {
	background: #ffffff;
	color: var(--bus-bg);
	border-color: #ffffff;
}

/* --- formularios --- */
.rga-bus__panel { display: none; }
.rga-bus__panel.is-active { display: block; }

.rga-bus__label {
	display: block;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
	margin-bottom: 6px;
}
.rga-bus__row { display: flex; gap: 10px; flex-wrap: wrap; }
.rga-bus__grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	margin-bottom: 12px;
}
.rga-bus__input {
	flex: 1 1 260px;
	width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #ffffff;
	border-radius: var(--radius, 4px);
	background: #ffffff;
	color: var(--bus-ink);
	font: inherit;
	font-size: 16px; /* < 16px hace zoom en iOS */
}
.rga-bus__input::placeholder { color: #767676; }
.rga-bus__input:focus-visible {
	outline: 3px solid #ffd166;
	outline-offset: 2px;
}
.rga-bus__btn {
	flex: 0 0 auto;
	min-height: 48px;
	padding: 10px 26px;
	border: 0;
	border-radius: var(--radius, 4px);
	background: var(--bus-accent);
	color: #ffffff; /* sobre #c8102e = 5.9:1 */
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.rga-bus__btn:hover { background: var(--brand-dark, #9e0c23); color: #ffffff; }
.rga-bus__btn--block { width: 100%; }
.rga-bus__hint {
	color: #dbe7f0;
	font-size: 13px;
	margin: 10px 0 0;
}

/* --- estado / resultados --- */
.rga-bus__estado {
	color: #ffffff;
	font-size: 14px;
	margin-top: 14px;
	min-height: 0;
}
.rga-bus__estado:empty { margin-top: 0; }

.rga-bus__resultados { margin-top: 16px; }
.rga-bus__resultados:empty { margin-top: 0; }

.rga-bus-res {
	background: var(--bus-card);
	color: var(--bus-ink);
	border-radius: var(--radius, 4px);
	padding: 16px;
	margin-bottom: 14px;
}
.rga-bus-res__top {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	border-bottom: 1px solid var(--bus-line);
	padding-bottom: 10px;
	margin-bottom: 12px;
}
.rga-bus-res__ref {
	font-size: 19px;
	font-weight: 800;
	color: var(--bus-ink);
}
.rga-bus-res__match {
	font-size: 13px;
	color: var(--bus-muted);
}
.rga-bus-res__badge {
	display: inline-block;
	background: var(--steel-tint, #eaf2f8);
	color: var(--steel-dark, #08405f); /* 9.7:1 sobre el tint */
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.rga-bus-specs {
	display: grid;
	gap: 8px 18px;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}
.rga-bus-specs li {
	font-size: 14px;
	color: var(--bus-ink);
	border-left: 3px solid var(--steel, #0b4f7a);
	padding-left: 9px;
	line-height: 1.35;
}
.rga-bus-specs b {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--bus-muted);
	text-transform: uppercase;
	letter-spacing: .03em;
}

.rga-bus-apps {
	font-size: 13px;
	color: var(--bus-muted);
	margin: 0 0 12px;
	line-height: 1.5;
}
.rga-bus-apps strong { color: var(--bus-ink); }

/* --- tarjetas de producto --- */
.rga-bus-prods {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.rga-bus-prod {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--bus-line);
	border-radius: var(--radius, 4px);
	padding: 10px;
	text-decoration: none;
	color: var(--bus-ink);
	background: #ffffff;
}
.rga-bus-prod:hover {
	border-color: var(--steel, #0b4f7a);
	color: var(--bus-ink);
}
.rga-bus-prod img {
	width: 100%;
	height: 130px;
	object-fit: contain;
	margin-bottom: 8px;
}
.rga-bus-prod__name {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
	margin-bottom: 6px;
}
.rga-bus-prod__meta {
	margin-top: auto;
	font-size: 13px;
	color: var(--bus-muted);
}
.rga-bus-prod__price {
	font-weight: 800;
	color: var(--bus-ink);
	font-size: 15px;
}
.rga-bus-prod__tag {
	display: inline-block;
	margin-top: 6px;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	border-radius: 3px;
	padding: 2px 7px;
}
.rga-bus-prod__tag--exacto {
	background: #d8f3e3;
	color: #0f5132; /* 8.1:1 */
}
.rga-bus-prod__tag--cerca {
	background: #fdf1d6;
	color: #6b4900; /* 7.4:1 */
}
.rga-bus-prod__tag--nostock {
	background: #f1f1f1;
	color: #5a5a5a;
}

.rga-bus-res__vacio {
	font-size: 14px;
	color: var(--bus-muted);
	background: var(--surface-alt, #f4f4f4);
	border-radius: var(--radius, 4px);
	padding: 12px 14px;
}
.rga-bus-res__vacio a { color: var(--bus-accent); font-weight: 700; }

/* --- pie de ayuda --- */
.rga-bus__ayuda {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, .25);
	color: #dbe7f0;
	font-size: 14px;
}
.rga-bus__ayuda strong { color: #ffffff; }
.rga-bus__link {
	color: #ffffff;
	font-weight: 700;
	text-decoration: underline;
	margin-left: 6px;
}
.rga-bus__link:hover { color: #ffd166; }

/* --- variante compacta (home) --- */
.rga-bus--compacto { padding: clamp(16px, 2.4vw, 24px); }
.rga-bus--compacto .rga-bus__sub { display: none; }

@media (max-width: 600px) {
	.rga-bus__row { flex-direction: column; }
	.rga-bus__btn { width: 100%; }
	.rga-bus-prods { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
	.rga-bus-prod img { height: 110px; }
}

/* El buscador en la portada va dentro de la anchura de contenido del tema */
.rga-home-sec--bus { margin: 0 0 8px; }
.rga-bus-prod__price s { color: var(--muted, #595959); font-weight: 500; margin-right: 4px; }
/* Las tarjetas de producto del buscador no heredan el subrayado de los enlaces */
.rga-bus-prod, .rga-bus-prod:hover, .rga-bus-prod * { text-decoration: none; }

/* --- formulario de consulta --- */
.rga-bus-consulta { margin-top: 14px; }
.rga-bus-consulta__intro { color: #dbe7f0; font-size: 14px; margin: 0 0 12px; }
.rga-bus__textarea { min-height: 90px; resize: vertical; }
.rga-bus-consulta__trampa { position: absolute; left: -9999px; }
.rga-bus-consulta__aviso { color: #ffffff; font-size: 14px; margin: 10px 0 0; font-weight: 600; }
.rga-bus-consulta__aviso:empty { margin: 0; }
button.rga-bus__link {
	appearance: none;
	background: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	color: #ffffff;
	text-decoration: underline;
	padding: 6px 2px;
	min-height: 40px;
}
