/**
 * Kunhar Medical
 * Header 01 — Single Category Dropdown
 *
 * Replaces the old multi-column products mega menu with one
 * configurable parent-category dropdown attached to any main
 * navigation item selected in Header Manager.
 */

.kunhar-d01-category-dropdown[hidden],
.kunhar-d01-mobile-category-dropdown[hidden] {
	display: none !important;
}

.kunhar-d01-category-trigger__chevron {
	width: 13px;
	height: 13px;
	flex: 0 0 13px;
	transition: transform .16s ease;
}

.kunhar-d01-category-dropdown__icon {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 7px;
	background: rgba(228, 60, 62, .08);
	color: var(--kunhar-primary, #e43c3e);
}

.kunhar-d01-category-dropdown__icon svg,
.kunhar-d01-category-dropdown__icon .kunhar-d01-category-icon-mask,
.kunhar-d01-category-dropdown__icon .kunhar-d01-category-dropdown__custom-icon,
.kunhar-d01-category-dropdown__icon .kunhar-d01-category-dropdown__fallback-icon {
	display: block;
	width: 20px;
	height: 20px;
	max-width: 20px;
	max-height: 20px;
	object-fit: contain;
}

.kunhar-d01-category-dropdown__icon svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.kunhar-d01-category-dropdown__icon svg circle {
	fill: currentColor;
	stroke: none;
}

.kunhar-d01-category-dropdown__icon .kunhar-d01-category-icon-mask {
	background-color: currentColor;
	-webkit-mask-image: var(--kunhar-category-icon-url);
	mask-image: var(--kunhar-category-icon-url);
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
}

/* ==========================================================
   DESKTOP
   ========================================================== */

@media (min-width: 901px) {
	.kunhar-d01-menu > li.kunhar-has-category-dropdown {
		position: relative;
	}

	.kunhar-d01-menu > li.kunhar-has-category-dropdown > a {
		display: inline-flex;
		align-items: center;
		gap: 6px;
	}

	.kunhar-d01-category-trigger {
		appearance: none;
		width: 28px;
		min-height: 42px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 28px;
		margin: 0;
		padding: 0;
		background: transparent !important;
		border: 0 !important;
		border-radius: 0;
		box-shadow: none;
		color: var(--kunhar-d01-menu-text, #536176) !important;
		font: inherit;
		cursor: pointer;
	}

	.kunhar-d01-category-trigger:hover,
	.kunhar-d01-category-trigger:focus-visible,
	.kunhar-d01-category-trigger[aria-expanded="true"] {
		color: var(--kunhar-d01-menu-hover-text, var(--kunhar-primary, #e43c3e)) !important;
	}

	.kunhar-d01-category-trigger:focus-visible {
		outline: 2px solid var(--kunhar-primary, #e43c3e);
		outline-offset: 2px;
	}

	.kunhar-d01-category-trigger[aria-expanded="true"]
	.kunhar-d01-category-trigger__chevron {
		transform: rotate(180deg);
	}

	.kunhar-d01-category-dropdown {
		position: absolute;
		top: calc(100% - 1px);
		left: 50%;
		z-index: 9999;
		width: min(330px, calc(100vw - 40px));
		padding: 8px;
		background: #fff;
		border: 1px solid #e3e9ef;
		border-top: 2px solid var(--kunhar-primary, #e43c3e);
		border-radius: 0 0 8px 8px;
		box-shadow: 0 16px 38px rgba(24, 34, 48, .13);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translate(-50%, 7px);
		transition: opacity .15s ease, visibility .15s ease, transform .15s ease;
	}

	.kunhar-d01-category-dropdown::before {
		content: "";
		position: absolute;
		top: -10px;
		left: 0;
		right: 0;
		height: 10px;
	}

	.kunhar-d01-menu > li.kunhar-has-category-dropdown.is-open
	> .kunhar-d01-category-dropdown {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translate(-50%, 0);
	}

	.kunhar-d01-category-dropdown ul {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.kunhar-d01-category-dropdown li {
		display: block;
		height: auto;
		margin: 0;
		padding: 0;
		border: 0;
	}

	.kunhar-d01-category-dropdown li + li {
		border-top: 1px solid #eef1f4;
	}

	.kunhar-d01-category-dropdown li > a {
		min-height: 52px;
		display: grid;
		grid-template-columns: 36px minmax(0, 1fr) 18px;
		align-items: center;
		gap: 11px;
		padding: 8px 9px;
		background: transparent !important;
		border: 0 !important;
		border-radius: 5px !important;
		color: #273248 !important;
		text-decoration: none;
		transition: background-color .15s ease, color .15s ease;
	}

	.kunhar-d01-category-dropdown li > a:hover,
	.kunhar-d01-category-dropdown li > a:focus-visible {
		background: #fafbfc !important;
		color: var(--kunhar-primary, #e43c3e) !important;
	}

	.kunhar-d01-category-dropdown__name {
	min-width: 0;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
	white-space: normal;
	text-align: left;
}

	.kunhar-d01-category-dropdown__arrow {
	font-size: 15px;
	line-height: 1;
	color: #98a2b3;
	transition: transform .15s ease, color .15s ease;
}

	.kunhar-d01-category-dropdown li > a:hover
	.kunhar-d01-category-dropdown__arrow {
		color: var(--kunhar-primary, #e43c3e);
		transform: translateX(2px);
	}
}

/* ==========================================================
   MOBILE / TABLET
   ========================================================== */

@media (max-width: 900px) {
	.kunhar-d01-mobile-nav--managed > li {
		border-bottom: 1px solid #e8edf1;
	}

	.kunhar-d01-mobile-category-item {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 44px;
		align-items: center;
	}

	.kunhar-d01-mobile-category-item > .kunhar-d01-mobile-category-link {
		min-width: 0;
	}

	.kunhar-d01-mobile-category-trigger {
		appearance: none;
		width: 44px;
		min-height: 48px;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 10px 0;
		background: transparent !important;
		border: 0 !important;
		border-radius: 0;
		box-shadow: none;
		color: #536176;
		font: inherit;
		font-size: 14px;
		font-weight: 500;
		line-height: 1.3;
		text-align: left;
		cursor: pointer;
	}

	.kunhar-d01-mobile-category-trigger:hover,
	.kunhar-d01-mobile-category-trigger:focus-visible,
	.kunhar-d01-mobile-category-item.current-menu-ancestor
	> .kunhar-d01-mobile-category-trigger {
		color: var(--kunhar-primary, #e43c3e);
	}

	.kunhar-d01-mobile-category-trigger:focus-visible {
		outline: 2px solid var(--kunhar-primary, #e43c3e);
		outline-offset: -2px;
	}

	.kunhar-d01-mobile-category-trigger svg {
		width: 16px;
		height: 16px;
		flex: 0 0 16px;
		transition: transform .16s ease;
	}

	.kunhar-d01-mobile-category-item.is-open
	> .kunhar-d01-mobile-category-trigger svg {
		transform: rotate(180deg);
	}

	.kunhar-d01-mobile-category-dropdown {
		grid-column: 1 / -1;
		display: none;
		padding: 0 0 10px 12px;
	}

	.kunhar-d01-mobile-category-item.is-open
	> .kunhar-d01-mobile-category-dropdown {
		display: grid;
	}

	.kunhar-d01-mobile-category-dropdown__all,
	.kunhar-d01-mobile-category-dropdown__item {
		min-height: 44px;
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 7px 0;
		border-bottom: 1px solid #edf1f4;
		color: #667085 !important;
		font-size: 12.5px;
		font-weight: 500;
		line-height: 1.35;
		text-decoration: none;
	}

	.kunhar-d01-mobile-category-dropdown__all {
		font-weight: 700;
		color: #344054 !important;
	}

	.kunhar-d01-mobile-category-dropdown__item:hover,
	.kunhar-d01-mobile-category-dropdown__item:focus-visible,
	.kunhar-d01-mobile-category-dropdown__all:hover,
	.kunhar-d01-mobile-category-dropdown__all:focus-visible {
		color: var(--kunhar-primary, #e43c3e) !important;
	}

	.kunhar-d01-mobile-category-dropdown__item
	.kunhar-d01-category-dropdown__icon {
		width: 32px;
		height: 32px;
		flex-basis: 32px;
	}

	.kunhar-d01-mobile-category-dropdown__item
	.kunhar-d01-category-dropdown__icon svg,
	.kunhar-d01-mobile-category-dropdown__item
	.kunhar-d01-category-dropdown__icon .kunhar-d01-category-icon-mask,
	.kunhar-d01-mobile-category-dropdown__item
	.kunhar-d01-category-dropdown__icon .kunhar-d01-category-dropdown__custom-icon {
		width: 18px;
		height: 18px;
		max-width: 18px;
		max-height: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kunhar-d01-category-trigger__chevron,
	.kunhar-d01-category-dropdown,
	.kunhar-d01-category-dropdown__arrow,
	.kunhar-d01-mobile-category-trigger svg {
		transition: none !important;
	}
}
