/**
 * Betcris Promociones — estilos del front.
 *
 * Todo vive bajo los prefijos .bcp / .bcp-page para no chocar con el tema.
 * Los colores se controlan con variables: podés sobrescribirlas desde el
 * Personalizador o el CSS del tema sin tocar este archivo.
 */

.bcp,
.bcp-page {
	/* Paleta. Son sólo el respaldo: el plugin la sobrescribe con los valores de
	   Ajustes → Colores. El azul y el rojo son los del logo oficial. */
	--bcp-navy: #173358;
	--bcp-navy-dark: #0d1f3d;
	--bcp-red: #da202c;
	--bcp-green: #3aa935;
	--bcp-gold: #f2b705;
	--bcp-bg: #f5f6fa;
	--bcp-surface: #ffffff;
	--bcp-border: #e3e6ef;
	--bcp-text: #64748b;
	--bcp-muted: #64748b;
	--bcp-featured-border: #f2b705;
	--bcp-featured-badge-bg: #f2b705;
	--bcp-featured-badge-text: #0d1f3d;

	--bcp-radius: 3px;
	--bcp-gap: 20px;
	--bcp-max: 1200px;
	--bcp-cols: 4;

	box-sizing: border-box;
	color: var(--bcp-text);
	font-family: inherit;
}

.bcp *,
.bcp *::before,
.bcp *::after,
.bcp-page *,
.bcp-page *::before,
.bcp-page *::after {
	box-sizing: border-box;
}

/**
 * Ancho completo.
 *
 * El listado suele insertarse dentro de un contenedor con ancho máximo (el del
 * tema o el de una sección de Elementor). Sin esto, la banda de fondo queda
 * cortada a los lados. El cálculo se autoneutraliza si el contenedor ya es de
 * ancho completo: 50% del padre pasa a valer lo mismo que 50vw y el margen da 0.
 *
 * --bcp-vw lo fija el JS con el ancho real del viewport SIN la barra de scroll;
 * 1vw sí la incluye y provocaría scroll horizontal en Windows.
 */
.bcp {
	background: var(--bcp-bg);
	padding: 0 0 48px;
	max-width: none;
	margin-left: calc(50% - var(--bcp-vw, 1vw) * 50);
	margin-right: calc(50% - var(--bcp-vw, 1vw) * 50);
}

/* Escape hatch: [betcris_promociones ancho="contenedor"] */
.bcp--boxed {
	margin-left: 0;
	margin-right: 0;
}

.bcp__heading {
	margin: 0 auto 24px;
	max-width: var(--bcp-max);
	padding: 32px 20px 0;
	color: var(--bcp-navy);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
}

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

.bcp-filters-bar {
	position: relative;
	background: var(--bcp-surface);
	border-bottom: 1px solid var(--bcp-border);
}

/**
 * Degradados de borde: avisan de que hay más categorías fuera de vista.
 *
 * El JS activa .has-start / .has-end según la posición del scroll, así que el
 * degradado sólo aparece del lado donde realmente queda algo por ver. Sin esto,
 * la última categoría se corta contra el borde y parece un error de maquetación.
 */
.bcp-filters-bar::before,
.bcp-filters-bar::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 1px;
	z-index: 1;
	width: 40px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.bcp-filters-bar::before {
	left: 0;
	background: linear-gradient(to right, var(--bcp-surface), rgba(255, 255, 255, 0));
}

.bcp-filters-bar::after {
	right: 0;
	background: linear-gradient(to left, var(--bcp-surface), rgba(255, 255, 255, 0));
}

.bcp-filters-bar.has-start::before,
.bcp-filters-bar.has-end::after {
	opacity: 1;
}

/* Misma caja que .bcp__viewport para que la primera categoría arranque en la
   misma vertical que la primera tarjeta: la banda blanca sigue siendo de ancho
   completo, pero su contenido va centrado dentro de --bcp-max. */
.bcp-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-start;
	margin: 0 auto;
	max-width: var(--bcp-max);
	padding: 22px 20px;
}

.bcp-filters__tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 9px 18px;
	background: var(--bcp-surface);
	border: 1px solid var(--bcp-border);
	border-radius: 3px;
	color: var(--bcp-navy);
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.bcp-filters__tab:hover {
	border-color: var(--bcp-navy);
}

.bcp-filters__tab.is-active {
	background: var(--bcp-navy);
	border-color: var(--bcp-navy);
	color: #fff;
}

