/*
 * serviNec: Carrusel de Productos Recientes (WooCommerce)
 * assets/css/sections/product-carousel.css
 */

.snec-pcarousel {
	width: 100%;
	max-width: 1200px;
	margin: 24px auto 48px;
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	box-sizing: border-box;
}

.snec-pcarousel__inner {
	padding: 0 16px;
}

/* ── Encabezado ──────────────────────────────────────────────────────────── */
.snec-pcarousel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 18px;
	border-bottom: 1px solid #f1f5f9;
	margin-bottom: 22px;
}

.snec-pcarousel__title {
	font-size: clamp(18px, 2.2vw, 24px);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #111827;
	margin: 0;
	line-height: 1.25;
}

.snec-pcarousel__nav {
	display: flex;
	align-items: center;
	gap: 10px;
}

.snec-pcarousel__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	color: #2563eb;
	cursor: pointer;
	padding: 0;
	transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s, opacity 0.18s;
}

.snec-pcarousel__btn:hover:not(:disabled) {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #1d4ed8;
	transform: scale(1.05);
}

.snec-pcarousel__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
}

.snec-pcarousel__arrow {
	width: 18px;
	height: 18px;
	stroke-width: 2.2;
}

/* ── Viewport & Track ────────────────────────────────────────────────────── */
.snec-pcarousel__viewport {
	overflow: hidden;
	width: 100%;
	position: relative;
	touch-action: pan-y;
	cursor: grab;
}

.snec-pcarousel__viewport:active {
	cursor: grabbing;
}

.snec-pcarousel__track {
	display: flex;
	gap: 16px;
	transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
	will-change: transform;
	padding: 4px 2px 8px;
}

/* Cantidad de elementos según ancho de pantalla */
.snec-pcarousel__item {
	flex: 0 0 calc((100% - (4 * 16px)) / 5);
	max-width: calc((100% - (4 * 16px)) / 5);
	box-sizing: border-box;
}

@media (max-width: 1200px) {
	.snec-pcarousel__item {
		flex: 0 0 calc((100% - (3 * 16px)) / 4);
		max-width: calc((100% - (3 * 16px)) / 4);
	}
}

@media (max-width: 960px) {
	.snec-pcarousel__item {
		flex: 0 0 calc((100% - (2 * 16px)) / 3);
		max-width: calc((100% - (2 * 16px)) / 3);
	}
}

@media (max-width: 680px) {
	.snec-pcarousel__item {
		flex: 0 0 calc((100% - 16px) / 2);
		max-width: calc((100% - 16px) / 2);
	}
	.snec-pcarousel__inner {
		padding: 18px 16px 20px;
	}
}

@media (max-width: 440px) {
	.snec-pcarousel__item {
		flex: 0 0 84%;
		max-width: 84%;
	}
}

/* ── Tarjeta de Producto (snec-pcard) ─────────────────────────────────────── */
.snec-pcard {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	padding: 16px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	box-sizing: border-box;
	transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.snec-pcard:hover {
	border-color: #cbd5e1;
	box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

.snec-pcard__body {
	display: flex;
	flex-direction: column;
}

/* Fila superior: Tag + Wishlist */
.snec-pcard__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.snec-pcard__tag {
	display: inline-block;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	border-radius: 4px;
	line-height: 1.2;
}

.snec-pcard__tag--sale {
	background: #2563eb;
	color: #ffffff;
}

.snec-pcard__tag--cat {
	background: #f3f4f6;
	color: #4b5563;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.snec-pcard__wishlist {
	background: transparent;
	border: none;
	padding: 4px;
	color: #3b82f6;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s, transform 0.15s;
}

.snec-pcard__wishlist:hover {
	color: #1d4ed8;
	transform: scale(1.15);
}

.snec-pcard__wishlist.is-active svg {
	fill: #2563eb;
	color: #2563eb;
}

.snec-pcard__heart {
	width: 20px;
	height: 20px;
}

/* Imagen */
.snec-pcard__media {
	height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	overflow: hidden;
	text-decoration: none;
}

.snec-pcard__img {
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
	transition: transform 0.25s ease;
}

.snec-pcard:hover .snec-pcard__img {
	transform: scale(1.05);
}

/* Rating */
.snec-pcard__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
}

.snec-pcard__stars {
	display: flex;
	color: #2563eb;
	gap: 1.5px;
}

.snec-pcard__star {
	width: 14px;
	height: 14px;
}

.snec-pcard__count {
	font-size: 12px;
	color: #9ca3af;
	font-weight: 500;
}

/* Título */
.snec-pcard__title {
	font-size: 12.5px;
	font-weight: 700;
	color: #111827;
	line-height: 1.35;
	margin: 0 0 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 34px;
}

.snec-pcard__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s;
}

.snec-pcard__title a:hover {
	color: #2563eb;
}

/* Precio */
.snec-pcard__price-box {
	margin-bottom: 8px;
}

.snec-pcard__price {
	font-size: 17px;
	font-weight: 800;
	color: #2563eb;
	display: block;
	line-height: 1.2;
}

.snec-pcard__tax {
	font-size: 11px;
	color: #9ca3af;
	display: block;
	margin-top: 2px;
}

/* Entrega */
.snec-pcard__delivery {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	color: #6b7280;
	margin-bottom: 14px;
}

.snec-pcard__truck {
	width: 14px;
	height: 14px;
	color: #2563eb;
	flex-shrink: 0;
}

/* Botón Añadir al Carrito */
.snec-pcard__footer {
	margin-top: auto;
}

.snec-pcard__cart-btn {
	display: block;
	width: 100%;
	padding: 9px 12px;
	background: #2563eb;
	color: #ffffff !important;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	border-radius: 9999px;
	text-decoration: none;
	border: none;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
	cursor: pointer;
	box-sizing: border-box;
}

.snec-pcard__cart-btn:hover {
	background: #1d4ed8;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.snec-pcard__cart-btn:active {
	transform: scale(0.98);
}

/* Estados AJAX de WooCommerce */
.snec-pcard__cart-btn.loading {
	opacity: 0.7;
	position: relative;
}

.snec-pcard__cart-btn.added::after {
	content: ' ✓';
	font-weight: bold;
}
