/* Product page: "Dažnai perkama kartu" + "Panašūs produktai" carousels and the
 * "Pirkti kartu" bar (inc/product-related.php, js/product-related.js).
 * The cards are the catalog's own (content-product.php); only the grid layout
 * (float widths, columns-N) is replaced by the carousel. */

.rp-section {
	clear: both;
	min-width: 0;
	max-width: 100%;
	margin: 40px 0 0;
}

.rp-section .rp-title {
	margin: 0 0 4px;
	color: #212121;
	font-family: 'Inter', sans-serif;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
}

.rp-carousel {
	position: relative;
	min-width: 0;
	max-width: 100%;
	margin-top: 12px;
}

.rp-carousel .rp-swiper {
	position: relative;
	width: 100%;
	max-width: 100%;
	overflow: hidden !important; /* never let the slide row widen the page */
	padding: 6px 1px 14px; /* room for borders and the hover shadow */
}

.woocommerce .rp-carousel ul.products.rp-products {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch; /* equal card heights */
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: visible;
}

/* WooCommerce clearfix pseudo-elements would become flex items. */
.woocommerce .rp-carousel ul.products.rp-products::before,
.woocommerce .rp-carousel ul.products.rp-products::after {
	content: none;
	display: none;
}

/* Card = the catalog card (style.css "ul.products.columns-4 li.product"); width comes from Swiper. */
.woocommerce .rp-carousel ul.products li.product {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	float: none;
	clear: none;
	width: auto;
	height: auto;
	margin: 0; /* margin-right = Swiper spaceBetween (inline style) */
	padding: 24px;
	border: 1px solid #F1F1F1;
	border-radius: 10px;
	background: #fff;
	box-sizing: border-box;
	transition: box-shadow .15s ease, border-color .15s ease;
}

.woocommerce .rp-carousel ul.products li.product:hover {
	border-color: #E6EBF0;
	box-shadow: 0 6px 14px rgba(15, 105, 175, .08);
}

.woocommerce .rp-carousel ul.products li.product .woocommerce-LoopProduct-link {
	display: block;
	margin-bottom: 12px;
}

/* "Į krepšelį" always at the bottom of the card. */
.woocommerce .rp-carousel ul.products li.product > a.button {
	align-self: flex-start;
	margin-top: auto;
}

.woocommerce .rp-carousel ul.products li.product.product-type-variable span.onsale {
	font-size: 12px;
}

/* Before Swiper starts (or without it): a horizontally scrollable row with the same widths. */
.woocommerce .rp-carousel:not(.is-ready) ul.products.rp-products {
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.woocommerce .rp-carousel:not(.is-ready) ul.products.rp-products::-webkit-scrollbar {
	display: none;
}
.woocommerce .rp-carousel:not(.is-ready) ul.products li.product {
	width: calc((100% - 12px) / 1.3);
	scroll-snap-align: start;
}
@media (min-width: 576px) {
	.woocommerce .rp-carousel:not(.is-ready) ul.products.rp-products { gap: 16px; }
	.woocommerce .rp-carousel:not(.is-ready) ul.products li.product { width: calc((100% - 16px) / 2); }
}
@media (min-width: 992px) {
	.woocommerce .rp-carousel:not(.is-ready) ul.products.rp-products { gap: 20px; }
	.woocommerce .rp-carousel:not(.is-ready) ul.products li.product { width: calc((100% - 40px) / 3); }
}
@media (min-width: 1200px) {
	.woocommerce .rp-carousel:not(.is-ready) ul.products.rp-products { gap: 24px; }
	.woocommerce .rp-carousel:not(.is-ready) ul.products li.product { width: calc((100% - 72px) / 4); }
}

/* Arrows (same look as the testimonials / subcategory carousels). The theme forces
 * <button> styles with !important, so every state is set here with !important too. */
.rp-carousel .rp-nav,
.rp-carousel .rp-nav:hover,
.rp-carousel .rp-nav:focus,
.rp-carousel .rp-nav:active {
	position: absolute;
	top: calc(50% - 14px);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	padding: 0 !important;
	border: 1px solid #E6EBF0 !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #0f69af !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.rp-carousel .rp-nav svg {
	flex: none;
	width: 20px !important;
	height: 20px !important;
	max-width: none !important;
}
.rp-carousel .rp-nav:hover,
.rp-carousel .rp-nav:active {
	background: #0f69af !important;
	color: #fff !important;
}
.rp-carousel .rp-nav:focus-visible {
	outline: 2px solid #0f69af;
	outline-offset: 2px;
}
.rp-carousel .rp-prev { left: -20px; }
.rp-carousel .rp-next { right: -20px; }
.rp-carousel .rp-nav.swiper-button-disabled {
	opacity: 0;
	pointer-events: none;
}
.rp-carousel .rp-nav.swiper-button-lock,
.rp-carousel:not(.is-ready) .rp-nav {
	display: none;
}

/* Page dots */
.rp-carousel .rp-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	min-height: 8px;
	margin-top: 6px;
}
.rp-carousel .rp-dots.swiper-pagination-lock,
.rp-carousel:not(.is-ready) .rp-dots {
	display: none;
}
.rp-carousel .rp-dots .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0 !important;
	border-radius: 4px;
	background: #cfd8e1;
	opacity: 1;
	cursor: pointer;
	transition: width .2s ease, background-color .2s ease;
}
.rp-carousel .rp-dots .swiper-pagination-bullet-active {
	width: 22px;
	background: #0f69af;
}
.rp-carousel .rp-dots .swiper-pagination-bullet:focus-visible {
	outline: 2px solid #0f69af;
	outline-offset: 2px;
}

