/**
 * Elementor Products Tabs Carousel – mobile UX + "Show all products" CTA.
 * Desktop unchanged.
 */

/* Section containing carousel: avoid next section overlapping CTA (class set by JS; :has() fallback for modern browsers) */
.elementor-section.konte-child-carousel-section,
.elementor-section:has(.elementor-widget-konte-products-tabs-carousel) {
	overflow: visible;
	padding-bottom: 2rem;
}

.elementor-widget-konte-products-tabs-carousel,
.elementor-widget-wrap:has(.elementor-widget-konte-products-tabs-carousel) {
	overflow: visible !important;
}

/* ----- "Show all products" CTA – scoped, theme match (black bg, white text) ----- */
.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all {
	display: block !important;
	margin: 1.25rem 0 0;
	padding: 0 0 0.5rem;
	text-align: center;
	visibility: visible !important;
	position: relative;
	z-index: 2;
}
.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all__link {
	display: inline-block;
	padding: 0.65rem 1.5rem;
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #fff !important;
	background: #161619 !important;
	border: none !important;
	border-radius: 4px;
	text-decoration: none !important;
	transition: background 0.25s ease, color 0.25s ease;
	box-sizing: border-box;
}
.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all__link:hover,
.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all__link:focus {
	background: #333 !important;
	color: #fff !important;
}
.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all__link:active {
	background: #000 !important;
	color: #fff !important;
}

