/* ==========================================================
   MPC Product Slider — estilo dark tipo "Mousepad Chile"
   ========================================================== */

.mpc-slider {
	--mpc-bg: #121212;
	--mpc-fg: #ffffff;
	--mpc-fg-soft: rgba(255, 255, 255, 0.65);
	--mpc-line: rgba(255, 255, 255, 0.85);
	--mpc-accent: #e85d4a; /* coral del logo, usado para la oferta */
	--mpc-gap: 32px;
	--mpc-cols: 4;

	background: var(--mpc-bg);
	color: var(--mpc-fg);
	padding: 56px 48px 64px;
	box-sizing: border-box;
	position: relative;
	font-family: inherit;
}

.mpc-slider *,
.mpc-slider *::before,
.mpc-slider *::after {
	box-sizing: border-box;
}

/* Tema claro opcional */
.mpc-slider.mpc-theme-light {
	--mpc-bg: #f7f7f7;
	--mpc-fg: #121212;
	--mpc-fg-soft: rgba(0, 0, 0, 0.6);
	--mpc-line: rgba(0, 0, 0, 0.8);
}

/* ---------- Cabecera: título + flechas ---------- */
.mpc-slider__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 36px;
}

.mpc-slider__title {
	margin: 0;
	font-size: clamp(1.4rem, 2.6vw, 2.1rem);
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mpc-fg);
}

.mpc-slider__nav {
	display: flex;
	gap: 12px;
	margin-left: auto;
}

.mpc-slider__arrow {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1.5px solid var(--mpc-line);
	background: transparent;
	color: var(--mpc-fg);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
	padding: 0;
}

.mpc-slider__arrow svg {
	width: 20px;
	height: 20px;
}

.mpc-slider__arrow:hover:not(:disabled) {
	background: var(--mpc-fg);
	color: var(--mpc-bg);
}

.mpc-slider__arrow:active:not(:disabled) {
	transform: scale(0.94);
}

.mpc-slider__arrow:disabled {
	opacity: 0.3;
	cursor: default;
}

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

/* ---------- Pista ---------- */
.mpc-slider__viewport {
	overflow: hidden;
}

.mpc-slider__track {
	display: flex;
	gap: var(--mpc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	transition: transform 0.45s cubic-bezier(0.33, 1, 0.45, 1);
	will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
	.mpc-slider__track {
		transition: none;
	}
}

/* ---------- Tarjeta ---------- */
.mpc-card {
	flex: 0 0 calc((100% - (var(--mpc-cols) - 1) * var(--mpc-gap)) / var(--mpc-cols));
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-width: 0;

	/* Borde hover estilo mousepadchile.cl: siempre presente pero
	   transparente, para que el layout no salte al aparecer */
	border: 1.5px solid transparent;
	border-radius: 28px;
	padding: 28px 18px;
	transition: border-color 0.25s ease;
}

.mpc-card:hover,
.mpc-card:focus-within {
	border-color: var(--mpc-line);
}

@media (hover: none) {
	/* En táctil no hay hover real: evitar que quede "pegado" */
	.mpc-card:hover {
		border-color: transparent;
	}
}

.mpc-card__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	margin-bottom: 28px;
	text-decoration: none;
}

.mpc-card__media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 10px;
	transition: transform 0.3s ease;
}

.mpc-card__media:hover img {
	transform: scale(1.03);
}

/* Badge OFERTA */
.mpc-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	background: var(--mpc-accent);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 6px 12px;
	border-radius: 999px;
	line-height: 1;
}

/* Título del producto */
.mpc-card__title {
	margin: 0 0 14px;
	font-size: clamp(1.15rem, 1.8vw, 1.6rem);
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.15;
}

.mpc-card__title a {
	color: var(--mpc-fg);
	text-decoration: none;
}

.mpc-card__title a:hover {
	opacity: 0.85;
}

