/**
 * WC Carrusel de Categorías - estilos del frontend.
 */

.wccc-carousel {
	--wccc-cols-desktop: 4;
	--wccc-cols-tablet: 3;
	--wccc-cols-mobile: 2;
	--wccc-gap: 20px;
	--wccc-title-color: #1f2937;
	--wccc-text-color: #6b7280;
	--wccc-accent: #7f54b3;
	--wccc-card-bg: #ffffff;
	--wccc-title-size: 16px;
	--wccc-radius: 12px;
	--wccc-align: center;

	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
}

.wccc-carousel *,
.wccc-carousel *::before,
.wccc-carousel *::after {
	box-sizing: border-box;
}

.wccc-viewport {
	position: relative;
	width: 100%;
}

/* --- Pista ------------------------------------------------------------- */

.wccc-track {
	display: flex;
	gap: var(--wccc-gap);
	margin: 0;
	padding: 6px 2px 14px;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.wccc-track::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.wccc-track:focus-visible {
	outline: 2px solid var(--wccc-accent);
	outline-offset: 4px;
}

.wccc-carousel[data-drag="1"] .wccc-track {
	cursor: grab;
}

.wccc-carousel.is-dragging .wccc-track {
	cursor: grabbing;
	scroll-snap-type: none;
}

.wccc-carousel.is-dragging .wccc-card {
	pointer-events: none;
}

.wccc-item {
	flex: 0 0 calc((100% - (var(--wccc-cols-desktop) - 1) * var(--wccc-gap)) / var(--wccc-cols-desktop));
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

.wccc-item::marker,
.wccc-item::before {
	content: none;
}

/* --- Tarjeta ----------------------------------------------------------- */

.wccc-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	padding: 12px;
	background: var(--wccc-card-bg);
	border-radius: var(--wccc-radius);
	text-align: var(--wccc-align);
	text-decoration: none;
	color: inherit;
	transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.wccc-carousel.wccc-has-shadow .wccc-card {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.wccc-card:hover,
.wccc-card:focus {
	text-decoration: none;
	color: inherit;
}

.wccc-card:focus-visible {
	outline: 2px solid var(--wccc-accent);
	outline-offset: 3px;
}

.wccc-hover-lift .wccc-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

/* --- Imagen ------------------------------------------------------------ */

.wccc-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--wccc-radius);
	background: rgba(0, 0, 0, 0.04);
}

@supports not (aspect-ratio: 1 / 1) {
	.wccc-thumb {
		height: 0;
		padding-top: 100%;
	}

	.wccc-thumb .wccc-img {
		position: absolute;
		top: 0;
		left: 0;
	}
}

.wccc-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
	border-radius: inherit;
	margin: 0;
}

.wccc-img--empty {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 10px, #e9eaee 10px, #e9eaee 20px);
}

.wccc-hover-zoom .wccc-card:hover .wccc-img {
	transform: scale(1.08);
}

.wccc-shape-circle .wccc-thumb {
	border-radius: 50%;
}

.wccc-shape-square .wccc-thumb {
	border-radius: 0;
}

/* --- Textos ------------------------------------------------------------ */

.wccc-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 4px 2px 2px;
}

.wccc-align-left .wccc-body {
	align-items: flex-start;
}

.wccc-align-center .wccc-body {
	align-items: center;
}

.wccc-align-right .wccc-body {
	align-items: flex-end;
}

.wccc-title {
	margin: 0;
	font-size: var(--wccc-title-size);
	line-height: 1.3;
	font-weight: 600;
	color: var(--wccc-title-color);
	word-wrap: break-word;
}

.wccc-count {
	font-size: 0.8125em;
	color: var(--wccc-text-color);
	opacity: 0.9;
}

.wccc-desc {
	margin: 2px 0 0;
	font-size: 0.875em;
	line-height: 1.5;
	color: var(--wccc-text-color);
}

/* --- Flechas ----------------------------------------------------------- */

.wccc-nav {
	position: absolute;
	top: 40%;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 50%;
	background: #fff;
	color: var(--wccc-accent);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.wccc-nav:hover {
	background: var(--wccc-accent);
	color: #fff;
}

.wccc-nav:focus-visible {
	outline: 2px solid var(--wccc-accent);
	outline-offset: 2px;
}

.wccc-nav--prev {
	left: -18px;
}

.wccc-nav--next {
	right: -18px;
}

.wccc-nav[disabled] {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.wccc-nav.is-hidden {
	display: none;
}

/* --- Puntos ------------------------------------------------------------ */

.wccc-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
}

.wccc-dots:empty {
	display: none;
}

.wccc-dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition: width 0.25s ease, background 0.25s ease;
}

.wccc-dot.is-active {
	width: 24px;
	border-radius: 6px;
	background: var(--wccc-accent);
}

.wccc-dot:focus-visible {
	outline: 2px solid var(--wccc-accent);
	outline-offset: 2px;
}

/* --- Avisos ------------------------------------------------------------ */

.wccc-empty {
	padding: 14px 16px;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	color: #6b7280;
	font-size: 14px;
}

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 1024px) {
	.wccc-item {
		flex-basis: calc((100% - (var(--wccc-cols-tablet) - 1) * var(--wccc-gap)) / var(--wccc-cols-tablet));
	}

	.wccc-nav--prev {
		left: 0;
	}

	.wccc-nav--next {
		right: 0;
	}
}

@media (max-width: 600px) {
	.wccc-item {
		flex-basis: calc((100% - (var(--wccc-cols-mobile) - 1) * var(--wccc-gap)) / var(--wccc-cols-mobile));
	}

	.wccc-nav {
		width: 34px;
		height: 34px;
	}

	.wccc-nav svg {
		width: 18px;
		height: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wccc-card,
	.wccc-img,
	.wccc-dot {
		transition: none;
	}
}
