/* Subcategory carousel (inc/product-categories.php). Card look matches the old grid tiles. */

.subcats-carousel {
	position: relative;
	margin: 0 0 32px;
}

.subcats-carousel .subcat-swiper {
	overflow: hidden;
	position: relative;
	padding: 2px 1px; /* keep hover borders visible */
}

.subcats-carousel ul.products.swiper-wrapper {
	display: flex;
	flex-wrap: nowrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Before Swiper starts: a horizontally scrollable row, never the old tall grid. */
.subcats-carousel:not(.is-ready) ul.products.swiper-wrapper {
	gap: 12px;
	overflow-x: auto;
	scrollbar-width: none;
}

.subcats-carousel:not(.is-ready) li.product-category {
	flex: 0 0 calc((100% - 24px) / 2.3);
	margin-right: 0 !important;
}

.subcats-carousel ul.products li.product-category {
	float: none;
	clear: none;
	width: auto;
	height: auto; /* equal heights come from align-items: stretch */
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	margin-left: 0 !important; /* margin-right = Swiper spaceBetween (inline style) */
	padding: 0 !important;
	border: 1px solid #F1F1F1;
	border-radius: 10px;
	background: #fff;
	flex-shrink: 0;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.subcats-carousel ul.products li.product-category:hover {
	border-color: #0f69af;
	box-shadow: 0 4px 14px rgba(15, 105, 175, .08);
}

.subcats-carousel li.product-category a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	width: 100%;
	height: 100%;
	padding: 16px 12px;
	text-decoration: none;
	box-sizing: border-box;
}

.subcats-carousel li.product-category a img {
	width: 100%;
	height: 80px !important;
	object-fit: contain;
	margin: 0 !important;
	border-radius: 10px;
}

.subcats-carousel li.product-category h2 {
	font-family: 'Inter', sans-serif !important;
	font-weight: 400 !important;
	font-size: 14px !important;
	line-height: 17px !important;
	color: #000 !important;
	text-align: center !important;
	margin: 0 !important;
	padding: 0 !important;
}

.subcats-carousel li.product-category mark {
	display: none;
}

/* Arrows */
.subcats-carousel .subcat-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-top: -18px;
	padding: 0;
	border: 1px solid #e3e8ee !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;
}

.subcats-carousel .subcat-nav svg {
	flex: none;
	width: 20px !important;
	height: 20px !important;
	max-width: none !important;
}

.subcats-carousel .subcat-nav:hover {
	background: #0f69af !important;
	color: #fff !important;
}

.subcats-carousel .subcat-nav:focus-visible {
	outline: 2px solid #0f69af;
	outline-offset: 2px;
}

.subcats-carousel .subcat-prev { left: -18px; }
.subcats-carousel .subcat-next { right: -18px; }

.subcats-carousel .subcat-nav.swiper-button-disabled {
	opacity: 0;
	pointer-events: none;
}

/* All tiles fit: no arrows (Swiper watchOverflow). */
.subcats-carousel .subcat-nav.swiper-button-lock,
.subcats-carousel:not(.is-ready) .subcat-nav {
	display: none;
}

@media (max-width: 767px) {
	/* Touch: swipe, the half-visible last tile shows there is more. */
	.subcats-carousel .subcat-nav {
		display: none;
	}
	.subcats-carousel {
		margin-bottom: 24px;
	}
	.subcats-carousel li.product-category a {
		padding: 12px 8px;
	}
	.subcats-carousel li.product-category a img {
		height: 64px !important;
	}
	.subcats-carousel li.product-category h2 {
		font-size: 13px !important;
		line-height: 16px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.subcats-carousel .swiper-wrapper {
		transition-duration: 0ms !important;
	}
}
