/* ======================================================
   SHIMGE — PRODUCTOS DESTACADOS DE LA HOME
   Versión 0.9.0
   ====================================================== */

/* Libera automáticamente el contenedor de Elementor que aloja
   el shortcode, sin depender de un ID generado por el editor. */
.shg-destacados-host,
.shg-destacados-host > .e-con-inner,
.shg-destacados-host > .elementor-container {
	--container-max-width: none !important;
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin-right: 0 !important;
	margin-left: 0 !important;
	padding-right: 0 !important;
	padding-left: 0 !important;
}

.shg-destacados-host :is(
	.elementor-widget-shortcode,
	.elementor-widget-html,
	.elementor-widget-container,
	.elementor-shortcode
) {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.shg-destacados {
	--shg-destacados-fondo: #f7f9fa;
	--shg-destacados-borde: #dbe4e6;
	--shg-destacados-texto: #0d1720;
	--shg-destacados-suave: #586871;
	--shg-destacados-teal: #159da3;
	--shg-destacados-gap: 18px;
	--shg-destacados-card-width: 300px;
	--shg-destacados-edge-left: clamp(42px, 4.5vw, 68px);
	--shg-destacados-edge-right: clamp(76px, 7vw, 112px);
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding: 92px 0 96px;
	overflow: hidden;
	background: var(--shg-destacados-fondo);
	color: var(--shg-destacados-texto);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shg-destacados,
.shg-destacados * {
	box-sizing: border-box;
}

.shg-destacados__contenido {
	width: min(var(--shimge-layout-max, 1344px), calc(100% - 48px));
	max-width: var(--shimge-layout-max, 1344px);
	margin: 0 auto;
	padding-right: var(--shimge-layout-gutter-desktop, 24px);
	padding-left: var(--shimge-layout-gutter-desktop, 24px);
}

.shg-destacados__cabecera {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	margin-bottom: 42px;
}

.shg-destacados__titulos {
	min-width: 0;
}

.shg-destacados__eyebrow {
	margin-bottom: 13px;
	color: var(--shg-destacados-teal);
	font-size: 14px;
	font-weight: 800;
	letter-spacing: .16em;
	line-height: 1.2;
	text-transform: uppercase;
}

.shg-destacados__titulo {
	max-width: 900px;
	margin: 0 !important;
	color: var(--shg-destacados-texto);
	font-size: clamp(34px, 3.15vw, 48px) !important;
	font-weight: 800 !important;
	letter-spacing: -.035em;
	line-height: 1.08 !important;
}

.shg-destacados__acciones {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 18px;
}

.shg-destacados__catalogo,
.shg-destacados__detalle {
	color: var(--shg-destacados-teal) !important;
	font-weight: 700;
	text-decoration: none !important;
}

.shg-destacados__catalogo {
	font-size: 15px;
	white-space: nowrap;
}

.shg-destacados__catalogo span,
.shg-destacados__detalle span {
	display: inline-block;
	margin-left: 5px;
	transition: transform .25s ease;
}

.shg-destacados__catalogo:hover span,
.shg-destacados__detalle:hover span {
	transform: translateX(4px);
}

.shg-destacados__controles {
	display: none !important;
	gap: 8px;
}

.shg-destacados__controles button {
	display: inline-grid;
	width: 38px;
	height: 38px;
	padding: 0;
	place-items: center;
	border: 1px solid #bfdadd;
	border-radius: 50%;
	background: #fff;
	color: var(--shg-destacados-teal);
	cursor: pointer;
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.shg-destacados__controles button:hover,
.shg-destacados__controles button:focus-visible {
	border-color: var(--shg-destacados-teal);
	background: var(--shg-destacados-teal);
	color: #fff;
	outline: none;
}

.shg-destacados__ventana {
	position: relative;
	isolation: isolate;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(
		90deg,
		transparent 0,
		#000 var(--shg-destacados-edge-left),
		#000 calc(100% - var(--shg-destacados-edge-right)),
		transparent 100%
	);
	mask-image: linear-gradient(
		90deg,
		transparent 0,
		#000 var(--shg-destacados-edge-left),
		#000 calc(100% - var(--shg-destacados-edge-right)),
		transparent 100%
	);
}

/* Los paneles transparentes desenfocan las tarjetas al entrar y salir.
   El degradado conserva un borde suave incluso en navegadores sin blur. */
.shg-destacados__ventana::before,
.shg-destacados__ventana::after {
	position: absolute;
	z-index: 3;
	top: 0;
	bottom: 0;
	pointer-events: none;
	content: "";
}

.shg-destacados__ventana::before {
	left: 0;
	width: var(--shg-destacados-edge-left);
	background: linear-gradient(
		90deg,
		rgba(247, 249, 250, .98) 0%,
		rgba(247, 249, 250, .56) 48%,
		rgba(247, 249, 250, 0) 100%
	);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.shg-destacados__ventana::after {
	right: 0;
	width: var(--shg-destacados-edge-right);
	background: linear-gradient(
		270deg,
		rgba(247, 249, 250, 1) 0%,
		rgba(247, 249, 250, .84) 24%,
		rgba(247, 249, 250, .42) 62%,
		rgba(247, 249, 250, 0) 100%
	);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.shg-destacados__pista {
	display: flex;
	align-items: stretch;
	gap: var(--shg-destacados-gap);
	width: max-content;
	min-width: 100%;
	will-change: transform;
}

.shg-destacados__tarjeta {
	display: flex;
	flex: 0 0 var(--shg-destacados-card-width);
	width: var(--shg-destacados-card-width);
	min-width: 0;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--shg-destacados-borde);
	border-radius: 13px;
	background: #fff;
	transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}

.shg-destacados__tarjeta:hover {
	border-color: #acdadd;
	box-shadow: 0 16px 40px rgba(20, 55, 64, .10);
	transform: translateY(-4px);
}

.shg-destacados__imagen {
	display: flex;
	width: 100%;
	height: 225px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #eff4f5;
	text-decoration: none !important;
}

.shg-destacados .shg-destacados__imagen > img {
	display: block;
	width: calc(100% - 32px) !important;
	height: calc(100% - 32px) !important;
	max-width: calc(100% - 32px) !important;
	max-height: calc(100% - 32px) !important;
	margin: 16px !important;
	padding: 0 !important;
	object-fit: contain !important;
	object-position: 50% 50% !important;
	transform: none !important;
	transition: opacity .3s ease;
}

.shg-destacados__tarjeta:hover .shg-destacados__imagen > img {
	opacity: .96;
	transform: none !important;
}

.shg-destacados__sin-imagen {
	color: #819097;
	font-size: 14px;
	font-weight: 600;
}

.shg-destacados__cuerpo {
	display: flex;
	flex: 1 1 auto;
	min-height: 238px;
	padding: 20px 20px 19px;
	flex-direction: column;
}

.shg-destacados__familia {
	margin-bottom: 9px;
	color: var(--shg-destacados-teal);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .08em;
	line-height: 1.25;
	text-transform: uppercase;
}

.shg-destacados__cuerpo h3 {
	margin: 0 0 6px !important;
	font-size: 17px !important;
	font-weight: 700 !important;
	letter-spacing: -.015em;
	line-height: 1.28 !important;
}

.shg-destacados__cuerpo h3 a {
	color: var(--shg-destacados-texto) !important;
	text-decoration: none !important;
}

.shg-destacados__modelo,
.shg-destacados__descripcion {
	margin: 0 !important;
	color: var(--shg-destacados-suave);
}

.shg-destacados__modelo {
	font-size: 13px;
	line-height: 1.4;
}

.shg-destacados__descripcion {
	display: -webkit-box;
	margin-top: 10px !important;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.48;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.shg-destacados__detalle {
	align-self: flex-end;
	margin-top: auto;
	padding-top: 17px;
	font-size: 13px;
}

@media (min-width: 851px) and (max-width: 1180px) {
	.shg-destacados {
		padding-top: 78px;
		padding-bottom: 82px;
	}

	.shg-destacados__contenido {
		width: min(1120px, calc(100% - 48px));
		max-width: 1120px;
	}

	.shg-destacados {
		--shg-destacados-card-width: 280px;
	}
}

@media (max-width: 850px) {
	.shg-destacados {
		padding: 66px 0 70px;
	}

	.shg-destacados__contenido {
		width: min(760px, calc(100% - 32px));
		max-width: 760px;
		padding-right: 0;
		padding-left: 0;
	}

	.shg-destacados__cabecera {
		align-items: flex-start;
		margin-bottom: 30px;
		flex-direction: column;
	}

	.shg-destacados__acciones {
		width: 100%;
		justify-content: space-between;
	}

	.shg-destacados {
		--shg-destacados-card-width: min(72vw, 300px);
		--shg-destacados-edge-left: clamp(28px, 7vw, 48px);
		--shg-destacados-edge-right: clamp(52px, 11vw, 82px);
	}
}

@media (max-width: 600px) {
	.shg-destacados {
		--shg-destacados-gap: 14px;
		--shg-destacados-card-width: min(78vw, 286px);
		--shg-destacados-edge-left: 28px;
		--shg-destacados-edge-right: 52px;
		padding: 56px 0 60px;
	}

	.shg-destacados__contenido {
		width: calc(100% - 24px);
		max-width: none;
	}

	.shg-destacados__eyebrow {
		font-size: 11px;
	}

	.shg-destacados__titulo {
		font-size: 30px !important;
	}

	.shg-destacados__acciones {
		align-items: flex-end;
	}

	.shg-destacados__catalogo {
		font-size: 13px;
		white-space: normal;
	}

	.shg-destacados__controles button {
		width: 36px;
		height: 36px;
	}

	.shg-destacados__imagen {
		height: 215px;
	}

	.shg-destacados__cuerpo {
		min-height: 232px;
		padding: 19px 18px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shg-destacados__tarjeta,
	.shg-destacados__imagen img,
	.shg-destacados__catalogo span,
	.shg-destacados__detalle span {
		transition: none !important;
	}
}

/* ======================================================
   v0.9.40 — Ranking real de productos más consultados
   Primeros cuatro visibles; navegación manual por el resto.
   ====================================================== */
.shg-destacados.is-ranked-list {
	--shg-destacados-card-width: calc((100% - (var(--shg-destacados-gap) * 3)) / 4);
}
.shg-destacados.is-ranked-list .shg-destacados__controles {
	display: flex !important;
	align-items: center;
	gap: 8px;
}
.shg-destacados.is-ranked-list .shg-destacados__controles button:disabled {
	border-color: #d8e2e4 !important;
	background: #f2f5f6 !important;
	color: #9ba8ad !important;
	cursor: default;
	opacity: .65;
}
.shg-destacados.is-ranked-list .shg-destacados__ventana {
	overflow: hidden;
	-webkit-mask-image: none !important;
	mask-image: none !important;
}
.shg-destacados.is-ranked-list .shg-destacados__ventana::before,
.shg-destacados.is-ranked-list .shg-destacados__ventana::after {
	display: none !important;
	content: none !important;
}
.shg-destacados.is-ranked-list .shg-destacados__pista {
	display: flex;
	width: 100%;
	min-width: 100%;
	gap: var(--shg-destacados-gap);
	transform: translate3d(0,0,0);
	transition: transform .34s cubic-bezier(.2,.75,.25,1);
	will-change: transform;
}
.shg-destacados.is-ranked-list .shg-destacados__tarjeta {
	flex: 0 0 var(--shg-destacados-card-width);
	width: var(--shg-destacados-card-width);
}
@media (max-width: 1000px) {
	.shg-destacados.is-ranked-list {
		--shg-destacados-card-width: calc((100% - var(--shg-destacados-gap)) / 2);
	}
}
@media (max-width: 600px) {
	.shg-destacados.is-ranked-list {
		--shg-destacados-card-width: 100%;
	}
	.shg-destacados.is-ranked-list .shg-destacados__acciones {
		align-items: center;
	}
}

/* v0.9.41 — La sección permanece visible aunque todavía no haya tráfico. */
.shg-destacados__empty-state {
	margin-top: 12px;
	padding: 28px 24px;
	border: 1px solid #dce6e8;
	border-radius: 12px;
	background: #f7fafb;
	color: #64747d;
	font-size: 14px;
	line-height: 1.55;
	text-align: center;
}
