/* =============================================================================
   Cabecera de la tienda (patrón em-wine-store/shop-hero, templates/archive-product.html)
   -----------------------------------------------------------------------------
   .cat-hero de docs/ux/categoria-tintos.html: título y descripción sobre negro a la
   izquierda y la foto a la derecha, fundidos con un degradado. Bajo 700 px la foto
   ocupa toda la cabecera y el texto va abajo, sobre un degradado desde el pie.
   La foto es un bloque Imagen (se cambia en el editor del sitio). Se carga solo en
   la tienda, sus categorías y etiquetas (inc/shop-hero.php) y en el editor.
   Solo tokens de theme.json.
   ============================================================================= */

.wp-block-group.ws-shop-hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: var(--wp--custom--shop--hero-min-height);
	margin-block: 0;
	overflow: hidden;
	border-radius: var(--wp--preset--border-radius--xx-large);
}

.ws-shop-hero > .ws-shop-hero__photo {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 0;
	width: 50%;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

/* En el editor la imagen lleva height: auto en línea: min-height la estira y top + translate la
   centran (en la tienda, con height: 100%, se anulan). */
.ws-shop-hero > .ws-shop-hero__photo img {
	position: relative;
	top: 50%;
	width: 100%;
	height: 100%;
	min-height: 100%;
	translate: 0 -50%;
	object-fit: cover;
	object-position: 50% 42%;
}

/* Fundido del negro del texto hacia la foto. */
.ws-shop-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg,
		var(--wp--preset--color--inverse) 50%,
		color-mix(in srgb, var(--wp--preset--color--inverse) 55%, transparent) 56%,
		transparent 72%);
	pointer-events: none;
}

.ws-shop-hero > .ws-shop-hero__copy {
	position: relative;
	z-index: 2;
	box-sizing: border-box;
	width: 52%;
	margin: 0;
	padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60) var(--wp--preset--spacing--70) var(--wp--preset--spacing--80);
}

/* Hasta los filtros y la grilla, el espacio de la maqueta (el blockGap del main es menor). */
.ws-shop-hero + .wp-block-columns.ws-shop {
	margin-block-start: var(--wp--custom--shop--hero-gap);
}

.ws-shop-hero__copy > * {
	margin-block: 0;
}

.ws-shop-hero .ws-shop-hero__title {
	color: inherit;
	line-height: var(--wp--custom--line-height--tight);
}

.ws-shop-hero .ws-shop-hero__text {
	max-width: 40ch;
	margin-block-start: var(--wp--preset--spacing--30);
	line-height: var(--wp--custom--line-height--normal);
}

.ws-shop-hero .ws-shop-hero__text > * {
	margin: 0;
}

/* ===== Tablet (≤1023 px) ===== */
@media (max-width: 1023px) {
	.wp-block-group.ws-shop-hero {
		min-height: var(--wp--custom--shop--hero-min-height-compact);
	}

	.ws-shop-hero + .wp-block-columns.ws-shop {
		margin-block-start: var(--wp--custom--shop--hero-gap-compact);
	}

	.ws-shop-hero > .ws-shop-hero__photo {
		width: 48%;
	}

	.ws-shop-hero::before {
		background: linear-gradient(90deg,
			var(--wp--preset--color--inverse) 52%,
			color-mix(in srgb, var(--wp--preset--color--inverse) 55%, transparent) 58%,
			transparent 74%);
	}

	.ws-shop-hero > .ws-shop-hero__copy {
		width: 56%;
		padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50) var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
	}

	.ws-shop-hero .ws-shop-hero__title {
		font-size: var(--wp--preset--font-size--x-large);
	}

	.ws-shop-hero .ws-shop-hero__text {
		font-size: var(--wp--preset--font-size--body);
	}
}

/* ===== Mobile (≤699 px): la foto ocupa la cabecera y el texto va abajo ===== */
@media (max-width: 699px) {
	.wp-block-group.ws-shop-hero {
		align-items: flex-end;
		min-height: var(--wp--custom--shop--hero-min-height-mobile);
		border-radius: var(--wp--preset--border-radius--x-large);
	}

	.ws-shop-hero + .wp-block-columns.ws-shop {
		margin-block-start: var(--wp--custom--shop--hero-gap-mobile);
	}

	.ws-shop-hero > .ws-shop-hero__photo {
		width: 100%;
	}

	.ws-shop-hero > .ws-shop-hero__photo img {
		object-position: 50% 30%;
	}

	.ws-shop-hero::before {
		background: linear-gradient(0deg,
			color-mix(in srgb, var(--wp--preset--color--inverse) 94%, transparent) 0%,
			color-mix(in srgb, var(--wp--preset--color--inverse) 78%, transparent) 48%,
			color-mix(in srgb, var(--wp--preset--color--inverse) 15%, transparent) 85%,
			transparent 100%);
	}

	.ws-shop-hero > .ws-shop-hero__copy {
		width: 100%;
		padding: 0 var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);
	}

	.ws-shop-hero .ws-shop-hero__title {
		font-size: var(--wp--preset--font-size--x-large);
	}

	.ws-shop-hero .ws-shop-hero__text {
		margin-block-start: var(--wp--preset--spacing--20);
		font-size: var(--wp--preset--font-size--body-small);
	}
}

/* Teléfono o tablet en horizontal (poco alto): cabecera más baja, para que la primera pantalla alcance a mostrar
   "Filtrar" y el comienzo de la grilla. */
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 600px) {
	.wp-block-group.ws-shop-hero {
		min-height: var(--wp--custom--shop--hero-min-height-landscape);
	}
}
