/*
 * Marinelli · portada: hero, beneficios, categorías, promo y servicios.
 * Solo se carga en la página de inicio (ver inc/setup.php). El HTML lo genera inc/homepage.php.
 */

/* ------------------------------------------------------------------ Hero */
.m-hero {
	position: relative;
	overflow: hidden;
	background: var(--m-gradient);
	color: #fff;
	padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(4rem, 9vw, 7.5rem);
	isolation: isolate;
}

.m-hero__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

.m-hero__blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: .55;
	animation: m-float 16s ease-in-out infinite alternate;
}

.m-hero__blob--1 {
	width: 560px;
	height: 560px;
	background: #2A2AB8;
	top: -200px;
	right: -120px;
}

.m-hero__blob--2 {
	width: 460px;
	height: 460px;
	background: #5CB8F2;
	bottom: -240px;
	left: 8%;
	animation-delay: -7s;
}

.m-hero__grid {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.5px);
	background-size: 28px 28px;
	-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent 85%);
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent 85%);
}

@keyframes m-float {
	from { transform: translate3d(0, 0, 0) scale(1); }
	to { transform: translate3d(40px, -50px, 0) scale(1.08); }
}

@keyframes m-bob {
	0%, 100% { translate: 0 0; }
	50% { translate: 0 -12px; }
}

.m-hero__inner {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	gap: 3rem;
	align-items: center;
}

.m-hero__inner::before,
.m-hero__inner::after {
	content: none;
	display: none;
}

.m-hero__copy > .m-reveal:nth-child(2) { --delay: 80ms; }
.m-hero__copy > .m-reveal:nth-child(3) { --delay: 160ms; }
.m-hero__copy > .m-reveal:nth-child(4) { --delay: 240ms; }
.m-hero__copy > .m-reveal:nth-child(5) { --delay: 320ms; }

.marinelli .m-hero__title {
	font-size: clamp(2.2rem, 4.6vw, 3.7rem);
	line-height: 1.06;
	letter-spacing: -.03em;
	color: #fff;
	margin: .5rem 0 1.1rem;
	font-weight: 800;
	max-width: 14ch;
}

.m-hero__title em {
	font-style: normal;
	color: var(--m-sky-l);
}

.m-hero__text {
	font-size: clamp(1rem, 1.4vw, 1.2rem);
	color: rgba(255, 255, 255, .86);
	max-width: 50ch;
	line-height: 1.6;
	margin: 0 0 1.8rem;
}

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

.m-hero__trust {
	list-style: none;
	display: flex;
	gap: 1.4rem;
	flex-wrap: wrap;
	margin: 1.9rem 0 0;
	padding: 0;
	font-size: .9rem;
	font-weight: 600;
	color: rgba(255, 255, 255, .88);
}

.m-hero__trust li {
	display: flex;
	gap: .4rem;
	align-items: center;
	margin: 0;
}

.m-hero__trust .m-icon {
	color: var(--m-sky-l);
}

.m-hero__visual {
	position: relative;
	height: 400px;
}

.m-hero__card {
	position: absolute;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .7rem;
	padding: 1.15rem 1.4rem;
	min-width: 150px;
	background: rgba(255, 255, 255, .12);
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 18px;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 1rem;
	box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .5);
	transition: transform .35s var(--m-ease), background-color .35s;
	animation: m-bob 6s ease-in-out infinite;
}

.m-hero__card .m-icon {
	width: 2.1rem;
	height: 2.1rem;
	color: var(--m-sky-l);
}

.m-hero__card:hover {
	background: rgba(255, 255, 255, .24);
	transform: translateY(-4px) scale(1.04);
	color: #fff;
}

.m-hero__card--1 { top: 4%; left: 6%; }
.m-hero__card--2 { top: 14%; right: 2%; animation-delay: -1.5s; }
.m-hero__card--3 { bottom: 16%; left: 18%; animation-delay: -3s; }
.m-hero__card--4 { bottom: 2%; right: 10%; animation-delay: -4.5s; }

/* ------------------------------------------------------------------ Beneficios */
.m-benefits {
	margin-top: -3rem;
	position: relative;
	z-index: 2;
}

.m-benefits__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
}

.m-benefit {
	display: flex;
	gap: .9rem;
	align-items: flex-start;
	background: #fff;
	border: 1px solid var(--m-border);
	border-radius: var(--m-radius);
	padding: 1.15rem 1.2rem;
	box-shadow: var(--m-shadow-sm);
	margin: 0;
	transition: transform .3s var(--m-ease), box-shadow .3s var(--m-ease);
}

