/*
 * PF Comprar por Categoría — «shop by category» de Hardware Store Homepage.dc.html.
 * Solo estructura: los controles de Estilo escriben las custom properties.
 */

.pf-cats {
	--pf-cat-size: 88px;
	--pf-cat-gap: 22px;
	--pf-cat-pad: 0px;
	--pf-cat-fit: cover;
	--pf-cat-ring: var(--pf-orange);

	position: relative;
	padding: 48px 0 16px;
}

.pf-cats__title {
	margin: 0 0 28px;
	font-family: var(--pf-font-display);
	font-weight: 800;
	font-size: 26px;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--pf-ink);
	text-align: center;
}

.pf-cats__viewport {
	position: relative;
}

.pf-cats__track {
	display: flex;
	gap: var(--pf-cat-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	padding: 8px 6px 12px; /* 8 px: el aro de 3 px + el salto de 2 px del hover no se cortan. */
	scroll-padding-inline: 6px; /* Sin esto el snap arranca desplazado y aparece la flecha «‹». */
}

.pf-cats__track::-webkit-scrollbar {
	display: none;
}

/* Cuando todo cabe, se centra (el diseño con 7 categorías llena el ancho). */
.pf-cats.is-static .pf-cats__track {
	justify-content: center;
}

.pf-cats__item {
	flex: none;
	scroll-snap-align: start;
}

.pf-cats__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: calc(var(--pf-cat-size) + 8px);
	color: inherit;
}

.pf-cats__circle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--pf-cat-size);
	height: var(--pf-cat-size);
	padding: var(--pf-cat-pad);
	border-radius: 50%;
	border: 1px solid var(--pf-line);
	background: var(--pf-soft);
	overflow: hidden;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pf-cats__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: var(--pf-cat-fit);
	border-radius: 50%;
}

.pf-cats__mono {
	font-family: var(--pf-font-display);
	font-weight: 800;
	font-size: calc(var(--pf-cat-size) * 0.24);
	color: #fff;
}

.pf-cats__circle:has(.pf-cats__mono) {
	background: var(--pf-navy);
	border-color: var(--pf-navy);
}

.pf-cats__circle--lead {
	background: var(--pf-orange);
	border-color: var(--pf-orange);
	color: #fff;
	font-family: var(--pf-font-display);
	font-weight: 800;
	font-size: 15px;
	line-height: 1.1;
	text-align: center;
}

/* Aro de la activa: box-shadow en vez de borde de 3 px, para no mover el layout. */
.pf-cats__link.is-active .pf-cats__circle {
	box-shadow: 0 0 0 3px var(--pf-cat-ring);
	border-color: transparent;
}

.pf-cats__link:hover .pf-cats__circle {
	transform: translateY(-2px);
}

.pf-cats__label {
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--pf-ink);
	text-align: center;
	overflow-wrap: anywhere;
}

.pf-cats__link:hover .pf-cats__label {
	color: var(--pf-orange);
}

/* Flechas: fuera del flujo, a la altura de los círculos. */
.pf-cats-root .pf-cats__arrow {
	position: absolute;
	top: calc(8px + var(--pf-cat-size) / 2);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-top: -19px;
	border-radius: 50%;
	background-color: var(--pf-orange);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
	transition: background-color 0.15s ease;
}

.pf-cats-root .pf-cats__arrow:hover,
.pf-cats-root .pf-cats__arrow:focus {
	background-color: var(--pf-orange-dark);
	color: #fff;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.pf-cats-root .pf-cats__arrow[hidden] {
	display: none;
}

.pf-cats__arrow--prev {
	left: -6px;
}

.pf-cats__arrow--next {
	right: -6px;
}

/* Tablet y teléfono: círculos más chicos y el dedo manda (sin flechas). */
@media (max-width: 767px) {
	.pf-cats {
		--pf-cat-size: 72px;
		--pf-cat-gap: 14px;
		padding: 20px 0 4px;
	}

	.pf-cats__title {
		font-size: 21px;
		margin-bottom: 12px;
	}

	.pf-cats__label {
		font-size: 12px;
	}
}

@media (hover: none) {
	.pf-cats-root .pf-cats__arrow {
		display: none;
	}

	.pf-cats__link:hover .pf-cats__circle {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pf-cats__track {
		scroll-behavior: auto;
	}

	.pf-cats__circle {
		transition: none;
	}
}
