/* Secciones del final de una categoría (bloques em-wine-store/category-packs y category-siblings;
   #packs-tintos y #otros-tipos de docs/ux/categoria-tintos.html). Se carga con los bloques, también
   en el editor. Aire entre secciones: el del home (custom.section de theme.json). Doble clase para
   ganarle a :root :where(.is-layout-*) > *. */

.wp-block-em-wine-store-category-packs.ws-category-packs,
.wp-block-em-wine-store-category-siblings.ws-category-siblings {
	margin-block-start: var(--wp--custom--section--space);
}

.ws-category-packs .wp-block-woocommerce-product-collection {
	margin: 0;
}

/* Packs: una fila (4 en desktop, 3 en tablet vertical); bajo 700 px, una card horizontal por fila. */
@media (min-width: 700px) {
	.ws-category-packs .wc-block-product-template.wc-block-product-template__responsive {
		gap: var(--wp--custom--section--grid-gap);
	}
}

@media (min-width: 700px) and (max-width: 1023px) {
	.wp-block-em-wine-store-category-packs.ws-category-packs,
	.wp-block-em-wine-store-category-siblings.ws-category-siblings {
		margin-block-start: var(--wp--custom--section--space-tablet);
	}

	.ws-category-packs .wc-block-product:nth-child(n+4) {
		display: none;
	}
}

/* ---- Otras categorías: links con foto ------------------------------------------------ */
.ws-category-links {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
}

.ws-category-link {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
	align-items: center;
	padding: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	background: var(--wp--preset--color--surface);
	border-width: 1px;
	border-style: solid;
	border-color: var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--x-large);
	transition: border-color var(--wp--custom--transition--fast);
}

.ws-category-link:hover {
	border-color: var(--wp--preset--color--primary);
}

.ws-category-link__image {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
	background: var(--wp--preset--color--surface-sunken);
	border-radius: var(--wp--preset--border-radius--medium);
}

.ws-category-link__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20);
	min-width: 0;
}

.ws-category-link__name {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--lead);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--tight);
	letter-spacing: var(--wp--custom--letter-spacing--heading);
}

.ws-category-link__name .ws-type-dot {
	flex: none;
}

/* El link es toda la tarjeta: "Ver blancos" se ve como link con flecha, sin ser otro link. */
.ws-category-link .ws-link-arrow {
	font-size: var(--wp--preset--font-size--small);
}

.ws-category-link:hover .ws-link-arrow {
	color: var(--wp--preset--color--primary-hover);
}

@media (max-width: 1279px) {
	.ws-category-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 699px) {
	.wp-block-em-wine-store-category-packs.ws-category-packs,
	.wp-block-em-wine-store-category-siblings.ws-category-siblings {
		margin-block-start: var(--wp--custom--section--space-compact);
	}

	.ws-category-links {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--wp--preset--spacing--20);
	}

	.ws-category-link {
		gap: var(--wp--preset--spacing--30);
		padding: var(--wp--preset--spacing--20);
	}

	.ws-category-link__image {
		width: 56px;
		height: 56px;
	}
}