.bcp-filters__count {
	font-weight: 500;
	opacity: 0.85;
}

.bcp-filters__icon {
	display: inline-block;
	width: 12px;
	height: 12px;
	background:
		linear-gradient(currentColor 0 0) 0 0 / 5px 5px no-repeat,
		linear-gradient(currentColor 0 0) 7px 0 / 5px 5px no-repeat,
		linear-gradient(currentColor 0 0) 0 7px / 5px 5px no-repeat,
		linear-gradient(currentColor 0 0) 7px 7px / 5px 5px no-repeat;
}

/* ---------- Viewport / track ---------- */

.bcp__viewport {
	position: relative;
	margin: 0 auto;
	max-width: var(--bcp-max);
	padding: 40px 20px;
}

/**
 * El número de columnas de escritorio llega por --bcp-cols-desktop (inline,
 * desde el shortcode). --bcp-cols se declara acá, en la hoja de estilos, para
 * que las media queries de abajo puedan sobrescribirlo: si el valor inline
 * fuera --bcp-cols, ganaría siempre y el listado no respondería.
 */
.bcp__track {
	--bcp-cols: var(--bcp-cols-desktop, 4);

	display: grid;
	gap: var(--bcp-gap);
	grid-template-columns: repeat(var(--bcp-cols), minmax(0, 1fr));
}

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

.bcp-card {
	display: flex;
	flex-direction: column;
	padding: 12px 12px 16px;
	background: var(--bcp-surface);
	border: 1px solid var(--bcp-border);
	border-radius: var(--bcp-radius);
	box-shadow: 0 1px 2px rgba(22, 48, 90, 0.04);
	text-align: center;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bcp-card:hover {
	box-shadow: 0 8px 24px rgba(22, 48, 90, 0.12);
	transform: translateY(-2px);
}

.bcp-card[hidden] {
	display: none;
}

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

/* Mismo tamaño que el resto: así la retícula no se descuadra cuando el filtro
   deja una sola destacada visible, o ninguna.

   El borde es de 1px en los cuatro lados, igual que el de las demás tarjetas:
   sólo cambia el color. Antes llevaba además una sombra interior arriba, que
   sumaba grosor sólo en ese lado y hacía ver el borde superior más ancho. */
.bcp-card--featured {
	border-color: var(--bcp-featured-border);
}

.bcp-card__featured {
	position: absolute;
	top: 5px;
	right: 5px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	background: var(--bcp-featured-badge-bg);
	border-radius: 2px;
	color: var(--bcp-featured-badge-text);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-transform: uppercase;
}

.bcp-card__featured svg {
	width: 10px;
	height: 10px;
}

.bcp-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 3px;
	line-height: 0;
}

.bcp-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.bcp-card__img--placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, var(--bcp-navy) 0%, var(--bcp-navy-dark) 100%);
}

.bcp-card__badge {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 4px 10px;
	background: var(--bcp-red);
	border-radius: 3px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.4;
	text-transform: uppercase;
}

.bcp-card__body {
	flex: 1 1 auto;
	padding: 16px 6px 12px;
}

.bcp-card__title {
	margin: 0 0 10px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
}

.bcp-card__title a {
	color: var(--bcp-navy);
	text-decoration: none;
}

.bcp-card__title a:hover {
	text-decoration: underline;
}

.bcp-card__text {
	margin: 0;
	color: var(--bcp-muted);
	font-size: 15px;
	line-height: 1.55;
}

/* El subrayado va forzado: varios temas aplican text-decoration:none a todos
   los enlaces del contenido y se comían el del "Ver más". */
.bcp .bcp-card__more {
	align-self: center;
	color: var(--bcp-muted);
	font-size: 14px;
	text-decoration: underline !important;
	text-underline-offset: 2px;
}

.bcp .bcp-card__more:hover,
.bcp .bcp-card__more:focus {
	color: var(--bcp-navy);
	text-decoration: underline !important;
}

/* ---------- Flechas ---------- */

.bcp__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: var(--bcp-surface);
	border: 1px solid var(--bcp-border);
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(22, 48, 90, 0.12);
	color: var(--bcp-navy);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.bcp__nav svg {
	width: 20px;
	height: 20px;
}

.bcp__nav:hover {
	background: var(--bcp-navy);
	color: #fff;
}

