/* Magenta Catálogo – Reels */

.mgc-rl {
	--rl-accent: var(--mgc-bg, #9c3586);
	--rl-ink: #1f1a24;
	--rl-muted: #6b6274;
	--rl-line: #eadbe4;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 16px 40px;
	color: var(--rl-ink);
}

.mgc-rl *,
.mgc-rl-feed * {
	box-sizing: border-box;
}

.mgc-rl-head {
	text-align: center;
	margin: 10px 0 22px;
}

.mgc-rl-head h2 {
	font-size: clamp(26px, 4vw, 38px);
	margin: 0 0 6px;
}

.mgc-rl-head p {
	color: var(--rl-muted);
	margin: 0;
}

.mgc-rl-empty {
	text-align: center;
	color: var(--rl-muted);
}

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

.mgc-rl-chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 2px 12px;
	margin-bottom: 8px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.mgc-rl-chips::-webkit-scrollbar {
	display: none;
}

/* Una sola fila que se desliza (también en computador), con desvanecido al final */
.mgc-rl-chips {
	flex-wrap: nowrap;
	scroll-snap-type: x proximity;
	-webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
	mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
}

.mgc-rl-chips > button {
	scroll-snap-align: start;
}

.mgc-rl-chips > button:last-child {
	margin-right: 32px;
}

@media (min-width: 768px) {
	.mgc-rl-chips {
		justify-content: safe center;
	}
}

.mgc-rl-chips button {
	flex: 0 0 auto;
	font-family: inherit;
	text-transform: none !important;
	letter-spacing: normal;
	line-height: 1.2;
	min-height: 0;
	border: 1.5px solid var(--rl-line);
	background: #fff;
	color: var(--rl-ink);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: all .15s ease;
}

.mgc-rl-chips button.is-active,
.mgc-rl-chips button:hover {
	border-color: var(--rl-accent);
	background: var(--rl-accent);
	color: #fff;
}

/* ---------- Grilla ---------- */

.mgc-rl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

@media (min-width: 768px) {
	.mgc-rl-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 14px;
	}
}

.mgc-rl-tile {
	position: relative;
	display: block;
	aspect-ratio: 9 / 16;
	border-radius: 14px;
	overflow: hidden;
	background: #1a1020;
	color: #fff !important;
	text-decoration: none !important;
	transition: transform .2s ease, box-shadow .2s ease;
}

.mgc-rl-tile[hidden] {
	display: none;
}

.mgc-rl-tile:hover,
.mgc-rl-tile:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 12px 26px rgba(63, 25, 93, .22);
}

.mgc-rl-tile:focus-visible {
	outline: 3px solid var(--rl-accent);
	outline-offset: 2px;
}

.mgc-rl-tile img,
.mgc-rl-tile video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.mgc-rl-tile::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 45%);
	pointer-events: none;
}

.mgc-rl-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .25);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	padding-left: 3px;
	opacity: .9;
	transition: transform .2s ease;
	z-index: 1;
}

.mgc-rl-tile:hover .mgc-rl-play {
	transform: scale(1.12);
}

.mgc-rl-tile-views {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 1;
	font-size: 12px;
	font-weight: 600;
	background: rgba(0, 0, 0, .45);
	padding: 3px 8px;
	border-radius: 999px;
}

.mgc-rl-tile-title {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	z-index: 1;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Feed a pantalla completa ---------- */

html.mgc-rl-lock,
html.mgc-rl-lock body {
	overflow: hidden !important;
}

.mgc-rl-feed {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: #000;
	display: none;
	color: #fff;
}

.mgc-rl-feed.is-open {
	display: block;
}

.mgc-rl-track {
	height: 100%;
	overflow-y: auto;
	scroll-snap-type: y mandatory;
	overscroll-behavior: contain;
	scrollbar-width: none;
}

.mgc-rl-track::-webkit-scrollbar {
	display: none;
}

.mgc-rl-slide {
	position: relative;
	height: 100vh;
	height: 100dvh;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.mgc-rl-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
}

/* En computador: columna central tipo celular. */
@media (min-width: 768px) {
	.mgc-rl-slide {
		padding: 16px 0;
	}

	.mgc-rl-video {
		width: auto;
		height: 100%;
		aspect-ratio: 9 / 16;
		max-width: 100%;
		object-fit: cover;
		border-radius: 14px;
	}
}

.mgc-rl-paused-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 76px;
	height: 76px;
	margin: -38px 0 0 -38px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .4);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	padding-left: 5px;
	opacity: 0;
	transform: scale(.8);
	transition: opacity .15s ease, transform .15s ease;
	pointer-events: none;
}

