/*
 * Mallorkinas Product Showcase — CSS frontend.
 * Migrado desde el snippet TIENDA+FILTROS_V2 (mk-grid-mobile, mk-layout-fix,
 * mk-filters-style) + estilos del carrusel por categoría.
 */

/* ============================================================
 * Cards del grid principal: usar el CSS base de mallorkinas-card
 * ============================================================ */
#mallorkinas-products ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	align-items: stretch;
}

#mallorkinas-products ul.products > li.product.mallorkinas-card {
	height: 100%;
	min-height: 100%;
}

#mallorkinas-products .mallorkinas-card {
	position: relative;
	list-style: none;
	background: #ffffff;
	border-radius: 0;
	overflow: hidden;
	border: 1px solid #f1e4ff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	height: 100%;
}

#mallorkinas-products .mallorkinas-card__image-wrap {
	position: relative;
}

#mallorkinas-products .mallorkinas-card__image-link {
	display: block;
}

#mallorkinas-products .mallorkinas-card__image-wrap,
.mallorkinas-category-carousel .mallorkinas-card__image-wrap {
	flex-shrink: 0;
}

#mallorkinas-products .mallorkinas-card__image,
.mallorkinas-category-carousel .mallorkinas-card__image {
	position: relative;
	overflow: hidden;
	aspect-ratio: 6 / 5;
}

#mallorkinas-products .mallorkinas-card__image img,
.mallorkinas-category-carousel .mallorkinas-card__image img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	object-position: center;
	transition: transform 0.35s ease;
}

#mallorkinas-products .mallorkinas-card:hover .mallorkinas-card__image img {
	transform: scale(1.03);
}

#mallorkinas-products .mallorkinas-card__image::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 45%;
	background: linear-gradient(to top, rgba(255,255,255,0.96), rgba(255,255,255,0));
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

#mallorkinas-products .mallorkinas-card__image::before {
	content: attr(data-title);
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	font-size: 15px;
	color: #b3b3b3;
	text-align: center;
	white-space: nowrap;
	max-width: 90%;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
	z-index: 1;
}

#mallorkinas-products .mallorkinas-card:hover .mallorkinas-card__image::after,
#mallorkinas-products .mallorkinas-card:hover .mallorkinas-card__image::before {
	opacity: 1;
}

#mallorkinas-products .mallorkinas-card__content {
	padding: 12px 12px 14px;
	text-align: center;
	display: flex;
	flex-direction: column;
	flex: 1;
}

#mallorkinas-products .mallorkinas-card__title {
	font-size: 14px;
	font-weight: 500;
	margin: 0 0 4px;
	color: #2d2733;
	line-height: 1.3;
	min-height: 2.6em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

#mallorkinas-products .mallorkinas-card__title a {
	color: inherit;
	text-decoration: none;
}

#mallorkinas-products .mallorkinas-card__price {
	display: block;
	font-size: 13px;
	color: #7c6f8f;
	margin-bottom: 10px;
	min-height: 1.35em;
}

#mallorkinas-products .mallorkinas-card__actions {
	margin-top: auto;
}

#mallorkinas-products .mallorkinas-card__actions .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 26px;
	border-radius: 0;
	border: none;
	border-bottom: 1px solid #b391a4;
	background: transparent;
	color: #b391a4;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	box-shadow: none;
	transition: color 0.2s ease, border-color 0.2s ease;
}

#mallorkinas-products .mallorkinas-card__actions .button:hover {
	background: transparent;
	color: #60123E;
	border-bottom: 1px solid #60123E;
	box-shadow: none;
}

#mallorkinas-products .mallorkinas-card__wishlist,
.mallorkinas-category-carousel .mallorkinas-card__wishlist {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 12;
}

#mallorkinas-products .mallorkinas-card__wishlist .wewl-button,
.mallorkinas-category-carousel .mallorkinas-card__wishlist .wewl-button {
	width: 32px;
	height: 32px;
	min-width: 32px;
	padding: 0;
	border: none;
	background: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	line-height: 1;
}

#mallorkinas-products .mallorkinas-card__wishlist .wewl-icon,
.mallorkinas-category-carousel .mallorkinas-card__wishlist .wewl-icon {
	font-size: 16px;
	color: #ffffff;
	line-height: 1;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1024px) {
	#mallorkinas-products ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	#mallorkinas-products ul.products {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 12px !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	#mallorkinas-products ul.products li.product {
		width: 100% !important;
		margin: 0 !important;
		float: none !important;
	}
}

/* ============================================================
 * Carrusel por categoría: misma estética base que las cards
 * ============================================================ */
