/**
 * Catalog Hub for WooCommerce — estilos públicos.
 *
 * Se apoyan en variables con reserva, de modo que un tema pueda redefinir la
 * paleta sin tocar este archivo.
 */

.cathub-index,
.cathub-grid,
.cathub-header,
.cathub-filters {
	--cathub-radius: 14px;
	--cathub-border: var(--theme-border-color, #e5e7eb);
	--cathub-bg: var(--theme-palette-color-8, #fff);
	--cathub-muted: var(--theme-text-color, #6b7280);
	--cathub-accent: var(--theme-palette-color-1, #b91c1c);
}

/* --------------------------------------------------------------------- */
/*  Página de índice                                                      */
/* --------------------------------------------------------------------- */

.cathub-page__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px 64px;
}

.cathub-page__title {
	margin: 0 0 24px;
}

.cathub-index__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}

.cathub-index__search {
	position: relative;
	flex: 1 1 260px;
	max-width: 420px;
}

.cathub-index__ico {
	position: absolute;
	top: 50%;
	left: 12px;
	transform: translateY(-50%);
	color: var(--cathub-muted);
	display: flex;
}

/*
 * El padding izquierdo deja sitio al icono. Se marca !important porque muchos
 * temas (Blocksy incluido) fijan el padding de los input con más especificidad,
 * y sin esto el icono se solapa con el texto.
 */
.cathub-index__input {
	width: 100%;
	padding: 10px 16px 10px 42px !important;
	border: 1px solid var(--cathub-border);
	border-radius: 999px;
	background: var(--cathub-bg);
	font-size: 15px;
}

.cathub-index__count {
	margin: 0;
	color: var(--cathub-muted);
	font-size: 14px;
}

.cathub-index__grid,
.cathub-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.cathub-index__empty {
	margin-top: 32px;
	text-align: center;
	color: var(--cathub-muted);
}

/* --------------------------------------------------------------------- */
/*  Tarjeta                                                               */
/* --------------------------------------------------------------------- */

.cathub-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--cathub-border);
	border-radius: var(--cathub-radius);
	background: var(--cathub-bg);
	text-decoration: none;
	color: inherit;
	transition: transform .18s ease, box-shadow .18s ease;
}

a.cathub-card:hover,
a.cathub-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, .1);
}

/*
 * La media es un marco cuadrado del que la imagen no se sale. Se posiciona en
 * absoluto en lugar de estirarse con flex: así todas las tarjetas quedan a la
 * misma altura sea cual sea la proporción original de cada imagen.
 */
.cathub-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f3f4f6;
}

.cathub-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cathub-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9ca3af;
}

/* Todas las tarjetas de una fila con la misma altura. */
.cathub-index__grid > *,
.cathub-grid > * {
	height: 100%;
}

.cathub-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 auto;
}

.cathub-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(17, 24, 39, .82);
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	backdrop-filter: blur(2px);
}

.cathub-card__body {
	padding: 14px 16px 16px;
}

.cathub-card__title {
	margin: 0 0 4px;
	font-size: 16px;
	line-height: 1.3;
}

.cathub-card__meta {
	margin: 0;
	font-size: 13px;
	color: var(--cathub-muted);
}

/*
 * Entrada fuera de su ventana con comportamiento "atenuado": se ve, pero no se
 * puede entrar. Es un <div>, no un <a>, así que tampoco recibe foco.
 */
.cathub-card--disabled {
	/*
	 * Puntero normal, no "not-allowed": no hay ninguna acción que se esté
	 * denegando, simplemente la tarjeta no lleva a ningún sitio. El símbolo de
	 * prohibido sugiere un error del usuario donde sólo hay una fecha pendiente.
	 */
	cursor: default;
	opacity: .6;
}

.cathub-card--disabled .cathub-card__img {
	filter: grayscale(1);
}

/* --------------------------------------------------------------------- */
/*  Migas de pan                                                          */
/* --------------------------------------------------------------------- */

.cathub-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 14px;
	font-size: 13px;
	color: var(--cathub-muted);
}

.cathub-crumbs a {
	color: inherit;
	text-decoration: none;
}

.cathub-crumbs a:hover {
	color: var(--cathub-accent);
	text-decoration: underline;
}

.cathub-crumbs__sep {
	opacity: .5;
}

.cathub-crumbs__current {
	color: inherit;
	font-weight: 600;
}

/* --------------------------------------------------------------------- */
/*  Cabecera de la ficha                                                  */
/* --------------------------------------------------------------------- */

