.lupi-reels-carousel {
	width: 100%;
	position: relative;
	display: block;
}

.lupi-reels-carousel,
.lupi-reels-carousel *,
.lupi-reels-carousel *::before,
.lupi-reels-carousel *::after {
	box-sizing: border-box;
}

/* Scoped primitive reset to isolate the widget from theme and Elementor globals. */
.lupi-reels-carousel :where(h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure) {
	margin: 0;
	padding: 0;
}

.lupi-reels-carousel :where(ul, ol) {
	list-style: none;
}

.lupi-reels-carousel :where(a) {
	color: inherit;
}

.lupi-reels-carousel :where(button) {
	font: inherit;
}

.lupi-reels-carousel img,
.lupi-reels-carousel video,
.lupi-reels-carousel svg {
	max-width: none;
	border: 0;
	vertical-align: middle;
}

.lupi-reels-carousel__wrapper {
	position: relative;
	width: 100%;
}

.lupi-reels-carousel__track {
	display: flex;
	align-items: stretch;
	width: 100%;
	gap: var(--lupi-reels-gap, 16px);
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	-ms-overflow-style: none;
	scrollbar-width: none;
	user-select: none;
	box-sizing: border-box;
	cursor: default;
}

.lupi-reels-carousel__track::-webkit-scrollbar {
	display: none;
}

.lupi-reels-carousel__track.is-scrollable {
	cursor: grab;
}

.lupi-reels-carousel__track.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	scroll-snap-type: none;
}

.lupi-reels-carousel__item {
	flex: 0 0 calc((100% - (var(--lupi-reels-gap, 16px) * (var(--lupi-reels-slides-desktop, 4) - 1))) / var(--lupi-reels-slides-desktop, 4));
	width: calc((100% - (var(--lupi-reels-gap, 16px) * (var(--lupi-reels-slides-desktop, 4) - 1))) / var(--lupi-reels-slides-desktop, 4));
	display: flex;
	scroll-snap-align: start;
	min-width: 0;
}

.lupi-reels-carousel__card {
	width: 100%;
	display: block;
	outline: none;
	cursor: pointer;
}

.lupi-reels-carousel__card:focus-visible .lupi-reels-carousel__media {
	box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.25);
}

.lupi-reels-carousel__media {
	width: 100%;
	display: grid;
	grid-template-areas: "stack";
	align-items: stretch;
	aspect-ratio: var(--lupi-reels-aspect-ratio, 324 / 575);
	border-radius: var(--lupi-reels-radius, 8px);
	overflow: hidden;
	background: #111111;
}

