.dbg-category-carousel {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
/*     padding: 2rem 0; */
    color: #1a1a1a;
}

.dbg-category-carousel__viewport {
    overflow: hidden;
    width: 100%;
    flex: 1 1 auto;
}

.dbg-category-carousel__track {
    display: flex;
    /* Spacing between circles/cards */
    gap: 16px;
    transition: transform 0.4s ease;
    will-change: transform;
}

.dbg-category-carousel__item {
    flex: 0 0 16.66%;
    display: flex;
}

.dbg-category-carousel__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    width: 100%;
    text-decoration: none;
    color: inherit;
    background: transparent;
    padding: 0;
}

.dbg-category-carousel__content {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.dbg-category-carousel__description {
    color: #555555 !important;
}

.dbg-category-carousel__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #d7d7d7;
    padding: 0.5rem;
    overflow: hidden;
}

.dbg-category-carousel__media img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    border: 0;
}

.dbg-category-carousel__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    border: 0;
}

.dbg-category-carousel__view {
    display: none !important;
}

.dbg-category-carousel__placeholder {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #777777;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

.dbg-category-carousel__media .dbg-category-carousel__placeholder {
    height: 100%;
}

.dbg-category-carousel__title {
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0 !important;
}

.dbg-category-carousel__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #f1f1f1;
    margin-bottom: 0.15rem;
}

.dbg-category-carousel__control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.dbg-category-carousel__control-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dbg-category-carousel__control-icon--prev {
    width: 40px;
    height: 40px;
}

.dbg-category-carousel__control-icon--prev svg {
    display: block;
    width: 100%;
    height: 100%;
}

.dbg-category-carousel__control-icon--next {
    width: 40px;
    height: 40px;
}

.dbg-category-carousel__control-icon--next svg {
    display: block;
    width: 100%;
    height: 100%;
}

.dbg-category-carousel__control:hover:not(:disabled) {
    transform: translateY(-3px);
}

.dbg-category-carousel__control:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.dbg-category-carousel__control--prev,
.dbg-category-carousel__control--next {
    align-self: center;
	padding: 0px !important;
}

@media (max-width: 991px) {
	.dbg-category-carousel__media { 
		width: 120px;
		height: 120px;
	}
	.dbg-category-carousel__item { 
		flex: 0 0 25%;
	}
}


@media (max-width: 767px) {
	/* Mobile: show controls (arrows) so users can navigate without swipe */
	button.dbg-category-carousel__control.dbg-category-carousel__control--next,
	button.dbg-category-carousel__control.dbg-category-carousel__control--prev {
		display: inline-flex;
		position: absolute;
		/* Align arrows with the media circles (not the full card height) */
		top: 60px;
		transform: translateY(-50%);
		width: 32px;
		height: 32px;
		border-radius: 999px;
		background: #E7F2FE !important;
		z-index: 5;
	}
	button.dbg-category-carousel__control.dbg-category-carousel__control--prev {
		left: 0;
		transform: translate(-50%, -50%);
	}
	button.dbg-category-carousel__control.dbg-category-carousel__control--next {
		right: 0;
		transform: translate(50%, -50%);
	}
	/* No side padding on mobile: exactly 3 items in view with no extra gutters */
	.dbg-category-carousel__viewport { padding-left: 0; padding-right: 0; }
	.dbg-category-carousel__control-icon--prev,
	.dbg-category-carousel__control-icon--next {
		width: 32px;
		height: 32px;
	}

	/* Touch devices can trigger :hover; keep arrows from jumping (desktop hover lifts the button) */
	.dbg-category-carousel__control:hover:not(:disabled),
	.dbg-category-carousel__control:active:not(:disabled) {
		transform: translateY(-50%);
	}
	/* Keep X positioning stable on mobile for each arrow */
	button.dbg-category-carousel__control.dbg-category-carousel__control--prev:hover:not(:disabled),
	button.dbg-category-carousel__control.dbg-category-carousel__control--prev:active:not(:disabled) {
		transform: translate(-50%, -50%);
	}
	button.dbg-category-carousel__control.dbg-category-carousel__control--next:hover:not(:disabled),
	button.dbg-category-carousel__control.dbg-category-carousel__control--next:active:not(:disabled) {
		transform: translate(50%, -50%);
	}
	.dbg-category-carousel__item { 
		flex: 0 0 33.33%;
	}
	.home-category-carousel h3 { 
		font-size : 16px !important;
	}
}

/* Hide empty category carousel containers and collapse their parent Elementor widgets */
.elementor-widget:has(.dbg-category-carousel__placeholder:empty),
.elementor-widget:not(:has(.dbg-category-carousel)),
.elementor-widget-container:empty,
.elementor-section:has(.elementor-widget-container:empty):not(:has(.dbg-category-carousel)) {
    /* Don't hide all - too aggressive */
}

/* When category carousel shortcode returns empty, collapse the Elementor widget */
.elementor-shortcode:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Collapse Elementor widget container when it only contains empty content */
.elementor-widget-shortcode .elementor-widget-container:empty,
.elementor-widget-shortcode .elementor-widget-container:not(:has(*)) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Collapse the entire Elementor widget when shortcode is empty */
.elementor-widget-shortcode:has(.elementor-widget-container:empty),
.elementor-widget-shortcode:has(.elementor-shortcode:empty) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Collapse Elementor section when it only contains empty widgets */
.elementor-section:has(.elementor-widget-shortcode):not(:has(.dbg-category-carousel)):not(:has(.dbg-product-grid)):not(:has(.dbg-brand-categories)):not(:has(.dbg-mega-menu)) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Specific fix for category carousel sections */
.elementor-element:has([class*="category-carousel"]):not(:has(.dbg-category-carousel__track)) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
