/* =========================================================
   SLIDER PRINCIPAL
   ========================================================= */
.cp-slider, .cp-cats {
	width: 100%;
	max-width: var(--cp-ancho, 1200px);
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box;
}
.cp-slider {
	position: relative;
	overflow: hidden;
	border-radius: var(--cp-radio, 18px);
	border: 1px solid var(--cp-card-borde, rgba(139, 92, 246, .3));
	box-shadow: 0 0 0 1px rgba(168, 85, 247, .35), 0 0 28px rgba(168, 85, 247, .28), 0 0 60px rgba(79, 107, 255, .14);
	background: #070818;
	margin-top: 0;
	margin-bottom: var(--cp-espacio, 24px) !important;
	isolation: isolate;
}
.cp-slider__track { display: flex; transition: transform .7s cubic-bezier(.2, .7, .2, 1); will-change: transform; touch-action: pan-y; }
.cp-slide { flex: 0 0 100%; min-width: 100%; position: relative; aspect-ratio: var(--cp-ratio, 3/1); max-height: var(--cp-alto-pc, 440px); }
.cp-slide__in { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none !important; }
.cp-slide picture, .cp-slide img { display: block; width: 100%; height: 100%; }
.cp-slide img { object-fit: cover; border-radius: 0 !important; margin: 0 !important; user-select: none; -webkit-user-drag: none; }

