/**
 * Shop Toolbar Component
 *
 * Renders the premium shop toolbar with category navigation,
 * result count, and filter/sort controls.
 *
 * @package Temiz_Wear
 * @subpackage Assets/CSS/Components
 * @since 1.0.0
 */

/* ========================================
   Toolbar Container
   ======================================== */

.tw-shop-toolbar {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	background-color: transparent;
	margin-bottom: 20px;
}

/* ========================================
   Top Section: Category Navigation
   ======================================== */

.tw-shop-toolbar__nav {
	width: 100%;
	border-bottom: 1px solid var(--tw-color-border);
	padding-bottom: 8px;
}

/* ========================================
   Bottom Section: Results & Actions
   ======================================== */

.tw-shop-toolbar__footer {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

/* ========================================
   Result Count
   ======================================== */

.tw-shop-toolbar__count {
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--tw-color-text);
	white-space: nowrap;
	flex-shrink: 0;
	font-weight: 400;
	letter-spacing: 0.01em;
}

.tw-shop-toolbar__count .woocommerce-result-count {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--tw-color-text);
	font-weight: 400;
}

/* ========================================
   Actions Container
   ======================================== */

.tw-shop-toolbar__actions {
	display: flex;
	flex-direction: row;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

/* ========================================
   Filter & Sort Buttons
   ======================================== */

.tw-shop-toolbar__filter-btn,
.tw-shop-toolbar__sort-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 36px;
	padding: 0 12px;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.01em;
	color: var(--tw-color-text);
	background-color: transparent;
	border: 1px solid var(--tw-color-border);
	border-radius: 3px;
	cursor: pointer;
	transition:
		color 160ms ease,
		background-color 160ms ease,
		border-color 160ms ease;
	white-space: nowrap;
}

.tw-shop-toolbar__filter-btn:hover,
.tw-shop-toolbar__sort-btn:hover {
	color: var(--tw-color-primary);
	border-color: var(--tw-color-primary);
	background-color: transparent;
}

.tw-shop-toolbar__filter-btn:focus-visible,
.tw-shop-toolbar__sort-btn:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: 2px;
	border-color: var(--tw-color-accent);
}

.tw-shop-toolbar__filter-btn:active,
.tw-shop-toolbar__sort-btn:active {
	transform: translateY(0.5px);
}

/* ========================================
   Button Icons
   ======================================== */

.tw-shop-toolbar__filter-icon,
.tw-shop-toolbar__sort-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: currentColor;
}

.tw-shop-toolbar__filter-icon svg,
.tw-shop-toolbar__sort-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* ========================================
   Shop Category Navigation
   ======================================== */

.tw-shop-nav {
	width: 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

/* ========================================
   Parent Category List
   ======================================== */

.tw-shop-nav__parents {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	list-style: none;
	margin: 0;
	padding: 4px 0;
	gap: 20px;
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.tw-shop-nav__parents::-webkit-scrollbar {
	display: none;
}

/* ========================================
   Parent List Items
   ======================================== */

.tw-shop-nav__parent {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
}

/* ========================================
   Parent Category Links
   ======================================== */

.tw-shop-nav__parent-link {
	display: inline-block;
	position: relative;
	color: var(--tw-color-text);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.01em;
	text-decoration: none;
	padding: 4px 0;
	transition:
		color 160ms ease;
	white-space: nowrap;
}

.tw-shop-nav__parent-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 0.125rem;
	background-color: var(--tw-color-accent);
	transition: width 160ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tw-shop-nav__parent-link:hover {
	color: var(--tw-color-primary);
}

.tw-shop-nav__parent-link:hover::after {
	width: 100%;
}

.tw-shop-nav__parent-link:focus {
	outline: none;
}

.tw-shop-nav__parent-link:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: 4px;
	border-radius: 2px;
}

.tw-shop-nav__parent-link.is-active {
	color: var(--tw-color-primary);
	font-weight: 600;
}

.tw-shop-nav__parent-link.is-active::after {
	width: 100%;
}

/* ========================================
   Child Collection List
   ======================================== */

.tw-shop-nav__chips {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 6px;
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.tw-shop-nav__chips::-webkit-scrollbar {
	display: none;
}

/* ========================================
   Child Chip Items
   ======================================== */

.tw-shop-nav__chip {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
}

/* ========================================
   Child Chip Links
   ======================================== */

.tw-shop-nav__chip-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 30px;
	padding: 0 10px;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0.01em;
	color: var(--tw-color-text);
	background-color: transparent;
	border: 1px solid var(--tw-color-border);
	border-radius: 999px;
	text-decoration: none;
	cursor: pointer;
	transition:
		color 160ms ease,
		background-color 160ms ease,
		border-color 160ms ease;
	white-space: nowrap;
}

.tw-shop-nav__chip-link:hover {
	color: var(--tw-color-primary);
	border-color: var(--tw-color-primary);
	background-color: transparent;
}

.tw-shop-nav__chip-link:focus {
	outline: none;
}

.tw-shop-nav__chip-link:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: 2px;
}

