/**
 * Header search — WooCommerce product_cat mega menu (desktop RTL).
 */

.category-mega-menu {
	position: static;
	width: 100%;
}

.category-mega-menu__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
	width: 100%;
	height: 100%;
	min-height: 2.75rem;
	margin: 0;
	padding-inline: 0.75rem;
	border: 0;
	background: transparent;
	color: var(--color-text);
	font: inherit;
	text-align: start;
	cursor: pointer;
}

.category-mega-menu__trigger-label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.category-mega-menu__trigger::after {
	content: "";
	display: inline-block;
	flex-shrink: 0;
	width: 0.4em;
	height: 0.4em;
	border-inline-end: 1.5px solid currentColor;
	border-block-end: 1.5px solid currentColor;
	transform: rotate(45deg);
	translate: 0 -0.12em;
	opacity: 0.7;
}

.category-mega-menu.is-open .category-mega-menu__trigger::after {
	transform: rotate(-135deg);
	translate: 0 0.12em;
}

.pish-header__mid {
	position: relative;
}

.category-mega-menu__panel {
	position: absolute;
	inset-block-start: 100%;
	left: 50%;
	right: auto;
	z-index: 420;
	box-sizing: border-box;
	width: min(var(--container-max), calc(100% - 80px));
	max-width: calc(100vw - 2rem);
	margin: 0;
	padding: var(--spacing-lg) 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: #fff;
	box-shadow: 0 12px 32px rgb(0 0 0 / 0.1);
	direction: rtl;
	text-align: start;
	transform: translateX(-50%);
}

.category-mega-menu__panel[hidden] {
	display: none;
}

.category-mega-menu__panel:not([hidden]) {
	display: block;
}

.category-mega-menu__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	align-items: start;
	column-gap: 8px;
	row-gap: var(--spacing-md);
	width: 100%;
}

.category-mega-menu__column {
	min-width: 0;
	padding-inline: 8px;
}

.category-mega-menu__panel::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-end: 100%;
	height: 1.25rem;
}

.category-mega-menu__heading {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	padding-block: 0.25rem;
	color: var(--color-text);
	font-weight: 500;
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
}

.category-mega-menu__icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	color: inherit;
}

.category-mega-menu__icon svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.category-mega-menu__heading-text {
	min-width: 0;
}

.category-mega-menu__heading:hover,
.category-mega-menu__heading:focus-visible {
	color: var(--color-primary);
}

.pish-header__search:has(.category-mega-menu) {
	overflow: visible;
}

.pish-header__mid:has(.category-mega-menu.is-open) {
	z-index: 420;
}

@media (max-width: 991px) {
	.category-mega-menu__panel {
		display: none;
	}
}