.mallorkinas-category-carousel li.product.mallorkinas-card {
	position: relative;
	list-style: none;
	background: #ffffff;
	border-radius: 0;
	overflow: hidden;
	border: 1px solid #f1e4ff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.mallorkinas-category-carousel .mallorkinas-card__image-wrap {
	position: relative;
}

.mallorkinas-category-carousel .mallorkinas-card__image-link {
	display: block;
}

.mallorkinas-category-carousel .mallorkinas-card:hover .mallorkinas-card__image img {
	transform: scale(1.03);
}

.mallorkinas-category-carousel .mallorkinas-card__content {
	padding: 12px 12px 14px;
	text-align: center;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.mallorkinas-category-carousel .mallorkinas-card__title {
	font-size: 14px;
	font-weight: 500;
	margin: 0 0 4px;
	color: #2d2733;
	line-height: 1.3;
	min-height: 2.6em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mallorkinas-category-carousel .mallorkinas-card__title a {
	color: inherit;
	text-decoration: none;
}

.mallorkinas-category-carousel .mallorkinas-card__price {
	display: block;
	font-size: 13px;
	color: #7c6f8f;
	margin-bottom: 10px;
	min-height: 1.35em;
}

.mallorkinas-category-carousel .mallorkinas-card__actions {
	margin-top: auto;
}

.mallorkinas-category-carousel .mallorkinas-card__actions .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 26px;
	border-radius: 0;
	border: none;
	border-bottom: 1px solid #b391a4;
	background: transparent;
	color: #b391a4;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	box-shadow: none;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.mallorkinas-category-carousel .mallorkinas-card__actions .button:hover {
	background: transparent;
	color: #60123E;
	border-bottom: 1px solid #60123E;
	box-shadow: none;
}

/* Mensaje "sin resultados" */
#mallorkinas-products ul.products li.no-products-found {
	grid-column: 1 / -1 !important;
	width: 100% !important;
	float: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	padding: 60px 24px !important;
	font-size: 18px !important;
	font-weight: 400 !important;
	color: #888 !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	list-style: none !important;
}

/* ============================================================
 * Contenedores Elementor: altura variable según contenido.
 * Evita que --height fije la caja y meta el footer en medio.
 * ============================================================ */
.elementor-element-a434511,
.elementor-element-a434511 > .e-con-inner,
.elementor-element-a434511 .e-con,
.elementor-element-a434511 .e-con-inner,
#mallorkinas-products,
#mallorkinas-products ul.products {
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	overflow: visible !important;
}

@media (max-width: 767px) {
	.elementor-element-e5fbb60,
	.elementor-element-e5fbb60 > .e-con-inner {
		height: auto !important;
		min-height: 0 !important;
	}
}

/* ============================================================
 * Filtros: botón flotante abajo centrado + popup a pantalla
 * completa (estilo Louis Vuitton).
 * ============================================================ */
/*
 * El shortcode solo contiene elementos fijos (botón flotante) u ocultos
 * (popup), así que el bloque no debe reservar ninguna altura en Elementor.
 */
#mallorkinas-filters {
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	overflow: visible !important;
	display: block;
}

/* Botón flotante: pastilla oscura fija abajo, centrada */
#mk-filters-open {
	position: fixed;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	background: #60123f;
	color: #ffffff;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .04em;
	line-height: 1;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: background .2s ease, transform .2s ease;
	-webkit-appearance: none;
	appearance: none;
}
#mk-filters-open:hover,
#mk-filters-open:focus {
	background: #4a0e31;
	outline: none;
}
#mk-filters-open:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}
#mk-filters-open .mk-filters-open__icon {
	flex-shrink: 0;
	display: block;
}

/* Móvil: botón por encima de todo (switch de idiomas incluido)
 * y elevado un 5% de la altura de pantalla para no taparlo. */
@media (max-width: 767px) {
	#mk-filters-open {
		z-index: 999999 !important;
		bottom: calc(22px + 5vh);
	}
}

/* Con el popup abierto, el botón queda por debajo del overlay
 * (el overlay/panel usan z-index 100000). */
body.mk-filters-modal-open #mk-filters-open {
	z-index: 99999 !important;
}

/* Popup: panel blanco sobre overlay negro semitransparente */
.mk-filters-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
}
.mk-filters-modal[hidden] {
	display: none;
}

body.mk-filters-modal-open {
	overflow: hidden;
}

/* Overlay oscuro: clic para cerrar */
.mk-filters-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
}

/* Panel blanco anclado a la derecha, altura completa */
.mk-filters-modal__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	max-width: 620px;
	background: #ffffff;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
	animation: mk-filters-slide-in .28s ease;
}