/*
 * La cabecera se imprime en woocommerce_before_main_content, que según el tema
 * puede quedar fuera del contenedor de contenido. Por eso se centra y acota por
 * su cuenta: así no queda pegada al borde de la ventana.
 */
.cathub-header {
	box-sizing: border-box;
	max-width: var(--cathub-content-width, 1290px);
	margin: 0 auto 32px;
	padding: 0 20px;
}

.cathub-header__cover {
	margin: 0;
	aspect-ratio: 16 / 5;
	overflow: hidden;
	border-radius: var(--cathub-radius);
}

.cathub-header__cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * Sólo el logo se monta sobre la portada; el texto arranca por debajo. Si sube
 * el bloque entero, el rótulo del tipo queda encima de la imagen y no se lee.
 */
.cathub-header__inner {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	padding: 0 8px;
}

.cathub-header--has-cover .cathub-header__logo {
	margin-top: -56px;
}

.cathub-header__logo {
	flex: 0 0 auto;
	width: 112px;
	height: 112px;
	margin: 0;
	overflow: hidden;
	border: 4px solid var(--cathub-bg);
	border-radius: 20px;
	background: var(--cathub-bg);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

.cathub-header__logo-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cathub-header__body {
	flex: 1 1 auto;
	padding-bottom: 6px;
}

.cathub-header__eyebrow {
	margin: 0 0 2px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--cathub-accent);
}

.cathub-header__title {
	margin: 0 0 6px;
}

.cathub-header__desc {
	margin: 0 0 8px;
	max-width: 68ch;
	color: var(--cathub-muted);
}

.cathub-header__notice {
	display: inline-block;
	margin: 0 0 8px;
	padding: 6px 12px;
	border-radius: 999px;
	background: #fef3c7;
	color: #92400e;
	font-size: 14px;
}

.cathub-header__count {
	margin: 0;
	font-size: 14px;
	color: var(--cathub-muted);
}

.cathub-header__count-num {
	font-weight: 700;
	color: inherit;
}

/* --------------------------------------------------------------------- */
/*  Estado vacío                                                          */
/* --------------------------------------------------------------------- */

.cathub-empty {
	padding: 32px 0;
}

.cathub-empty__card {
	max-width: 480px;
	margin: 0 auto;
	padding: 32px 24px;
	border: 1px solid var(--cathub-border);
	border-radius: var(--cathub-radius);
	background: var(--cathub-bg);
	text-align: center;
}

.cathub-empty__icon {
	display: inline-flex;
	margin-bottom: 12px;
	color: var(--cathub-muted);
}

.cathub-empty__title {
	margin: 0 0 8px;
	font-size: 20px;
}

.cathub-empty__text {
	margin: 0 0 20px;
	color: var(--cathub-muted);
}

.cathub-empty__cta {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--cathub-accent);
	color: #fff;
	text-decoration: none;
}

/* --------------------------------------------------------------------- */
/*  Filtros                                                               */
/* --------------------------------------------------------------------- */

.cathub-filters {
	margin-bottom: 24px;
	padding: 18px;
	border: 1px solid var(--cathub-border);
	border-radius: var(--cathub-radius);
	background: var(--cathub-bg);
}

.cathub-filters__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
}

.cathub-filters__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	color: var(--cathub-muted);
}

.cathub-filters__field input,
.cathub-filters__field select {
	padding: 8px 10px;
	border: 1px solid var(--cathub-border);
	border-radius: 8px;
	font-size: 14px;
	color: initial;
}

.cathub-filters__price {
	display: flex;
	align-items: center;
	gap: 8px;
}

.cathub-filters__price input {
	width: 100%;
	min-width: 0;
}

.cathub-filters__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
}

.cathub-filters__submit,
.cathub-filters__reset {
	padding: 9px 20px;
	border: 1px solid var(--cathub-border);
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	font-size: 14px;
}

.cathub-filters__submit {
	border-color: transparent;
	background: var(--cathub-accent);
	color: #fff;
}

.cathub-filters__status {
	font-size: 13px;
	color: var(--cathub-muted);
}

.cathub-filters.is-loading {
	opacity: .7;
	pointer-events: none;
}

@media (max-width: 600px) {
	.cathub-header__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.cathub-header--has-cover .cathub-header__logo {
		margin-top: -40px;
	}

	.cathub-header__logo {
		width: 88px;
		height: 88px;
	}
}

/* --------------------------------------------------------------------- */
/*  Destacados (listado de urgencia)                                      */
/* --------------------------------------------------------------------- */

