/**
 * Header y Hero - Safety Garage
 * Colores: azul #122d5c, rojo #c01617
 */

:root {
	--sg-dark: #122d5c;
	--sg-red: #c01617;
	--sg-red-hover: #a81213;
	--sg-white: #ffffff;
	--sg-text-muted: rgba(255, 255, 255, 0.9);
	--sg-inner-max: 1200px;
}

/* ========== HEADER ========== */

.site-header {
	background: var(--sg-dark);
	color: var(--sg-white);
	position: relative;
	z-index: 100;
}

.header-inner {
	max-width: var(--sg-inner-max);
	margin: 0 auto;
	padding: 0 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

/* Barra superior (contacto + enlaces secundarios) */
.header-utility {
	padding: 0.5rem 0;
	font-size: 0.875rem;
}

.header-utility .header-inner {
	justify-content: space-between;
}

.header-utility__contact {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.header-utility__icon {
	display: inline-flex;
	color: var(--sg-white);
}

.header-utility__icon svg {
	display: block;
}

.header-utility__phone {
	color: var(--sg-white);
	text-decoration: none;
}

.header-utility__phone:hover {
	text-decoration: underline;
}

.header-utility__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.header-utility__menu a {
	color: var(--sg-text-muted);
	text-decoration: none;
}

.header-utility__menu a:hover {
	color: var(--sg-white);
}

/* Barra principal (logo + menú + CTA) - Se vuelve sticky al hacer scroll */
.header-main {
	padding: 1rem 0;
	background: var(--sg-dark);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	transition: padding 0.3s ease, background 0.3s ease;
}

/* Cuando se activa el sticky (después de pasar la barra superior) */
.header-main.is-sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: rgba(18, 45, 92, 0.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-top: none;
	padding: 0.6rem 0;
	animation: slideDown 0.3s ease;
}

@keyframes slideDown {
	from {
		transform: translateY(-100%);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.header-main.is-sticky .site-branding__logo {
	max-height: 40px;
}

.header-main.is-sticky .site-branding__mark {
	font-size: 1.25rem;
	padding: 0.25rem 0.5rem;
}

.header-main.is-sticky .site-branding__name {
	font-size: 0.6rem;
}

/* Placeholder para evitar salto cuando header se vuelve fixed */
.header-main-placeholder {
	display: none;
}

.header-main-placeholder.is-active {
	display: block;
}

.site-branding__link {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	text-decoration: none;
	color: var(--sg-white);
}

.site-branding__mark {
	display: inline-block;
	background: transparent;
	color: var(--sg-white);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.2;
	padding: 0.35rem 0.6rem;
	border: 2px solid var(--sg-white);
	border-radius: 6px;
	letter-spacing: 0.02em;
}

.site-branding__name {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sg-white);
	opacity: 0.9;
}

.site-branding__logo {
	max-height: 50px;
	width: auto;
	display: block;
}

.site-navigation {
	flex: 1;
	display: flex;
	justify-content: flex-end;
	margin-right: 2rem;
}

.primary-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 2.5rem;
}

.primary-menu a {
	color: var(--sg-white);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.9rem;
	letter-spacing: 0.02em;
}

.primary-menu a:hover {
	text-decoration: underline;
}

.primary-menu .current-menu-item a {
	text-decoration: underline;
}

/* Items con submenú */
.primary-menu > li {
	position: relative;
}

.primary-menu > li.menu-item-has-children > a {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.primary-menu > li.menu-item-has-children > a::after {
	content: '';
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform 0.3s ease;
}

.primary-menu > li.menu-item-has-children:hover > a::after {
	transform: rotate(180deg);
}

/* Submenú dropdown */
.primary-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 240px;
	background: var(--sg-white);
	border-radius: 8px;
	box-shadow: 0 8px 30px rgba(18, 45, 92, 0.15);
	list-style: none;
	margin: 0;
	padding: 0.5rem 0;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 1000;
	margin-top: 1rem;
}

.primary-menu .sub-menu::before {
	content: '';
	position: absolute;
	top: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-bottom: 8px solid var(--sg-white);
}

.primary-menu > li.menu-item-has-children:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	margin-top: 0.5rem;
}

.primary-menu .sub-menu li {
	margin: 0;
}

.primary-menu .sub-menu a {
	display: block;
	padding: 0.75rem 1.25rem;
	color: var(--sg-dark) !important;
	font-weight: 500;
	font-size: 0.9rem;
	text-decoration: none !important;
	transition: all 0.2s ease;
	border-left: 3px solid transparent;
}

.primary-menu .sub-menu a:hover {
	background: #f8fafc;
	color: var(--sg-red) !important;
	border-left-color: var(--sg-red);
}

/* Botón CTA header */
.header-cta .btn--primary {
	display: inline-block;
	background: var(--sg-red);
	color: var(--sg-white) !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0.65rem 1.25rem;
	border-radius: 6px;
	border: none;
	box-shadow: 0 2px 8px rgba(192, 22, 23, 0.35);
	white-space: nowrap;
}

.header-cta .btn--primary:hover {
	background: var(--sg-red-hover);
	box-shadow: 0 4px 12px rgba(192, 22, 23, 0.4);
}

/* ========== HERO ========== */

.hero {
	position: relative;
	width: 100vw;
	margin-left: calc(-50vw + 50%);
	aspect-ratio: 16 / 7;
	max-height: 85vh;
	display: block;
	background: transparent;
	overflow: hidden;
}

/* Hero como slider (varios slides) */
.hero-slider {
	overflow: hidden;
	width: 100%;
	height: 100%;
}

.hero-slider__track {
	display: flex;
	height: 100%;
	width: 100%;
	transition: transform 0.5s ease;
	will-change: transform;
}

.hero-slide {
	flex: 0 0 100%;
	min-width: 100%;
	width: 100%;
	height: 100%;
	position: relative;
	display: flex;
	align-items: center;
}

/* Imagen de fondo: cubre TODO el slide de borde a borde */
.hero-slide--has-bg {
	background-image: var(--hero-bg-image);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #0d1f3c; /* fallback si la imagen no cubre todo */
}

.hero-slide:not(.hero-slide--has-bg) {
	background-color: var(--sg-dark);
}

/* Overlay con gradiente de izquierda (azul) a derecha (transparente) */
.hero-slide::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		to right,
		rgba(18, 45, 92, 0.75) 0%,
		rgba(18, 45, 92, 0.55) 30%,
		rgba(18, 45, 92, 0.25) 55%,
		rgba(18, 45, 92, 0.1) 75%,
		rgba(18, 45, 92, 0) 100%
	);
	pointer-events: none;
	z-index: 1;
}

