/*!
 * WPMobileTabBar – desktop shop bar & mega menu.
 * Loaded conditionally (media query) only when the desktop bar is enabled,
 * so phones never download a single byte of it.
 */

/* ==========================================================================
   15. Desktop shop bar + mega menu
   ========================================================================== */

.wmtb-dbar {
	position: relative;
	z-index: calc(var(--wmtb-z, 9999) - 2);
	font-family: var(--wmtb-font, inherit);
	color: var(--wmtb-fg);
}

.wmtb-dbar.is-sticky {
	position: fixed;
	inset-inline: 0;
	top: 0;
}

.wmtb-dbar__inner {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: var(--wmtb-container, 1280px);
	margin-inline: auto;
	padding: 0 20px;
	height: 58px;
	background: var(--wmtb-surface);
	-webkit-backdrop-filter: blur(var(--wmtb-blur)) saturate(180%);
	backdrop-filter: blur(var(--wmtb-blur)) saturate(180%);
	border-bottom: 1px solid var(--wmtb-border);
	box-shadow: 0 4px 18px rgba(12, 16, 32, .06);
	position: relative;
}

.wmtb-dbar.is-sticky .wmtb-dbar__inner {
	position: relative;
}

.wmtb-dbar__brand {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	text-decoration: none !important;
	color: var(--wmtb-fg);
}

.wmtb-dbar__logo {
	max-height: 34px;
	max-width: 150px;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
}

.wmtb-dbar__title {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -.3px;
	white-space: nowrap;
}

/* categories button */
.wmtb-dbar__cats {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	flex: 0 0 auto;
	height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--wmtb-accent), var(--wmtb-accent-2, var(--wmtb-accent)));
	color: #fff;
	font: inherit;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(var(--wmtb-accent-rgb), .3);
	transition: filter .2s ease, transform .16s ease;
}

.wmtb-dbar__cats:hover { filter: brightness(1.06); }
.wmtb-dbar__cats:active { transform: scale(.98); }
.wmtb-dbar__cats .wmtb-ico { width: 17px; height: 17px; }
.wmtb-dbar__cats .wmtb-ico:last-child { width: 14px; height: 14px; transition: transform .25s var(--wmtb-ease); }
.wmtb-dbar__cats[aria-expanded="true"] .wmtb-ico:last-child { transform: rotate(180deg); }

/* inline menu */
.wmtb-dbar__menu { flex: 0 1 auto; min-width: 0; }

.wmtb-dbar__menu ul {
	display: flex;
	align-items: center;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wmtb-dbar__item { position: relative; }

.wmtb-dbar__item > a {
	display: flex;
	align-items: center;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	color: var(--wmtb-fg);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background .18s ease, color .18s ease;
}

.wmtb-dbar__item > a:hover { background: var(--wmtb-active-bg); color: var(--wmtb-accent); }

.wmtb-dbar__item.has-drop > a::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-inline-start: 7px;
	border-inline-end: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	opacity: .65;
}

/* search */
.wmtb-dsearch {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 160px;
	max-width: 520px;
	height: 40px;
	padding: 0 6px 0 14px;
	border: 1px solid var(--wmtb-border);
	border-radius: 12px;
	background: var(--wmtb-field);
	transition: border-color .2s ease, box-shadow .2s ease;
}

[dir="rtl"] .wmtb-dsearch { padding: 0 14px 0 6px; }

.wmtb-dsearch:focus-within {
	border-color: var(--wmtb-accent);
	box-shadow: 0 0 0 3px rgba(var(--wmtb-accent-rgb), .14);
}

.wmtb-dsearch > .wmtb-ico { width: 17px; height: 17px; color: var(--wmtb-fg-muted); flex: 0 0 auto; }

.wmtb-dsearch input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	border: 0 !important;
	background: transparent !important;
	color: var(--wmtb-fg) !important;
	font: inherit !important;
	font-size: 13.5px !important;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	padding: 0 !important;
	box-shadow: none !important;
}

.wmtb-dsearch input::-webkit-search-cancel-button { -webkit-appearance: none; }

.wmtb-dsearch__go {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	flex: 0 0 auto;
	border: 0;
	border-radius: 9px;
	background: var(--wmtb-active-bg);
	color: var(--wmtb-accent);
	cursor: pointer;
	transition: transform .16s ease;
}

.wmtb-dsearch__go:active { transform: scale(.92); }
.wmtb-dsearch__go .wmtb-ico { width: 15px; height: 15px; }
[dir="rtl"] .wmtb-dsearch__go .wmtb-ico { transform: scaleX(-1); }

.wmtb-dsearch__panel {
	position: absolute;
	top: calc(100% + 8px);
	inset-inline: 0;
	z-index: 60;
	max-height: 420px;
	overflow-y: auto;
	padding: 8px;
	border: 1px solid var(--wmtb-border);
	border-radius: 16px;
	background: var(--wmtb-sheet, var(--wmtb-surface-solid));
	box-shadow: 0 22px 54px rgba(10, 12, 24, .22);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .22s ease, transform .26s var(--wmtb-ease), visibility .22s;
}