.m-benefit:hover {
	transform: translateY(-3px);
	box-shadow: var(--m-shadow);
}

.m-benefit__icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--m-sky-100);
	color: var(--m-sky-600);
	display: grid;
	place-items: center;
	flex: none;
}

.m-benefit__icon .m-icon {
	width: 22px;
	height: 22px;
}

.m-benefit__title {
	font-size: .98rem;
	margin: 0 0 .2rem;
	font-weight: 800;
}

.m-benefit__text {
	margin: 0;
	font-size: .85rem;
	color: var(--m-muted);
	line-height: 1.45;
}

/* ------------------------------------------------------------------ Categorías */
.m-cat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.2rem;
}

.m-cat-card {
	--cat-color: var(--m-blue);
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--m-border);
	border-radius: var(--m-radius);
	overflow: hidden;
	text-decoration: none;
	color: var(--m-ink);
	position: relative;
	transition: transform .35s var(--m-ease), box-shadow .35s var(--m-ease), border-color .35s;
}

.m-cat-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--m-shadow-lg);
	border-color: transparent;
	color: var(--m-ink);
}

.m-cat-card:first-child {
	grid-column: span 2;
}

.m-cat-card__media {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--cat-color);
	display: grid;
	place-items: center;
}

.m-cat-card:first-child .m-cat-card__media {
	aspect-ratio: 3.12 / 1;
}

/* La imagen se posiciona en absoluto: así el alto lo define el aspect-ratio del contenedor
   y object-fit la recorta centrada, sin importar la proporción del archivo. */
.m-cat-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .7s var(--m-ease);
}

.m-cat-card:hover .m-cat-card__media img {
	transform: scale(1.06);
}

.m-cat-card__fallback {
	width: 40%;
	height: 40%;
	color: #fff;
}

.m-cat-card__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto; /* el título puede achicarse; la flecha nunca se sale */
	grid-template-rows: auto auto;
	column-gap: .6rem;
	padding: 1rem 1.1rem 1.1rem;
	align-items: center;
}

.m-cat-card__title {
	grid-column: 1;
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
	transition: color .2s;
}

.m-cat-card:hover .m-cat-card__title {
	color: var(--m-blue);
}

.m-cat-card__count {
	grid-column: 1;
	font-size: .8rem;
	color: var(--m-muted);
	font-weight: 600;
	white-space: nowrap;
}

.m-cat-card__arrow {
	grid-column: 2;
	grid-row: 1 / 3;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--m-blue-50);
	color: var(--m-blue);
	display: grid;
	place-items: center;
	transition: background-color .3s, color .3s, transform .3s var(--m-ease);
}

.m-cat-card:hover .m-cat-card__arrow {
	background: var(--cat-color);
	color: #fff;
	transform: translateX(3px);
}

/* ------------------------------------------------------------------ Promo transferencia */
.m-promo {
	position: relative;
	overflow: hidden;
	display: grid;
	grid-template-columns: 1.3fr .7fr;
	align-items: center;
	gap: 2rem;
	background: linear-gradient(120deg, #1F7BD1 0%, #5CB8F2 45%, #111178 130%);
	color: #fff;
	border-radius: 22px;
	padding: clamp(1.6rem, 4vw, 3rem);
	box-shadow: var(--m-shadow);
}

.m-promo::before {
	content: "";
	position: absolute;
	width: 420px;
	height: 420px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	top: -200px;
	right: -100px;
}

.m-promo__copy {
	position: relative;
}

.marinelli .m-promo__title {
	color: #fff;
	font-size: clamp(1.5rem, 3vw, 2.3rem);
	font-weight: 800;
	letter-spacing: -.02em;
	margin: .3rem 0 .6rem;
	line-height: 1.15;
}

.m-promo__title strong {
	color: #fff;
	background: rgba(17, 17, 120, .35);
	padding: 0 .35em;
	border-radius: 10px;
}

.m-promo__text {
	color: rgba(255, 255, 255, .92);
	margin: 0 0 1.4rem;
	max-width: 50ch;
	line-height: 1.55;
}

.m-promo__art {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 170px;
}

.m-promo__art > .m-icon {
	width: 170px;
	height: 170px;
	opacity: .2;
	color: #fff;
	stroke-width: 1.1;
}

.m-promo__pill {
	position: absolute;
	background: #fff;
	color: var(--m-sky-600);
	font-weight: 800;
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1;
	padding: .25em .6em;
	border-radius: 999px;
	box-shadow: var(--m-shadow-lg);
	transform: rotate(-6deg);
	animation: m-bob 5s ease-in-out infinite;
}

/* ------------------------------------------------------------------ Servicios */
.m-services__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.2rem;
}