@keyframes mk-filters-slide-in {
	from {
		transform: translateX(40px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Móvil: el panel ocupa casi todo el ancho, overlay visible en el borde */
@media (max-width: 767px) {
	.mk-filters-modal__panel {
		max-width: calc(100% - 44px);
	}
}

/* Cabecera: título + X */
.mk-filters-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px 18px;
	flex-shrink: 0;
}
.mk-filters-modal__title {
	margin: 0;
	font-size: 17px;
	font-weight: 400;
	letter-spacing: .02em;
	color: #1c1c1c;
}
.mk-filters-modal__close {
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	color: #1c1c1c;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background .2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.mk-filters-modal__close:hover,
.mk-filters-modal__close:focus {
	background: #f2f2f2;
	outline: none;
}

/* Cuerpo scrollable con los grupos de filtros */
.mk-filters-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 24px;
	-webkit-overflow-scrolling: touch;
}

#mallorkinas-filters-form {
	margin: 0;
	padding: 0;
}

#mallorkinas-filters-form .mallorkinas-filter-group {
	border-bottom: 1px solid #e5e5e5;
	margin: 0;
	padding: 0;
}
#mallorkinas-filters-form .mallorkinas-filter-group:first-child {
	border-top: 1px solid #e5e5e5;
}

/* Cabecera desplegable de cada grupo */
#mallorkinas-filters-form .mk-group-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 20px 4px;
	margin: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 15px;
	font-weight: 400;
	color: #1c1c1c;
	letter-spacing: .02em;
	text-align: left;
	line-height: 1;
	-webkit-appearance: none;
	appearance: none;
}
#mallorkinas-filters-form .mk-group-toggle:focus {
	outline: none;
}
#mallorkinas-filters-form .mk-group-toggle:focus-visible {
	outline: 2px solid #1c1c1c;
	outline-offset: 2px;
}
#mallorkinas-filters-form .mk-group-chevron {
	font-style: normal;
	font-size: 14px;
	color: #1c1c1c;
	transition: transform .25s ease;
	display: inline-block;
}
#mallorkinas-filters-form .mk-group-toggle[aria-expanded="true"] .mk-group-chevron {
	transform: rotate(180deg);
}

#mallorkinas-filters-form .mk-group-body {
	padding: 0 4px 20px;
}

#mallorkinas-filters-form .mallorkinas-filter-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 0;
	font-size: 14px;
	color: #333;
	cursor: pointer;
}
#mallorkinas-filters-form .mallorkinas-filter-item input[type="checkbox"] {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: #1c1c1c;
}

/* Pie: botón "Mostrar artículos" */
.mk-filters-modal__footer {
	flex-shrink: 0;
	padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
	background: #ffffff;
	box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06);
}
.mk-filters-modal__apply {
	display: block;
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	padding: 15px 24px;
	background: #1c1c1c;
	color: #ffffff;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .04em;
	line-height: 1;
	transition: background .2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.mk-filters-modal__apply:hover,
.mk-filters-modal__apply:focus {
	background: #3a3a3a;
	outline: none;
}
.mk-filters-modal__apply:focus-visible {
	outline: 2px solid #1c1c1c;
	outline-offset: 2px;
}

/* ============================================================
 * Deslizador de precio (doble rango)
 * ============================================================ */
.mk-price-slider {
	padding: 4px 2px 10px;
}
.mk-price-slider__values {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	color: inherit;
}
.mk-price-slider__track-wrap {
	position: relative;
	height: 24px;
}
.mk-price-slider__track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	transform: translateY(-50%);
	background: #e0d5dc;
	border-radius: 2px;
}
.mk-price-slider__range {
	position: absolute;
	top: 50%;
	height: 4px;
	transform: translateY(-50%);
	background: #60123f;
	border-radius: 2px;
}
.mk-price-slider input[type="range"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 24px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: none;
	-webkit-appearance: none;
	appearance: none;
	pointer-events: none;
	outline: none;
}
.mk-price-slider input[type="range"]::-webkit-slider-runnable-track {
	background: transparent;
	border: none;
	height: 24px;
}
.mk-price-slider input[type="range"]::-moz-range-track {
	background: transparent;
	border: none;
	height: 24px;
}
.mk-price-slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	pointer-events: auto;
	width: 18px;
	height: 18px;
	margin-top: 3px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid #60123f;
	box-shadow: 0 1px 4px rgba(0,0,0,.25);
	cursor: pointer;
}
.mk-price-slider input[type="range"]::-moz-range-thumb {
	pointer-events: auto;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid #60123f;
	box-shadow: 0 1px 4px rgba(0,0,0,.25);
	cursor: pointer;
}

/* ============================================================
 * 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;
}
