/* ============================================================================
 * Khome Hero — estilos del carrusel.
 * Valores de animación copiados de design/home-v2/Home-v2.dc.html (clases
 * .k-img, .k-txt, .k-w, .k-up, .k-dot). No tocar sin revisar el HANDOFF §5.
 * ========================================================================== */

.k-hero {
	position: relative;
	height: 860px;
	overflow: hidden;
	background: #d9d4cf;
	font-family: 'Nunito Sans', sans-serif;
	color: #fff;
}

/* --- Fotos: fundido lento + zoom suave --------------------------------- */
.k-hero .k-img {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 1.6s cubic-bezier(.4, 0, .2, 1);
}
.k-hero .k-img[data-on="true"] {
	opacity: 1;
}
.k-hero .k-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1.12);
	transition: transform 0s 1.7s; /* reset del zoom cuando ya es invisible */
}
.k-hero .k-img[data-on="true"] img {
	transform: scale(1);
	transition: transform 9s cubic-bezier(.2, .6, .2, 1);
}

/* --- Capa oscura ------------------------------------------------------- */
.k-hero-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(0, 0, 0, .38) 0%, rgba(0, 0, 0, 0) 62%),
		linear-gradient(180deg, rgba(0, 0, 0, .38) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, .58) 100%);
}

/* --- Texto ------------------------------------------------------------- */
.k-hero-foot {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
}
.k-hero-in {
	max-width: 1360px;
	margin: 0 auto;
	padding: 0 24px 104px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	align-items: flex-start;
}
.k-hero-h1 {
	margin: 0;
	font-family: 'Nunito Sans', sans-serif;
	font-size: 13px;
	line-height: 1.4;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 700;
	color: #fff;
}
.k-hero-stack {
	display: grid;
	width: 100%;
}
.k-h {
	font-family: 'PP Agrandir', 'Nunito Sans', sans-serif;
	letter-spacing: -0.005em;
}

/* El titular rota: cada slide ocupa la misma celda del grid */
.k-txt {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	gap: 18px;
	align-items: flex-start;
	justify-content: flex-end;
	opacity: 0;
	transition: opacity .45s ease;
}
.k-txt[data-on="true"] {
	opacity: 1;
	transition: opacity .2s ease;
}

.k-hero-h {
	margin: 0;
	font-size: 68px;
	line-height: 1.02;
	font-weight: 700;
	color: #fff;
	max-width: 12em;
}

/* --- Titular palabra a palabra desde una máscara ---------------------- */
.k-w {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
	padding-bottom: .1em;
	margin-bottom: -.1em;
	margin-right: .24em;
}
.k-w > span {
	display: inline-block;
	transform: translateY(110%);
	transition: transform .45s cubic-bezier(.7, 0, .84, 0);
}
.k-txt[data-on="true"] .k-w > span {
	transform: none;
	transition: transform 1.1s cubic-bezier(.16, 1, .3, 1);
}

/* Texto y botones suben */
.k-up {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity .35s ease, transform .35s ease;
}
.k-txt[data-on="true"] .k-up {
	opacity: 1;
	transform: none;
	transition: opacity .9s ease, transform 1s cubic-bezier(.16, 1, .3, 1);
}
.k-txt[data-on="true"] .k-up1 {
	transition-delay: .85s;
}
.k-txt[data-on="true"] .k-up2 {
	transition-delay: 1.05s;
}

.k-hero-p {
	margin: 0;
	font-size: 18px;
	line-height: 1.55;
	max-width: 32em;
	color: #f3f3f3;
}
.k-hero-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 8px;
}

/* --- Botones ----------------------------------------------------------- */
.k-hero .k-btn {
	background: #fff;
	color: #111;
	text-decoration: none;
	font-weight: 700;
	font-size: 16px;
	padding: 16px 40px;
	border-radius: 0;
	display: inline-block;
}
.k-hero .k-btn-o {
	border: 1.5px solid #fff;
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 16px;
	padding: 14.5px 32px;
	border-radius: 0;
	display: inline-block;
}

