/* ==========================================================================
   Vendavo Carousel Widget
   ========================================================================== */

/* ── Outer wrapper ───────────────────────────────────────────────────────── */
.vendavo-carousel-widget {
	position: relative;
	width: 100%;
	/* Let the section/container handle side padding; we just need overflow
	   visible on the right so the partial next slide peeks through. */
	overflow: hidden;
}
.vendavo-card-content {
  display: flex;
  flex-direction: column;
  height: 100%; /* or a fixed height if your cards are uniform */
}

.vendavo-card-desc {
  margin-bottom: 0; /* avoid fixed spacing */
}

.vendavo-tags {
  margin-top: auto; /* pushes tags to the bottom */
}

/* Hide tags ONLY on the static (manual repeater) variant.
   Dynamic (CPT) carousels keep their term pills visible. */
.vendavo-carousel-widget.is-source-manual .vendavo-tags {
  display: none !important;
}
/* ── Swiper container ────────────────────────────────────────────────────── */
.vendavo-carousel-widget .vendavo-swiper {
	overflow: visible; /* allows partial-slide peek */
	width: 100%;
}

.vendavo-carousel-widget .vendavo-swiper-wrapper {
	display: flex;
	align-items: stretch;
}

/* ── Each slide ──────────────────────────────────────────────────────────── */
.vendavo-carousel-widget .vendavo-swiper-slide {
	height: auto;
	box-sizing: border-box;
	display: flex;
	
	/* Fallback width and gap when Swiper is locked (watchOverflow) or not initialized */
	width: var(--fallback-width-d, 31.25%);
	margin-right: var(--gap-d, 24px);
}
.vendavo-carousel-widget .vendavo-swiper-slide:last-child {
	margin-right: 0 !important;
}

@media (max-width: 1024px) {
	.vendavo-carousel-widget .vendavo-swiper-slide {
		width: var(--fallback-width-t, 45.45%);
		margin-right: var(--gap-t, 20px);
	}
}

@media (max-width: 767px) {
	.vendavo-carousel-widget .vendavo-swiper-slide {
		width: var(--fallback-width-m, 83.33%);
		margin-right: var(--gap-m, 16px);
	}
}

/* Force correct fallback widths for single slide to prevent Swiper/Elementor default CSS from stretching it to 100% width */
.vendavo-carousel-widget.has-single-slide .vendavo-swiper-slide {
	width: var(--fallback-width-d, 31.25%) !important;
	margin-right: var(--gap-d, 24px) !important;
}

@media (max-width: 1024px) {
	.vendavo-carousel-widget.has-single-slide .vendavo-swiper-slide {
		width: var(--fallback-width-t, 45.45%) !important;
		margin-right: var(--gap-t, 20px) !important;
	}
}

@media (max-width: 767px) {
	.vendavo-carousel-widget.has-single-slide .vendavo-swiper-slide {
		width: var(--fallback-width-m, 83.33%) !important;
		margin-right: var(--gap-m, 16px) !important;
	}
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.vendavo-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	height: auto;
	overflow: hidden;
	border-radius: 16px;
	text-decoration: none;
	isolation: isolate; /* keeps the content blur contained to the card */
}

a.vendavo-card { color: inherit; }

/* Image area */
.vendavo-card-image {
	position: relative;
	width: 100%;
	height: 260px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	flex-shrink: 0;
}

/* Content area (the dark section that turns to glass on hover) */
.vendavo-card-content {
	position: relative;
	flex: 1 1 auto;
	padding: 24px;
	background-color: #15103A;   /* solid dark navy by default */
	color: #FFFFFF;
	transition: background-color 0.35s ease,
	            backdrop-filter 0.35s ease,
	            -webkit-backdrop-filter 0.35s ease,
	            color 0.35s ease;
	-webkit-backdrop-filter: blur(0);
	backdrop-filter: blur(0);
}

