/* ---------------------------------------------------------
   Product category bar
--------------------------------------------------------- */

.p2p-category-bar {
	width: 100%;
	background: #000;
	color: #fff;
}

.p2p-category-bar-inner {
	display: grid;
    grid-template-columns: 1fr 5fr 1fr;
	align-items: center;
	width: min(100%, 1600px);
	margin-inline: auto;
	overflow: hidden;

    > :nth-child(3n + 1) {
        justify-self: end;
    }
    
    > :nth-child(3n + 2) {
        justify-self: center;
    }
    
     > :nth-child(3n) {
        justify-self: center;
    }

	>* {
		max-width: 100%;
		
	}
}

.p2p-category-bar-all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 5px 20px;
	margin-block: 5%;
	color: #fff;
	background: #000;
	text-decoration: none;
	white-space: nowrap;

	border-right: 1px solid white;
}

.p2p-category-bar-all:hover,
.p2p-category-bar-all:focus-visible {
	background: #222;
}

.p2p-category-bar-list {
	display: flex;
	align-items: center;
	gap: 0;
	min-width: 0;
	overflow-x: auto;
	overflow-y: hidden;

	--sb-background-color: black;
	--sb-track-color: #000000;
	--sb-thumb-color: #ffffff;
	--sb-size: 2px;

	/* Firefox */
	scrollbar-width: thin;
	scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
}

/* Chrome, Edge, Safari */
.p2p-category-bar-list::-webkit-scrollbar {
	width: var(--sb-size);
	height: 8px;
}

.p2p-category-bar-list::-webkit-scrollbar-track {
	background: var(--sb-track-color);
	border-radius: 10px;
	box-shadow: 0 0 0 3px var(--sb-background-color) inset;
	-webkit-box-shadow: 0 0 0 3px var(--sb-background-color) inset;
}

.p2p-category-bar-list::-webkit-scrollbar-thumb {
	background: var(--sb-thumb-color);
	border-radius: 4px;
	cursor: grab;

	box-shadow: 0 0 0 3px var(--sb-background-color) inset;
	-webkit-box-shadow: 0 0 0 3px var(--sb-background-color) inset;
}

.p2p-category-bar-list::-webkit-scrollbar-thumb:hover {
	box-shadow: 0 0 0 0 var(--sb-background-color) inset;
	-webkit-box-shadow: 0 0 0 0 var(--sb-background-color) inset;
}

.p2p-category-bar-category {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
	padding: 13px 18px;
	color: #fff;
	text-decoration: none;
	white-space: nowrap;

    img {
        display: block;
        height: 1.5rem;
        width: auto;
        object-fit: contain;
    }
}

.p2p-category-bar-category:hover,
.p2p-category-bar-category:focus-visible,
.p2p-category-bar-category.is-current {
	background: #6d6d6d;
}

.p2p-category-bar-category:focus-visible,
.p2p-category-bar-all:focus-visible,
.p2p-primary-menu a:focus-visible,
.p2p-header-action:focus-visible,
.p2p-footer-menu a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.category-bar-search {
	padding: 5px 20px;
	margin-block: 5%;
	border-left: 1px solid white;
	width: 100%;
}

/* icons */
.p2p-category-bar-category-icon.p2p-white-icon--masked,
.p2p-category-bar-category-icon.p2p-icon {
	width: 2rem;
	height: 2rem;
}

/* =========================================================
   P2P — Category bar labels
   ========================================================= */

.p2p-category-bar-category-label {
    display: block;
    text-align: center;
}

.p2p-category-bar-category-label.is-long {
    max-width: 130px;
    margin-inline: auto;
    font-size: 0.8rem;
    line-height: 1.15;
    white-space: normal;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* =========================================================
   P2P — Category bar responsive
   ========================================================= */

@media (max-width: 991.98px) {

	.p2p-category-bar-category {
		padding: 10px 14px;
	}

	.category-bar-search {
		padding: 5px 12px;
	}

}

/*
 * xs: icons only. Labels stay available to screen readers. A category
 * without an icon or thumbnail keeps its text so it isn't an empty tile.
 */
@media (max-width: 575.98px) {

	.p2p-category-bar-inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}

	.p2p-category-bar-all {
		padding: 5px 12px;
	}

	.p2p-category-bar-category {
		padding: 10px 12px;
	}

	.p2p-category-bar-all span,
	.p2p-category-bar-category:has(.p2p-category-bar-category-icon) .p2p-category-bar-category-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.category-bar-search {
		width: auto;
		padding: 5px 8px;
	}

}


/* =========================================================
   P2P — Drag to scroll (assets/js/category-bar-drag.js)
   Mouse only: touch devices keep native swipe scrolling.
   ========================================================= */

@media (hover: hover) and (pointer: fine) {

	.p2p-category-bar-list {
		cursor: grab;

		/* A drag must not start selecting the labels. */
		user-select: none;
	}

	.p2p-category-bar-list.is-dragging,
	.p2p-category-bar-list.is-dragging * {
		cursor: grabbing;
		user-select: none;
	}

}

/* Icons and thumbnails can't be dragged out of the bar as images. */
.p2p-category-bar-list img,
.p2p-category-bar-list svg {
	-webkit-user-drag: none;
	user-select: none;
}