/* Efecto fundido */
.cp-slider--fundido .cp-slider__track { display: grid; transform: none !important; }
.cp-slider--fundido .cp-slide { grid-area: 1 / 1; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.cp-slider--fundido .cp-slide.is-activa { opacity: 1; pointer-events: auto; }

/* Texto sobre la imagen */
.cp-slide__txt {
	position: absolute;
	inset: auto 0 0 0;
	padding: clamp(16px, 4vw, 48px);
	background: linear-gradient(0deg, rgba(7, 8, 24, .85) 0%, rgba(7, 8, 24, .35) 60%, transparent 100%);
	color: #fff;
}
.cp-slide__txt h2 { margin: 0 0 6px; font: 800 clamp(20px, 3.4vw, 42px)/1.1 "Outfit", system-ui, sans-serif; color: #fff !important; text-shadow: 0 0 18px rgba(168, 85, 247, .7); }
.cp-slide__txt p { margin: 0 0 14px; max-width: 46ch; font: 500 clamp(13px, 1.4vw, 17px)/1.4 "Outfit", system-ui, sans-serif; color: #e7e8ff !important; }
.cp-slide__btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 11px 20px; border-radius: 999px;
	background: #fff; color: #14163a;
	font: 800 14px/1 "Outfit", system-ui, sans-serif;
	box-shadow: 0 0 22px rgba(255, 255, 255, .35);
	transition: transform .2s, box-shadow .2s;
}
.cp-slide__in:hover .cp-slide__btn { transform: translateY(-2px); box-shadow: 0 0 30px rgba(168, 85, 247, .8); }

/* Flechas y puntos */
.cp-slider__flecha {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 44px; height: 44px; border-radius: 50%;
	display: grid; place-items: center; cursor: pointer;
	border: 1px solid rgba(255, 255, 255, .25);
	background: rgba(10, 12, 46, .55); color: #fff;
	backdrop-filter: blur(6px);
	transition: background .2s, box-shadow .2s, opacity .2s;
	padding: 0;
}
.cp-slider__flecha:hover { background: linear-gradient(135deg, #a855f7, #4f6bff); box-shadow: 0 0 18px rgba(168, 85, 247, .8); }
.cp-slider__flecha--prev { left: 14px; }
.cp-slider__flecha--next { right: 14px; }
.cp-slider__puntos { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.cp-slider__punto { width: 9px; height: 9px; padding: 0; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s, background .3s; }
.cp-slider__punto.is-activa { width: 26px; background: linear-gradient(90deg, #a855f7, #22d3ee); box-shadow: 0 0 10px rgba(168, 85, 247, .9); }

@media (min-width: 768px) and (max-width: 1024px) {
	.cp-slide { max-height: var(--cp-alto-tablet, 340px); }
}
@media (max-width: 767px) {
	.cp-slider { border-radius: calc(var(--cp-radio, 18px) * .75); }
	.cp-slide { max-height: var(--cp-alto-movil, 460px); }
	/* Forma vertical solo si hay imagen para celular en todas las diapositivas. */
	.cp-slider--con-movil .cp-slide { aspect-ratio: var(--cp-ratio-m, 4/5); }
	.cp-slide__txt { padding: 14px 16px 30px; }
	.cp-slide__txt p { display: none; }
	.cp-slide__btn { padding: 8px 14px; font-size: 12px; }
	/* En celular se pasa deslizando con el dedo. */
	.cp-slider__flecha { display: none; }
	.cp-slider__puntos { bottom: 6px; gap: 6px; }
	.cp-slider__punto { width: 7px; height: 7px; }
	.cp-slider__punto.is-activa { width: 18px; }
	/* Banner horizontal en celular: sin texto encima (los banners ya traen su texto). */
	.cp-slider:not(.cp-slider--con-movil) .cp-slide__txt { display: none; }
}

/* =========================================================
   CARRUSEL DE CATEGORÍAS
   ========================================================= */
.cp-cats { margin-top: 0; margin-bottom: var(--cp-espacio, 24px) !important; }
.cp-cats__titulo { margin: 0 0 14px !important; font: 800 22px/1.2 "Outfit", system-ui, sans-serif !important; }
.cp-cats__marco { position: relative; }
.cp-cats__track {
	display: flex; gap: clamp(12px, 1.6vw, 22px);
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	padding: 12px 6px 14px;
	scroll-padding-inline: 6px;
	scrollbar-width: none;
}
.cp-cats__track::-webkit-scrollbar { display: none; }
.cp-cat {
	flex: 0 0 auto; width: var(--cp-cat, 120px);
	scroll-snap-align: start;
	display: flex; flex-direction: column; align-items: center; gap: 9px;
	text-decoration: none !important;
}
.cp-cat__img {
	display: block; width: var(--cp-cat, 120px); aspect-ratio: 1;
	border-radius: 24%;
	overflow: hidden;
	background: linear-gradient(135deg, #1a1450, #3b1a78);
	border: 1px solid var(--cp-card-borde, rgba(139, 92, 246, .3));
	box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cp-cat__img img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0 !important; border-radius: 0 !important; }
.cp-cat__letra { display: grid; place-items: center; height: 100%; font: 800 calc(var(--cp-cat, 120px) * .4)/1 "Outfit", system-ui, sans-serif; color: #fff; }
.cp-cat:hover .cp-cat__img, .cp-cat:focus-visible .cp-cat__img {
	transform: translateY(-5px) scale(1.04);
	border-color: var(--cp-violeta, #a855f7);
	box-shadow: 0 0 0 1px rgba(168, 85, 247, .6), 0 0 22px rgba(168, 85, 247, .55), 0 0 44px rgba(79, 107, 255, .25);
}
.cp-cat__nombre {
	max-width: 100%; text-align: center;
	font: 700 13px/1.25 "Outfit", system-ui, sans-serif;
	color: var(--cp-texto, #eef0ff) !important;
}
.cp-cats__flecha {
	position: absolute; top: calc(12px + var(--cp-cat, 120px) / 2); transform: translateY(-50%); z-index: 2;
	width: 38px; height: 38px; border-radius: 12px; padding: 0;
	display: grid; place-items: center; cursor: pointer;
	border: 0; color: #fff;
	background: linear-gradient(135deg, #a855f7, #4f6bff);
	box-shadow: 0 0 16px rgba(168, 85, 247, .6);
	transition: opacity .2s, transform .2s;
}
.cp-cats__flecha:hover { transform: translateY(-50%) scale(1.08); }
.cp-cats__flecha--prev { left: -6px; }
.cp-cats__flecha--next { right: -6px; }
.cp-cats__flecha[disabled] { opacity: 0; pointer-events: none; }

/* =========================================================
   POP-UP
   ========================================================= */
.cp-popup { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; }
.cp-popup[hidden] { display: none; }
.cp-popup__fondo { position: absolute; inset: 0; background: rgba(4, 5, 18, .72); backdrop-filter: blur(4px); animation: cp-aparece .3s ease; }
.cp-popup__caja {
	position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto;
	background: var(--cp-bg-2, #0d0f2b); color: var(--cp-texto, #eef0ff);
	border-radius: 22px;
	border: 1px solid rgba(168, 85, 247, .5);
	box-shadow: 0 0 0 1px rgba(168, 85, 247, .4), 0 0 40px rgba(168, 85, 247, .45), 0 30px 80px rgba(0, 0, 0, .5);
	animation: cp-sube .35s cubic-bezier(.2, .8, .2, 1);
}
.cp-popup__img { display: block; width: 100%; height: auto; margin: 0 !important; border-radius: 22px 22px 0 0 !important; }
.cp-popup__cuerpo { padding: 20px 22px 24px; text-align: center; }
.cp-popup__cuerpo h3 { margin: 0 0 8px; font: 800 22px/1.2 "Outfit", system-ui, sans-serif; color: var(--cp-texto, #eef0ff) !important; }
.cp-popup__txt { font: 400 15px/1.55 "Outfit", system-ui, sans-serif; color: var(--cp-texto-2, #a9acd6); }
.cp-popup__txt p { margin: 0 0 10px; color: inherit !important; }
.cp-popup__btn {
	display: inline-block; margin-top: 8px; padding: 12px 26px; border-radius: 999px;
	background: linear-gradient(135deg, #a855f7, #4f6bff); color: #fff !important;
	font: 800 14px/1 "Outfit", system-ui, sans-serif; text-decoration: none !important;
	box-shadow: 0 0 20px rgba(168, 85, 247, .6);
}
.cp-popup__x {
	position: absolute; top: 10px; right: 10px; z-index: 2;
	width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0;
	background: rgba(7, 8, 24, .7); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.cp-popup__x:hover { background: #a855f7; }
@keyframes cp-aparece { from { opacity: 0; } }
@keyframes cp-sube { from { opacity: 0; transform: translateY(24px) scale(.97); } }

@media (prefers-reduced-motion: reduce) {
	.cp-slider__track, .cp-slider--fundido .cp-slide, .cp-cat__img { transition: none !important; }
	.cp-popup__fondo, .cp-popup__caja { animation: none; }
}

/* =========================================================
   ENCUADRE DENTRO DE PORTO / WPBAKERY
   ========================================================= */
/* WPBakery envuelve los shortcodes en <p>: sin márgenes extra ni párrafos vacíos. */
p:has(> .cp-slider), p:has(> .cp-cats) { margin: 0 !important; padding: 0 !important; }
:is(.wpb_wrapper, .porto-block, .wpb_text_column) > p:empty { display: none; }
/* Si el bloque de Porto tenía alto fijo o imagen de fondo, que se adapte al slider. */
:is(.porto-block, .vc_row, .wpb_column, .vc_column-inner, .wpb_wrapper, .wpb_text_column, .page-top, .banner-container, .porto-ibanner):has(.cp-slider) {
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
}

/* Categorías: tamaños por pantalla */
@media (max-width: 1024px) {
	.cp-cats { --cp-cat: var(--cp-cat-tablet, 100px) !important; }
}
@media (max-width: 767px) {
	.cp-cats { --cp-cat: var(--cp-cat-movil, 84px) !important; }
	.cp-cats__titulo { font-size: 18px !important; }
	.cp-cat__nombre { font-size: 11.5px; }
	/* En celular se desliza con el dedo: sin flechas encima de los cuadros. */
	.cp-cats__flecha { display: none; }
	.cp-cats__track { padding-left: 2px; padding-right: 2px; }
}
