/**
 * Mallorkinas Product Showcase — carrusel.
 */
/* ============================================================
 * Carrusel por categoría
 * Todo acotado bajo .mallorkinas-category-carousel:
 * no toca el grid principal ni otras listas de WooCommerce.
 * ============================================================ */
.mallorkinas-category-carousel {
	position: relative;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

.mallorkinas-category-carousel .mkps-carousel__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	outline: none;
}
.mallorkinas-category-carousel .mkps-carousel__viewport::-webkit-scrollbar {
	display: none;
}
.mallorkinas-category-carousel .mkps-carousel__viewport:focus-visible {
	outline: 2px solid #60123f;
	outline-offset: 2px;
}

.mallorkinas-category-carousel ul.products.mkps-carousel__track {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	gap: 16px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	height: auto !important;
}

/*
 * El ancho de cada card se calcula en porcentaje del viewport del carrusel
 * (el <ul> flex ocupa el 100% del viewport aunque su contenido desborde).
 * Escritorio: 4 visibles · Tablet: 3 · Móvil: 2.
 */
.mallorkinas-category-carousel ul.products.mkps-carousel__track li.product.mallorkinas-card {
	flex: 0 0 calc((100% - 48px) / 4) !important;
	width: calc((100% - 48px) / 4) !important;
	max-width: none !important;
	margin: 0 !important;
	float: none !important;
	scroll-snap-align: start;
	box-sizing: border-box;
}

/* Tablet: 3 cards visibles */
@media (max-width: 1024px) and (min-width: 768px) {
	.mallorkinas-category-carousel ul.products.mkps-carousel__track li.product.mallorkinas-card {
		flex: 0 0 calc((100% - 32px) / 3) !important;
		width: calc((100% - 32px) / 3) !important;
	}
}

/* Móvil: 2 cards visibles */
@media (max-width: 767px) {
	.mallorkinas-category-carousel ul.products.mkps-carousel__track {
		gap: 12px;
	}
	.mallorkinas-category-carousel ul.products.mkps-carousel__track li.product.mallorkinas-card {
		flex: 0 0 calc((100% - 12px) / 2) !important;
		width: calc((100% - 12px) / 2) !important;
	}
}

/* Flechas: abajo en los extremos, moradas */
.mallorkinas-category-carousel .mkps-carousel__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 4px;
	padding: 0;
}

.mallorkinas-category-carousel .mkps-carousel__nav[hidden] {
	display: none;
}

.mallorkinas-category-carousel .mkps-carousel__arrow {
	position: static;
	transform: none;
	z-index: 1;
	width: auto;
	height: auto;
	min-width: 36px;
	min-height: 36px;
	padding: 4px;
	border: none;
	border-radius: 0;
	background: transparent;
	color: #60123f;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color 0.2s ease, opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.mallorkinas-category-carousel .mkps-carousel__arrow-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.mallorkinas-category-carousel .mkps-carousel__arrow-icon svg {
	display: block;
	width: 22px;
	height: 22px;
}

.mallorkinas-category-carousel .mkps-carousel__arrow-icon--prev {
	transform: rotate(90deg);
}

.mallorkinas-category-carousel .mkps-carousel__arrow-icon--next {
	transform: rotate(-90deg);
}

.mallorkinas-category-carousel .mkps-carousel__arrow:hover,
.mallorkinas-category-carousel .mkps-carousel__arrow:focus {
	background: transparent;
	color: #4a0e31;
	outline: none;
}

.mallorkinas-category-carousel .mkps-carousel__arrow:focus-visible {
	outline: 2px solid #60123f;
	outline-offset: 3px;
}

.mallorkinas-category-carousel .mkps-carousel__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

.mallorkinas-category-carousel .mkps-carousel__arrow--prev,
.mallorkinas-category-carousel .mkps-carousel__arrow--next {
	left: auto;
	right: auto;
}

@media (max-width: 767px) {
	.mallorkinas-category-carousel .mkps-carousel__nav {
		margin-top: 2px;
	}

	.mallorkinas-category-carousel .mkps-carousel__arrow {
		min-width: 32px;
		min-height: 32px;
		padding: 2px;
	}

	.mallorkinas-category-carousel .mkps-carousel__arrow-icon svg {
		width: 20px;
		height: 20px;
	}
}

/* Mensaje vacío del carrusel */
.mallorkinas-category-carousel .mkps-carousel__empty {
	text-align: center;
	padding: 40px 24px;
	font-size: 16px;
	color: #888;
	margin: 0;
}