.m-service {
	background: #fff;
	border: 1px solid var(--m-border);
	border-radius: var(--m-radius);
	padding: 1.4rem 1.3rem;
	text-decoration: none;
	color: var(--m-ink);
	display: flex;
	flex-direction: column;
	gap: .7rem;
	transition: transform .3s var(--m-ease), box-shadow .3s var(--m-ease), border-color .3s;
}

.m-service:hover {
	transform: translateY(-4px);
	box-shadow: var(--m-shadow);
	border-color: var(--m-blue-100);
	color: var(--m-ink);
}

.m-service__icon {
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: var(--m-blue-50);
	color: var(--m-blue);
	display: grid;
	place-items: center;
	transition: background-color .3s, color .3s;
}

.m-service:hover .m-service__icon {
	background: var(--m-blue);
	color: #fff;
}

.m-service__icon .m-icon {
	width: 24px;
	height: 24px;
}

.m-service__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 800;
}

.m-service__text {
	margin: 0;
	color: var(--m-muted);
	font-size: .88rem;
	line-height: 1.5;
}

/* ------------------------------------------------------------------ Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
	.m-hero__blob,
	.m-hero__card,
	.m-promo__pill {
		animation: none;
	}
}

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1024px) {
	.m-hero__visual {
		height: 340px;
	}
}

@media (max-width: 900px) {
	.m-hero__inner {
		grid-template-columns: 1fr;
		gap: 2.2rem;
	}

	.m-hero__visual {
		height: auto;
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: .8rem;
	}

	.m-hero__card {
		position: static;
		animation: none;
		min-width: 0;
	}

	.m-benefits__list,
	.m-cat-grid,
	.m-services__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.m-cat-card:first-child .m-cat-card__media {
		aspect-ratio: 2.2 / 1;
	}

	.m-promo {
		grid-template-columns: 1fr;
	}

	.m-promo__art {
		min-height: 120px;
	}
}

@media (max-width: 560px) {
	.m-hero__visual {
		grid-template-columns: repeat(2, 1fr);
	}

	.m-hero__card {
		padding: .9rem 1rem;
		font-size: .9rem;
	}

	.m-benefits {
		margin-top: 1.5rem;
	}

	.m-benefits__list,
	.m-services__grid {
		grid-template-columns: 1fr;
	}

	.m-cat-grid {
		gap: .8rem;
	}

	.m-cat-card__body {
		padding: .8rem .9rem;
	}

	.m-cat-card__title {
		font-size: .95rem;
	}
}

/* ------------------------------------------------------------------ Carrusel hero */
/* Los slides se apilan; el activo queda en el flujo (define la altura) y el resto en absoluto para el fundido. */
.m-carousel {
	position: relative;
	overflow: hidden;
	background: var(--m-gradient);
	color: #fff;
}

.m-carousel__track {
	position: relative;
}

.m-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .8s var(--m-ease), visibility 0s linear .8s;
}

.m-slide.is-active {
	position: relative;
	opacity: 1;
	visibility: visible;
	transition: opacity .8s var(--m-ease), visibility 0s;
	z-index: 1;
}

/* La imagen manda: el alto sale de la proporción real de cada imagen (--m-slide-ratio, la pone el tema), así
   no se recorta el texto que traiga; 16:7 es el respaldo (tamaño recomendado 1600 x 700). En pantallas muy
   anchas se limita el alto y se recorta apenas arriba y abajo. Conviene que todos los slides compartan
   proporción para que el carrusel no cambie de alto al pasar de uno a otro. */
.m-slide__media {
	position: relative;
	width: 100%;
	aspect-ratio: var(--m-slide-ratio, 16 / 7);
	max-height: 600px;
	z-index: 0;
}

.m-slide__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Si el slide tiene enlace, toda la imagen es clickeable. */
.m-slide__link {
	position: absolute;
	inset: 0;
	z-index: 2;
}

/* Selector con "button" a propósito: theme.css mueve todos los botones al pasar el mouse
   (.marinelli button:not(:disabled):hover { transform: translateY(-1px) }) y eso le sacaba a la flecha el
   translateY(-50%) que la centraba: "bajaba" 22 px. Acá se centra con translate y transform queda en none. */
