/*
Theme Name: Recaseis
Theme URI: https://www.recaseis.com/
Description: Tema a medida para Recaseis, recambios del automóvil en Sevilla.
Version: 1.1.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: recaseis
*/

/* ---------- Fuentes (auto-alojadas) ---------- */
@font-face {
	font-family: "Archivo";
	src: url("assets/fonts/archivo.woff2") format("woff2");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Archivo";
	src: url("assets/fonts/archivo-italic.woff2") format("woff2");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-style: italic;
	font-display: swap;
}

/* ---------- Tokens ----------
 * Web de recambios convencional, en blanco (PRODUCT.md). Estructura de referencia: recambiosvallecas.com.
 * Un acento: el azul de la fachada, solo en botones, enlaces y detalles. Esquinas rectas.
 */
:root {
	--bg: #ffffff;
	--soft: #f4f6f8;
	--ink: #16191d;
	--muted: #4f5761;
	--line: #e1e5ea;
	--field: #8a929c;
	--accent: #1f3fd1;
	--accent-hover: #1631a8;
	--accent-soft: #eef1fd;
	--accent-ink: #ffffff;
	--ok: #1d7a45;
	--error: #b3261e;
	--wa: #1f9d55;

	--wrap: 1280px;
	--gutter: clamp(16px, 4vw, 40px);
	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
	color-scheme: light; /* la web va siempre en claro, también con el sistema en modo oscuro */
	accent-color: var(--accent);
	scrollbar-color: #a3aab3 var(--soft);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
::selection { background: var(--accent); color: var(--accent-ink); }
input, textarea { caret-color: var(--accent); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
figure { margin: 0; }
address { font-style: normal; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
/* Horarios y teléfonos: cifras de ancho fijo para que las columnas cuadren. */
.cifras { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sr, .screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip {
	position: absolute; left: var(--gutter); top: -100px; z-index: 100;
	background: var(--accent); color: var(--accent-ink); padding: 0.75rem 1rem; font-weight: 700;
}
.skip:focus { top: 8px; }
.ico { width: 1.25em; height: 1.25em; flex: none; }

/* Titulares: Archivo de anchura normal, en minúsculas. */
.tit, .hero__tit, .pag__tit { font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.tit { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 1rem; }
.sec-sub { color: var(--muted); font-size: 1.1rem; max-width: 56ch; margin-bottom: 2.25rem; }

.enlace {
	display: inline-flex; align-items: center; gap: 0.3em;
	color: var(--accent); font-weight: 600; text-decoration: underline;
}
.enlace:hover { text-decoration-thickness: 2px; }

/* ---------- Botones ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
	min-height: 52px; padding: 0 1.4rem;
	font: inherit; font-weight: 650; font-size: 1rem; white-space: nowrap;
	text-decoration: none; border: 1.5px solid transparent; border-radius: 0; cursor: pointer;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--solid:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--line { background: var(--bg); color: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--bg); }

/* ---------- Barra superior ---------- */
.topbar { background: var(--soft); color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid var(--line); }
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 38px; }
.topbar a { text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.topbar a:hover { color: var(--ink); text-decoration: underline; }
.topbar__contacto { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.estado { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.estado::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--field); }
.estado .ico { display: none; }
.estado.is-abierto::before { background: var(--ok); }
.estado.is-cerrado::before { background: var(--error); }

/* ---------- Cabecera ---------- */
.head { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.head__in { display: flex; align-items: center; gap: 2rem; min-height: 76px; }
.marca { display: block; flex: none; }
.marca img { width: 132px; height: auto; }
.nav { margin-left: auto; }
.nav__list { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.nav__list a {
	display: block; padding: 0.6rem 0.8rem; font-weight: 550; font-size: 1rem;
	text-decoration: none; text-underline-offset: 0.5em; text-decoration-thickness: 2px;
}
.nav__list a:hover { color: var(--accent); }
.nav__list a[aria-current="page"], .nav__list .current-menu-item > a {
	color: var(--accent); text-decoration-line: underline;
}
.head__tel { min-height: 46px; }
.head__tel-corto { display: none; }
.menu-btn {
	display: none; margin-left: auto; width: 48px; height: 48px;
	align-items: center; justify-content: center;
	background: none; border: 1px solid var(--line); color: var(--ink); cursor: pointer;
}
.menu-btn .ico { width: 26px; height: 26px; }
.menu-btn__cerrar { display: none; }
.menu-btn[aria-expanded="true"] .menu-btn__abrir { display: none; }
.menu-btn[aria-expanded="true"] .menu-btn__cerrar { display: inline-flex; }

/* ---------- Portada: hero (foto a todo ancho, panel blanco encima) ---------- */
.hero { position: relative; min-height: clamp(520px, 72vh, 700px); display: flex; align-items: flex-end; }
.hero__foto { position: absolute; inset: 0; }
.hero__foto img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero__in { position: relative; padding-block: clamp(2rem, 5vw, 4rem); }
.hero__txt { background: var(--bg); max-width: 620px; padding: clamp(1.75rem, 3.5vw, 3rem); border-bottom: 4px solid var(--accent); }
.hero__tit { font-size: clamp(2.2rem, 4.2vw, 3.6rem); margin-bottom: 1rem; }
.hero__sub { font-size: clamp(1.05rem, 1.3vw, 1.2rem); color: var(--muted); max-width: 44ch; margin-bottom: 1.75rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Portada: datos ---------- */
.datos { border-bottom: 1px solid var(--line); }
.datos__in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dato { margin: 0; padding: 1.75rem 1.5rem 1.75rem 0; display: flex; gap: 0.9rem; align-items: flex-start; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.dato + .dato { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.dato .ico { width: 34px; height: 34px; color: var(--accent); }
.dato strong { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 0.15rem; }

/* ---------- Familias de producto ---------- */
.cats { padding-block: clamp(3.5rem, 7vw, 6rem); }
.fams { display: grid; gap: 1.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fam { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--bg); transition: border-color 0.2s var(--ease); }
.fam:hover { border-color: var(--accent); }
.fam__img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.fam__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.fam:hover .fam__img img { transform: scale(1.04); }
.fam__img .ico { width: 64px; height: 64px; color: var(--accent); }
.fam__txt { padding: 1.1rem 1.25rem 1.35rem; }
.fam h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.4rem; }
.fam p { font-size: 0.95rem; line-height: 1.5; color: var(--muted); }

/* ---------- Marcas ---------- */
.marcas { padding-block: clamp(3.5rem, 7vw, 5.5rem); background: var(--soft); border-block: 1px solid var(--line); }
.marcas .tit { margin-bottom: 0.5rem; }
.marcas__sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }
.marcas__lista {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
	margin: 0 0 1.75rem; padding: 0; list-style: none;
}
.marcas__lista li {
	background: var(--bg); border: 1px solid var(--line); padding: 0.85rem 0.75rem;
	text-align: center; font-weight: 650; font-size: 0.98rem; line-height: 1.2;
}
.marcas__lista .es-grupo { border-color: var(--accent); color: var(--accent); }
.marcas__nota { color: var(--muted); }

/* ---------- Conózcanos ---------- */
.nosotros { padding-block: clamp(4rem, 8vw, 7rem); }
.nosotros__in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2rem clamp(2rem, 5vw, 4.5rem); align-items: center; }
.nosotros__foto { grid-column: 1 / 6; grid-row: 1; }
.nosotros__foto img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.nosotros__foto figcaption { margin-top: 0.6rem; font-size: 0.875rem; color: var(--muted); }
.nosotros__txt { grid-column: 6 / -1; grid-row: 1; }
.nosotros__txt p { max-width: 62ch; color: var(--muted); }
.lead { font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.4; font-weight: 500; color: var(--ink) !important; margin-bottom: 1.2em !important; }

/* ---------- Andel ---------- */
.andel { padding-block: 0 clamp(4rem, 8vw, 7rem); }
.andel__in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2rem; align-items: center; background: var(--accent-soft); padding: clamp(1.75rem, 4vw, 3.5rem); }
.andel__txt { grid-column: 1 / 7; }
.andel__txt p { font-size: 1.1rem; max-width: 52ch; color: var(--muted); }
.andel__img { grid-column: 8 / -1; background: var(--bg); padding: clamp(1rem, 2vw, 1.5rem); }

/* ---------- Visítenos ---------- */
.visita { position: relative; min-height: 540px; display: flex; align-items: center; padding-block: 4rem; background: var(--soft); border-top: 1px solid var(--line); }
.visita__foto { position: absolute; inset: 0 0 0 45%; }
.visita__foto img { width: 100%; height: 100%; object-fit: cover; }
.visita__in { position: relative; }
.visita__panel { background: var(--bg); max-width: 560px; padding: clamp(1.75rem, 3vw, 2.75rem); border: 1px solid var(--line); }
.visita__datos { display: grid; gap: 1.25rem; margin: 0 0 2rem; }
.visita__datos dt { font-size: 0.85rem; font-weight: 650; color: var(--muted); margin-bottom: 0.15rem; }
.visita__datos dd { margin: 0; line-height: 1.55; }
.visita__datos a { text-decoration: none; }
.visita__datos a:hover { text-decoration: underline; }
.visita__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Páginas interiores ---------- */
.pag__head { border-bottom: 1px solid var(--line); background: var(--soft); }
.pag__head-in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2rem; align-items: center; padding-block: clamp(2.5rem, 5vw, 4rem); }
.pag__tit-wrap { grid-column: 1 / -1; }
.pag--foto .pag__tit-wrap { grid-column: 1 / 8; }
.pag__tit { font-size: clamp(2rem, 3.8vw, 3.1rem); max-width: 24ch; }
.pag__sub { margin-top: 1rem; font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.pag__foto { grid-column: 8 / -1; }
.pag__foto img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.prosa { max-width: 68ch; padding-block: clamp(2.5rem, 5vw, 4rem); }
.prosa h2 { font-weight: 700; font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.01em; margin: 2em 0 0.6em; }
.prosa h2:first-child { margin-top: 0; }
.prosa h3 { font-size: 1.2rem; margin: 1.6em 0 0.5em; }
.prosa a { color: var(--accent); }
.prosa ul, .prosa ol { padding-left: 1.2em; }
.prosa img { margin-block: 1.5rem; }

/* ---------- Contacto ---------- */
.contacto__in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2rem clamp(2rem, 5vw, 5rem); padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.contacto__datos { grid-column: 1 / 6; }
.contacto__datos .prosa { padding-block: 0 2rem; }
.form-wrap { grid-column: 6 / -1; background: var(--soft); border: 1px solid var(--line); padding: clamp(1.5rem, 3vw, 2.5rem); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1rem; }
.campo { grid-column: 1 / -1; display: grid; gap: 0.4rem; }
.campo--mitad { grid-column: auto; }
.campo label { font-weight: 600; font-size: 0.95rem; }
.campo input, .campo textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--bg);
	border: 1px solid var(--field); border-radius: 0; padding: 0.75rem 0.85rem; min-height: 50px;
}
.campo textarea { resize: vertical; min-height: 150px; }
.campo input:focus, .campo textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.campo__ayuda { grid-column: 1 / -1; margin: -0.3rem 0 0; font-size: 0.875rem; color: var(--muted); }
.campo .campo__ayuda { margin: 0; }
.check { grid-column: 1 / -1; display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0.15rem 0 0; flex: none; }
.check a { color: var(--accent); }
.form .btn { grid-column: 1 / -1; justify-self: start; margin-top: 0.5rem; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.aviso { padding: 1rem 1.2rem; margin-bottom: 1.5rem; border: 1px solid; }
.aviso--ok { border-color: var(--ok); background: #e9f4ee; color: #135331; }
.aviso--error { border-color: var(--error); background: #fbeceb; color: #8c1d17; font-weight: 600; }

/* ---------- Blog ---------- */
.posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 2.5rem; padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.post-card__img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 1rem; }
.post-card__fecha { color: var(--muted); margin-bottom: 0.4rem; font-size: 0.85rem; }
.post-card__tit { font-size: 1.45rem; line-height: 1.2; margin-bottom: 0.6rem; }
.post-card__tit a { text-decoration: none; }
.post-card__tit a:hover { color: var(--accent); }
.post__img { margin-top: 2.5rem; max-width: 900px; }
.volver { padding-bottom: 4rem; }
.paginas .nav-links { display: flex; gap: 1rem; padding-bottom: 4rem; }
.vacio { padding-block: clamp(3rem, 6vw, 5rem); max-width: 60ch; }
.vacio p { font-size: 1.15rem; margin-bottom: 1.75rem; }

/* ---------- Pie ---------- */
.foot { background: var(--soft); color: var(--muted); border-top: 1px solid var(--line); padding-top: clamp(3rem, 6vw, 4.5rem); font-size: 0.95rem; }
.foot__in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; }
.foot__marca p { max-width: 34ch; margin-top: 1.25rem; }
.placa { display: inline-block; }
.placa img { width: 140px; }
.foot__tit { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 0.7rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.foot .enlace { margin-top: 0.6rem; }
.foot__base {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
	padding-block: 1.25rem 1.5rem; border-top: 1px solid var(--line); font-size: 0.85rem;
}
.foot__base p { margin: 0; }
.foot__legal { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin: 0; padding: 0; list-style: none; }

/* ---------- WhatsApp flotante (solo si hay número en recaseis_datos) ---------- */
.wa {
	position: fixed; right: 20px; bottom: 20px; z-index: 30;
	display: inline-flex; align-items: center; gap: 0.55rem; min-height: 52px; padding: 0 1.2rem 0 1rem;
	background: var(--wa); color: #fff; font-weight: 650; text-decoration: none; border-radius: 999px;
	box-shadow: 0 6px 20px rgb(22 25 29 / 0.18);
}
.wa .ico { width: 26px; height: 26px; }
.wa:hover { background: #17834a; }

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
	.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
	.js .reveal.is-in { opacity: 1; transform: none; }
	.hero__txt { animation: entra 0.8s var(--ease) both; }
	.hero__foto img { animation: entra-foto 1.2s var(--ease) both; }
}
@keyframes entra { from { opacity: 0; transform: translateY(18px); } }
@keyframes entra-foto { from { opacity: 0.6; transform: scale(1.03); } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.head__in { gap: 1rem; }
	.nav__list a { padding-inline: 0.55rem; font-size: 0.95rem; }
	.fams { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
	.menu-btn { display: inline-flex; }
	/* En móvil se llama más que en ningún sitio: el botón se queda, junto al menú. */
	.head__tel { margin-left: auto; min-height: 48px; padding-inline: 1rem; }
	.head__tel + .menu-btn { margin-left: 0; }
	.nav {
		position: absolute; left: 0; right: 0; top: 100%;
		background: var(--bg); border-bottom: 1px solid var(--line);
		display: none; margin: 0;
	}
	.nav.is-open { display: block; }
	.nav__list { flex-direction: column; padding: 0.5rem var(--gutter) 1.25rem; }
	.nav__list a { padding: 0.9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }

	.fams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.datos__in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dato:nth-child(3) { padding-left: 0; border-left: 0; }
	.dato:nth-child(n + 3) { border-top: 1px solid var(--line); }
	.foot__in { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
	body { font-size: 1rem; }
	.topbar__contacto li:first-child { display: none; }
	.estado { font-size: 0.8rem; }
	/* En móvil la foto va arriba y el panel debajo, sin taparla. */
	.hero { display: block; min-height: 0; }
	.hero__foto { position: relative; height: 280px; }
	.hero__in { padding: 0; }
	.hero__txt { max-width: none; padding: 1.75rem var(--gutter) 2rem; }
	.hero__ctas .btn { flex: 1 1 auto; }
	.nosotros__in, .andel__in, .pag__head-in, .contacto__in { grid-template-columns: 1fr; }
	.nosotros__txt, .nosotros__foto, .andel__txt, .andel__img,
	.pag__tit-wrap, .pag--foto .pag__tit-wrap, .pag__foto, .contacto__datos, .form-wrap { grid-column: 1 / -1; grid-row: auto; }
	.visita { flex-direction: column; align-items: stretch; padding-block: 0 3rem; min-height: 0; }
	.visita__foto { position: relative; inset: auto; height: 240px; }
	.visita__panel { margin-top: -3rem; }
	.form { grid-template-columns: 1fr; }
	.campo--mitad { grid-column: 1 / -1; }
	.posts { grid-template-columns: 1fr; }
	.foot__in { grid-template-columns: 1fr; gap: 2rem; }
	.wa { right: 14px; bottom: 14px; padding: 0; width: 56px; height: 56px; justify-content: center; }
	.wa span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (max-width: 560px) {
	.head__tel-num { display: none; }
	.head__tel-corto { display: inline; }
	.marca img { width: 112px; }
	.fams { grid-template-columns: 1fr; }
	.marcas__lista { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
	.head__in { gap: 0.5rem; }
	.head__tel { width: 48px; padding: 0; }
	.head__tel-corto { display: none; }
	.topbar__contacto { display: none; }
	.estado { white-space: nowrap; }
}

@media (max-width: 420px) {
	.datos__in { grid-template-columns: 1fr; }
	.dato, .dato + .dato { padding: 1.25rem 0; border-left: 0; }
	.dato + .dato { border-top: 1px solid var(--line); }
}
