/* Orden 028 — capa visual sobre los archivos exactos de producción. */
:root {
	--tesla-red: #bb0112;
}

header.fixed-header,
header.fixed-header.active {
	left: 0;
	right: 0;
	width: 100% !important;
	height: 64px !important;
	min-height: 64px !important;
	background: var(--tesla-red) !important;
}

header.fixed-header .navbarlogo,
header.fixed-header.active .navbarlogo,
header.fixed-header .navbarlogo > .container-fluid,
header.fixed-header.active .navbarlogo > .container-fluid {
	height: 64px !important;
	min-height: 64px !important;
	background: var(--tesla-red) !important;
	overflow: visible;
}

header.fixed-header .navbarlogo,
header.fixed-header .navbarlogo > .container-fluid {
	width: 100% !important;
	box-sizing: border-box;
}

header.fixed-header .navbarlogo > .container-fluid {
	position: relative;
	display: flex;
	align-items: center;
	padding: 0 4%;
}

header.fixed-header .navbarlogo > .container-fluid > .nav-link.link,
header.fixed-header.active .navbarlogo > .container-fluid > .nav-link.link {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	height: 64px !important;
	margin: 0;
	padding: 4px 0 !important;
	box-shadow: none;
}

header.fixed-header .brand-logo,
header.fixed-header.active .brand-logo {
	display: flex;
	align-items: center;
	height: 56px !important;
}

header.fixed-header .brand-logo .logo,
header.fixed-header.active .brand-logo .logo {
	width: auto !important;
	height: 50px !important;
	max-width: 180px !important;
	max-height: 50px !important;
	margin: 0 !important;
}

header.fixed-header .navbar-toggler,
header.fixed-header.active .navbar-toggler {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: auto;
	height: 42px;
	margin: 0 0 0 auto;
	padding: 0 14px;
	border: 1px solid rgba(255,255,255,.58);
	border-radius: 10px;
	background: transparent !important;
	color: #fff;
}

header.fixed-header .tesla-menu-label {
	display: inline-flex;
	align-items: center;
	margin: 0;
	color: #fff;
	font-size: .86rem;
	font-weight: 700;
	letter-spacing: .12em;
}

header.fixed-header .navbar-toggler-icon {
	display: none;
}

header.fixed-header .navbar-toggler:focus,
header.fixed-header .navbar-toggler:focus-visible {
	outline: 3px solid rgba(255,255,255,.88);
	outline-offset: 2px;
}

header.fixed-header .menu-card > .menu {
	counter-reset: tesla-main-menu;
}

header.fixed-header #navbarSupportedContent:not(.show),
header.fixed-header #cursosPanel:not(.show) {
	display: none;
}

header.fixed-header #navbarSupportedContent.show,
header.fixed-header #cursosPanel.show {
	display: block;
}

header.fixed-header .menu-card,
header.fixed-header .menu-card.collapsing {
	z-index: 1200;
}

header.fixed-header .menu-card > .menu > .nav-item:not(.nav-social) {
	counter-increment: tesla-main-menu;
}

header.fixed-header .menu-card > .menu > .nav-item:not(.nav-social) > .nav-link::before {
	content: counter(tesla-main-menu, decimal-leading-zero) ". ";
	margin-right: .32rem;
	color: var(--tesla-red);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

header.fixed-header .menu-card .destacadomenu,
header.fixed-header .menu-card .destacadomenu:hover,
header.fixed-header .menu-card .destacadomenu:focus {
	background: var(--tesla-red);
	color: #fff !important;
}

.content,
.contenido-single-blog {
	padding-top: 64px;
}

.banner.curso > * {
	position: relative;
	z-index: 2;
}

.banner.curso .tesla-share {
	position: absolute;
	top: 24px;
	right: 28px;
	z-index: 1002;
}

.tesla-share__toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 42px;
	padding: .4rem .2rem;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	box-shadow: none;
	font-weight: 700;
	letter-spacing: .04em;
	text-shadow: 0 2px 8px rgba(0,0,0,.72);
	cursor: pointer;
}

.tesla-share__toggle::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: .1rem;
	left: 0;
	height: 2px;
	background: currentColor;
	opacity: .8;
}

.tesla-share__toggle span {
	max-width: 8rem;
	margin-left: .55rem;
	overflow: hidden;
	opacity: 1;
	font-weight: 700;
	white-space: nowrap;
	transition: max-width .2s ease, margin-left .2s ease, opacity .2s ease;
}

.tesla-share__toggle:hover span,
.tesla-share__toggle:focus-visible span,
.tesla-share__toggle[aria-expanded="true"] span {
	max-width: 7rem;
	margin-left: .55rem;
	opacity: 1;
}

