/*
 * Header oscuro — integración visual con el Hero (Sprint 5A).
 * Selectores reales de Astra, auditados contra el HTML servido por
 * este sitio (no genéricos) — sin tocar Astra Core ni el tema padre.
 * Paleta fría D-004, misma familia que el Hero.
 */

#masthead.site-header {
	background-color: #060B0A;
	box-shadow: none;
}

/* Barra que realmente pinta el fondo del header en Astra */
#masthead.site-header .main-header-bar,
#masthead.site-header .ast-primary-header-bar {
	background-color: #060B0A;
	border-bottom: 1px solid color-mix(in srgb, #16241F 70%, #2DD8E8 12%);
	padding-block: 8px;
}

/* Logo — el ancho lo controla exclusivamente Astra (Personalizar →
   Logotipo → Ancho del logotipo). Aquí solo se protege la proporción
   natural, sin fijar width/max-width/max-height. */
#masthead .ast-site-identity .site-logo-img img.custom-logo {
	height: auto;
	max-width: 210px;
}

#masthead .ast-site-identity {
	padding-block: 4px;
}

/* Navegación principal */
#masthead .main-header-menu .menu-link {
	position: relative;
	color: #E7ECEA;
	font-weight: 500;
	font-size: 1.02rem;
	letter-spacing: -0.01em;
	padding-inline: 17px;
	transition: color .2s ease, background-color .2s ease;
}

@media (max-width: 920px) {
	#masthead .ast-site-identity .site-logo-img img.custom-logo {
		max-width: 175px;
	}
}
#masthead .main-header-menu .menu-item:hover > .menu-link,
#masthead .main-header-menu .current-menu-item > .menu-link {
	color: #2DD8E8;
}

#masthead .main-header-menu .current-menu-item > .menu-link::after {
	content: '';
	position: absolute;
	left: 17px;
	right: 17px;
	bottom: 7px;
	height: 1px;
	background: #2DD8E8;
	box-shadow: 0 0 7px rgba(45, 216, 232, .7);
}

/* Botón WhatsApp del Header Builder — se mantiene verde, se adapta
   la integración (sin borde blanco, sin sombra clara) */
#masthead .ast-header-button-1 .ast-custom-button {
	background: rgba(63, 203, 122, .08);
	border: 1px solid rgba(63, 203, 122, .58);
	border-radius: 6px;
	color: #8CE5B2;
	box-shadow: none;
	padding: 11px 19px;
	font-size: .78rem;
	letter-spacing: .06em;
	transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
#masthead .ast-header-button-1 .ast-custom-button:hover {
	background: rgba(63, 203, 122, .16);
	border-color: #3FCB7A;
	color: #C7F5DA;
	transform: translateY(-1px);
}

/* Carrito de WooCommerce — el control del extremo derecho */
#masthead .ast-site-header-cart .ast-icon-shopping-cart svg,
#masthead .ast-site-header-cart .ast-icon-shopping-cart path {
	fill: #E7ECEA;
}
#masthead .ast-site-header-cart .cart-container {
	color: #E7ECEA;
	display: grid;
	place-items: center;
	min-width: 42px;
	min-height: 42px;
	border: 1px solid #1B2D28;
	border-radius: 6px;
	background: #0B1614;
	transition: border-color .2s ease, background-color .2s ease;
}
#masthead .ast-site-header-cart .cart-container:hover {
	border-color: rgba(45, 216, 232, .55);
	background: #101D1A;
}

/* Ícono de Instagram — su color viene fijado por un custom property
   inline (--color) que una hoja externa no puede vencer por
   especificidad normal; este es el único !important de este archivo,
   justificado por esa razón técnica, no por comodidad. */
#masthead .header-social-item.ast-instagram {
	--color: #2DD8E8 !important;
}

/* Menú móvil (toggle) — mismo mecanismo de Astra, solo color */
#masthead .menu-toggle.main-header-menu-toggle,
#masthead .mobile-menu-toggle-icon {
	color: #E7ECEA;
}

/* Alineación — acerca logo y navegación (hoy separados por
   justify-content: space-between de Astra en un contenedor ancho).
   No se centra el logo: se mantiene flex-start, solo se reduce el
   hueco entre la zona izquierda (logo+Instagram) y la derecha
   (nav+WhatsApp+carrito). */