.lupi-reels-carousel video.lupi-reels-carousel__video,
.lupi-reels-carousel img.lupi-reels-carousel__poster {
	grid-area: stack;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lupi-reels-carousel__poster--placeholder {
	background: linear-gradient(45deg, #1a1a1a, #333333);
}

.lupi-reels-carousel__overlay {
	grid-area: stack;
	width: 100%;
	height: 100%;
	background: linear-gradient(180deg, rgba(0, 0, 0, var(--lupi-reels-overlay-opacity, 0.8)) 0%, rgba(0, 0, 0, 0.2) 48%, rgba(0, 0, 0, 0.72) 100%);
	z-index: 1;
	pointer-events: none;
}

.lupi-reels-carousel__content {
	grid-area: stack;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-self: stretch;
	padding: 16px;
	min-height: 0;
}

.lupi-reels-carousel__top {
	display: flex;
	justify-content: flex-end;
}

.lupi-reels-carousel__platform-icon {
	display: inline-flex;
	align-items: center;
	color: #ffffff;
	line-height: 1;
}

.lupi-reels-carousel__platform-icon svg {
	display: block;
	width: 24px;
	height: 24px;
}

.lupi-reels-carousel__bottom {
	width: 100%;
}

.lupi-reels-carousel__product {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	width: 100%;
	min-width: 0;
}

.lupi-reels-carousel__product-image-wrap {
	width: 80px;
	height: 80px;
	max-width: 30%;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	background: #e5e7eb;
}

.lupi-reels-carousel img.lupi-reels-carousel__product-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lupi-reels-carousel__product-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.lupi-reels-carousel__title {
	margin: 0;
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	max-width: 100%;
	min-height: calc(2 * 1.4em);
	max-height: calc(2 * 1.4em);
	white-space: normal;
	overflow: hidden;
	overflow-wrap: anywhere;
	text-overflow: ellipsis;
}

.lupi-reels-carousel a.lupi-reels-carousel__button {
	appearance: none;
	box-sizing: border-box;
	width: fit-content;
	height: 32px;
	max-height: 32px;
	min-height: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 8px;
	border: 0;
	border-radius: 8px;
	background: #ffffff;
	color: #111111;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
}

.lupi-reels-carousel button.lupi-reels-carousel__control {
	all: unset;
	box-sizing: border-box;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	min-height: 48px;
	padding: 0;
	border-radius: 999px;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 3;
	color: #101010;
	line-height: 1;
	text-transform: none;
	text-shadow: none;
	font-family: inherit;
	font-style: normal;
	font-weight: 400;
	font-size: 0;
	vertical-align: middle;
	box-shadow: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.lupi-reels-carousel[data-navigation-visibility="on_hover"] button.lupi-reels-carousel__control {
	opacity: 0;
	visibility: hidden;
}

.lupi-reels-carousel[data-navigation-visibility="on_hover"]:hover button.lupi-reels-carousel__control,
.lupi-reels-carousel[data-navigation-visibility="on_hover"]:focus-within button.lupi-reels-carousel__control {
	opacity: 1;
	visibility: visible;
}

.lupi-reels-carousel button.lupi-reels-carousel__control--prev {
	left: -24px;
}

.lupi-reels-carousel button.lupi-reels-carousel__control--next {
	right: -24px;
}

.lupi-reels-carousel button.lupi-reels-carousel__control.is-disabled,
.lupi-reels-carousel button.lupi-reels-carousel__control:disabled {
	border-color: #e5e5e5;
	color: #d3d3d3;
	opacity: 1;
	cursor: default;
	pointer-events: none;
}

.lupi-reels-carousel .lupi-reels-carousel__chevron {
	display: inline-flex;
	width: 24px;
	height: 24px;
	align-items: center;
	justify-content: center;
}

.lupi-reels-carousel .lupi-reels-carousel__chevron svg {
	display: block;
	width: 24px;
	height: 24px;
	max-width: none;
}

.lupi-reels-carousel__empty {
	width: 100%;
	padding: 32px 24px;
	border: 1px dashed #d1d5db;
	border-radius: 16px;
	color: #4b5563;
	background: #f9fafb;
}

@media (max-width: 1024px) {
	.lupi-reels-carousel__item {
		flex-basis: calc((100% - (var(--lupi-reels-gap, 16px) * (var(--lupi-reels-slides-tablet, 2) - 1))) / var(--lupi-reels-slides-tablet, 2));
		width: calc((100% - (var(--lupi-reels-gap, 16px) * (var(--lupi-reels-slides-tablet, 2) - 1))) / var(--lupi-reels-slides-tablet, 2));
	}
}

@media (max-width: 767px) {
	.lupi-reels-carousel__item {
		flex-basis: calc((100% - (var(--lupi-reels-gap, 16px) * (var(--lupi-reels-slides-mobile, 1.2) - 1))) / var(--lupi-reels-slides-mobile, 1.2));
		width: calc((100% - (var(--lupi-reels-gap, 16px) * (var(--lupi-reels-slides-mobile, 1.2) - 1))) / var(--lupi-reels-slides-mobile, 1.2));
	}

	.lupi-reels-carousel button.lupi-reels-carousel__control {
		display: none;
	}
}
