/* ==========================================================================
   The Elite Cars – estilos base, cabecera y hero
   Medidas tomadas del mockup de Figma (lienzo de 1920 px).
   ========================================================================== */

/* Tipografía alojada en el tema (Roboto variable, subconjunto latino). */
@font-face {
	font-family: "Roboto";
	src: url("../fonts/roboto-var-latin.woff") format("woff");
	font-weight: 300 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--ec-black: #000;
	--ec-white: #fff;
	--ec-gold: #ffca68;        /* texto del menú */
	--ec-gold-strong: #e5a42a; /* líneas, bordes y botones */
	--ec-font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--ec-page-max: 1920px;
	--ec-header-h: 159px;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: 159px;
}

body {
	margin: 0;
	background: var(--ec-black);
	color: var(--ec-white);
	font-family: var(--ec-font);
	font-size: 16px;
	line-height: 1.5;
}

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

a {
	color: inherit;
}

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

.skip-link:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 20px;
	clip: auto;
	background: var(--ec-gold-strong);
	color: var(--ec-black);
	text-decoration: none;
}

.site-main {
	display: block;
}

/* Cabecera (escritorio ≥ 1280 px) ------------------------------------------ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	/* Negro sólido hasta que falta 1/4 del alto del menú para su final; desde ahí se difumina hacia abajo */
	background: linear-gradient(180deg, #000 0, #000 57%, rgba(0, 0, 0, 0) 100%);
}

.site-header__inner {
	display: flex;
	align-items: flex-start;
	max-width: var(--ec-page-max);
	height: var(--ec-header-h);
	margin: 0 auto;
	padding: 27px 0 0 clamp(16px, 5.625vw, 108px);
}

.site-header__logo {
	flex: none;
	display: block;
	width: 119px;
	height: 119px;
}

.site-header__logo-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.site-nav-toggle {
	display: none;
}

.site-nav {
	position: relative;
	flex: 1 1 auto;
	height: 88px;
	margin: 24px clamp(0px, 11.46vw, 220px) 0 clamp(24px, 3.7vw, 71px);
}

/* Línea dorada superior del menú */
.site-nav::before {
	content: "";
	position: absolute;
	top: 8px;
	right: 0;
	left: 0;
	height: 3px;
	background: var(--ec-gold-strong);
}

.site-nav__list {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin: 0;
	padding: 40px clamp(8px, 3vw, 58px) 0;
	list-style: none;
}

.site-nav__list li {
	margin: 0;
}

.site-nav__list a {
	position: relative;
	display: block;
	max-width: 9.2rem;
	color: var(--ec-gold);
	font-size: 18px;
	font-weight: 400;
	line-height: normal;
	text-align: center;
	text-decoration: none;
	text-wrap: balance;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
	transition: color 0.2s ease;
}

.site-nav__list a:hover {
	color: var(--ec-white);
}

.site-nav__list a:focus-visible,
.social-pill__link:focus-visible,
.site-nav-toggle:focus-visible {
	outline: 2px solid var(--ec-gold);
	outline-offset: 4px;
}

/* Marcador triangular del elemento activo (cuelga de la línea dorada) */
.site-nav__list .current-menu-item > a::before,
.site-nav__list .current_page_item > a::before {
	content: "";
	position: absolute;
	top: -32px;
	left: 50%;
	width: 30px;
	height: 23px;
	background: var(--ec-gold-strong);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	transform: translateX(-50%);
}

/* Indicador deslizante: lo coloca main.js bajo la opción activa */
.site-nav__indicator {
	position: absolute;
	top: 8px;
	left: 0;
	width: 30px;
	height: 23px;
	background: var(--ec-gold-strong);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.45s cubic-bezier(0.65, 0, 0.25, 1), opacity 0.2s ease;
}

.site-nav.has-indicator .site-nav__indicator {
	opacity: 1;
}

/* Con indicador deslizante se oculta el triángulo fijo del elemento activo */
.site-nav.has-indicator .site-nav__list .current-menu-item > a::before,
.site-nav.has-indicator .site-nav__list .current_page_item > a::before {
	display: none;
}

@media (max-width: 1279px) {
	.site-nav__indicator {
		display: none;
	}
}