.tw-shop-nav__chip-link.is-active {
	color: var(--tw-color-white);
	background-color: var(--tw-color-primary);
	border-color: var(--tw-color-primary);
	font-weight: 600;
}

.tw-shop-nav__chip-link.is-active:hover {
	color: var(--tw-color-white);
	background-color: var(--tw-color-primary);
	border-color: var(--tw-color-primary);
}

/* ========================================
   Mobile: Responsive Layout
   ======================================== */

@media (max-width: 767px) {
	.tw-shop-toolbar {
		gap: 10px;
		margin-bottom: 16px;
	}

	.tw-shop-toolbar__nav {
		padding-bottom: 6px;
		margin-bottom: 2px;
	}

	.tw-shop-toolbar__footer {
		gap: 10px;
		align-items: center;
	}

	.tw-shop-toolbar__count {
		font-size: 0.75rem;
		flex-grow: 0;
	}

	.tw-shop-toolbar__actions {
		gap: 6px;
	}

	.tw-shop-toolbar__filter-btn,
	.tw-shop-toolbar__sort-btn {
		height: 36px;
		padding: 0 10px;
		font-size: 0.75rem;
		border-radius: 3px;
	}

	.tw-shop-toolbar__sort-btn {
		display: none;
	}

	.tw-shop-toolbar__filter-icon,
	.tw-shop-toolbar__sort-icon {
		width: 16px;
		height: 16px;
	}

	.tw-shop-nav {
		gap: 6px;
	}

	.tw-shop-nav__parents {
		gap: 16px;
		padding: 2px 0;
	}

	.tw-shop-nav__parent-link {
		font-size: 0.8125rem;
		padding: 3px 0;
	}

	.tw-shop-nav__chips {
		gap: 4px;
		padding: 2px 0;
	}

	.tw-shop-nav__chip-link {
		height: 28px;
		padding: 0 8px;
		font-size: 0.6875rem;
	}
}

/* ========================================
   Tablet & Desktop: Optimized Layout
   ======================================== */

@media (min-width: 768px) {
	.tw-shop-toolbar {
		gap: 18px;
		margin-bottom: 24px;
	}

	.tw-shop-toolbar__nav {
		padding-bottom: 12px;
	}

	.tw-shop-toolbar__footer {
		gap: 16px;
	}

	.tw-shop-toolbar__count {
		font-size: 0.8125rem;
	}

	.tw-shop-toolbar__filter-btn,
	.tw-shop-toolbar__sort-btn {
		height: 40px;
		padding: 0 14px;
		font-size: 0.875rem;
		border-radius: 3px;
	}

	.tw-shop-toolbar__sort-btn {
		display: inline-flex;
	}

	.tw-shop-toolbar__filter-icon,
	.tw-shop-toolbar__sort-icon {
		width: 20px;
		height: 20px;
	}

	.tw-shop-nav {
		gap: 12px;
	}

	.tw-shop-nav__parents {
		gap: 28px;
		padding: 4px 0;
		overflow-x: visible;
	}

	.tw-shop-nav__parent-link {
		font-size: 0.9375rem;
		padding: 4px 0;
	}

	.tw-shop-nav__chips {
		gap: 8px;
		padding: 2px 0;
		overflow-x: visible;
	}

	.tw-shop-nav__chip-link {
		height: 32px;
		padding: 0 12px;
		font-size: 0.75rem;
	}
}

/* ========================================
   Large Desktop: Hide Filter Button
   ======================================== */

@media (min-width: 1024px) {
	.tw-shop-toolbar {
		gap: 20px;
		margin-bottom: 28px;
	}

	.tw-shop-toolbar__nav {
		padding-bottom: 14px;
	}

	.tw-shop-toolbar__filter-btn {
		display: none;
	}

	.tw-shop-toolbar__footer {
		gap: 20px;
	}

	.tw-shop-toolbar__count {
		font-size: 0.8125rem;
	}

	.tw-shop-toolbar__sort-btn {
		height: 40px;
		padding: 0 14px;
		font-size: 0.875rem;
	}

	.tw-shop-nav {
		gap: 14px;
	}

	.tw-shop-nav__parents {
		gap: 32px;
	}

	.tw-shop-nav__parent-link {
		font-size: 1rem;
	}

	.tw-shop-nav__chips {
		gap: 10px;
	}

	.tw-shop-nav__chip-link {
		height: 34px;
		padding: 0 14px;
		font-size: 0.8125rem;
	}
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
	.tw-shop-toolbar__filter-btn,
	.tw-shop-toolbar__sort-btn,
	.tw-shop-nav__parent-link,
	.tw-shop-nav__parent-link::after,
	.tw-shop-nav__chip-link {
		transition: none;
	}

	.tw-shop-toolbar__filter-btn:active,
	.tw-shop-toolbar__sort-btn:active {
		transform: none;
	}
}