html,
body {
	touch-action: pan-x pan-y;
	-ms-touch-action: pan-x pan-y;
}

/*
 * iPad/iPhone: evita el “rebote” (espacio vacío al deslizar).
 * No depende de max-width: muchos iPads en landscape superan 1024px.
 */
html.jj-ios,
html.jj-ios body,
body.jj-ios {
	overscroll-behavior: none;
	overscroll-behavior-y: none;
	overscroll-behavior-x: none;
}

/* Páginas internas (blog, singles…): el scroll vive en body, sin rebote del viewport */
html.jj-ios:not(.jj-ios-home) {
	height: 100%;
	overflow: hidden;
}

html.jj-ios:not(.jj-ios-home) body {
	height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-y: none;
	position: relative;
}

html.jj-ios:not(.jj-ios-home) .vlt-site-wrapper,
html.jj-ios:not(.jj-ios-home) .vlt-content-holder,
html.jj-ios:not(.jj-ios-home) #page,
html.jj-ios:not(.jj-ios-home) .vlt-page-content {
	overscroll-behavior-y: none;
}

/*
 * Home fullpage en iPhone/iPad (incluye iPad landscape >1024):
 * body fijo + touch-action none = Safari no puede “tirar” del documento.
 */
html.jj-ios-home {
	height: 100% !important;
	width: 100% !important;
	overflow: hidden !important;
	overscroll-behavior: none !important;
	touch-action: none;
	-ms-touch-action: none;
}

html.jj-ios-home body.home,
body.home.jj-ios,
body.home.jj-ios-home {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-height: 100% !important;
	overflow: hidden !important;
	overscroll-behavior: none !important;
	touch-action: none;
	-ms-touch-action: none;
	-webkit-overflow-scrolling: auto;
}

html.jj-ios-home .vlt-site-wrapper,
html.jj-ios-home .vlt-content-holder,
html.jj-ios-home #page,
html.jj-ios-home .vlt-main,
html.jj-ios-home .vlt-fullpage-slider,
html.jj-ios-home #pagepiling,
html.jj-ios-home .pp-wrapper,
html.jj-ios-home .pp-section,
html.jj-ios-home .vlt-section,
html.jj-ios-home .fp-section,
html.jj-ios-home .fullpage-wrapper {
	overscroll-behavior: none !important;
	overscroll-behavior-y: none !important;
	touch-action: none;
	-ms-touch-action: none;
}

/* Scroll interno permitido solo donde hace falta */
html.jj-ios-home .pp-scrollable,
html.jj-ios-home .vlt-section.pp-scrollable,
html.jj-ios-home .vlt-offcanvas-menu,
html.jj-ios-home .vlt-offcanvas-menu__navigation,
html.jj-ios-home .jj-asistente {
	touch-action: pan-y;
	-ms-touch-action: pan-y;
	overscroll-behavior-y: contain;
}

body.home {
	overscroll-behavior-y: none;
}

body.home .vlt-fullpage-slider,
body.home #pagepiling,
body.home .pp-section,
body.home .vlt-section.pp-scrollable {
	overscroll-behavior-y: none;
}

.jj-offcanvas-close {
	display: none;
}

.vlt-offcanvas-menu__navigation .menu-item-text svg {
	display: none !important;
}

/*
 * Merge desplaza el texto a la izquierda para dejar sitio al icono hover.
 * Como el SVG está oculto, ese translateX recorta el inicio de cada ítem.
 */
.vlt-offcanvas-menu__navigation ul.sf-menu > li > a span.menu-item-text,
.vlt-offcanvas-menu__navigation a span.menu-item-text,
.vlt-offcanvas-menu__navigation .menu-item-text {
	-webkit-transform: none !important;
	-ms-transform: none !important;
	transform: none !important;
}

