/*
Theme Name:   Dinamo (Astra Child)
Theme URI:    https://dinamorepuestos.com
Description:  Tema hijo de Astra para Repuestos Dinamo. Plantillas a medida del catálogo, optimizadas para SEO técnico, HTML semántico y Core Web Vitals.
Author:       Repuestos Dinamo
Template:     astra
Version:      1.3.0
Text Domain:  dinamo-child
*/

/* ==========================================================================
   TOKENS DE DISEÑO  (alineados a la maqueta de Lovable)
   ========================================================================== */

:root {
	/* Marca */
	--dn-color-primary: #243B55;        /* Navy de la marca */
	--dn-color-primary-dark: #1B2D42;   /* Hover / estados oscuros */

	/* Acentos */
	--dn-color-highlight: #ECE318;      /* Amarillo lima: nombre sobre pizarra, badges, banner */
	--dn-color-whatsapp: #25D366;       /* Verde WhatsApp (color de marca de Lovable) */
	--dn-color-whatsapp-dark: #1EBE5B;  /* Hover del botón */

	/* Neutros */
	--dn-color-ink: #1A2434;            /* Texto principal / títulos */
	--dn-color-muted: #6B7280;          /* Texto secundario */
	--dn-color-line: #E5E7EB;           /* Bordes y divisores */
	--dn-color-line-strong: #B9C2CC;    /* Separadores de migas */
	--dn-color-surface: #FFFFFF;        /* Fondo de tarjetas */
	--dn-color-bg: #F4F6F8;             /* Fondo de secciones */

	/* Tipografía */
	--dn-font-heading: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
	--dn-font-body: inherit;

	/* Espaciado y formas */
	--dn-radius: 12px;
	--dn-radius-lg: 16px;
	--dn-radius-sm: 8px;
	--dn-gap: clamp(1rem, 2vw, 1.5rem);
	--dn-section-y: clamp(3rem, 6vw, 5rem);
	--dn-container: 1280px;
	--dn-shadow: 0 8px 24px rgba(26, 36, 52, 0.08);
}

.dn-wrap {
	width: min(100% - 2rem, var(--dn-container));
	margin-inline: auto;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--dn-color-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

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

/* ==========================================================================
   BOTÓN FLOTANTE DE WHATSAPP (global, en todas las páginas)
   ========================================================================== */
.dn-fab {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--dn-color-whatsapp, #25D366);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 30px rgba(37, 211, 102, 0.45);
	z-index: 999;
	transition: transform 0.15s ease;
	text-decoration: none;
}
.dn-fab:hover {
	transform: scale(1.08);
	color: #fff;
}
.dn-fab svg {
	width: 30px;
	height: 30px;
	fill: #fff;
}

/* ==========================================================================
   SALTAR AL CONTENIDO (accesibilidad)
   ========================================================================== */
.dn-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--dn-color-primary);
	color: #fff;
	padding: 0.6rem 1rem;
	z-index: 1000;
	border-radius: 0 0 8px 0;
}
.dn-skip-link:focus {
	left: 0;
	color: #fff;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.dn-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--dn-color-line);
	box-shadow: 0 6px 20px rgba(26, 36, 52, 0.05);
}
/* Escritorio: la barra de admin de WP es fija (32px), el header se baja. */
body.admin-bar .dn-header {
	top: 32px;
}
/* Móvil: la barra de admin de WP NO es fija (se desplaza con la página),
   así que el header debe quedar pegado arriba; si no, deja un hueco. */