/* --- Controles --------------------------------------------------------- */
.k-ctrl {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 32px;
}
.k-ctrl-in {
	max-width: 1360px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 16px;
	color: #fff;
}
.k-dots {
	display: flex;
	gap: 6px;
}
/* Prefijado + !important: el tema añade borde negro y fondo a todos los <button>. */
.k-hero .k-dot-btn {
	width: 44px;
	height: 44px;
	border: 0 !important;
	background: none !important;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.k-dot {
	position: relative;
	display: block;
	width: 32px;
	height: 2px;
	background: rgba(255, 255, 255, .4);
	overflow: hidden;
}
.k-dot > i {
	position: absolute;
	inset: 0;
	background: #fff;
	transform: scaleX(0);
	transform-origin: left;
	transition: none;
}
.k-dot[data-on="true"] > i {
	transform: scaleX(1);
	transition: transform var(--k-duration, 6s) linear;
}
/* Sin autoplay (o al hacer clic) la rayita activa se rellena de golpe */
.k-dot[data-on="true"][data-auto="false"] > i {
	transition: transform .4s ease;
}
.k-counter {
	font-size: 13px;
	letter-spacing: 0.08em;
	min-width: 44px;
	text-align: center;
}
/* Prefijado con .k-hero + !important: el tema (GeneratePress/Kit) aplica a todos los
   <button> color negro, border-radius 0 y afecta al svg; hay que ganarle. */
.k-hero .k-arrow {
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, .7) !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: #fff !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.k-hero .k-arrow svg {
	width: 18px !important;
	height: 18px !important;
	display: block;
}
/* El tema fija el color del svg a negro; forzar el trazo blanco directamente
   (más fiable que depender de currentColor). */
.k-hero .k-arrow svg path {
	stroke: #fff !important;
}

/* --- Foco accesible ---------------------------------------------------- */
.k-hero a:focus-visible,
.k-hero button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* --- prefers-reduced-motion: solo fundidos ---------------------------- */
@media (prefers-reduced-motion: reduce) {
	.k-hero .k-img img,
	.k-hero .k-img[data-on="true"] img {
		transform: none;
		transition: none;
	}
	.k-w > span,
	.k-up,
	.k-txt[data-on="true"] .k-w > span,
	.k-txt[data-on="true"] .k-up {
		transform: none;
		transition: opacity .3s;
	}
	.k-dot[data-on="true"] > i {
		transition: none;
	}
}

/* --- Móvil / tablet pequeña (≤ 767 px) --------------------------------
 * OJO con el breakpoint: la ALTURA del hero la controla Elementor (controles de
 * altura del widget) y baja a 600px a ≤767px (y a 720px a ≤1024px). El tamaño del
 * titular debe encoger EN EL MISMO punto (≤767), si no, entre 641 y 767px el hero
 * mide 600px pero el titular sigue a 68px: se parte en muchas líneas y, como el
 * texto va anclado abajo, se sube y se solapa con el menú. Por eso este bloque va
 * a ≤767 (antes estaba a ≤640, que era justo la franja rota). */
@media (max-width: 767px) {
	.k-hide-sm {
		display: none !important;
	}
	.k-hero {
		height: 600px !important;
	}
	.k-hero-in {
		padding-bottom: 84px !important;
		gap: 12px !important;
	}
	.k-hero-h {
		font-size: 34px !important;
		line-height: 1.06 !important;
	}
	.k-txt {
		gap: 12px !important;
	}
	.k-hero-p {
		font-size: 15px !important;
		line-height: 1.5 !important;
	}
	.k-hero-btns {
		margin-top: 4px !important;
	}
	.k-hero .k-btn {
		font-size: 14px !important;
		padding: 12px 22px !important;
	}
	.k-ctrl {
		bottom: 16px !important;
	}
	.k-ctrl-in {
		justify-content: flex-start !important;
		gap: 4px !important;
	}
}