.jj-offcanvas-socials {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	width: 100%;
	margin: 18px 0 10px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.jj-offcanvas-socials a {
	width: 36px;
	height: 36px;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.jj-offcanvas-socials svg {
	width: 22px;
	height: 22px;
	display: block;
}

.vlt-offcanvas-menu {
	background-color: rgba(12, 12, 16, 0.24) !important;
	background-image: none !important;
	-webkit-backdrop-filter: blur(24px) saturate(180%) !important;
	backdrop-filter: blur(24px) saturate(180%) !important;
	backface-visibility: visible !important;
}

.vlt-site-overlay,
.vlt-site-overlay.is-open {
	background: rgba(0, 0, 0, 0.22) !important;
	background-color: rgba(0, 0, 0, 0.22) !important;
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
}

.vlt-site-overlay.is-open::before,
.vlt-site-overlay.is-open::after {
	display: none !important;
	content: none !important;
	opacity: 0 !important;
	background: none !important;
}

.vlt-offcanvas-menu__locales .gt_float_switcher,
.vlt-offcanvas-menu__locales .gt-selected,
.vlt-offcanvas-menu__locales .gt-current-lang {
	font-size: 13px !important;
	line-height: 1.2 !important;
}

.vlt-offcanvas-menu__locales .gt-current-lang,
.vlt-offcanvas-menu__locales .gt_options a {
	padding: 5px 9px !important;
	font-size: 13px !important;
}

.vlt-offcanvas-menu__locales .gt_float_switcher img,
.vlt-offcanvas-menu__locales .gt-current-lang img,
.vlt-offcanvas-menu__locales .gt_options img {
	width: 20px !important;
	height: auto !important;
	max-height: 15px !important;
}

.vlt-offcanvas-menu__locales .gt-lang-code {
	font-size: 12px !important;
}

.vlt-offcanvas-menu__locales .gt_float_switcher-arrow {
	width: 11px !important;
	height: 16px !important;
}

.vlt-offcanvas-menu__subscribe .vlt-form-group,
.vlt-offcanvas-menu .vlt-subscribe-form .vlt-form-group {
	display: flex !important;
	align-items: center;
	max-width: 100%;
	overflow: hidden;
}

.vlt-offcanvas-menu__subscribe input,
.vlt-offcanvas-menu__subscribe input[type='text'],
.vlt-offcanvas-menu__subscribe input[type='email'],
.vlt-offcanvas-menu__subscribe textarea,
.vlt-offcanvas-menu .vlt-subscribe-form input,
.vlt-offcanvas-menu .vlt-subscribe-form input.wpcf7-form-control,
.vlt-offcanvas-menu .vlt-subscribe-form input.wpcf7-email,
.vlt-offcanvas-menu .vlt-subscribe-form input.wpcf7-text,
.vlt-offcanvas-menu .vlt-form-group input,
.vlt-offcanvas-menu .wpcf7 input,
.vlt-offcanvas-menu .wpcf7 input.wpcf7-form-control,
.vlt-offcanvas-menu .wpcf7 textarea {
	font-size: 16px !important;
	line-height: 1.35 !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	transform: none !important;
	touch-action: manipulation;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.vlt-offcanvas-menu__subscribe input::placeholder,
.vlt-offcanvas-menu .wpcf7 input::placeholder {
	font-size: 16px !important;
	line-height: 1.35 !important;
}

.vlt-offcanvas-menu .wpcf7-response-output,
.vlt-offcanvas-menu .wpcf7 form .wpcf7-response-output,
.vlt-offcanvas-menu .wpcf7-not-valid-tip,
.vlt-offcanvas-menu .wpcf7-not-valid-tip-no-ajax {
	display: none !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
	position: absolute !important;
	visibility: hidden !important;
}

.jj-nl-toast {
	position: fixed;
	left: 50%;
	right: auto;
	top: calc(env(safe-area-inset-top, 0px) + 72px);
	bottom: auto;
	z-index: 100050;
	width: min(420px, calc(100vw - 88px));
	max-width: calc(100vw - 88px);
	padding: 12px 16px;
	border-radius: 12px;
	background: rgba(17, 17, 17, 0.94);
	color: #fff;
	font-size: 13px;
	line-height: 1.35;
	text-align: center;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 10px);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.jj-nl-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

@media (min-width: 1025px) {
	.jj-nl-toast {
		top: 28px;
		width: min(420px, calc(100vw - 48px));
		max-width: calc(100vw - 48px);
	}
}

.jj-nl-toast.is-ok {
	border: 1px solid rgba(0, 189, 255, 0.45);
}

.jj-nl-toast.is-error {
	border: 1px solid rgba(255, 90, 90, 0.5);
}

/* Altura real del móvil: la barra del navegador no debe recortar el header. */

@media (max-width: 1024px) {
	:root {
		--vlt-navbar-height: 3.5rem;
		--jj-app-height: 100svh;
	}

	html:has(body.home),
	body.home {
		height: var(--jj-app-height);
		min-height: var(--jj-app-height);
		overscroll-behavior-y: none;
		-webkit-overflow-scrolling: auto;
	}

	body.home .vlt-fullpage-slider {
		overscroll-behavior-y: none;
	}

	body.home .pp-section,
	body.home .vlt-section.pp-scrollable {
		overscroll-behavior-y: none;
	}

	body.home .fullpage-wrapper,
	body.home .fp-container,
	body.home #fullpage,
	body.home .fp-section,
	body.home .vlt-section,
	body.home .fp-tableCell {
		height: var(--jj-app-height) !important;
		max-height: var(--jj-app-height) !important;
	}

	html:has(body:not(.home)),
	body:not(.home),
	body:not(.home) .vlt-site-wrapper,
	body:not(.home) .vlt-main {
		height: auto !important;
		max-height: none !important;
		overflow: visible !important;
	}

	body:not(.home) {
		overflow-x: hidden !important;
		overflow-y: auto !important;
	}

	.vlt-header--default,
	.vlt-header--mobile {
		top: 0 !important;
		padding-top: env(safe-area-inset-top, 0px);
	}

	.vlt-navbar .vlt-navbar-inner {
		min-height: var(--vlt-navbar-height);
	}

	.vlt-navbar-buttons > a,
	.vlt-bar-button {
		width: var(--vlt-navbar-height) !important;
		height: var(--vlt-navbar-height) !important;
	}

	.vlt-offcanvas-menu {
		padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px 28px 64px !important;
		overflow: hidden !important;
		box-sizing: border-box;
	}

	.vlt-site-overlay,
	.vlt-site-overlay.is-open {
		background: transparent !important;
		background-color: transparent !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
	}

	.vlt-offcanvas-menu__subscribe {
		margin-bottom: 18px !important;
		margin-right: 60px !important;
		max-width: calc(100% - 60px);
	}

	.vlt-offcanvas-menu .vlt-nav-table {
		height: 100%;
		max-height: 100%;
	}

	.vlt-offcanvas-menu__navigation a,
	.vlt-offcanvas-menu__navigation a .menu-item-text,
	.vlt-offcanvas-menu__navigation .current-menu-item > a,
	.vlt-offcanvas-menu__navigation .current-menu-item .menu-item-text,
	.vlt-offcanvas-menu__navigation a:hover,
	.vlt-offcanvas-menu__navigation a:focus {
		color: #fff !important;
	}

	.vlt-offcanvas-menu__navigation a svg,
	.vlt-offcanvas-menu__navigation a svg path,
	.vlt-offcanvas-menu__navigation .menu-item-text svg {
		display: none !important;
	}

	.vlt-offcanvas-menu__navigation a {
		font-size: clamp(22px, 6vw, 26px) !important;
		line-height: 1.25 !important;
		padding-top: 6px !important;
		padding-bottom: 6px !important;
		opacity: 0.7;
	}

	.vlt-offcanvas-menu__navigation li.jj-menu-active > a,
	.vlt-offcanvas-menu__navigation a:hover,
	.vlt-offcanvas-menu__navigation a:focus {
		opacity: 1;
	}

	.vlt-offcanvas-menu__navigation li {
		margin: 0 !important;
	}

	.jj-offcanvas-socials {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 16px;
		width: 100%;
		margin: 18px 0 10px;
		padding-top: 18px;
		border-top: 1px solid rgba(255, 255, 255, 0.4);
	}

	.jj-offcanvas-socials a {
		width: 36px;
		height: 36px;
		color: #fff;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		text-decoration: none;
	}

	.jj-offcanvas-socials svg {
		width: 22px;
		height: 22px;
		display: block;
	}

	.vlt-offcanvas-menu__locales {
		visibility: visible !important;
		text-align: center !important;
		display: flex !important;
		flex-direction: column;
		align-items: center !important;
		justify-content: center !important;
		width: 100% !important;
	}

	.vlt-offcanvas-menu__locales .vlt-display-2 {
		text-align: center !important;
		width: 100%;
	}

	.vlt-offcanvas-menu__locales nav,
	.vlt-offcanvas-menu__locales .gtranslate_wrapper,
	.vlt-offcanvas-menu__locales .gt_container-jncns5,
	.vlt-offcanvas-menu__locales #gt_float_wrapper,
	.vlt-offcanvas-menu__locales .gt_float_wrapper {
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
		text-align: center !important;
	}

	.vlt-offcanvas-menu__locales .gt_float_switcher,
	.vlt-offcanvas-menu__locales .gt-selected,
	.vlt-offcanvas-menu__locales .gt-current-lang {
		font-size: 13px !important;
		line-height: 1.2 !important;
	}

	.vlt-offcanvas-menu__locales .gt-current-lang,
	.vlt-offcanvas-menu__locales .gt_options a {
		padding: 5px 9px !important;
		font-size: 13px !important;
	}

	.vlt-offcanvas-menu__locales .gt_float_switcher img,
	.vlt-offcanvas-menu__locales .gt-current-lang img,
	.vlt-offcanvas-menu__locales .gt_options img {
		width: 20px !important;
		height: auto !important;
		max-height: 15px !important;
	}

	.vlt-offcanvas-menu__locales .gt-lang-code {
		font-size: 12px !important;
	}

	.vlt-offcanvas-menu__locales .gt_float_switcher-arrow {
		width: 11px !important;
		height: 16px !important;
	}

	.jj-offcanvas-close {
		position: absolute;
		top: calc(env(safe-area-inset-top, 0px) + 28px);
		right: 12px;
		z-index: 30;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: transparent;
		color: #fff;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}

	.jj-offcanvas-close svg {
		width: 26px;
		height: 26px;
		display: block;
	}
}

/* Header móvil: IA izquierda, wordmark Juanjo al centro, menú a la derecha. */
.jj-header-mobile .vlt-navbar-inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.jj-header-mobile .vlt-navbar-buttons--left {
	display: flex;
	align-items: center;
	z-index: 2;
	margin: 0 !important;
}

.jj-header-mobile .vlt-navbar-logo {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: auto !important;
	height: auto !important;
	max-width: 52%;
	z-index: 1;
	justify-content: center;
}

.jj-header-mobile .vlt-navbar-logo img,
.jj-header-mobile .jj-navbar-wordmark {
	width: auto !important;
	height: auto !important;
	max-height: 22px !important;
	max-width: 168px !important;
	object-fit: contain;
}

.jj-header-mobile .vlt-navbar-buttons {
	z-index: 2;
}

.jj-header-mobile .jj-menu-toggle {
	width: 48px !important;
	height: var(--vlt-navbar-height, 3.5rem) !important;
	margin-right: 8px;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border: 0 !important;
}

.jj-header-mobile .jj-menu-toggle::before,
.jj-header-mobile .jj-menu-toggle::after {
	display: none !important;
	background: none !important;
	content: none !important;
}

.jj-header-mobile .jj-menu-toggle__bars {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 22px;
	height: 14px;
}

.jj-header-mobile .jj-menu-toggle__bars span {
	display: block;
	width: 100%;
	height: 2px;
	background: #fff;
	border-radius: 1px;
}

/* Preloader solo en la home. */
body:not(.home) .vlt-site-preloader {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.jj-preloader-logo {
	display: none;
}

@media (max-width: 1024px) {
	.jj-preloader-logo {
		display: block;
		position: absolute;
		left: 50%;
		top: calc(50% + 22.5vw + 18px);
		transform: translateX(-50%);
		width: min(168px, 46vw);
		height: auto;
		margin: 0;
		opacity: 0.7;
		z-index: 2;
		pointer-events: none;
	}
}