.wmtb-dsearch__panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.wmtb-dsearch__panel .wmtb-results { gap: 2px; }
.wmtb-dsearch__panel .wmtb-result { padding: 8px; }
.wmtb-dsearch__panel .wmtb-result img { width: 44px; height: 44px; }

.wmtb-dsearch__state {
	padding: 22px 12px;
	text-align: center;
	color: var(--wmtb-fg-muted);
	font-size: 13px;
}

.wmtb-dsearch__state .wmtb-spinner { margin: 0 auto 8px; }

/* spacer + right cluster */
.wmtb-dbar__spacer { flex: 1 1 auto; }

.wmtb-dbar .wmtb-theme-switch { background: var(--wmtb-field); }

/* account */
.wmtb-dbar__userwrap { position: relative; }

.wmtb-dbar__user,
.wmtb-dbar__login {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--wmtb-border);
	border-radius: 12px;
	background: var(--wmtb-surface-solid);
	color: var(--wmtb-fg);
	font: inherit;
	font-size: 13px;
	font-weight: 650;
	cursor: pointer;
	text-decoration: none !important;
	transition: border-color .2s ease, background .2s ease;
	white-space: nowrap;
}

.wmtb-dbar__user:hover,
.wmtb-dbar__login:hover { border-color: var(--wmtb-accent); color: var(--wmtb-accent); }

.wmtb-dbar__user .wmtb-ico,
.wmtb-dbar__login .wmtb-ico { width: 17px; height: 17px; }

.wmtb-dbar__user .wmtb-ico:last-child { width: 13px; height: 13px; opacity: .7; }

.wmtb-dbar__avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--wmtb-field) center/cover no-repeat;
	box-shadow: 0 0 0 1.5px var(--wmtb-border);
}

.wmtb-dbar__username { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* shared dropdown (menu children + user) */
.wmtb-dbar__drop {
	position: absolute;
	top: calc(100% + 10px);
	inset-inline-end: 0;
	z-index: 70;
	min-width: 220px;
	padding: 8px;
	border: 1px solid var(--wmtb-border);
	border-radius: 16px;
	background: var(--wmtb-sheet, var(--wmtb-surface-solid));
	box-shadow: 0 22px 54px rgba(10, 12, 24, .2);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .2s ease, transform .24s var(--wmtb-ease), visibility .2s;
}

.wmtb-dbar__item .wmtb-dbar__drop { inset-inline-end: auto; inset-inline-start: 0; min-width: 200px; }

.wmtb-dbar__item:hover > .wmtb-dbar__drop,
.wmtb-dbar__item:focus-within > .wmtb-dbar__drop,
.wmtb-dbar__drop.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.wmtb-dbar__drop ul { list-style: none; margin: 0; padding: 0; }

.wmtb-dbar__drop li + li { margin-top: 2px; }

.wmtb-dbar__drop a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 11px;
	border-radius: 10px;
	color: var(--wmtb-fg);
	font-size: 13px;
	font-weight: 550;
	text-decoration: none !important;
	transition: background .16s ease, color .16s ease;
	white-space: nowrap;
}