.cathub-hot-grid {
	--cathub-hot-ending: #e5342b;
	--cathub-hot-starting: #e07a00;
	--cathub-hot-scheduled: #2b6fe0;
	--cathub-hot-open: #0a8a4f;
	--cathub-hot-dead: #8b8f97;

	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

/*
 * La tarjeta es una sola pieza: la portada ocupa el fondo entero y el texto va
 * encima. Antes la imagen y el texto vivían en cajas separadas y cada tarjeta
 * crecía distinto según lo largo que fuera su motivo, con lo que la fila
 * quedaba desalineada.
 */
.cathub-hot-card {
	position: relative;
	display: flex;
	flex-direction: column;
	aspect-ratio: 4 / 3;
	/*
	 * La proporción da la forma; el mínimo garantiza que el contenido quepa.
	 * Con sólo aspect-ratio, en las columnas estrechas la tarjeta se quedaba más
	 * baja que su contenido y el pie se montaba sobre la línea inferior.
	 */
	min-height: 250px;
	/*
	 * Imprescindible junto a aspect-ratio: un elemento de grid trae min-width
	 * auto, así que con una altura mínima de 250px deducía un ancho de 400px y se
	 * salía de la pantalla en móvil, cortando el contador por el borde.
	 */
	min-width: 0;
	padding: 16px;
	border-radius: 18px;
	overflow: hidden;
	isolation: isolate;
	background: #1e2129;
	color: #fff;
	text-decoration: none;
	transition: transform .25s ease, box-shadow .25s ease;
}

.cathub-hot-card__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	background: linear-gradient(135deg, #2f3542, #1a1d24);
}

.cathub-hot-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
}

/*
 * Doble velo: uno general que baja el contraste de la foto y otro más denso
 * abajo. Sin el segundo, un nombre claro sobre una portada clara desaparecía.
 */
.cathub-hot-card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(to top, rgba(10, 12, 16, .92) 0%, rgba(10, 12, 16, .55) 42%, rgba(10, 12, 16, .18) 70%, rgba(10, 12, 16, .35) 100%);
}

/*
 * El hover se limita a los punteros finos. En una pantalla táctil el navegador
 * dispara :hover al tocar y lo deja "pegado" hasta que se toca en otro sitio,
 * así que la tarjeta se quedaba levantada y con la imagen ampliada después de
 * volver atrás.
 */
@media (hover: hover) and (pointer: fine) {
	a.cathub-hot-card:hover {
		transform: translateY(-4px);
		box-shadow: 0 18px 40px rgba(12, 16, 24, .28);
	}

	a.cathub-hot-card:hover .cathub-hot-card__img {
		transform: scale(1.06);
	}

	a.cathub-hot-card:hover .cathub-hot-card__cta svg {
		transform: translateX(4px);
	}
}

/* El foco sí es de todos: se navega con teclado en cualquier dispositivo. */
a.cathub-hot-card:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

/* Respuesta al toque, que es lo que sí existe en una pantalla táctil. */
a.cathub-hot-card:active {
	transform: scale(.985);
}

/* ---- Fila superior: tipo y contador ---- */

.cathub-hot-card__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.cathub-hot-card__type {
	padding: 5px 11px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .16);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	line-height: 1.6;
}

/*
 * El contador es lo que tiene que hacer parar el ojo, así que se saca del texto
 * y se le da cuerpo propio: bloque flotante sobre la portada, con la etiqueta
 * arriba y los dígitos grandes debajo. Como chip de una línea competía en
 * tamaño con el rótulo del tipo y se leía como un dato más.
 */
.cathub-hot-card__timer {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
	padding: 7px 13px 8px;
	border-radius: 14px;
	background: var(--cathub-hot-dead);
	line-height: 1.15;
	white-space: nowrap;
	box-shadow: 0 6px 20px rgba(10, 12, 16, .45);
}

.cathub-hot-card__label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	opacity: .92;
}

.cathub-hot-card__ico {
	flex: none;
}

.cathub-hot-card__clock {
	font-size: 23px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.02em;
}