.mgc-rl-slide.is-paused .mgc-rl-paused-icon {
	opacity: 1;
	transform: none;
}

.mgc-rl-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	animation: mgc-rl-spin .8s linear infinite;
}

.mgc-rl-slide.is-loading .mgc-rl-spinner {
	opacity: 1;
}

@keyframes mgc-rl-spin {
	to { transform: rotate(360deg); }
}

/* Acciones laterales */
.mgc-rl-side {
	position: absolute;
	right: 12px;
	bottom: 110px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	z-index: 2;
}

@media (min-width: 768px) {
	.mgc-rl-side {
		right: calc(50% - (100dvh - 32px) * 9 / 32 - 74px);
	}
}

.mgc-rl-action,
.mgc-rl-feed a.mgc-wa-btn.mgc-rl-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0;
	color: #fff !important;
	font-size: 12px;
	font-weight: 600;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
	cursor: pointer;
	text-decoration: none !important;
	width: auto;
	min-width: 0;
	transform: none;
	filter: none;
}

.mgc-rl-action > svg,
.mgc-rl-eye {
	width: 48px;
	height: 48px;
	padding: 12px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .35);
	backdrop-filter: blur(6px);
	box-sizing: border-box;
	transition: transform .15s ease;
}

.mgc-rl-eye {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	padding: 0;
	text-shadow: none;
}

.mgc-rl-action:hover > svg,
.mgc-rl-action:focus-visible > svg {
	transform: scale(1.1);
}

.mgc-rl-action:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
	border-radius: 8px;
}

.mgc-rl-feed .mgc-rl-wa > svg {
	width: 56px;
	height: 56px;
	padding: 13px;
	background: #25d366;
	box-shadow: 0 4px 16px rgba(37, 211, 102, .45);
	animation: mgc-rl-pulse 2.4s ease-in-out infinite;
}

@keyframes mgc-rl-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); }
	50% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
}

/* Información inferior */
.mgc-rl-info {
	position: absolute;
	left: 0;
	right: 80px;
	bottom: 0;
	padding: 60px 16px calc(22px + env(safe-area-inset-bottom));
	background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
	z-index: 1;
	pointer-events: none;
}

@media (min-width: 768px) {
	.mgc-rl-info {
		left: 50%;
		right: auto;
		width: calc((100dvh - 32px) * 9 / 16);
		max-width: 100%;
		transform: translateX(-50%);
		bottom: 16px;
		border-radius: 0 0 14px 14px;
		padding-right: 16px;
	}
}

.mgc-rl-title {
	color: #fff !important;
	font-size: 16px;
	line-height: 1.3;
	margin: 0 0 8px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.mgc-rl-products {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	pointer-events: auto;
}

.mgc-rl-product {
	display: inline-block;
	background: rgba(255, 255, 255, .18);
	backdrop-filter: blur(6px);
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	text-decoration: none !important;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mgc-rl-product:hover {
	background: rgba(255, 255, 255, .3);
}

.mgc-rl-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(255, 255, 255, .2);
	z-index: 2;
}

@media (min-width: 768px) {
	.mgc-rl-progress {
		left: 50%;
		right: auto;
		width: calc((100dvh - 32px) * 9 / 16);
		transform: translateX(-50%);
		bottom: 16px;
	}
}

.mgc-rl-progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--mgc-bg, #9c3586);
}

.mgc-rl-close {
	position: absolute;
	top: calc(12px + env(safe-area-inset-top));
	right: 12px;
	z-index: 5;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(6px);
}