/* Un solo slide (sin slider): estilos de fondo por compatibilidad */
.hero:not([data-hero-slider="1"]) .hero-slider__track {
	display: block;
}

.hero:not([data-hero-slider="1"]) .hero-slide {
	min-width: 100%;
}

.hero__inner {
	position: relative;
	z-index: 2;
	max-width: var(--sg-inner-max);
	margin: 0 auto;
	padding: 5rem 1.5rem;
	width: 100%;
}

.hero__content {
	max-width: 480px;
}

.hero__title {
	color: var(--sg-white);
	font-size: clamp(2.5rem, 5vw, 3.75rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	margin: 0 0 0.25rem;
}

.hero__subtitle {
	color: var(--sg-white);
	font-size: clamp(1rem, 2vw, 1.25rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin: 0 0 1.5rem;
}

.hero__line {
	display: none;
}

.hero__text {
	color: var(--sg-text-muted);
	font-size: 1rem;
	line-height: 1.7;
	max-width: 460px;
	margin: 0 0 2rem;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

/* Botones hero */
.btn {
	display: inline-block;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0.85rem 1.5rem;
	border-radius: 6px;
	transition: background 0.2s, box-shadow 0.2s, color 0.2s;
	cursor: pointer;
	border: 2px solid transparent;
}

.btn--primary {
	background: var(--sg-red);
	color: var(--sg-white) !important;
	box-shadow: 0 2px 10px rgba(192, 22, 23, 0.4);
}

.btn--primary:hover {
	background: var(--sg-red-hover);
	box-shadow: 0 4px 14px rgba(192, 22, 23, 0.5);
}

.btn--secondary {
	background: transparent;
	color: var(--sg-white);
	border-color: var(--sg-white);
}

.btn--secondary:hover {
	background: rgba(255, 255, 255, 0.1);
}

/* Controles del slider hero */
.hero-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 48px;
	height: 48px;
	border: none;
	background: rgba(255, 255, 255, 0.2);
	color: var(--sg-white);
	font-size: 1.5rem;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.2s, color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
}

.hero-slider__arrow:hover {
	background: rgba(255, 255, 255, 0.35);
}

.hero-slider__arrow--prev {
	left: 1rem;
}

.hero-slider__arrow--next {
	right: 1rem;
}

.hero-slider__dots {
	position: absolute;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.hero-slider__dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid var(--sg-white);
	background: transparent;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s, transform 0.2s;
}

.hero-slider__dot:hover {
	background: rgba(255, 255, 255, 0.5);
}

.hero-slider__dot.is-active {
	background: var(--sg-white);
}

/* ========== HERO VIDEO DE FONDO ========== */

/* Slide con video de fondo */
.hero-slide--has-video {
	background-color: #0d1f3c; /* Fallback mientras carga el video */
}

/* Contenedor del video */
.hero-slide__video-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: 0;
}

/* Video - cubre todo el slide */
.hero-slide__video {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	object-fit: cover;
	pointer-events: none;
}

/* Ocultar controles nativos del video */
.hero-slide__video::-webkit-media-controls {
	display: none !important;
}

.hero-slide__video::-webkit-media-controls-enclosure {
	display: none !important;
}

.hero-slide__video::-webkit-media-controls-panel {
	display: none !important;
}

.hero-slide__video::-webkit-media-controls-play-button {
	display: none !important;
}

.hero-slide__video::-webkit-media-controls-start-playback-button {
	display: none !important;
}

/* Ocultar overlay de play de Safari */
.hero-slide__video::-webkit-media-controls-overlay-play-button {
	display: none !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

video::-webkit-media-controls {
	display: none !important;
}

video::-webkit-media-controls-start-playback-button {
	display: none !important;
	-webkit-appearance: none;
}

/* Fallback image dentro del video */
.hero-slide__video img {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	min-width: 100%;
	min-height: 100%;
	object-fit: cover;
}

/* El overlay funciona igual para video que para imagen */
.hero-slide--has-video::before {
	z-index: 1;
}

/* Asegurar que el contenido está por encima del video */
.hero-slide--has-video .hero__inner {
	position: relative;
	z-index: 2;
}

/* Responsive: en móviles el video puede ser más pequeño en altura */
@media (max-width: 768px) {
	.hero-slide__video {
		/* En móviles puede que el video sea muy ancho, aseguramos que cubra la altura */
		min-height: 100%;
		width: auto;
	}
}

/* ========== HERO PARTNERS (De venta en) ========== */
.hero__partners {
	margin-top: 2.5rem;
	display: inline-flex;
	align-items: center;
	gap: 1.5rem;
	padding: 1rem 1.5rem;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero__partners-label {
	font-size: 0.85rem;
	color: #fff;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	white-space: nowrap;
	padding-right: 1.5rem;
	border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.hero__partners-logos {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.hero__partner-link {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border-radius: 8px;
	padding: 0.6rem 1.25rem;
	transition: all 0.3s ease;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hero__partner-link:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.hero__partner-logo {
	height: 38px;
	width: auto;
	max-width: 130px;
	object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
	.hero__partners {
		margin-top: 2rem;
		flex-direction: column;
		gap: 1rem;
		padding: 1rem;
		align-items: flex-start;
	}

	.hero__partners-label {
		font-size: 0.75rem;
		padding-right: 0;
		padding-bottom: 0.75rem;
		border-right: none;
		border-bottom: 1px solid rgba(255, 255, 255, 0.3);
		width: 100%;
	}

	.hero__partners-logos {
		gap: 0.75rem;
		width: 100%;
		justify-content: center;
	}

	.hero__partner-logo {
		height: 30px;
		max-width: 100px;
	}

	.hero__partner-link {
		padding: 0.5rem 1rem;
	}
}

/* Main content wrapper (resto de la página) */
.site-main .site-container {
	max-width: var(--sg-inner-max);
	margin: 0 auto;
	padding: 2rem 1.5rem;
}