.bcp__nav--prev {
	left: -6px;
}

.bcp__nav--next {
	right: -6px;
}

.bcp__nav[disabled] {
	cursor: default;
	opacity: 0.3;
	pointer-events: none;
}

/* Si todas las tarjetas entran en pantalla no hay nada que desplazar:
   las flechas se ocultan en vez de quedar visibles y apagadas. */
.bcp__nav[hidden] {
	display: none;
}

/* ---------- Puntos de paginación ---------- */

/* El JS los oculta con [hidden] cuando hay una sola página, también al
   filtrar: una categoría que entra entera no muestra ningún control. */
.bcp__dots {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	justify-content: center;
	padding: 0 20px 28px;
}

.bcp__dots[hidden] {
	display: none;
}

.bcp__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	background: #c8cede;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.bcp__dot.is-active {
	background: var(--bcp-navy);
	transform: scale(1.15);
}

.bcp__empty {
	margin: 0;
	padding: 40px 20px;
	color: var(--bcp-muted);
	font-size: 15px;
	text-align: center;
}

/* ---------- Ficha individual ---------- */

.bcp-page--single {
	background: var(--bcp-bg);
	padding-bottom: 56px;
}

.bcp-single__hero {
	display: flex;
	align-items: flex-end;
	min-height: 320px;
	padding: 48px 20px;
	background-color: var(--bcp-navy-dark);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	position: relative;
}

.bcp-single__hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(9, 20, 40, 0.25) 0%, rgba(9, 20, 40, 0.85) 100%);
}

.bcp-single__hero-inner {
	position: relative;
	z-index: 1;
	margin: 0 auto;
	max-width: var(--bcp-max);
	width: 100%;
}

.bcp-single__cats {
	margin: 0 0 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bcp-single__cats a,
.bcp-single__cats span {
	padding: 4px 12px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	text-transform: uppercase;
}

.bcp-single__cats a:hover {
	background: rgba(255, 255, 255, 0.3);
}

.bcp-single__title {
	margin: 0;
	color: #fff;
	font-size: clamp(26px, 4vw, 40px);
	font-weight: 800;
	line-height: 1.15;
}

/* Vuelta al listado: alineado a la izquierda del contenedor, sobre el
   contenido, igual en escritorio y en móvil. */
.bcp-single__back {
	margin: 0 auto;
	max-width: var(--bcp-max);
	padding: 28px 20px 0;
}

.bcp-single__back a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--bcp-navy);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}

.bcp-single__back svg {
	width: 18px;
	height: 18px;
	transition: transform 0.18s ease;
}

.bcp-single__back a:hover,
.bcp-single__back a:focus-visible {
	text-decoration: underline;
}

.bcp-single__back a:hover svg,
.bcp-single__back a:focus-visible svg {
	transform: translateX(-3px);
}

.bcp-single__body {
	display: grid;
	gap: 32px;
	grid-template-columns: minmax(0, 1fr) 320px;
	margin: 0 auto;
	max-width: var(--bcp-max);
	padding: 40px 20px 0;
}

/* Con el enlace de vuelta encima no hace falta tanto aire arriba. */
.bcp-single__back + .bcp-single__body,
.bcp-single__back + .bcp-single__terms {
	padding-top: 24px;
}

/* Cuando sólo hay una de las dos cajas, ocupa la fila entera. */
.bcp-single__body--solo {
	grid-template-columns: minmax(0, 1fr);
}

.bcp-single__body--solo .bcp-single__aside {
	justify-self: center;
	max-width: 420px;
	width: 100%;
}

.bcp-single__content {
	background: var(--bcp-surface);
	border: 1px solid var(--bcp-border);
	border-radius: var(--bcp-radius);
	padding: 28px;
	font-size: 18px;
	line-height: 1.7;
}

.bcp-single__content > *:first-child {
	margin-top: 0;
}

.bcp-single__content > *:last-child {
	margin-bottom: 0;
}

/* Los titulares del contenido siguen el azul de marca; el resto queda gris. */
.bcp-single__content h1,
.bcp-single__content h2,
.bcp-single__content h3,
.bcp-single__content h4,
.bcp-single__content h5,
.bcp-single__content h6 {
	color: var(--bcp-navy);
}

/* Imágenes insertadas desde el editor. */
.bcp-single__content img {
	border-radius: 3px;
}

