/**
 * Category carousel (Owl) — layout + FOUC prevention.
 */

/* Buldog category slider shell */
.subcats-wrapper {
	overflow-x: hidden;
	width: 100%;
	max-width: 100%;
}

.cat-slider {
	background: #fff;
	border: 1px solid #dcdcdc;
	padding: 1em;
	margin-bottom: 20px;
	border-radius: 10px;
	overflow: hidden;
	width: 100%;
	max-width: 100%;
	--buldog-cat-cols: 5;
	--buldog-cat-gap: 10px;
	--buldog-cat-title: 2.5rem;
}

/* Empty carousel placeholder — keeps one-row height on category archives. */
.cat-slider--empty {
	padding-block: 0;
}

.cat-slider--empty > .owl-carousel {
	margin: 0;
}

.subcats-wrapper .cat-slider > .owl-carousel {
	min-height: calc(
		(100% - (var(--buldog-cat-cols) - 1) * var(--buldog-cat-gap)) / var(--buldog-cat-cols)
		+ var(--buldog-cat-title)
	);
}

.cat-slider header {
	border: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
}

.slider-title {
	font-size: 1.571em;
	margin: 0;
	flex: 1;
}

.slider-title a {
	text-decoration: none;
	color: inherit;
}

.view-all-link {
	border-right: 1px solid #ccc;
	padding-right: 10px;
	margin-right: 10px;
	font-size: 14px;
	color: #dd3333;
}

.cat-slider > .owl-carousel > .owl-nav {
	display: none !important;
}

.buldog-cat-slider-nav {
	display: flex;
	gap: 5px;
}

.slider-prev,
.slider-next {
	font-size: 24px;
	color: #333;
	text-decoration: none;
	padding: 5px;
	line-height: 1;
}

.slider-prev:hover,
.slider-next:hover {
	color: #e24545;
}

.product-category {
	text-align: center;
	margin: 1px;
	overflow: visible;
	min-width: 0;
}

.product-category span {
	color: #333e48;
	display: block;
	padding: 8px 4px;
	font-size: 14px;
	line-height: 1.2;
	word-wrap: break-word;
}

.product-category:hover {
	box-shadow: 0 0 6px 0 rgba(1, 1, 1, 0.3);
}

/* Round gray circle behind category image (legacy Electro look). */
.subcats-wrapper .cat-slider .product-category > a {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-decoration: none;
	color: inherit;
	width: 100%;
	overflow: visible;
}

.subcats-wrapper .cat-slider .product-category > a::before {
	content: '';
	display: block;
	background-color: #f5f5f5;
	border-radius: 50%;
	position: absolute;
	z-index: 1;
	width: 55%;
    aspect-ratio: 1 / 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cat-image {
	position: relative;
	z-index: 2;
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: contain;
	padding: 12%;
	box-sizing: border-box;
}

/*
 * Pre-init layout (before Owl adds .owl-loaded).
 * Keeps category thumbnails in a horizontal row at the correct size
 * while CSS/JS load — avoids full-width stacked images.
 */
.subcats-wrapper .cat-slider > .owl-carousel:not(.owl-loaded) {
	display: flex !important;
	flex-wrap: nowrap;
	overflow: hidden;
	gap: 10px;
	width: 100%;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	z-index: 1;
}

.subcats-wrapper .cat-slider > .owl-carousel:not(.owl-loaded) > .product-category {
	flex: 0 0 calc(20% - 8px);
	max-width: calc(20% - 8px);
}

/* Owl Carousel — after init */
.owl-carousel {
	width: 100%;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	z-index: 1;
}

.owl-carousel.owl-loaded {
	display: block;
	overflow: hidden;
}

.owl-carousel .owl-stage-outer {
	position: relative;
	overflow: hidden;
}

.owl-carousel .owl-stage {
	display: flex;
	align-items: stretch;
}

.owl-carousel .owl-item {
	position: relative;
	min-height: 1px;
	float: left;
	-webkit-backface-visibility: hidden;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.owl-carousel .owl-item img:not(.cat-image) {
	display: block;
	width: 100%;
	height: auto;
}

.owl-carousel.owl-rtl .owl-item {
	float: right;
}

/* Fade in after Owl has calculated layout */
.subcats-wrapper .cat-slider > .owl-carousel.owl-loaded:not(.buldog-owl-ready) {
	opacity: 0;
}

.subcats-wrapper .cat-slider > .owl-carousel.buldog-owl-ready {
	opacity: 1;
	transition: opacity 0.15s ease-out;
}

@media (max-width: 1023px) {
	.cat-slider {
		--buldog-cat-cols: 4;
	}

	.subcats-wrapper .cat-slider > .owl-carousel:not(.owl-loaded) > .product-category {
		flex: 0 0 calc(25% - 8px);
		max-width: calc(25% - 8px);
	}
}

@media (max-width: 767px) {
	.cat-slider {
		--buldog-cat-cols: 3;
		--buldog-cat-gap: 8px;
	}

	.subcats-wrapper .cat-slider > .owl-carousel:not(.owl-loaded) > .product-category {
		flex: 0 0 calc(33.333% - 6px);
		max-width: calc(33.333% - 6px);
	}
}

@media (max-width: 568px) {
	.cat-slider {
		padding: 0.5em;
		margin-bottom: 15px;
		--buldog-cat-title: 2rem;
	}

	.cat-slider header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.slider-title {
		font-size: 1.2em;
		order: 1;
	}

	.slider-title a {
		display: block;
		padding: 0;
		margin: 0;
	}

	.view-all-link {
		display: block;
		margin: 5px 0 0 0;
		padding: 0;
		border: none;
	}

	.buldog-cat-slider-nav {
		order: 2;
		align-self: flex-end;
		margin-top: -30px;
	}

	.slider-prev,
	.slider-next {
		font-size: 20px;
		padding: 3px;
	}

	.product-category span {
		font-size: 12px;
		padding: 5px 2px;
	}
}

@media (max-width: 480px) {
	.cat-slider {
		--buldog-cat-cols: 2;
		--buldog-cat-gap: 5px;
	}

	.subcats-wrapper .cat-slider > .owl-carousel:not(.owl-loaded) > .product-category {
		flex: 0 0 calc(50% - 3px);
		max-width: calc(50% - 3px);
	}

	.subcats-wrapper,
	.cat-slider,
	.cat-slider .owl-carousel.owl-loaded,
	.owl-stage-outer {
		max-width: 100vw;
		overflow-x: hidden;
	}

	body {
		overflow-x: hidden;
	}
}