@media (min-width: 921px) {
	#masthead .ast-builder-grid-row-has-sides {
		justify-content: space-between;
		gap: var(--space-5, 32px);
		max-width: 1440px;
		margin-inline: auto;
		padding-inline: 24px;
	}

	#masthead .site-header-primary-section-left {
		transform: translateX(-72px);
	}

	#masthead .site-header-primary-section-right {
		position: relative;
		transform: translateX(18px);
		gap: 12px;
		padding: 6px;
		background: rgba(11, 22, 20, .52);
		border: 1px solid rgba(27, 45, 40, .75);
		border-radius: 10px;
	}

	#masthead .site-header-primary-section-right::before,
	#masthead .site-header-primary-section-right::after {
		content: '';
		position: absolute;
		width: 34px;
		height: 11px;
		pointer-events: none;
	}

	#masthead .site-header-primary-section-right::before {
		top: -1px;
		left: -1px;
		border-top: 1px solid #2DD8E8;
		border-left: 1px solid #2DD8E8;
		border-radius: 10px 0 0 0;
		box-shadow: -2px -2px 8px rgba(45, 216, 232, .08);
	}

	#masthead .site-header-primary-section-right::after {
		right: -1px;
		bottom: -1px;
		border-right: 1px solid #2DD8E8;
		border-bottom: 1px solid #2DD8E8;
		border-radius: 0 0 10px 0;
		box-shadow: 2px 2px 8px rgba(45, 216, 232, .08);
	}
}

/* Acerca el ícono de Instagram al logo dentro de la misma zona
   izquierda, en vez de quedar con el espacio por defecto de Astra. */
#masthead .site-header-primary-section-left {
	gap: 10px;
	align-items: center;
}

@media (max-width: 1200px) and (min-width: 921px) {
	#masthead .site-header-primary-section-left {
		transform: translateX(-10px);
	}
	#masthead .site-header-primary-section-right {
		transform: none;
	}
	#masthead .main-header-menu .menu-link {
		padding-inline: 11px;
		font-size: .92rem;
	}
	#masthead .ast-header-button-1 .ast-custom-button {
		padding-inline: 14px;
	}
}

/* ============================================================
   Camión animado del logo (logo-base.svg + logo-truck.svg).
   El ancho lo sigue controlando Astra (misma regla que ya
   aplicaba a .custom-logo-link img, ahora alcanza a las dos
   capas por igual) -- aquí NO se fija ningún width/max-width.
   ============================================================ */
#masthead .custom-logo-link.logo-minemet {
	position: relative;
	display: inline-block;
}

#masthead .custom-logo-link.logo-minemet .logo-base {
	display: block;
	/* El SVG corporativo fue creado para fondo claro: MINE es negro.
	   Esta transformación convierte ese negro en blanco cálido y conserva
	   el cobre en una tonalidad equivalente para el encabezado oscuro. */
	filter: invert(1) hue-rotate(180deg);
}

#masthead .custom-logo-link.logo-minemet .logo-truck {
	position: absolute;
	inset: 0;
	filter:
		drop-shadow(0 0 1px rgba(255, 255, 255, 1))
		drop-shadow(0 0 3px rgba(214, 226, 222, .9))
		drop-shadow(0 2px 5px rgba(45, 216, 232, .24));
	transform-origin: 24% 31%;
}

@media (prefers-reduced-motion: no-preference) {
	#masthead .custom-logo-link.logo-minemet .logo-truck {
		animation: minemet-logo-truck-climb 7s ease-in-out infinite;
	}
}

/* Reposo ~6.8s, avance corto (~0.6s), retorno (~0.6s). Amplitud en
   porcentaje del propio tamaño del camión (no px fijos), para que
   se mantenga proporcional si el ancho del logo cambia en Astra. */
@keyframes minemet-logo-truck-climb {
	0%      { opacity: 0; transform: translate(-8%, 7%) rotate(-.5deg); }
	8%      { opacity: 1; }
	68%     { opacity: 1; transform: translate(4%, -3%) rotate(.5deg); }
	82%     { opacity: 1; transform: translate(7%, -5%) rotate(.8deg); }
	90%     { opacity: 0; transform: translate(7%, -5%) rotate(.8deg); }
	100%    { opacity: 0; transform: translate(-8%, 7%) rotate(-.5deg); }
}

@media (prefers-reduced-motion: reduce) {
	#masthead .custom-logo-link.logo-minemet .logo-truck {
		animation: none;
	}
}