.marinelli button.m-carousel__arrow {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	transform: none;
	box-shadow: none;
	z-index: 3;
	width: 46px;
	height: 46px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .35);
	background: rgba(255, 255, 255, .14);
	color: #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: background-color .25s;
}

.marinelli button.m-carousel__arrow:not(:disabled):hover,
.marinelli button.m-carousel__arrow:focus-visible {
	background: rgba(255, 255, 255, .3);
	transform: none;
	box-shadow: none;
}

.m-carousel__arrow--prev { left: 16px; }
.m-carousel__arrow--next { right: 16px; }

.m-carousel__arrow .m-icon {
	width: 22px;
	height: 22px;
}

.m-carousel__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 18px;
	z-index: 3;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.marinelli .m-carousel__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .45);
	cursor: pointer;
	box-shadow: none;
	transition: width .3s var(--m-ease), background-color .3s;
}

.marinelli .m-carousel__dot:hover {
	transform: none;
	box-shadow: none;
	background: rgba(255, 255, 255, .75);
}

.marinelli .m-carousel__dot.is-active {
	width: 28px;
	background: #fff;
}

@media (max-width: 767px) {
	.marinelli button.m-carousel__arrow {
		display: none;
	}
}

/* ------------------------------------------------------------------ Pop-up */
.m-popup {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	padding: 16px;
	opacity: 0;
	transition: opacity .3s ease;
}

.m-popup.is-open {
	opacity: 1;
}

.m-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 11, 79, .6);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.m-popup__card {
	position: relative;
	width: min(520px, 100%);
	max-height: calc(100vh - 32px);
	overflow: auto;
	background: #fff;
	border-radius: 20px;
	box-shadow: var(--m-shadow-lg);
	transform: translateY(16px) scale(.98);
	transition: transform .35s var(--m-ease);
}

.m-popup.is-open .m-popup__card {
	transform: none;
}

.marinelli .m-popup__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--m-ink);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	box-shadow: var(--m-shadow-sm);
}

.marinelli .m-popup__close:hover {
	background: #fff;
	transform: none;
}

.m-popup__media {
	display: block;
	background: var(--m-blue-50);
}

.m-popup__media img {
	width: 100%;
	height: auto;
	display: block;
}

.m-popup__body {
	padding: 1.4rem 1.6rem 1.7rem;
	text-align: center;
}

.marinelli .m-popup__title {
	margin: 0 0 .5rem;
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -.02em;
}

.m-popup__text {
	margin: 0 0 1.2rem;
	color: var(--m-text);
	line-height: 1.55;
}

/* El pop-up arranca con el atributo hidden; sin esta regla, display:grid le ganaría al navegador y el
   fondo transparente quedaría tapando la página (bloqueaba flechas y deslizamiento del carrusel). */
.m-popup[hidden] {
	display: none;
}

.m-popup:not(.is-open) {
	pointer-events: none;
}

/* Carrusel en celulares: la imagen manda el alto (sin recortes). */
@media (max-width: 767px) {
	.m-carousel__track {
		min-height: 0;
	}

	.m-slide {
		flex-direction: column;
		align-items: stretch;
		min-height: 0;
	}

	.m-carousel__dots {
		bottom: 12px;
	}
}

/* Celulares: cambio de slide instantáneo (más liviano que el fundido). */
@media (max-width: 767px) {
	.m-slide,
	.m-slide.is-active {
		transition: none;
	}
}

/* La imagen del pop-up se achica en pantallas bajas (notebooks) para que la tarjeta completa entre en la
   ventana sin barra de desplazamiento; se muestra entera (contain), nunca recortada. */
.m-popup__card {
	overflow: hidden;
}

.m-popup__media img {
	max-height: calc(100vh - 300px);
	min-height: 160px;
	object-fit: contain;
	background: #fff;
}

.m-popup__body {
	padding-top: 1.1rem;
	padding-bottom: 1.4rem;
}

@media (max-height: 560px) {
	.m-popup__media {
		display: none;
	}
}

/* Celulares muy angostos (320 px): las tarjetas de categoría miden ~135 px, así que la flecha se oculta y
   el título usa todo el ancho (con la flecha, palabras como "Seguridad" se partían por letra). */
@media (max-width: 360px) {
	.m-cat-card__arrow {
		display: none;
	}

	.m-cat-card__body {
		grid-template-columns: 1fr;
		padding: .7rem .8rem;
	}

	.m-cat-card__title {
		font-size: .95rem;
	}
}