/* Sin fecha que contar ("Agotado", "Finalizado") no hay dígitos que lucir. */
.cathub-hot-card__clock--text {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

/* ---- Pie: logo y nombre ---- */

/*
 * El pie se empuja al fondo con margin-top:auto en lugar de repartir el espacio
 * con space-between: así el nombre y la llamada quedan juntos abajo, y no el
 * nombre flotando en mitad de la tarjeta con un hueco debajo.
 */
.cathub-hot-card__foot {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
	margin-top: auto;
}

.cathub-hot-card__logo {
	flex: none;
	width: 46px;
	height: 46px;
	margin: 0;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	border: 2px solid rgba(255, 255, 255, .85);
}

.cathub-hot-card__logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cathub-hot-card__text {
	min-width: 0;
}

/*
 * El título va dentro de un <a>, así que muchos temas (Blocksy entre ellos) le
 * pasan su color de enlace. Aquí siempre es blanco: la tarjeta entera ya es el
 * enlace y el nombre va sobre una foto oscurecida.
 */
.cathub-hot-card__title {
	margin: 0;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cathub-hot-card__reason {
	margin: 2px 0 0;
	color: rgba(255, 255, 255, .78);
	font-size: 12.5px;
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---- Llamada inferior ---- */

.cathub-hot-card__cta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding-top: 11px;
	border-top: 1px solid rgba(255, 255, 255, .16);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .92);
}

.cathub-hot-card__cta svg {
	flex: none;
	transition: transform .25s ease;
}

/* ---- Color del contador según la urgencia ---- */

.cathub-hot-card--ending-soon .cathub-hot-card__timer {
	background: var(--cathub-hot-ending);
	animation: cathub-pulse 2s ease-in-out infinite;
}

.cathub-hot-card--starting-soon .cathub-hot-card__timer {
	background: var(--cathub-hot-starting);
}

.cathub-hot-card--scheduled .cathub-hot-card__timer {
	background: var(--cathub-hot-scheduled);
}

.cathub-hot-card--open .cathub-hot-card__timer {
	background: var(--cathub-hot-open);
}

/*
 * Sólo late lo que se acaba de verdad. Si latiera cualquier contador, el aviso
 * dejaría de significar nada.
 */
@keyframes cathub-pulse {
	0%, 100% { box-shadow: 0 4px 14px rgba(229, 52, 43, .45); }
	50%      { box-shadow: 0 4px 22px rgba(229, 52, 43, .85); }
}

@media (prefers-reduced-motion: reduce) {
	.cathub-hot-card--ending-soon .cathub-hot-card__timer {
		animation: none;
	}
	.cathub-hot-card,
	.cathub-hot-card__img,
	.cathub-hot-card__cta svg {
		transition: none;
	}
}

/* ---- Estados sin acceso ---- */

/*
 * Puntero normal: la tarjeta se ve pero no lleva a ningún sitio, y una manita
 * (o un símbolo de prohibido) promete una interacción que no existe.
 */
.cathub-hot-card--locked {
	cursor: default;
}

.cathub-hot-card--locked .cathub-hot-card__img {
	filter: grayscale(.4);
}

.cathub-hot-card--expired {
	background: #23262d;
}

.cathub-hot-card--expired .cathub-hot-card__img {
	filter: grayscale(1);
	opacity: .55;
}

.cathub-hot-card--expired .cathub-hot-card__title,
.cathub-hot-card--expired .cathub-hot-card__cta {
	color: rgba(255, 255, 255, .6);
}

.cathub-hot-card--expired .cathub-hot-card__logo {
	filter: grayscale(1);
	opacity: .75;
}

@media (max-width: 1024px) {
	.cathub-hot-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.cathub-hot-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	/*
	 * En una sola columna la proporción sobra: el ancho ya lo fija la pantalla y
	 * mantenerla sólo sirve para pelearse con la altura mínima. Manda el alto.
	 */
	.cathub-hot-card {
		aspect-ratio: auto;
		min-height: 210px;
	}

	.cathub-hot-card__clock {
		font-size: 21px;
	}
}


/* --------------------------------------------------------------------- */
/*  Promoción en el producto                                              */
/* --------------------------------------------------------------------- */

.cathub-product-notice {
	--cathub-muted: var(--theme-text-color, #6b7280);
	margin: 0 0 18px;
	padding: 12px 16px;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	background: #f9fafb;
}

.cathub-product-notice .cathub-hot-card__timer {
	margin-top: 0;
}

.cathub-product-notice--dim .cathub-hot-card__clock,
.cathub-product-notice--dim .cathub-hot-card__kicker {
	color: #175cd3;
}

.cathub-product-notice--normal .cathub-hot-card__clock,
.cathub-product-notice--normal .cathub-hot-card__kicker {
	color: #b54708;
}

.cathub-product-notice--expired .cathub-hot-card__kicker {
	color: var(--cathub-muted);
}

.cathub-product-notice__text {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--cathub-muted);
}

.cathub-loop-badge {
	display: inline-block;
	margin-bottom: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
}