@media (max-width: 767px) {
	.rp-section {
		margin-top: 32px;
	}
	.rp-section .rp-title {
		font-size: 20px;
	}
	/* Touch: swipe; the peeking next card shows there is more. */
	.rp-carousel .rp-nav,
	.rp-carousel .rp-nav:hover {
		display: none;
	}
	.woocommerce .rp-carousel ul.products li.product {
		padding: 14px;
	}
}
@media (min-width: 768px) and (max-width: 1260px) {
	/* Keep the arrows inside the viewport when the container is close to its edges. */
	.rp-carousel .rp-prev { left: -12px; }
	.rp-carousel .rp-next { right: -12px; }
}

/* ---------------------------------------------------------------------------
 * "Pirkti kartu"
 * ------------------------------------------------------------------------- */

.bt-bundle {
	margin: 8px 0 0;
	padding: 20px 24px;
	border: 1px solid #E6EBF0;
	border-radius: 10px;
	background: #F7FAFC;
	color: #212121;
	font-family: 'Inter', sans-serif;
}
.bt-bundle[hidden] {
	display: none;
}

.bt-bundle .bt-bundle-title {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 600;
}

.bt-bundle .bt-bundle-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bt-bundle .bt-bundle-item + .bt-bundle-item {
	border-top: 1px solid #E6EBF0;
}

.bt-bundle .bt-bundle-item label {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 8px 0;
	font-size: 14px;
	line-height: 1.35;
	cursor: pointer;
}

.bt-bundle .bt-bundle-item input[type="checkbox"] {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: #0f69af;
	cursor: pointer;
}

.bt-bundle .bt-bundle-name {
	flex: 1 1 auto;
	min-width: 0;
}

.bt-bundle .bt-bundle-price {
	flex: none;
	font-weight: 600;
	white-space: nowrap;
}
.bt-bundle .bt-bundle-price bdi,
.bt-bundle .bt-bundle-sum bdi {
	font-size: inherit;
	line-height: inherit;
}

.bt-bundle .bt-bundle-item.is-off .bt-bundle-name,
.bt-bundle .bt-bundle-item.is-off .bt-bundle-price {
	color: #6b7280;
	text-decoration: line-through;
}

.bt-bundle .bt-bundle-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-top: 12px;
	padding-top: 14px;
	border-top: 1px solid #E6EBF0;
}

.bt-bundle .bt-bundle-total {
	margin: 0;
	font-size: 15px;
}
.bt-bundle .bt-bundle-sum {
	font-size: 18px;
	font-weight: 700;
}

.bt-bundle .bt-bundle-btn,
.bt-bundle .bt-bundle-btn:hover,
.bt-bundle .bt-bundle-btn:focus,
.bt-bundle .bt-bundle-btn:active {
	min-width: 180px;
	padding: 12px 22px !important;
	border: none !important;
	border-radius: 10px !important;
	background: #0f69af !important;
	color: #fff !important;
	font-family: 'Inter', sans-serif;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	text-decoration: none;
	cursor: pointer;
}
.bt-bundle .bt-bundle-btn:hover,
.bt-bundle .bt-bundle-btn:active {
	background: #0b5590 !important;
}
.bt-bundle .bt-bundle-btn:focus-visible {
	outline: 2px solid #0f69af;
	outline-offset: 2px;
}
.bt-bundle .bt-bundle-btn:disabled {
	opacity: .55;
	cursor: not-allowed !important;
}
.bt-bundle.is-busy .bt-bundle-btn {
	cursor: progress !important;
}

.bt-bundle .bt-bundle-msg {
	margin: 10px 0 0;
	font-size: 14px;
	color: #6b7280;
}
.bt-bundle .bt-bundle-msg:empty {
	display: none;
}

.bt-bundle a.bt-bundle-cart,
.bt-bundle a.bt-bundle-cart:visited,
.bt-bundle a.bt-bundle-cart:hover,
.bt-bundle a.bt-bundle-cart:focus,
.bt-bundle a.bt-bundle-cart:active {
	color: #0f69af;
	font-weight: 600;
	text-decoration: none;
}
.bt-bundle a.bt-bundle-cart:hover,
.bt-bundle a.bt-bundle-cart:focus {
	color: #0b5590;
}

@media (max-width: 575px) {
	.bt-bundle {
		padding: 16px;
	}
	.bt-bundle .bt-bundle-btn,
	.bt-bundle .bt-bundle-btn:hover,
	.bt-bundle .bt-bundle-btn:focus,
	.bt-bundle .bt-bundle-btn:active {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.woocommerce .rp-carousel ul.products li.product,
	.rp-carousel .rp-nav,
	.rp-carousel .rp-dots .swiper-pagination-bullet {
		transition: none;
	}
	.rp-carousel .swiper-wrapper {
		transition-duration: 0ms !important;
	}
}
