/* ════════════════════════════════════════════════════
   CARRUSEL DE SUBCATEGORÍAS (arriba del loop de productos)
   Ver fitness-pro-category-carousel.php - solo aparece si la
   categoría actual tiene hijas (hoy: Línea Residencial).
════════════════════════════════════════════════════ */

.fp-cat-carousel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 32px;
}

.fp-cat-carousel-track {
	display: flex;
	justify-content: center;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	flex: 1 1 auto;
	padding: 4px 2px 12px;
	/* Oculta la barra de scroll nativa - el swipe sigue funcionando,
	   la navegación visible queda a cargo de las flechas/gesto táctil. */
	scrollbar-width: none;
}

.fp-cat-carousel-track::-webkit-scrollbar {
	display: none;
}

/* 8 visibles en escritorio: ancho = (100% - 7 gaps) / 8. */
.fp-cat-carousel-item {
	flex: 0 0 calc((100% - 7 * 16px) / 8);
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none;
	gap: 10px;
}

.fp-cat-carousel-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 104px;
	height: 104px;
	border-radius: 50%;
	background: #f4f4f2;
	border: 1px solid #e4e4e1;
	overflow: hidden;
	flex-shrink: 0;
	transition: border-color .15s ease, transform .15s ease;
}

.fp-cat-carousel-item:hover .fp-cat-carousel-icon {
	border-color: var(--theme-palette-color-1, #FA0000);
	transform: translateY(-2px);
}

/* Principal (o subcategoría) que corresponde a la página actual - la
   fila entera sigue mostrándose igual, esta solo se resalta (a pedido
   del cliente, las categorías principales de Residencial ya no
   desaparecen al elegir una - ver fitness-pro-category-carousel.php). */
.fp-cat-carousel-item.is-active .fp-cat-carousel-icon {
	border-color: var(--theme-palette-color-1, #FA0000);
	border-width: 2px;
}

.fp-cat-carousel-item.is-active .fp-cat-carousel-name {
	color: var(--theme-palette-color-1, #FA0000);
}

/* Segunda fila (subcategorías de la principal activa, ej. Cardio) -
   como si la fila de arriba fuera pestañas y esto fuera su panel. */
.fp-cat-carousel-fila2 {
	margin-top: -16px;
}

/* Con la fila 1 en estilo "pestaña" (Profesional - ver más abajo), sin
   el padding-bottom del track de tarjetas que la de arriba sí tiene,
   así que en vez de acercarla hace falta separarla un poco más -
   selector de 2 clases, le gana en especificidad a la regla de arriba. */
.fp-cat-carousel-tabs + .fp-cat-carousel-fila2 {
	margin-top: 12px;
}

/* ── Fila de "pestañas" (Profesional: Tren Inferior/Tren Superior/
   Multiestaciones/Cardio) - solo texto con borde, sin miniatura, a
   diferencia de las tarjetas con ícono de arriba. Siempre las 4
   presentes (ver fitness-pro-category-carousel.php), la actual
   resaltada con relleno.
   MISMO estilo exacto que las pestañas del shortcode
   [fp_tipo_entrenamiento] (ver .fp-te-tab-buttons/.fp-te-tab-btn en
   tipo-entrenamiento.css) - a pedido del cliente, para que ambos
   lugares se vean idénticos. ── */
.fp-cat-carousel-tabs {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 32px;
}

.fp-cat-carousel-tab {
	flex: 0 0 190px;
	height: 58px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 20px;
	border: 1px solid #e2e0db;
	border-radius: 8px;
	text-decoration: none;
	background: #fff;
	color: #1a1a1a;
	font-family: 'Fjalla One', sans-serif;
	font-weight: 500;
	font-size: 15px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-align: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
	transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
	/* Reset por si el elemento es un <button> en vez de un <a> (ver
	   [fp_parques_tabs] en fitness-pro-parques-tabs.php) - sin esto
	   hereda el estilo nativo del navegador para botones. */
	appearance: none;
	cursor: pointer;
	margin: 0;
}

.fp-cat-carousel-tab:hover {
	border-color: var(--theme-palette-color-1, #FA0000);
	color: var(--theme-palette-color-1, #FA0000);
	box-shadow: 0 8px 18px rgba(0, 0, 0, .1);
}

.fp-cat-carousel-tab.is-active {
	background: var(--theme-palette-color-1, #FA0000);
	border-color: var(--theme-palette-color-1, #FA0000);
	color: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
}

@media (max-width: 768px) {
	.fp-cat-carousel-tabs {
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 10px;
	}

	.fp-cat-carousel-tabs::-webkit-scrollbar {
		display: none;
	}

	.fp-cat-carousel-tab {
		flex: 0 0 160px;
		height: 50px;
		padding: 0 14px;
		font-size: 12px;
	}
}

.fp-cat-carousel-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fp-cat-carousel-icon-fallback {
	font-family: 'Fjalla One', sans-serif;
	font-size: 28px;
	color: var(--theme-palette-color-1, #FA0000);
}

.fp-cat-carousel-name {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #1a1a1a;
	line-height: 1.3;
}

/* Ocultas por defecto - fitness-pro-category-carousel/category-carousel.js
   les agrega .fp-cat-carousel--scrollable al contenedor solo cuando el
   contenido realmente desborda el ancho visible (si entran las 8/3
   categorías sin necesidad de deslizar, no tiene sentido mostrarlas). */
.fp-cat-carousel-arrow {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid #e4e4e1;
	background: #fff;
	color: #1a1a1a;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease;
}

.fp-cat-carousel--scrollable .fp-cat-carousel-arrow {
	display: flex;
}

.fp-cat-carousel-arrow:hover {
	border-color: var(--theme-palette-color-1, #FA0000);
	color: var(--theme-palette-color-1, #FA0000);
}

/* ── RESPONSIVE ──
   3 visibles en mobile: ancho = (100% - 2 gaps) / 3. Las flechas se
   ocultan - el carrusel se desliza con el dedo directamente
   (overflow-x + scroll-snap ya lo permiten sin JS). */
@media (max-width: 768px) {
	.fp-cat-carousel-item {
		flex: 0 0 calc((100% - 2 * 16px) / 3);
	}

	.fp-cat-carousel-icon {
		width: 64px;
		height: 64px;
	}

	.fp-cat-carousel-name {
		font-size: 11px;
	}

	.fp-cat-carousel-arrow {
		display: none !important;
	}
}
