/**
 * Gomaeme Hero - estilos del front
 * Texto fijo a la izquierda, fichas rotativas a la derecha.
 * El color de acento llega por la variable --gh-accent (inyectada desde PHP).
 */

.gomaeme-hero {
	--gh-accent: #c8102e;       /* sombra del botón principal (= color del botón) */
	--gh-title: #1a1a1a;        /* color del título */
	--gh-sub: #444444;          /* color del subtítulo */
	--gh-btn1-bg: #c8102e;      /* fondo botón principal */
	--gh-btn1-text: #ffffff;    /* texto botón principal */
	--gh-btn2-bg: #ffffff;      /* fondo botón secundario */
	--gh-btn2-text: #1a1a1a;    /* texto botón secundario */
	--gh-radius: 14px;
	--gh-gap: clamp(24px, 5vw, 64px);
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	/* Padding vertical chico para no pasar el alto objetivo. */
	padding: 10px clamp(20px, 5vw, 60px);
	overflow: hidden;
}

.gomaeme-hero *,
.gomaeme-hero *::before,
.gomaeme-hero *::after {
	box-sizing: border-box;
}

.gomaeme-hero .gh-inner {
	max-width: 1240px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: var(--gh-gap);
}

/* --- Columna de texto (fija) --- */
.gomaeme-hero .gh-text {
	min-width: 0;
}

.gomaeme-hero .gh-heading {
	margin: 0 0 .5em;
	font-size: clamp(1.9rem, 3.4vw, 3.1rem);
	line-height: 1.08;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--gh-title);
}

.gomaeme-hero .gh-sub {
	margin: 0 0 1.6em;
	font-size: clamp(1rem, 1.4vw, 1.15rem);
	line-height: 1.6;
	max-width: 46ch;
	color: var(--gh-sub);
}

.gomaeme-hero .gh-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.gomaeme-hero .gh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 26px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
	cursor: pointer;
}

.gomaeme-hero .gh-btn-primary {
	background: var(--gh-btn1-bg);
	color: var(--gh-btn1-text);
	box-shadow: 0 6px 18px -6px var(--gh-accent);
}

.gomaeme-hero .gh-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px -6px var(--gh-accent);
	color: var(--gh-btn1-text);
}

/* Botón secundario: relleno, con fondo y texto propios (sin borde),
   igual que el principal. */
.gomaeme-hero .gh-btn-ghost {
	background: var(--gh-btn2-bg);
	color: var(--gh-btn2-text);
	box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .30);
}

.gomaeme-hero .gh-btn-ghost:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .30);
	color: var(--gh-btn2-text);
}

/* --- Columna de fichas --- */
.gomaeme-hero .gh-cards {
	position: relative;
	width: 100%;
	max-width: 480px;
	height: 360px;          /* marco 4:3 (480x360); entra en 400px con el padding */
	margin-inline: auto;
	overflow: hidden;       /* el marco recorta la animación, no la fila de afuera */
	border-radius: var(--gh-radius);
}

/* Ficha (foto). Todas apiladas; solo la activa se ve. */
.gomaeme-hero .gh-card {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: var(--gh-radius);
	overflow: hidden;
	background: transparent; /* deja ver la transparencia de los PNG */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-42px) rotate(-3deg);
	transition:
		opacity .5s ease,
		transform .55s cubic-bezier(.22, 1, .36, 1),
		visibility 0s linear .55s;
	will-change: transform, opacity;
}

.gomaeme-hero .gh-card.is-active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) rotate(0);
	transition:
		opacity .5s ease,
		transform .55s cubic-bezier(.22, 1, .36, 1),
		visibility 0s;
	z-index: 2;
}

/* La ficha saliente se va hacia abajo suavemente. */
.gomaeme-hero .gh-card.is-leaving {
	opacity: 0;
	visibility: visible;
	transform: translateY(34px) rotate(2deg) scale(.97);
	z-index: 1;
	transition:
		opacity .45s ease,
		transform .5s ease;
}

.gomaeme-hero .gh-card-link {
	display: block;
	width: 100%;
	height: 100%;
}

.gomaeme-hero .gh-card-img {
	width: 100%;
	height: 100%;
	object-fit: contain; /* muestra el producto completo sin recortar */
	display: block;
}

.gomaeme-hero .gh-card--empty {
	opacity: 1;
	visibility: visible;
	transform: none;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 24px;
	color: #666;
	font-size: .95rem;
	background: #f5f5f5;
	border: 2px dashed #ccc;
}

/* --- Altura máxima en escritorio (para entrar en una fila de 400px) --- */
@media (min-width: 861px) {
	.gomaeme-hero {
		max-height: 400px;
	}
}

/* --- Responsive (celular / ventana angosta) --- */
@media (max-width: 860px) {
	/* Importante: en mobile el hero NO tiene alto máximo, crece con su
	   contenido. La altura fija de 440px debe aplicarse solo en escritorio
	   (ver el CSS personalizado de WordPress). */
	.gomaeme-hero {
		padding-top: 18px;
		padding-bottom: 18px;
	}
	.gomaeme-hero .gh-inner {
		grid-template-columns: 1fr;
		text-align: center;
	}
	.gomaeme-hero .gh-sub {
		margin-inline: auto;
	}
	.gomaeme-hero .gh-buttons {
		justify-content: center;
	}
	.gomaeme-hero .gh-cards {
		max-width: 320px;   /* marco 4:3 (320x240) en pantallas chicas */
		height: 240px;
		order: -1;          /* imágenes arriba en mobile */
		margin-bottom: 14px;
	}
}

/* --- Accesibilidad: respetar "reducir movimiento" --- */
@media (prefers-reduced-motion: reduce) {
	.gomaeme-hero .gh-card,
	.gomaeme-hero .gh-card.is-active,
	.gomaeme-hero .gh-card.is-leaving {
		transform: none;
		transition: opacity .4s ease, visibility 0s;
	}
	.gomaeme-hero .gh-cards::before,
	.gomaeme-hero .gh-cards::after {
		transform: none;
		opacity: .5;
	}
}