.mgc-rl-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.mgc-rl-toast {
	position: absolute;
	left: 50%;
	bottom: 90px;
	transform: translate(-50%, 20px);
	z-index: 6;
	background: rgba(255, 255, 255, .95);
	color: #111;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 999px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	max-width: 90%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mgc-rl-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* El botón flotante general no debe tapar el feed. */
html.mgc-rl-lock .mgc-wa-float {
	display: none !important;
}

/* ---------- Página individual /reel/… ---------- */

.mgc-rl-single {
	max-width: 420px;
	margin: 0 auto 24px;
}

.mgc-rl-single video {
	width: 100%;
	aspect-ratio: 9 / 16;
	object-fit: cover;
	border-radius: 16px;
	background: #000;
	display: block;
}

.mgc-rl-single-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 14px;
}

.mgc-rl-single-actions .mgc-wa-btn {
	width: 100%;
}

.mgc-rl-single-product,
.mgc-rl-single-more {
	text-align: center;
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.mgc-rl-feed .mgc-rl-wa > svg {
		animation: none;
	}

	.mgc-rl-tile,
	.mgc-rl-action > svg {
		transition: none;
	}
}

/* ---------- Selector de productos (varios productos en un video) ---------- */

.mgc-rl-sheet {
	position: absolute;
	inset: 0;
	z-index: 8;
	background: rgba(0, 0, 0, .55);
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.mgc-rl-sheet[hidden] {
	display: none;
}

.mgc-rl-sheet-panel {
	width: 100%;
	max-width: 480px;
	max-height: 80dvh;
	overflow: auto;
	background: #fff;
	color: #1f1a24;
	border-radius: 22px 22px 0 0;
	padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
	animation: mgc-rl-sheet-up .25s ease;
}

@media (min-width: 768px) {
	.mgc-rl-sheet {
		align-items: center;
	}

	.mgc-rl-sheet-panel {
		border-radius: 22px;
	}
}

@keyframes mgc-rl-sheet-up {
	from { transform: translateY(100%); }
	to { transform: none; }
}

.mgc-rl-sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.mgc-rl-sheet-head h3 {
	margin: 0;
	font-size: 18px;
	color: #1f1a24 !important;
}

.mgc-rl-sheet-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: #f3e9ef;
	color: #1f1a24;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
}

.mgc-rl-sheet-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mgc-rl-sheet-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	margin: 0;
	border-bottom: 1px solid #eadbe4;
}

.mgc-rl-sheet-name {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	font-size: 14px;
	color: #1f1a24 !important;
	text-decoration: none !important;
	line-height: 1.3;
}

.mgc-rl-feed a.mgc-wa-btn.mgc-rl-sheet-wa {
	flex: 0 0 auto;
	font-size: 13px;
	padding: 8px 14px;
	width: auto;
}

.mgc-rl-sheet-wa svg,
.mgc-rl-sheet-all svg {
	width: 16px;
	height: 16px;
}

.mgc-rl-feed a.mgc-wa-btn.mgc-rl-sheet-all {
	display: flex;
	width: 100%;
	margin-top: 14px;
	padding: 12px 16px;
	background: #25d366 !important;
}

/* ---------- Ficha de producto: botón "Ver video del producto" ---------- */

.mgc-rl--button {
	padding: 0;
	margin: 0 0 18px;
	max-width: none;
}

.mgc-rl-open {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: 2px solid var(--mgc-bg, #9c3586);
	background: #fff;
	color: var(--mgc-bg, #9c3586);
	border-radius: 999px;
	padding: 8px 18px 8px 8px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.mgc-rl-open:hover,
.mgc-rl-open:focus-visible {
	background: var(--mgc-bg, #9c3586);
	color: #fff;
}

.mgc-rl-open:focus-visible {
	outline: 2px solid var(--mgc-bg, #9c3586);
	outline-offset: 3px;
}

.mgc-rl-open-icon {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--mgc-bg, #9c3586);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	padding-left: 2px;
}

@media (max-width: 600px) {
	.mgc-rl-open {
		width: 100%;
		justify-content: center;
	}
}

/* ---------- Tarjetas de la tienda: etiqueta "▶ Video" ---------- */

.mgc-rl-badge {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 3;
	background: rgba(0, 0, 0, .65);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 999px;
	pointer-events: none;
	line-height: 1.4;
}