/* Brillo metálico que recorre el logo (se recorta con la silueta del propio logo) */
@keyframes ec-shine {
	0% { background-position: 100% 0; }
	38%, 100% { background-position: 0 0; }
}

.site-header__logo {
	position: relative;
}

.site-header__logo[style*="--logo"]::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(115deg, rgba(255, 240, 200, 0) 40%, rgba(255, 240, 200, 0.35) 45%, rgba(255, 255, 255, 0.98) 50%, rgba(255, 240, 200, 0.35) 55%, rgba(255, 240, 200, 0) 60%) no-repeat;
	background-size: 300% 100%;
	background-position: 100% 0;
	-webkit-mask: var(--logo) center / contain no-repeat;
	mask: var(--logo) center / contain no-repeat;
	animation: ec-shine 4.8s ease-in-out 1s infinite;
}

/* Hero --------------------------------------------------------------------- */
.hero {
	position: relative;
	width: 100%;
	max-width: var(--ec-page-max);
	margin: 0 auto;
	aspect-ratio: 1920 / 800;
	background: var(--ec-black);
}

.hero__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Botones flotantes de TikTok y WhatsApp */
.social-pill {
	--u: 0.5px;
	position: absolute;
	z-index: 5;
	right: clamp(10px, 1.82vw, 35px);
	bottom: calc(-24 * var(--u));
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: calc(36 * var(--u));
	width: calc(90 * var(--u));
	height: auto;
	padding: calc(28 * var(--u)) 0;
	border: 3px solid var(--ec-gold-strong);
	border-radius: calc(45 * var(--u));
}

.social-pill__link {
	display: block;
	line-height: 0;
}

.social-pill__link img {
	width: auto;
}

.social-pill__link--tiktok img {
	height: calc(38 * var(--u));
}

.social-pill__link--whatsapp img {
	height: calc(54 * var(--u));
}

/* Animación de los iconos flotantes */
@keyframes ec-heartbeat {
	0%, 100% { transform: scale(1); opacity: 1; }
	14% { transform: scale(1.05); opacity: 0.55; }
	28% { transform: scale(1); opacity: 1; }
	42% { transform: scale(1.05); opacity: 0.55; }
	70% { transform: scale(1); opacity: 1; }
}

@keyframes ec-sway {
	0%, 100% { transform: translateY(0) rotate(0); }
	50% { transform: translateY(-2px) rotate(-6deg); }
}

.social-pill__link img {
	transform-origin: center;
}

.social-pill__link--whatsapp img {
	animation: ec-heartbeat 1.6s ease-in-out infinite;
}

.social-pill__link--tiktok img {
	animation: ec-sway 2.6s ease-in-out infinite;
}

.social-pill__link--instagram img,
.social-pill__link--youtube img,
.social-pill__link--facebook img {
	height: calc(30 * var(--u));
}

/* Espacios para Instagram, YouTube y Facebook: se muestran al añadir el enlace (quitar hidden) */
.social-pill__link[hidden] {
	display: none;
}

/* Sección de TikTok (incrustación del perfil) ------------------------------ */
.ec-sec {
	position: relative;
}

.ec-box {
	max-width: 1740px;
	margin: 0 clamp(16px, 2.6vw, 50px) clamp(40px, 4.4vw, 84px);
	padding: clamp(24px, 3.4vw, 66px) clamp(16px, 3.1vw, 60px);
	border: 3px solid var(--ec-gold-strong);
	border-radius: clamp(24px, 2.6vw, 50px);
}

@media (min-width: 1800px) {
	.ec-box {
		margin-inline: auto;
	}
}

.ec-h2 {
	margin: 0;
	color: #e5ac42;
	font-size: clamp(40px, 5vw, 96px);
	font-weight: 700;
	line-height: 1.1;
	text-wrap: balance;
}

.tiktok__embed {
	display: flex;
	justify-content: center;
	margin-top: clamp(18px, 2vw, 36px);
}

.tiktok__embed .tiktok-embed {
	width: 100%;
	margin: 0;
	color: #fff;
}