/* Precios */
.mpc-card__price {
	margin-bottom: 22px;
	font-size: clamp(1.3rem, 2vw, 1.8rem);
	font-weight: 500;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: baseline;
	justify-content: center;
	color: var(--mpc-fg);
}

.mpc-card__price del,
.mpc-card__price .mpc-card__price-regular {
	color: var(--mpc-fg-soft);
	font-size: 0.72em;
	font-weight: 400;
	/* La línea se dibuja con ::after (el line-through nativo se
	   descuadra cuando el theme cambia el font-size de los spans
	   internos de Woo). */
	text-decoration: none;
	position: relative;
	display: inline-block;
	line-height: 1.2;
}

.mpc-card__price del::after,
.mpc-card__price .mpc-card__price-regular::after {
	content: "";
	position: absolute;
	left: -3px;
	right: -3px;
	top: 50%;
	height: 0.085em;
	min-height: 1.5px;
	background: currentColor;
	transform: translateY(-50%);
	pointer-events: none;
}

/* Los spans internos del precio de Woo heredan el tamaño del del,
   aunque el theme intente cambiarlos */
.mpc-card__price del .woocommerce-Price-amount,
.mpc-card__price del bdi,
.mpc-card__price del span {
	font-size: inherit !important;
	line-height: inherit !important;
	text-decoration: none !important;
	color: inherit;
}

.mpc-card__price ins,
.mpc-card__price .mpc-card__price-sale {
	text-decoration: none;
	color: var(--mpc-accent);
	font-weight: 700;
	display: inline-block;
	margin: 0;
	line-height: 1.2;
}

/* Compatibilidad con el HTML de precios nativo de Woo */
.mpc-card__price .woocommerce-Price-amount {
	color: inherit;
}

/* Botón outline — aplica tanto al botón propio como al nativo de Woo
   (incluyendo el que reemplacen plugins de personalización) */
.mpc-card__btn,
.mpc-card .mpc-card__actions a,
.mpc-card .mpc-card__actions .button,
.mpc-card .mpc-card__actions button {
	display: inline-block;
	padding: 14px 30px;
	border: 1.5px solid var(--mpc-line);
	border-radius: 6px;
	background: transparent;
	color: var(--mpc-fg);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	margin-top: auto;
}

.mpc-card__btn:hover,
.mpc-card .mpc-card__actions a:hover,
.mpc-card .mpc-card__actions .button:hover,
.mpc-card .mpc-card__actions button:hover {
	background: var(--mpc-fg);
	color: var(--mpc-bg);
}

.mpc-card__btn:focus-visible,
.mpc-card .mpc-card__actions a:focus-visible,
.mpc-card .mpc-card__actions .button:focus-visible {
	outline: 2px solid var(--mpc-accent);
	outline-offset: 3px;
}

.mpc-card__actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
}

/* Link "Ver carrito" que Woo agrega tras añadir vía AJAX */
.mpc-card .mpc-card__actions .added_to_cart {
	border: none;
	padding: 4px 0;
	font-size: 0.85rem;
	color: var(--mpc-fg-soft);
}

.mpc-card .mpc-card__actions .added_to_cart:hover {
	background: transparent;
	color: var(--mpc-fg);
}

/* ---------- Dots ---------- */
.mpc-slider__dots {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 40px;
}

.mpc-slider__dots:empty {
	display: none;
}

.mpc-slider__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: var(--mpc-fg-soft);
	opacity: 0.45;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mpc-slider__dot.is-active {
	opacity: 1;
	background: var(--mpc-fg);
	transform: scale(1.25);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.mpc-slider {
		--mpc-cols: 2 !important;
		padding: 44px 32px 52px;
	}
}

@media (max-width: 600px) {
	.mpc-slider {
		--mpc-cols: 1 !important;
		--mpc-gap: 24px;
		padding: 36px 20px 44px;
	}

	.mpc-slider__arrow {
		width: 40px;
		height: 40px;
	}
}