/* ----- Mobile only (≤768px) ----- */
@media (max-width: 768px) {
	/* Hide arrows; rely on swipe + dots */
	.elementor-widget-konte-products-tabs-carousel .konte-carousel-navigation--prev,
	.elementor-widget-konte-products-tabs-carousel .konte-carousel-navigation--next {
		display: none !important;
	}

	/* Categories row: horizontal scroll + discoverability (gradient fade on right) */
	.elementor-widget-konte-products-tabs-carousel .konte-product-tabs__tabs,
	.elementor-widget-konte-products-tabs-carousel .konte-tabs__nav {
		display: flex !important;
		flex-wrap: nowrap !important;
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 0.5rem;
		padding-bottom: 0.25rem;
		margin-bottom: 1rem;
		position: relative;
	}
	.elementor-widget-konte-products-tabs-carousel .konte-tabs__nav::-webkit-scrollbar {
		display: none;
	}
	.elementor-widget-konte-products-tabs-carousel .konte-tabs__nav li {
		flex: 0 0 auto;
		white-space: nowrap;
	}
	/* Fade on right edge so users see there’s more to scroll */
	.elementor-widget-konte-products-tabs-carousel .konte-tabs__nav::after {
		content: '';
		flex: 0 0 28px;
		width: 28px;
		min-width: 28px;
		height: 100%;
		position: sticky;
		right: 0;
		top: 0;
		background: linear-gradient(to left, var(--carousel-tabs-fade, #f5f5f5) 40%, transparent);
		pointer-events: none;
	}

	/* Swiper row: equal-height slides */
	.elementor-widget-konte-products-tabs-carousel .swiper-container .swiper-wrapper {
		align-items: stretch;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .swiper-slide {
		height: auto;
		display: flex;
	}
	/* Product cards: even alignment, fixed structure, no layout shift */
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product {
		display: flex !important;
		flex-direction: column !important;
		width: 100%;
		height: 100%;
		min-height: 0;
		min-width: 0;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product > a {
		display: flex !important;
		flex-direction: column !important;
		flex: 1;
		height: 100%;
		min-height: 0;
		text-decoration: none;
		color: inherit;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .woocommerce-loop-product__title {
		flex-shrink: 0;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price {
		flex-shrink: 0;
		margin-top: auto;
	}
	/* Image box: consistent height (aspect-ratio) */
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .attachment-woocommerce_thumbnail,
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .woocommerce-loop-product__link img {
		width: 100%;
		height: auto;
		aspect-ratio: 1;
		object-fit: contain;
		display: block;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .woocommerce-loop-product__link {
		position: relative;
		display: block;
	}
	/* Title: fixed 2-line space to avoid shift */
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .woocommerce-loop-product__title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		line-height: 1.3;
		min-height: 2.6em;
		margin: 0.5rem 0 0.35rem;
		font-size: 0.9375rem;
	}
	/* Price: consistent spacing; variable price (od–do) on one or two clean lines */
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price {
		font-size: 0.8125rem;
		line-height: 1.35;
		margin: 0 0 0.5rem;
		display: flex !important;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 0.15em 0.35em;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price .from,
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price .to {
		font-size: 0.85em;
		opacity: 0.9;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price .amount {
		font-weight: 600;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price del {
		opacity: 0.7;
	}
	/* Variable price: compact (JS wraps in .price-range when 2+ amounts); amounts don’t break mid-number */
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price .price-range {
		display: inline;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .price .amount {
		white-space: nowrap;
	}
	.elementor-widget-konte-products-tabs-carousel .swiper-container .product .onsale {
		top: 0.5rem;
		left: 0.5rem;
		font-size: 0.7rem;
		padding: 0.25rem 0.4rem;
	}

	/* Pagination dots */
	.elementor-widget-konte-products-tabs-carousel .konte-carousel__pagination {
		display: flex !important;
		justify-content: center;
		margin-top: 1rem;
		gap: 0.35rem;
	}
	.elementor-widget-konte-products-tabs-carousel .konte-carousel__pagination .swiper-pagination-bullet {
		width: 8px;
		height: 8px;
		background: #ccc;
		opacity: 1;
	}
	.elementor-widget-konte-products-tabs-carousel .konte-carousel__pagination .swiper-pagination-bullet-active {
		background: #161619;
	}

	/* CTA on mobile: always visible, ensure contrast (nadpisanie ewentualnych reguł z serwera/motywu) */
	.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all,
	.elementor-section.konte-child-carousel-section .konte-child-carousel-show-all {
		display: block !important;
		visibility: visible !important;
		margin-top: 1rem;
		opacity: 1 !important;
		height: auto !important;
		overflow: visible !important;
	}
	.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all__link,
	.elementor-section.konte-child-carousel-section .konte-child-carousel-show-all__link {
		display: inline-block !important;
		visibility: visible !important;
		opacity: 1 !important;
		background: #161619 !important;
		color: #fff !important;
	}
	.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-show-all__link:hover,
	.elementor-section.konte-child-carousel-section .konte-child-carousel-show-all__link:hover {
		background: #333 !important;
		color: #fff !important;
	}

}

/* Oryginalne strzałki wewnątrz karuzeli — usunięte, zastąpione przez nowe pod karuzelą */
.elementor-widget-konte-products-tabs-carousel .konte-tabs__panel .konte-carousel__arrow {
	display: none !important;
}

/* ← POKAŻ WSZYSTKIE PRODUKTY → — działa na wszystkich szerokościach */
.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-bottom {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: center !important;
	flex-wrap: nowrap !important;
	gap: 1rem;
	margin-top: 1.25rem;
	overflow: visible !important;
}

.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-bottom .konte-child-carousel-show-all {
	margin: 0 !important;
	padding: 0 !important;
	flex: 0 0 auto !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
}

.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-arrow-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px !important;
	min-height: 44px !important;
	border-radius: 999px !important;
	border: none !important;
	background: #161619 !important;
	color: #fff !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	visibility: visible !important;
	opacity: 1 !important;
	transition: background 0.15s;
}

.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-arrow-btn:hover {
	background: #444 !important;
	color: #fff !important;
}

.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-arrow-btn .svg-icon {
	display: flex !important;
	align-items: center;
	justify-content: center;
	color: #fff !important;
}

.elementor-widget-konte-products-tabs-carousel .konte-child-carousel-arrow-btn .svg-icon svg {
	fill: currentColor !important;
	width: 16px !important;
	height: 16px !important;
	display: block !important;
}