/* Glass-morphism on hover — translucent white over the image behind */
.vendavo-card:hover .vendavo-card-content {
	background-color: rgba(255, 255, 255, 0.18);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

/* Title */
.vendavo-card-title {
	margin: 0 0 12px;
	color: #FFFFFF;
	font-weight: 700;
	font-size: 24px;
	line-height: 1.2;

	/* Required base for -webkit-line-clamp to trigger the ellipsis.
	   The actual number of lines is driven by Elementor's control. */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Description */
.vendavo-card-desc {
	margin: 0 0 16px;
	color: #E6E6EE;
	font-size: 16px;
	line-height: 1.5;

	/* Required base for -webkit-line-clamp to trigger the ellipsis.
	   The actual number of lines is driven by Elementor's control. */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Tags row */
.vendavo-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.vendavo-tag {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 100px;
	background-color: rgba(255, 255, 255, 0.08);
	color: #FFFFFF;
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
}

/* ── Controls bar ────────────────────────────────────────────────────────── */
.vendavo-carousel-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 32px;
	gap: 16px;
	margin-left:auto !important;
	margin-right:auto !important;
}

/* ── Progress pagination ─────────────────────────────────────────────────── */
.vendavo-pagination-wrap {
	flex: 1;
}

.vendavo-swiper-pagination {
	--progress: 0%;
	--progress-color: #F97676;
	padding:3px 2px;
	position: relative;
	display: block;
	width: 100%;
	max-width: 340px;
	height: 10px;
	background-color: rgba(255, 255, 255, 0.12);
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.15);
	box-shadow:
		inset 0 1px 2px rgba(0, 0, 0, 0.3),
		0 2px 4px rgba(0, 0, 0, 0.2);
	padding:3px 2px;
}

/* Filled progress bar */
.vendavo-swiper-pagination::before {
	content: '';
	position: absolute;
	inset-block: 0;
	left: 0;
	width: var(--progress, 0%);
	background: var(--progress-color, #F97676);
	border-radius: 6px;
	transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
	margin:2px;
}

/* ── Arrow buttons ───────────────────────────────────────────────────────── */
.vendavo-arrows {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
	margin-bottom:4px;
}

.vendavo-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background-color: #F97676;
	color: #FFFFFF;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.15s ease;
	padding: 17px;
	line-height: 1;
}

.vendavo-arrow:hover {
	opacity: 0.85;
	transform: scale(1.05);
}

.vendavo-arrow:active {
	transform: scale(0.97);
}

.vendavo-arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.vendavo-arrow svg {
	display: block;
	flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.vendavo-card-image {
		height: 220px;
	}
	.vendavo-card-title { font-size: 22px; }
}
@media (max-width: 1440px) {

.vendavo-carousel-controls {
    margin-left: auto !important;
    margin-right: auto !important;
}
	.vendavo-swiper{
		margin-left:0px !important;
	}
}
@media (max-width: 767px) {
	.vendavo-card{
		width:100%;
		height:auto;
	}

	.vendavo-arrow {
		width: 40px;
		height: 40px;
	}
	.vendavo-swiper-pagination {
		max-width: 100%;
	}
	.vendavo-carousel-controls {
		margin-top: 24px;
	}
	.vendavo-card-image {
		height: 200px;
	}
	.vendavo-card-title { font-size: 20px; }
	.vendavo-card-desc { font-size: 15px; }
}

/* ==========================================================================
   Dark Overlay variant (card_style = dark_overlay)
   Image fills the whole card, dark gradient from bottom, text on top,
   small arrow button in bottom-right corner.
   ========================================================================== */

.vendavo-card.is-dark {
	position: relative;
	background-color: #000;
}

.vendavo-card.is-dark .vendavo-card-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Dark gradient overlay on the image */
.vendavo-card.is-dark .vendavo-card-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top,
		rgba(0, 0, 0, 0.55) 0%,
		rgba(0, 0, 0, 0.55) 40%,
		rgba(0, 0, 0, 0) 100%);
	pointer-events: none;
}

/* Content sits on top of the image, aligned to the bottom */
.vendavo-card.is-dark .vendavo-card-content {
	position: relative;
	z-index: 2;
	margin-top: auto;
	background-color: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	padding: 28px;
	padding-right: 88px; /* room for the arrow button */
	color: #FFFFFF;
}

/* In dark mode, don't apply the glass effect on hover */
.vendavo-card.is-dark:hover .vendavo-card-content {
	background-color: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

/* Arrow button in bottom-right */
.vendavo-card-btn {
	position: absolute;
	right: 20px;
	bottom: 20px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background-color: rgba(255, 255, 255, 0.18);
	color: #FFFFFF;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color 0.25s ease, transform 0.25s ease;
	pointer-events: none; /* card itself is the link */
}

.vendavo-card.is-dark:hover .vendavo-card-btn {
	background-color: rgba(255, 255, 255, 0.32);
	transform: translateX(4px);
}

.vendavo-card-btn svg {
	display: block;
}

/* ── Editor mode tweaks ──────────────────────────────────────────────────── */
/* Inside the Elementor editor preview, Swiper isn't initialised the same way
   as the frontend. Just keep slides in a row and let Swiper's own overflow
   handling show — no scrollbar needed. */
body.elementor-editor-active .vendavo-carousel-widget .vendavo-swiper,
body.elementor-editor-active .vendavo-carousel-widget .vendavo-swiper-wrapper {
	overflow: visible;
}