.wmtb-dbar__drop a:hover { background: var(--wmtb-active-bg); color: var(--wmtb-accent); }
.wmtb-dbar__drop a .wmtb-ico { width: 15px; height: 15px; color: var(--wmtb-accent); }
.wmtb-dbar__drop a.wmtb-danger { color: #ff4d5e; }
.wmtb-dbar__drop a.wmtb-danger .wmtb-ico { color: #ff4d5e; }

.wmtb-dbar__drophead {
	padding: 8px 11px 10px;
	margin-bottom: 6px;
	border-bottom: 1px solid var(--wmtb-border);
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wmtb-dbar__drophead strong { font-size: 13.5px; color: var(--wmtb-fg); }
.wmtb-dbar__drophead small { font-size: 11.5px; color: var(--wmtb-fg-muted); }
.wmtb-dbar__dropsep { height: 1px; margin: 6px 4px; background: var(--wmtb-border); }

.wmtb-user-drop-open { /* hook */ }

/* cart */
.wmtb-dbar__cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 40px;
	flex: 0 0 auto;
	border: 1px solid var(--wmtb-border);
	border-radius: 12px;
	background: var(--wmtb-surface-solid);
	color: var(--wmtb-fg);
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease;
}

.wmtb-dbar__cart:hover { border-color: var(--wmtb-accent); color: var(--wmtb-accent); }
.wmtb-dbar__cart .wmtb-tab__icon { width: auto; height: auto; }
.wmtb-dbar__cart .wmtb-ico { width: 19px; height: 19px; }

/* ---------------------------------------------------------------- mega menu */

.wmtb-mega {
	position: absolute;
	inset-inline: 0;
	top: 100%;
	z-index: 65;
	background: var(--wmtb-sheet, var(--wmtb-surface-solid));
	border-bottom: 1px solid var(--wmtb-border);
	box-shadow: 0 30px 60px rgba(10, 12, 24, .18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .24s ease, transform .3s var(--wmtb-ease), visibility .24s;
}

.wmtb-mega.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.wmtb-mega__inner {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	max-width: var(--wmtb-container, 1280px);
	margin-inline: auto;
	padding: 14px 20px;
	gap: 8px;
	min-height: 300px;
	max-height: min(62vh, 560px);
}

.wmtb-mega__roots {
	list-style: none;
	margin: 0;
	padding: 0 0 8px;
	border-inline-end: 1px solid var(--wmtb-border);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.wmtb-mega__root > a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 11px;
	color: var(--wmtb-fg);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background .16s ease, color .16s ease;
}

.wmtb-mega__root > a > span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wmtb-mega__root > a em {
	font-style: normal;
	font-size: 11px;
	font-weight: 700;
	color: var(--wmtb-fg-muted);
	background: var(--wmtb-field);
	padding: 2px 7px;
	border-radius: 999px;
}

.wmtb-mega__root > a .wmtb-ico { width: 14px; height: 14px; color: var(--wmtb-fg-muted); }

[dir="rtl"] .wmtb-mega__root > a .wmtb-ico { transform: scaleX(-1); }

.wmtb-mega__root:hover > a,
.wmtb-mega__root.is-active > a {
	background: var(--wmtb-active-bg);
	color: var(--wmtb-accent);
}

.wmtb-mega__panes { position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 8px 16px; }
[dir="rtl"] .wmtb-mega__panes { padding: 4px 16px 8px 8px; }

.wmtb-mega__pane { display: none; }
.wmtb-mega__pane.is-active { display: block; animation: wmtb-fade-in .22s ease both; }

.wmtb-mega__grid {
	display: grid;
	grid-template-columns: repeat(var(--wmtb-mega-cols, 3), minmax(0, 1fr));
	gap: 18px 22px;
}

.wmtb-mega__head {
	display: block;
	padding-bottom: 7px;
	margin-bottom: 7px;
	border-bottom: 1px solid var(--wmtb-border);
	color: var(--wmtb-fg) !important;
	font-size: 13.5px;
	font-weight: 750;
	text-decoration: none !important;
}

.wmtb-mega__head em,
.wmtb-mega__col ul a em {
	font-style: normal;
	font-size: 11px;
	color: var(--wmtb-fg-muted);
	font-weight: 600;
}

.wmtb-mega__col ul { list-style: none; margin: 0; padding: 0; }
.wmtb-mega__col ul li + li { margin-top: 2px; }

.wmtb-mega__col ul a {
	display: block;
	padding: 5px 8px;
	margin-inline-start: -8px;
	border-radius: 8px;
	color: var(--wmtb-fg-muted);
	font-size: 12.5px;
	text-decoration: none !important;
	transition: color .16s ease, background .16s ease;
}

.wmtb-mega__col ul a:hover { color: var(--wmtb-accent); background: var(--wmtb-active-bg); }

.wmtb-mega__single { padding: 26px 8px; }
.wmtb-mega__single .wmtb-btn-primary { display: inline-flex; min-height: 42px; padding: 0 22px; border-radius: 12px; }

.wmtb-mega__foot {
	border-top: 1px solid var(--wmtb-border);
	background: color-mix(in srgb, var(--wmtb-sheet, #fff) 92%, transparent);
}

.wmtb-mega__foot a {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	max-width: var(--wmtb-container, 1280px);
	margin-inline: auto;
	padding: 11px 20px;
	color: var(--wmtb-accent);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none !important;
}

.wmtb-mega__foot .wmtb-ico { width: 15px; height: 15px; }
[dir="rtl"] .wmtb-mega__foot .wmtb-ico { transform: scaleX(-1); }

/* Desktop bar isolation (themes style bare buttons with :not() chains). */
.wmtb-dbar__cart {
	background: var(--wmtb-surface-solid) !important;
	color: var(--wmtb-fg) !important;
	border: 1px solid var(--wmtb-border) !important;
	border-radius: 12px !important;
	width: 42px !important;
	height: 40px !important;
	padding: 0 !important;
}

.wmtb-dbar__cart:hover {
	border-color: var(--wmtb-accent) !important;
	color: var(--wmtb-accent) !important;
}

.wmtb-dsearch__go {
	background: var(--wmtb-active-bg) !important;
	color: var(--wmtb-accent) !important;
	border: 0 !important;
	border-radius: 9px !important;
	width: 30px !important;
	height: 30px !important;
	padding: 0 !important;
}

.wmtb-dbar__cats {
	background: linear-gradient(135deg, var(--wmtb-accent), var(--wmtb-accent-2, var(--wmtb-accent))) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 12px !important;
	height: 40px !important;
	padding: 0 16px !important;
}

.wmtb-dbar__user {
	background: var(--wmtb-surface-solid) !important;
	color: var(--wmtb-fg) !important;
	border: 1px solid var(--wmtb-border) !important;
	border-radius: 12px !important;
	height: 40px !important;
	padding: 0 14px !important;
}

.wmtb-mega__inner {
	min-height: 220px;
}

.wmtb-mega__single {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	min-height: 200px;
	padding: 26px 8px;
}