/* Control de reproducir / pausar del vídeo del hero */
.hero__toggle {
	position: absolute;
	z-index: 5;
	bottom: clamp(12px, 1.8vw, 35px);
	left: max(clamp(12px, 1.8vw, 35px), env(safe-area-inset-left, 0px));
	width: 44px;
	height: 44px;
	padding: 0;
	border: 2px solid var(--ec-gold-strong);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: var(--ec-gold);
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.hero__toggle:hover {
	background: rgba(229, 164, 42, 0.25);
	transform: scale(1.06);
}

.hero__toggle:focus-visible {
	outline: 2px solid var(--ec-gold);
	outline-offset: 3px;
}

.hero__toggle::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 16px;
	transform: translate(-50%, -50%);
	/* Pausa: dos barras */
	background: linear-gradient(90deg, currentColor 0 36%, transparent 36% 64%, currentColor 64% 100%);
}

.hero__toggle.is-paused::before {
	/* Reproducir: triángulo */
	width: 14px;
	margin-left: 2px;
	background: currentColor;
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Contenido genérico (index.php) ------------------------------------------- */
.content-area {
	max-width: 960px;
	margin: 0 auto;
	padding: 48px 24px;
}

.entry__title {
	color: var(--ec-gold);
}

/* Tablet y móvil (< 1280 px): menú desplegable ------------------------------ */
@media (max-width: 1279px) {
	html {
		scroll-padding-top: 104px;
	}

	.site-header__inner {
		align-items: center;
		justify-content: space-between;
		height: auto;
		padding: 16px;
	}

	.site-header__logo {
		width: 72px;
		height: 72px;
	}

	.site-nav-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		padding: 0;
		border: 2px solid var(--ec-gold-strong);
		border-radius: 12px;
		background: transparent;
		color: var(--ec-gold);
		cursor: pointer;
	}

	.site-nav-toggle__bars,
	.site-nav-toggle__bars::before,
	.site-nav-toggle__bars::after {
		display: block;
		width: 22px;
		height: 2px;
		background: currentColor;
		content: "";
	}

	.site-nav-toggle__bars {
		position: relative;
	}

	.site-nav-toggle__bars::before,
	.site-nav-toggle__bars::after {
		position: absolute;
		left: 0;
	}

	.site-nav-toggle__bars::before {
		top: -7px;
	}

	.site-nav-toggle__bars::after {
		top: 7px;
	}

	.site-nav {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		display: none;
		height: auto;
		margin: 0;
		background: var(--ec-black);
		border-top: 3px solid var(--ec-gold-strong);
	}

	.site-nav.is-open {
		display: block;
	}

	.site-nav::before {
		display: none;
	}

	.site-nav__list {
		flex-direction: column;
		align-items: stretch;
		padding: 8px 16px 24px;
	}

	.site-nav__list a {
		max-width: none;
		padding: 14px 8px 14px 20px;
		border-bottom: 1px solid rgba(229, 164, 42, 0.25);
		text-align: left;
	}

	.site-nav__list .current-menu-item > a::before,
	.site-nav__list .current_page_item > a::before {
		top: 50%;
		left: 0;
		width: 12px;
		height: 10px;
		transform: translateY(-50%) rotate(-90deg);
	}
}

@media (max-width: 767px) {
	/* Se mantiene la proporción de la imagen para que el coche se vea completo. */
	.hero {
		aspect-ratio: 1944 / 809;
		margin-bottom: 84px;
	}

	/* Los botones pasan a una píldora horizontal centrada bajo el hero. */
	.social-pill {
		--u: 0.4px;
		right: 50%;
		bottom: -70px;
		flex-direction: row;
		gap: 26px;
		width: auto;
		height: auto;
		padding: 10px 26px;
		border-width: 2px;
		border-radius: 999px;
		transform: translateX(50%);
	}
}

/* Botones flotantes anclados: siempre visibles y se ocultan al llegar al pie */
.social-pill {
	position: fixed;
	top: calc(50% + 48px);
	bottom: auto;
	background: #000;
	transform: translateY(-50%);
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.social-pill.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

@media (max-width: 767px) {
	.social-pill {
		top: auto;
		right: 50%;
		bottom: max(14px, env(safe-area-inset-bottom, 0px));
		transform: translateX(50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero__video {
		display: none;
	}

	.social-pill__link img {
		animation: none !important;
	}

	* {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