@media (max-width: 782px) {
	body.admin-bar .dn-header {
		top: 0;
	}
}
.dn-header__inner {
	width: min(100% - 2rem, var(--dn-container));
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	height: 68px;
}
.dn-header__logo {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex: none;
}
.dn-header__logo img {
	height: 42px;
	width: auto;
	display: block;
}
.dn-header__nav {
	display: none;
	align-items: center;
	gap: 0.2rem;
	margin-left: auto;
}
@media (min-width: 1024px) {
	.dn-header__nav {
		display: flex;
	}
}
.dn-header__nav a {
	font-size: 0.9rem;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	padding: 0.5rem 0.85rem;
	border-radius: 8px;
	transition: color 0.15s ease, background 0.15s ease;
}
.dn-header__nav a:hover {
	color: var(--dn-color-primary);
	background: #f3f4f6;
}
.dn-header__nav a.is-active {
	color: var(--dn-color-primary);
	font-weight: 700;
}
.dn-header__cta {
	display: none;
	align-items: center;
	gap: 0.5rem;
	background: var(--dn-color-whatsapp);
	color: #fff;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	padding: 0 1.1rem;
	height: 40px;
	border-radius: 999px;
	box-shadow: 0 6px 18px rgba(37, 211, 102, 0.28);
	flex: none;
}
@media (min-width: 1024px) {
	.dn-header__cta {
		display: inline-flex;
	}
}
.dn-header__cta:hover {
	filter: brightness(1.06);
	color: #fff;
}
.dn-header__cta svg {
	width: 16px;
	height: 16px;
	fill: #fff;
}
.dn-header__burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--dn-color-line);
	background: #fff;
	border-radius: 10px;
	cursor: pointer;
	color: var(--dn-color-primary);
	margin-left: auto;
}
@media (min-width: 1024px) {
	.dn-header__burger {
		display: none;
	}
}
.dn-header__mobile {
	display: none;
	border-top: 1px solid var(--dn-color-line);
	background: #fff;
	padding: 0.6rem 1rem 1rem;
}
.dn-header__mobile.is-open {
	display: block;
}
@media (min-width: 1024px) {
	.dn-header__mobile {
		display: none !important;
	}
}
.dn-header__mobile a {
	display: block;
	padding: 0.65rem 0.75rem;
	border-radius: 8px;
	text-decoration: none;
	color: var(--dn-color-ink);
	font-weight: 500;
}
.dn-header__mobile a:hover {
	background: #f3f4f6;
}
.dn-header__mobile a.is-active {
	color: var(--dn-color-primary);
	font-weight: 700;
}
.dn-header__mobile .dn-header__cta {
	display: inline-flex;
	width: 100%;
	justify-content: center;
	margin-top: 0.6rem;
	height: 44px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.dn-footer {
	background: var(--dn-color-primary);
	color: #fff;
}
.dn-footer__inner {
	width: min(100% - 2rem, var(--dn-container));
	margin: 0 auto;
	padding: clamp(2.5rem, 5vw, 3.5rem) 0;
	display: grid;
	gap: 2.5rem;
	grid-template-columns: 1fr;
}
@media (min-width: 768px) {
	.dn-footer__inner {
		grid-template-columns: 1.4fr 1fr 1fr 1fr;
	}
}
.dn-footer h3 {
	font-family: var(--dn-font-heading);
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--dn-color-highlight);
	margin: 0 0 0.9rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}
.dn-footer p {
	font-size: 0.875rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.72);
	margin: 0;
	max-width: 320px;
}
.dn-footer__logo {
	height: 52px;
	width: auto;
	display: block;
	margin-bottom: 1rem;
}
.dn-footer ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}
.dn-footer ul.dn-footer__grid2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem 1rem;
}
.dn-footer a {
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
	font-size: 0.875rem;
	transition: color 0.15s ease;
}
.dn-footer a:hover {
	color: #fff;
}
.dn-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.dn-footer__bottom-inner {
	width: min(100% - 2rem, var(--dn-container));
	margin: 0 auto;
	padding: 1.1rem 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	justify-content: space-between;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.6);
}
@media (min-width: 768px) {
	.dn-footer__bottom-inner {
		flex-direction: row;
	}
}
.dn-footer__bottom p {
	max-width: none;
	color: inherit;
	font-size: inherit;
}
.dn-footer__bottom a {
	text-decoration: underline;
	color: rgba(255, 255, 255, 0.6);
	font-size: inherit;
}
.dn-footer__bottom a:hover {
	color: #fff;
}
