/*
 * base.css — reset, tipografía base y utilidades compartidas.
 */

/* ---------- Tipografías corporativas (D-03 del PLAN) ----------
 *
 * «Mapfre Display» (titulares) y «Mapfre Text» (cuerpo), las mismas del Figma.
 * Self-hosted en assets/fonts para no mandar la IP del visitante a terceros.
 * Sólo los pesos que usa el tema: 400, 500 y 700, sin cursivas.
 */

@font-face {
	font-family: "Mapfre Display";
	src: url("../fonts/MapfreDisplay-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Mapfre Display";
	src: url("../fonts/MapfreDisplay-Medium.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Mapfre Display";
	src: url("../fonts/MapfreDisplay-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Mapfre Text";
	src: url("../fonts/MapfreText-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Mapfre Text";
	src: url("../fonts/MapfreText-Medium.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Mapfre Text";
	src: url("../fonts/MapfreText-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	background: var(--mp-white);
	color: var(--mp-ink);
	font-family: var(--mp-font);
	font-size: var(--mp-fs-body);
	font-weight: var(--mp-weight-regular);
	line-height: var(--mp-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
ul,
ol {
	margin: 0;
}

ul,
ol {
	padding: 0;
	list-style: none;
}

img,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

button,
input,
textarea,
select {
	font: inherit;
	color: inherit;
}

address {
	font-style: normal;
}

/* ---------- Foco visible ---------- */

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: var(--mp-focus-ring);
	outline-offset: var(--mp-focus-offset);
}

/* ---------- Utilidades ---------- */

/* El max-width incluye los gutters para que el ancho útil coincida con el del
   diseño de Figma. */
.mp-container {
	width: 100%;
	max-width: calc(var(--mp-container) + var(--mp-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--mp-gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mp-skip-link {
	position: absolute;
	top: -100px;
	left: var(--mp-gutter);
	z-index: 100;
	padding: 12px 20px;
	background: var(--mp-primary);
	color: var(--mp-white);
	font-weight: var(--mp-weight-bold);
	text-decoration: none;
	border-radius: 0 0 var(--mp-radius-sm) var(--mp-radius-sm);
}

.mp-skip-link:focus {
	top: 0;
}

/* ---------- Botones (Figma 115:1960 / 115:1975 / 115:1977) ----------
 * Los tres botones del diseño miden 48px de alto, son píldoras completas y
 * llevan el texto a 18px (token `b`). El ancho lo marca el contenido: en Figma
 * van de 169px («Ver catálogo») a 250px («Solicita información»), que es
 * justo el texto más 30px de aire a cada lado.
 */

.mp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	/* 30px de aire en Figma, contando ya los 2px del borde: 28 + 2. */
	padding: 11px 28px;
	border: 2px solid transparent;
	border-radius: var(--mp-radius-pill);
	font-family: var(--mp-font-text);
	font-size: var(--mp-fs-body);
	font-weight: var(--mp-weight-bold);
	line-height: var(--mp-lh-heading);
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease,
		border-color 0.18s ease, transform 0.18s ease;
}

.mp-btn:hover {
	transform: translateY(-1px);
}

.mp-btn--primary {
	background: var(--mp-red);
	border-color: var(--mp-red);
	color: var(--mp-white);
}

.mp-btn--primary:hover {
	background: var(--mp-red-hover);
	border-color: var(--mp-red-hover);
}

/* Fondo blanco con borde y texto rojos: el «Cómo funciona» del hero. */
.mp-btn--white {
	background: var(--mp-white);
	border-color: var(--mp-red);
	color: var(--mp-red);
}

.mp-btn--white:hover {
	background: var(--mp-red);
	color: var(--mp-white);
}
