:root {
	--rg-accent: var(--color-accent, #ec2725);
	--rg-accent-ink: var(--color-accent-ink, #ffffff);
	--rg-ink: var(--color-ink, #1d1f21);
	--rg-muted: var(--color-muted, #5d6268);
	--rg-ground: var(--color-bg, #f4f4f2);
	--rg-surface: var(--color-surface, #ffffff);
	--rg-line: var(--color-line, #d9dadb);
	--rg-dark: var(--color-dark, #1a1b1d);
	--rg-ok: #1f7a4a;
	--rg-bad: #b3261e;
	--rg-radius: var(--radius-sm, 4px);
	--rg-font-display: var(--font-display, "Barlow Condensed", "Arial Narrow", sans-serif);
}

/* Botón del header */

.rg-toggle {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	padding: .45rem .9rem .45rem .7rem;
	border: 1px solid currentColor;
	border-radius: var(--rg-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	max-width: 14rem;
	min-width: 0;
	flex-shrink: 1;
	transition: border-color .2s, background-color .2s;
}
.rg-toggle:hover { border-color: var(--rg-accent); }
.rg-toggle.has-vehicle { border-color: var(--rg-accent); }
.rg-toggle__icon { width: 1.4rem; height: 1.4rem; flex: none; color: var(--rg-accent); }
.rg-toggle__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.rg-toggle__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.rg-toggle__vehicle { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Selector */

.rg-selector {
	display: grid;
	gap: .6rem;
	align-items: end;
	position: relative;
}
.rg-selector--inline { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.rg-selector--stacked { grid-template-columns: 1fr; }
.rg-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.rg-field.is-hidden { display: none; }
.rg-selector--inline:has(.rg-field.is-hidden) { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.rg-field__label {
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	font-weight: 600;
	opacity: .8;
}
.rg-field select {
	appearance: none;
	width: 100%;
	height: 3rem;
	padding: 0 2.2rem 0 .9rem;
	border: 1px solid var(--rg-line);
	border-radius: var(--rg-radius);
	background: var(--rg-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231d1f21' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right .9rem center / .7rem;
	color: var(--rg-ink);
	font: inherit;
	font-size: 1rem;
	cursor: pointer;
	transition: border-color .2s, opacity .2s;
}
.rg-field select:focus-visible { outline: 2px solid var(--rg-accent); outline-offset: 1px; border-color: var(--rg-accent); }
.rg-field select:disabled { opacity: .45; cursor: not-allowed; }
.rg-submit {
	height: 3rem;
	padding: 0 1.6rem;
	border: 0;
	border-radius: var(--rg-radius);
	background: var(--rg-accent);
	color: var(--rg-accent-ink);
	font-family: var(--rg-font-display);
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
	transition: transform .15s, opacity .2s, background-color .2s;
}
.rg-submit:hover:not(:disabled) { background: color-mix(in srgb, var(--rg-accent) 86%, #000); }
.rg-submit:active:not(:disabled) { transform: translateY(1px); }
.rg-submit:disabled { opacity: .4; cursor: not-allowed; }
.rg-selector.is-loading .rg-submit { opacity: .6; }
.rg-selector__msg { grid-column: 1 / -1; margin: 0; font-size: .85rem; color: var(--rg-bad); }
.rg-selector__msg:empty { display: none; }

@media (max-width: 860px) {
	.rg-selector--inline,
	.rg-selector--inline:has(.rg-field.is-hidden) { grid-template-columns: 1fr 1fr; }
	.rg-selector--inline .rg-submit { grid-column: 1 / -1; }
}

/* Modal */

.rg-modal {
	width: min(32rem, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	padding: 0;
	border: 0;
	border-radius: var(--rg-radius);
	background: var(--rg-surface);
	color: var(--rg-ink);
	box-shadow: 0 24px 60px rgba(14, 15, 16, .35);
}
.rg-modal::backdrop { background: rgba(14, 15, 16, .6); backdrop-filter: blur(2px); }
.rg-modal[open] { animation: rg-in .22s ease-out; }
@keyframes rg-in { from { opacity: 0; transform: translateY(10px); } }
.rg-modal__inner { padding: 1.5rem; }
.rg-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.rg-modal__head h2 { margin: 0; font-family: var(--rg-font-display); font-size: 1.8rem; text-transform: uppercase; line-height: 1; }
.rg-modal__close { width: 2.4rem; height: 2.4rem; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: inherit; }
.rg-modal__add { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rg-line); }
.rg-modal__add h3 { margin: 0 0 .8rem; font-size: 1rem; }
.rg-modal__login { margin: 1rem 0 0; font-size: .88rem; color: var(--rg-muted); }
.rg-modal__login a { color: var(--rg-ink); font-weight: 600; }

/* Lista del garage */

.rg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.rg-list__item { display: flex; align-items: stretch; border: 1px solid var(--rg-line); border-radius: var(--rg-radius); }
.rg-list__item.is-active { border-color: var(--rg-accent); box-shadow: inset 3px 0 0 var(--rg-accent); }
.rg-list__pick { flex: 1; display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rg-list__radio { width: 1rem; height: 1rem; border: 2px solid var(--rg-line); border-radius: 50%; flex: none; }
.is-active .rg-list__radio { border-color: var(--rg-accent); background: radial-gradient(var(--rg-accent) 45%, transparent 50%); }
.rg-list__name { font-weight: 600; }
.rg-list__remove { width: 2.8rem; border: 0; border-left: 1px solid var(--rg-line); background: none; font-size: 1.3rem; color: var(--rg-muted); cursor: pointer; }
.rg-list__remove:hover { color: var(--rg-bad); }
.rg-list__clear { margin-top: .6rem; padding: 0; border: 0; background: none; font: inherit; font-size: .85rem; color: var(--rg-muted); text-decoration: underline; cursor: pointer; }
.rg-list__empty { margin: 0; color: var(--rg-muted); }

/* Avisos en la tienda */

.rg-notice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1.5rem;
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border-radius: var(--rg-radius);
	background: var(--rg-dark);
	color: #f1f1ef;
}
.rg-notice p { margin: 0; }
.rg-notice--filtered { justify-content: flex-start; }
.rg-notice--filtered .rg-notice__actions { margin-left: auto; }
.rg-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .35rem .3rem .85rem; border: 1px solid var(--rg-accent); border-radius: var(--rg-radius); background: color-mix(in srgb, var(--rg-accent) 14%, transparent); }
.rg-chip strong { font-family: var(--rg-font-display); font-size: 1.3rem; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.rg-chip__remove { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 0; border-radius: var(--rg-radius); background: transparent; color: inherit; font-size: 1.35rem; line-height: 1; text-decoration: none; cursor: pointer; transition: background-color .2s; }
.rg-chip__remove:hover { background: var(--rg-accent); color: #fff; }
.rg-notice--empty { flex-direction: column; align-items: stretch; background: var(--rg-surface); color: var(--rg-ink); border: 1px solid var(--rg-line); }
.rg-notice--all { background: var(--rg-surface); color: var(--rg-ink); border: 1px solid var(--rg-line); }
.rg-notice__actions { display: flex; gap: 1.25rem; }
.rg-notice__link { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rg-notice--filtered .rg-notice__link:hover { color: var(--rg-accent); }

/* Badges y compatibilidad */

.rg-badge {
	display: inline-block;
	margin: .35rem 0;
	padding: .2rem .5rem;
	border-radius: var(--rg-radius);
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.rg-badge--fits { background: color-mix(in srgb, var(--rg-ok) 14%, transparent); color: var(--rg-ok); }
.rg-badge--universal { background: color-mix(in srgb, var(--rg-ink) 9%, transparent); color: var(--rg-ink); }
.rg-badge--nofit { background: color-mix(in srgb, var(--rg-bad) 12%, transparent); color: var(--rg-bad); }

.rg-fit { margin: 1.25rem 0; padding: 1rem 1.15rem; border: 1px solid var(--rg-line); border-left-width: 4px; border-radius: var(--rg-radius); }
.rg-fit p { margin: 0 0 .5rem; }
.rg-fit p:last-child { margin-bottom: 0; }
.rg-fit__title { font-weight: 700; font-size: 1.05rem; }
.rg-fit--fits { border-left-color: var(--rg-ok); }
.rg-fit--fits .rg-fit__title { color: var(--rg-ok); }
.rg-fit--nofit { border-left-color: var(--rg-bad); }
.rg-fit--nofit .rg-fit__title { color: var(--rg-bad); }
.rg-fit--specific, .rg-fit--universal { border-left-color: var(--rg-accent); }
.rg-fit__action { display: inline-block; margin: .35rem .75rem 0 0; padding: .55rem 1rem; border: 1px solid var(--rg-ink); border-radius: var(--rg-radius); background: var(--rg-ink); color: var(--rg-surface); font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; }
.rg-fit__action--ghost { background: transparent; color: var(--rg-ink); }

.rg-fit-table { width: 100%; border-collapse: collapse; }
.rg-fit-table th, .rg-fit-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--rg-line); text-align: left; }
.rg-fit-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rg-muted); }

/* Vitrina */

.rg-vitrina { margin: 0; }
.rg-vitrina__stage { position: relative; isolation: isolate; }
.rg-vitrina__img { display: block; width: 100%; height: auto; border-radius: var(--rg-radius); user-select: none; }

.rg-hotspot {
	position: absolute;
	left: var(--x);
	top: var(--y);
	z-index: 2;
	width: 2.75rem;
	height: 2.75rem;
	margin: -1.375rem 0 0 -1.375rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}
.rg-hotspot__dot {
	position: absolute;
	inset: .7rem;
	border-radius: 50%;
	background: var(--rg-accent);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 4px 12px rgba(0, 0, 0, .45);
	transition: transform .2s ease-out;
}
.rg-hotspot__dot::after {
	content: "";
	position: absolute;
	inset: -.7rem;
	border: 2px solid var(--rg-accent);
	border-radius: 50%;
	opacity: 0;
	animation: rg-pulse 2.4s ease-out infinite;
}
.rg-hotspot:nth-of-type(2n) .rg-hotspot__dot::after { animation-delay: .8s; }
.rg-hotspot:nth-of-type(3n) .rg-hotspot__dot::after { animation-delay: 1.6s; }
@keyframes rg-pulse {
	0% { transform: scale(.5); opacity: .9; }
	70%, 100% { transform: scale(1.4); opacity: 0; }
}
.rg-hotspot:hover .rg-hotspot__dot,
.rg-hotspot:focus-visible .rg-hotspot__dot,
.rg-hotspot.is-active .rg-hotspot__dot { transform: scale(1.3); }
.rg-hotspot.is-active .rg-hotspot__dot::after { animation: none; }
.rg-hotspot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.rg-card {
	position: absolute;
	left: var(--x);
	top: var(--y);
	z-index: 3;
	display: flex;
	gap: .9rem;
	width: min(22rem, 80vw);
	padding: .9rem;
	border-radius: var(--rg-radius);
	background: var(--rg-surface);
	color: var(--rg-ink);
	box-shadow: 0 18px 40px rgba(14, 15, 16, .4);
	transform: translate(1.6rem, -1.6rem);
	opacity: 0;
	transition: opacity .18s ease-out, transform .18s ease-out;
	pointer-events: auto;
}
.rg-card.is-visible { opacity: 1; transform: translate(1.9rem, -1.6rem); }
.rg-card.is-left { transform: translate(calc(-100% - 1.6rem), -1.6rem); }
.rg-card.is-left.is-visible { transform: translate(calc(-100% - 1.9rem), -1.6rem); }
.rg-card.is-up { margin-top: -6rem; }
.rg-card__img { width: 6rem; height: 6rem; object-fit: cover; border-radius: var(--rg-radius); background: var(--rg-ground); flex: none; }
.rg-card__body { min-width: 0; }
.rg-card__body p { margin: 0; }
.rg-card__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rg-accent); font-weight: 700; }
.rg-card__name { font-family: var(--rg-font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.1; text-transform: uppercase; margin: .15rem 0 .3rem !important; }
.rg-card__excerpt { font-size: .82rem; line-height: 1.4; color: var(--rg-muted); }
.rg-card__excerpt:empty { display: none; }
.rg-card__meta { margin-top: .45rem !important; display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; }
.rg-card__price { font-weight: 700; }
.rg-card__fit { font-size: .75rem; font-weight: 600; }
.rg-card__fit--fits { color: var(--rg-ok); }
.rg-card__fit--nofit { color: var(--rg-bad); }
.rg-card__link { display: inline-block; margin-top: .5rem; font-weight: 700; font-size: .85rem; color: var(--rg-ink); text-decoration: underline; text-decoration-color: var(--rg-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.rg-vitrina__list ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; }
.rg-vitrina__list a { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .8rem .45rem .45rem; border: 1px solid var(--rg-line); border-radius: 999px; color: inherit; text-decoration: none; font-size: .88rem; font-weight: 600; transition: border-color .2s, background-color .2s; }
.rg-vitrina__list a:hover, .rg-vitrina__list a.is-active { border-color: var(--rg-accent); }
.rg-vitrina__num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--rg-accent); color: var(--rg-accent-ink); font-size: .75rem; }

@media (max-width: 640px) {
	.rg-card,
	.rg-card.is-left,
	.rg-card.is-visible,
	.rg-card.is-left.is-visible {
		position: absolute;
		left: .5rem;
		right: .5rem;
		top: auto;
		bottom: .5rem;
		width: auto;
		margin: 0;
		transform: none;
	}
	.rg-hotspot { width: 2.4rem; height: 2.4rem; margin: -1.2rem 0 0 -1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
	.rg-hotspot__dot::after { animation: none; }
	.rg-modal[open] { animation: none; }
	.rg-card, .rg-hotspot__dot { transition: none; }
}

.rg-saved { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-bottom: .9rem; border-bottom: 1px solid var(--rg-line); }
.rg-saved__label { width: 100%; margin: 0 0 .1rem; font-weight: 600; }
.rg-saved__pick { padding: .55rem .9rem; border: 1px solid var(--rg-ink); border-radius: var(--rg-radius); background: transparent; color: var(--rg-ink); font: inherit; font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.rg-saved__pick:hover { background: var(--rg-accent); border-color: var(--rg-accent); color: #fff; }