.bcp-single__aside {
	align-self: start;
	position: sticky;
	top: 24px;
	padding: 24px;
	background: var(--bcp-navy);
	border-radius: var(--bcp-radius);
	color: #fff;
	text-align: center;
}

.bcp-single__code {
	margin-bottom: 18px;
	padding: 14px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px dashed rgba(255, 255, 255, 0.4);
	border-radius: 3px;
}

.bcp-single__code-label {
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	letter-spacing: 0.5px;
	opacity: 0.8;
	text-transform: uppercase;
}

.bcp-single__code-value {
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 1px;
}

.bcp-btn {
	display: inline-block;
	width: 100%;
	padding: 14px 24px;
	border: 0;
	border-radius: 3px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: filter 0.2s ease;
}

.bcp-btn--primary {
	background: var(--bcp-green);
	color: #fff;
}

.bcp-btn:hover {
	filter: brightness(1.08);
}

.bcp-single__valid {
	margin: 14px 0 0;
	font-size: 12px;
	opacity: 0.75;
}

.bcp-single__terms {
	margin: 0 auto;
	max-width: var(--bcp-max);
	padding: 40px 20px 0;
}

/* Siempre visibles: en la ficha de la promoción los T&C son parte del
   contenido, no un detalle plegable. */
.bcp-single__terms-title {
	margin: 0;
	padding: 16px 20px;
	background: var(--bcp-surface);
	border: 1px solid var(--bcp-border);
	border-radius: var(--bcp-radius) var(--bcp-radius) 0 0;
	color: var(--bcp-navy);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.bcp-single__terms-body {
	padding: 20px;
	background: var(--bcp-surface);
	border: 1px solid var(--bcp-border);
	border-top: 0;
	border-radius: 0 0 var(--bcp-radius) var(--bcp-radius);
	color: var(--bcp-muted);
	font-size: 15px;
	line-height: 1.7;
}

.bcp-single__terms-body > *:first-child {
	margin-top: 0;
}

.bcp-single__terms-body > *:last-child {
	margin-bottom: 0;
}

/* ---------- Cabecera de categoría ---------- */

.bcp-page__header {
	margin: 0 auto;
	max-width: var(--bcp-max);
	padding: 40px 20px 8px;
	text-align: center;
}

.bcp-page__title {
	margin: 0 0 10px;
	color: var(--bcp-navy);
	font-size: 34px;
	font-weight: 800;
}

.bcp-page__desc,
.bcp-page__back {
	color: var(--bcp-muted);
	font-size: 16px;
}

.bcp-page__back a {
	color: var(--bcp-navy);
	text-decoration: none;
}

.bcp-related {
	background: transparent;
	padding-bottom: 0;
}

/* ---------- Responsive ---------- */

/* Los cortes son los de Elementor en los sitios Betcris (≥992 / 768-991 /
   ≤767), para que el listado cambie de columnas donde cambia el resto. */
@media (max-width: 991px) {
	.bcp__track {
		--bcp-cols: 3;
	}

	.bcp-single__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.bcp-single__aside {
		position: static;
	}
}

@media (max-width: 767px) {
	.bcp__track {
		--bcp-cols: 2;
	}

	/* En móvil las flechas estorban: la paginación se hace con los puntos. */
	.bcp__nav {
		display: none;
	}

	.bcp__viewport {
		padding-bottom: 20px;
	}

	.bcp-card__title {
		font-size: 16px;
	}

	.bcp-card__text {
		font-size: 14px;
	}

	/* Una sola fila desplazable: escala a cualquier número de categorías sin
	   robar altura a las tarjetas. */
	.bcp-filters {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		scroll-behavior: smooth;
		scroll-snap-type: x proximity;
		scroll-padding: 0 14px;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.bcp-filters::-webkit-scrollbar {
		display: none;
	}

	.bcp-filters__tab {
		flex: 0 0 auto;
		scroll-snap-align: center;
	}
}

/* En teléfono se mantienen las 2 columnas (como en el diseño de referencia);
   sólo se aprietan el gap y los espaciados. */
@media (max-width: 520px) {
	.bcp {
		--bcp-gap: 12px;
	}

	.bcp__viewport {
		padding: 20px 14px;
	}

	.bcp-card {
		padding: 8px 8px 12px;
	}

	.bcp-card__body {
		padding: 12px 2px 10px;
	}

	.bcp-filters {
		padding: 16px 14px;
	}
}

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