/* Badge Base Styles */
.cs-badge {
	position: absolute;
	top: 0;
	z-index: 9;
	margin: 0;
	padding: 8px 15px;
	background-color: #13a9e0;
	color: white;
	font-size: 0.7rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	text-shadow: 0 1px 1px rgba(0,0,0,0.2);
	border-radius: 0 0 4px 0;
	border-bottom: 2px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	pointer-events: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
	box-sizing: border-box;
	transform: translateZ(0);
	will-change: transform;
}

/* Position specific styles */
.cs-badge.top-left {
	left: 0;
	right: auto;
	border-radius: 0 0 4px 0;
}

.cs-badge.top-right {
	right: 0;
	left: auto;
	border-radius: 0 0 0 4px;
}

.cs-badge.top-center {
	left: 50%;
	transform: translateX(-50%);
	border-radius: 0 0 4px 4px;
}

/* Aucun effet de survol */

.cs-badge.top-left::before,
.cs-badge.top-right::before {
	display: none;
}

.cs-badge.top-right::before {
	right: 0;
	bottom: -6px;
	border-width: 6px 0 0 6px;
	border-style: solid;
	border-color: rgba(0,0,0,.2) transparent transparent transparent;
}

/* Ensure parent containers have proper positioning for badge placement */
#home_categories li,
.featured-categories li,
.at-featured-categories li,
.category-item {
	position: relative !important;
	overflow: hidden !important; /* Cache tout ce qui dépasse */
	height: auto;
	min-height: 100%;
	contain: layout style paint; /* Améliore les performances */
}

#home_categories li a,
.featured-categories li a,
.at-featured-categories li a,
.category-item a {
	position: relative !important;
	display: block;
	height: 100%;
}

/* Ensure image containers are relative */
#home_categories li img,
.featured-categories li img,
.at-featured-categories li img,
.category-item img,
.category-cover,
.category-image {
	position: relative;
}

/* Wrapper créé par JS si nécessaire */
.csb-image-wrapper {
	position: relative !important;
	display: inline-block;
	width: 100%;
}

.csb-image-wrapper img {
	width: 100%;
	height: auto;
	display: block;
}

/* Disable Click Style */
/* Style pour les éléments désactivés */
.csb-disabled {
	pointer-events: none !important;
	cursor: default !important;
	position: relative;
}

/* Style pour le lien de la catégorie désactivée */
.csb-disabled a[href*="id_category="] {
	position: relative;
}

/* Overlay semi-transparent pour indiquer que c'est désactivé */
.csb-disabled a[href*="id_category="]::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
	pointer-events: none;
	z-index: 2;
	border-radius: 4px;
}

/* Style pour le badge de la catégorie désactivée */
.csb-disabled .cs-badge {
	z-index: 3; /* S'assure que le badge est au-dessus de l'overlay */
}

/* Remove Browser Tap Highlights */
#home_categories a,
.featured-categories a,
.at-featured-categories a {
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

#home_categories a:focus,
#home_categories a:active,
.featured-categories a:focus,
.featured-categories a:active,
.at-featured-categories a:focus,
.at-featured-categories a:active {
	outline: none !important;
	box-shadow: none !important;
}

/* Responsive Adjustments */

/* Small Phones (≤ 430px) */
@media (max-width: 430px) {
    .cs-badge {
        font-size: 0.55rem;
        padding: 5px 8px;
    }
    
    .cs-badge.top-left,
    .cs-badge.top-right {
        max-width: 90%;
    }
}

/* Very Small Phones (≤ 360px) */
@media (max-width: 360px) {
    .cs-badge {
        font-size: 0.5rem;
        padding: 4px 8px;
        max-width: 100%;
    }
    
    .cs-badge.top-left,
    .cs-badge.top-right {
        max-width: 95%;
    }
    
    .cs-badge.top-left {
        left: 0 !important;
        right: auto !important;
    }
    
    .cs-badge.top-right {
        right: 0 !important;
        left: auto !important;
    }
    
    .cs-badge.top-center {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
	
	.cs-badge.top-center {
		top: 6px !important;
		left: 50% !important;
		transform: translateX(-50%) !important;
	}
}

/* Grands écrans (≥ 1400px) - Optimisation */
@media (min-width: 1400px) {
	.cs-badge {
		font-size: 13px;
		padding: 7px 14px;
	}
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.cs-badge.anim-pulse,
	.cs-badge.anim-shake,
	.cs-badge.anim-glow {
		animation: none !important;
	}
}

/* Print Styles */
@media print {
	.cs-badge {
		display: none;
	}
}