.tesla-share__toggle:focus-visible,
.tesla-share__option:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.tesla-share__menu {
	position: absolute;
	top: calc(100% + .6rem);
	right: 0;
	width: 220px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.tesla-share__menu[hidden] {
	display: none !important;
}

.tesla-share__option {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 42px;
	padding: .62rem .2rem;
	border: 0;
	border-bottom: 1px solid rgba(255,255,255,.55);
	border-radius: 0;
	background: transparent;
	color: #fff !important;
	font: inherit;
	font-weight: 650;
	text-align: left;
	text-shadow: 0 2px 8px rgba(0,0,0,.88);
	text-decoration: none !important;
	cursor: pointer;
}

.tesla-share__option:hover,
.tesla-share__option:focus {
	padding-left: .72rem;
	background: rgba(187,1,18,.88);
	color: #fff !important;
}

.tesla-share__option i {
	width: 1.55rem;
	margin-right: .4rem;
	color: #fff;
	text-align: center;
}

.tesla-share__status {
	display: block;
	min-height: 1.25rem;
	padding: .2rem .78rem 0;
	color: #fff;
	font-size: .82rem;
	font-weight: 700;
}

@media (max-width: 991.98px) {
	header.fixed-header .navbarlogo > .container-fluid {
		padding: 0 14px;
	}

	header.fixed-header .brand-logo .logo,
	header.fixed-header.active .brand-logo .logo {
		height: 48px !important;
		max-width: calc(100vw - 92px) !important;
		max-height: 48px !important;
	}

	header.fixed-header .navbar-toggler,
	header.fixed-header.active .navbar-toggler {
		width: 42px;
		height: 42px;
		padding: 0;
	}

	header.fixed-header .tesla-menu-label {
		display: none;
	}

	header.fixed-header .navbar-toggler-icon {
		display: block;
		width: 26px;
		height: 26px;
		background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='%23fff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
	}

	header.fixed-header .menu-card,
	header.fixed-header .menu-card.collapsing {
		top: 72px;
		max-height: calc(100dvh - 84px);
	}

	.tesla-share__toggle span {
		max-width: 7rem;
		margin-left: .55rem;
		opacity: 1;
	}

	.banner.curso .tesla-share {
		top: 18px;
		right: 16px;
		width: calc(100vw - 32px);
	}

	.tesla-share__toggle {
		width: auto;
		margin-left: auto;
	}

	.tesla-share__menu {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		width: 100%;
	}

	.tesla-share__menu[hidden] {
		display: none !important;
	}

	.tesla-share__option {
		flex-direction: column;
		justify-content: center;
		min-height: 76px;
		padding: .5rem .25rem;
		gap: .35rem;
		border-right: 1px solid rgba(255,255,255,.55);
		border-bottom: 0;
		line-height: 1.08;
		text-align: center;
	}

	.tesla-share__option:last-of-type {
		border-right: 0;
	}

	.tesla-share__option:hover,
	.tesla-share__option:focus {
		padding-left: .25rem;
	}

	.tesla-share__option i {
		margin-right: 0;
	}
}

/* ORDEN 032 — Compartir móvil: derecha, escala 80% y separación de promoción */
@media (max-width: 767.98px) {
	.banner.curso .tesla-share {
		top: 32px;
		right: 8px;
		width: calc(100% - 16px);
		text-align: right;
		transform: scale(.8);
		transform-origin: top right;
	}

	.banner.curso .tesla-share .tesla-share__toggle {
		margin-left: 0;
	}
}

/* ORDEN 033 — menú alineado, panel móvil translúcido y Compartir sticky */
header.fixed-header .menu-card__courses-toggle,
header.fixed-header .menu-card .destacadomenu {
	justify-content: flex-start;
	text-align: left;
}

header.fixed-header .menu-card__courses-toggle::after {
	margin-left: auto;
}

@media (min-width: 768px) and (max-width: 991.98px) {
	.banner.curso .tesla-share {
		text-align: right;
	}

	.banner.curso .tesla-share .tesla-share__toggle {
		margin-left: 0;
	}
}

.tesla-course-mobile-divider,
.tesla-share-sticky-rail {
	display: none;
}

.tesla-course-content {
	overflow: visible;
}

@media (max-width: 767.98px) {
	header.fixed-header .menu-card,
	header.fixed-header .menu-card.collapsing {
		right: 12px;
		left: auto;
		width: calc(100% - 48px);
		max-width: 360px;
		margin-right: 0;
		margin-left: 0;
		background: rgba(255,255,255,.70);
		-webkit-backdrop-filter: blur(10px) saturate(120%);
		backdrop-filter: blur(10px) saturate(120%);
	}

	.tesla-course-mobile-divider {
		display: block;
		box-sizing: border-box;
		height: 32px;
		border-top: 2px solid #bb0112;
		background: #f3f3f3;
	}

	.tesla-share-sticky-rail.is-active {
		position: sticky;
		top: calc(64px + env(safe-area-inset-top, 0px));
		z-index: 1000;
		display: flex;
		justify-content: flex-end;
		width: 100%;
		min-height: 52px;
		padding: 4px 8px 2px;
		background: linear-gradient(90deg, rgba(255,255,255,0) 18%, rgba(35,35,35,.52) 100%);
		box-shadow: 0 2px 0 rgba(187,1,18,.25);
	}

	.tesla-share-sticky-rail .tesla-share {
		position: relative;
		top: auto;
		right: auto;
		width: calc(100% - 16px);
		text-align: right;
		transform: scale(.8);
		transform-origin: top right;
	}

	.tesla-share-sticky-rail .tesla-share__toggle {
		margin-left: 0;
	}

	.tesla-share-sticky-rail .tesla-share__menu {
		position: static;
		margin-left: auto;
	}
}
