/* Load Inter + JetBrains Mono. The theme tokens (--mw-font-*)
 * may not be defined on every page; this guarantees the drawer
 * matches the design regardless of theme state. Single Google
 * Fonts request with weights we actually use. */
@import url( 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap' );

/**
 * Midwest Armor Notify — wishlist drawer.
 *
 * Implementation of reference/saved_item_sidebar_design.html v2.
 * Side panel anchored right (420px desktop, 100vw mobile, no
 * scrim on mobile). Light + dark themes via `.is-night` class on
 * the drawer shell (driven from html[data-mw-mode="night"]).
 *
 * Anatomy (top → bottom):
 *   .d-head  — title + count badge + close X
 *   .d-msg   — admin-attached product message (when present)
 *   .d-nudge — sign-in nudge (always visible to logged-out users,
 *              no dismiss button per Mo's call)
 *   .d-list  — scrollable items; each row is one <a> to the PDP
 *   .d-empty — zero state (mutually exclusive with .d-list)
 *   .d-foot  — rollup: N ITEMS SAVED + total value
 *
 * @package Midwest_Armor_Notify
 */

/* ── Root wrapper + scrim ─────────────────────────────────────── */
.mwa-mini-panel { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.mwa-mini-panel[hidden] { display: none; }

/* Hard hidden overrides: every direct child below has a
 * `display: flex/block` rule that would otherwise beat the
 * `[hidden]` attribute's UA-default `display:none`. Without
 * these, toggling `hidden=true` from JS doesn't actually hide
 * the element (the v0.9.4 "empty state showing alongside items"
 * bug). */
.mwa-mini-panel [hidden] { display: none !important; }

.mwa-mini-panel__scrim {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, 0 );
	transition: background 220ms ease;
	pointer-events: auto;
}
.mwa-mini-panel.is-open .mwa-mini-panel__scrim { background: rgba( 0, 0, 0, 0.45 ); }

/* ── Drawer shell (light theme defaults; .is-night swaps tokens) */
.mwa-mini-panel__shell {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 92vw;
	height: 100vh;
	display: flex;
	flex-direction: column;
	pointer-events: auto;
	transform: translateX( 100% );
	transition: transform 320ms cubic-bezier( 0.65, 0.05, 0.36, 1 );
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	border-left: 1px solid var( --d-border );

	/* Light theme tokens. */
	--d-fg:        #141416;
	--d-fg-mute:   rgba( 20, 20, 22, 0.58 );
	--d-fg-faint:  rgba( 20, 20, 22, 0.42 );
	--d-body:      #ffffff;
	--d-chrome:    #f4f5f6;
	--d-strip:     #e8e9eb;
	--d-border:    rgba( 0, 0, 0, 0.10 );
	--d-hair:      rgba( 0, 0, 0, 0.06 );
	--d-accent:    #d97a4a;
	--d-mono:      'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

	background: var( --d-body );
	color: var( --d-fg );
}
.mwa-mini-panel__shell.is-night,
html[data-mw-mode="night"] .mwa-mini-panel__shell {
	--d-fg:        #edeef0;
	--d-fg-mute:   rgba( 237, 238, 240, 0.55 );
	--d-fg-faint:  rgba( 237, 238, 240, 0.38 );
	--d-body:      #1a1c1f;
	--d-chrome:    #24272a;
	--d-strip:     #2e3135;
	--d-border:    rgba( 255, 255, 255, 0.09 );
	--d-hair:      rgba( 255, 255, 255, 0.06 );
}
.mwa-mini-panel.is-open .mwa-mini-panel__shell { transform: translateX( 0 ); }

/* ── Global link & text-color reset INSIDE the drawer ─────────
 * Storefronts ship their own `a { color: #blue }` and emphasis
 * rules that win the cascade against unprefixed selectors here.
 * Every text element inside the panel inherits from its closest
 * styled parent — anchors get inherit color + no underline by
 * default; button classes opt back in with their own !important
 * rules. Without this, the empty-state CTA + the bold lead text
 * in the sign-in nudge render in the storefront's link color
 * (Mo's site: blue). */
.mwa-mini-panel,
.mwa-mini-panel * {
	box-sizing: border-box;
}
.mwa-mini-panel a {
	color: inherit !important;
	text-decoration: none !important;
	background: transparent;
}
.mwa-mini-panel b,
.mwa-mini-panel strong {
	color: var( --d-fg ) !important;
	font-weight: 600 !important;
}
.mwa-mini-panel p {
	color: var( --d-fg-mute ) !important;
	margin: 0;
}

/* ── Header ───────────────────────────────────────────────────── */
.mwa-mini-panel__head {
	flex: 0 0 auto;
	padding: 18px 22px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 1px solid var( --d-hair );
	background: var( --d-chrome );
}
.mwa-mini-panel__title {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var( --d-mono );
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2.2px;
	color: var( --d-fg );
	text-transform: uppercase;
}
.mwa-mini-panel__title-heart {
	width: 14px;
	height: 14px;
	color: var( --d-accent );
	flex-shrink: 0;
}
.mwa-mini-panel__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	background: var( --d-accent );
	color: #ffffff;
	border: 1px solid var( --d-accent );
	font-family: var( --d-mono );
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0;
	border-radius: 0;
}
/* Count badge for zero state — outline only, no fill. */
.mwa-mini-panel__count.is-zero {
	background: transparent;
	color: var( --d-fg-faint );
	border-color: var( --d-border );
}
.mwa-mini-panel__close {
	width: 32px !important;
	height: 32px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: transparent !important;
	border: 1px solid var( --d-border ) !important;
	color: var( --d-fg-mute ) !important;
	cursor: pointer !important;
	border-radius: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	flex-shrink: 0;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mwa-mini-panel__close:hover {
	color: var( --d-fg ) !important;
	border-color: var( --d-fg ) !important;
	background: var( --d-strip ) !important;
}

/* ── Admin product message bar (Slot A, mutually exclusive with nudge) */
.mwa-mini-panel__messages {
	flex: 0 0 auto;
}
.mwa-mini-panel__msg {
	padding: 11px 22px;
	background: var( --d-accent );
	color: #ffffff;
	font-family: var( --d-mono );
	font-size: 10.5px;
	letter-spacing: 1.5px;
	font-weight: 700;
	text-transform: uppercase;
	line-height: 1.4;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.10 );
}
.mwa-mini-panel__msg + .mwa-mini-panel__msg { border-top: 1px solid rgba( 255, 255, 255, 0.18 ); }
.mwa-mini-panel__msg--info         { background: #2271b1; }
.mwa-mini-panel__msg--restock_soon { background: var( --d-accent ); }
.mwa-mini-panel__msg--low_stock    { background: #b32d2e; }
.mwa-mini-panel__msg--price_change { background: #946800; }

/* ── Sign-in nudge (Slot B — always visible for logged-out) ───── */
.mwa-mini-panel__nudge {
	flex: 0 0 auto;
	padding: 14px 22px;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	background: var( --d-strip );
	border-bottom: 1px solid var( --d-hair );
}
.mwa-mini-panel__nudge-icon {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var( --d-border );
	color: var( --d-fg-mute );
}
.mwa-mini-panel__nudge-body { flex: 1; min-width: 0; }
.mwa-mini-panel__nudge-body p {
	font-size: 11.5px !important;
	line-height: 1.5 !important;
	color: var( --d-fg-mute ) !important;
	margin: 0 0 9px !important;
}
.mwa-mini-panel__nudge-body p b,
.mwa-mini-panel__nudge-body p strong {
	color: var( --d-fg ) !important;
	font-weight: 600 !important;
}
.mwa-mini-panel__nudge-actions { display: flex; gap: 8px; }
.mwa-mini-panel__nudge-btn {
	display: inline-block !important;
	font-family: var( --d-mono ) !important;
	font-size: 10px !important;
	letter-spacing: 1.6px !important;
	font-weight: 700 !important;
	padding: 7px 11px !important;
	border-radius: 0 !important;
	text-decoration: none !important;
	cursor: pointer !important;
	border: 1px solid var( --d-border ) !important;
	background: transparent !important;
	color: var( --d-fg-mute ) !important;
	text-transform: uppercase !important;
	box-shadow: none !important;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mwa-mini-panel__nudge-btn:hover { color: var( --d-fg ) !important; border-color: var( --d-fg ) !important; }
.mwa-mini-panel__nudge-btn--primary {
	background: var( --d-accent ) !important;
	color: #ffffff !important;
	border-color: var( --d-accent ) !important;
}
.mwa-mini-panel__nudge-btn--primary:hover { background: #c2683a !important; border-color: #c2683a !important; }

/* ── Items list ───────────────────────────────────────────────── */
.mwa-mini-panel__list {
	flex: 1 1 auto;
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	background: var( --d-body );
}
.mwa-mini-panel__list::-webkit-scrollbar { width: 6px; }
.mwa-mini-panel__list::-webkit-scrollbar-thumb { background: var( --d-border ); }
.mwa-mini-panel__list::-webkit-scrollbar-track { background: transparent; }

/* Item row: flex layout, link wraps thumb+info, actions sibling
 * outside the link. Avoids display:contents weirdness with grid
 * + theme button defaults winning specificity on the remove button.
 * Every visual style here is !important because Hello Elementor
 * + the Midwest chrome each ship their own button + link rules
 * that would otherwise win the cascade. */
.mwa-mini-panel__item {
	display: flex !important;
	align-items: center !important;
	gap: 14px !important;
	padding: 18px 22px !important;
	border-bottom: 1px solid var( --d-hair ) !important;
	background: var( --d-body ) !important;
	margin: 0 !important;
	list-style: none !important;
}
.mwa-mini-panel__item:hover { background: var( --d-chrome ) !important; }
.mwa-mini-panel__item:last-child { border-bottom: 0 !important; }

.mwa-mini-panel__item-link {
	display: flex !important;
	align-items: center !important;
	gap: 14px !important;
	flex: 1 1 auto !important;
	min-width: 0 !important;
	color: var( --d-fg ) !important;
	text-decoration: none !important;
	background: transparent !important;
	padding: 0 !important;
}
.mwa-mini-panel__item-link:hover,
.mwa-mini-panel__item-link:focus,
.mwa-mini-panel__item-link:active { color: var( --d-fg ) !important; text-decoration: none !important; }

.mwa-mini-panel__item-thumb {
	width: 84px !important;
	height: 84px !important;
	background: var( --d-strip ) !important;
	border: 1px solid var( --d-hair ) !important;
	object-fit: cover !important;
	display: block !important;
	flex: 0 0 84px !important;
	border-radius: 0 !important;
	transition: border-color 0.15s;
}
.mwa-mini-panel__item-thumb--blank {
	position: relative;
	overflow: hidden;
}
.mwa-mini-panel__item-thumb--blank::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: repeating-linear-gradient( 135deg, rgba( 0, 0, 0, 0.06 ) 0 10px, transparent 10px 20px );
}
.mwa-mini-panel__shell.is-night .mwa-mini-panel__item-thumb--blank::before,
html[data-mw-mode="night"] .mwa-mini-panel__item-thumb--blank::before {
	background-image: repeating-linear-gradient( 135deg, rgba( 255, 255, 255, 0.05 ) 0 10px, transparent 10px 20px );
}
.mwa-mini-panel__item:hover .mwa-mini-panel__item-thumb { border-color: var( --d-fg ) !important; }

.mwa-mini-panel__item-info {
	min-width: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 6px !important;
	flex: 1 1 auto !important;
}
.mwa-mini-panel__item-name {
	display: -webkit-box !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	letter-spacing: -0.1px !important;
	line-height: 1.25 !important;
	color: var( --d-fg ) !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.mwa-mini-panel__item-variant {
	display: block !important;
	font-family: var( --d-mono ) !important;
	font-size: 9.5px !important;
	letter-spacing: 1.4px !important;
	color: var( --d-fg-mute ) !important;
	text-transform: uppercase !important;
}
.mwa-mini-panel__item-price {
	display: block !important;
	font-family: var( --d-mono ) !important;
	font-size: 12.5px !important;
	font-weight: 700 !important;
	letter-spacing: 0.3px !important;
	color: var( --d-fg ) !important;
	margin-top: 2px !important;
}

.mwa-mini-panel__item-actions {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-end !important;
	justify-content: space-between !important;
	gap: 10px !important;
	height: 84px !important;
	padding: 2px 0 !important;
	flex: 0 0 auto !important;
}
.mwa-mini-panel__item-remove {
	width: 26px !important;
	height: 26px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: transparent !important;
	border: 0 !important;
	color: var( --d-fg-faint ) !important;
	cursor: pointer !important;
	border-radius: 0 !important;
	padding: 0 !important;
	font: inherit !important;
	box-shadow: none !important;
	transition: color 0.15s, background 0.15s;
}
.mwa-mini-panel__item-remove:hover {
	color: var( --d-accent ) !important;
	background: var( --d-strip ) !important;
}
.mwa-mini-panel__item-chev {
	width: 18px !important;
	height: 18px !important;
	color: var( --d-fg-faint ) !important;
	transition: color 0.2s, transform 0.2s;
}
.mwa-mini-panel__item:hover .mwa-mini-panel__item-chev {
	color: var( --d-fg ) !important;
	transform: translateX( 2px );
}

/* ── Empty state ──────────────────────────────────────────────── */
.mwa-mini-panel__empty {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 32px;
	text-align: center;
	background: var( --d-body );
}
.mwa-mini-panel__empty-glyph {
	width: 64px;
	height: 64px;
	border: 1px solid var( --d-border );
	display: flex;
	align-items: center;
	justify-content: center;
	color: var( --d-fg-faint );
	margin-bottom: 22px;
}
.mwa-mini-panel__empty h3 {
	font-family: var( --d-mono );
	font-size: 13px;
	letter-spacing: 2px;
	font-weight: 700;
	color: var( --d-fg );
	margin: 0 0 10px;
	text-transform: uppercase;
}
.mwa-mini-panel__empty p {
	font-size: 12.5px;
	line-height: 1.55;
	color: var( --d-fg-mute );
	max-width: 280px;
	margin: 0 0 22px;
}
.mwa-mini-panel__empty-cta {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 11px 16px !important;
	border: 1px solid var( --d-fg ) !important;
	border-radius: 0 !important;
	color: var( --d-fg ) !important;
	background: transparent !important;
	font-family: var( --d-mono ) !important;
	font-size: 10.5px !important;
	letter-spacing: 1.6px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	text-decoration: none !important;
	box-shadow: none !important;
	transition: background 0.15s, color 0.15s;
}
.mwa-mini-panel__empty-cta:hover {
	background: var( --d-fg ) !important;
	color: var( --d-body ) !important;
}

/* Recents row below the empty-state CTA — 3 small square
 * thumbs of the newest catalog items. Suggestion surface, not
 * personal browse history. */
.mwa-mini-panel__recents {
	margin-top: 34px;
	width: 100%;
	max-width: 280px;
	text-align: left;
}
.mwa-mini-panel__recents h4 {
	font-family: var( --d-mono ) !important;
	font-size: 9.5px;
	letter-spacing: 1.8px;
	font-weight: 700;
	color: var( --d-fg-mute ) !important;
	margin: 0 0 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var( --d-hair );
	text-transform: uppercase;
}
.mwa-mini-panel__recents-list {
	display: flex;
	gap: 8px;
}
.mwa-mini-panel__recent {
	flex: 1;
	aspect-ratio: 1 / 1;
	background: var( --d-strip );
	border: 1px solid var( --d-hair ) !important;
	display: block;
	overflow: hidden;
	transition: border-color 0.15s;
	color: inherit !important;
	text-decoration: none !important;
}
.mwa-mini-panel__recent:hover { border-color: var( --d-fg ) !important; }
.mwa-mini-panel__recent img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ── Footer rollup ────────────────────────────────────────────── */
.mwa-mini-panel__foot {
	flex: 0 0 auto;
	padding: 18px 22px 20px;
	background: var( --d-chrome );
	border-top: 1px solid var( --d-hair );
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}
.mwa-mini-panel__foot-label {
	font-family: var( --d-mono );
	font-size: 10px;
	letter-spacing: 1.8px;
	font-weight: 500;
	color: var( --d-fg-mute );
	text-transform: uppercase;
}
.mwa-mini-panel__foot-label .count {
	color: var( --d-fg );
	font-weight: 700;
	margin: 0 4px 0 6px;
}
.mwa-mini-panel__foot-value {
	font-family: var( --d-mono );
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.3px;
	color: var( --d-fg );
}

/* ── Mobile: full viewport, no scrim ──────────────────────────── */
@media ( max-width: 640px ) {
	.mwa-mini-panel.is-open .mwa-mini-panel__scrim { background: transparent; }
	.mwa-mini-panel__shell {
		width: 100vw;
		max-width: 100vw;
		border-left: 0;
	}
	.mwa-mini-panel__head { padding-top: 62px; /* clear notch / status bar */ }
}

@media ( prefers-reduced-motion: reduce ) {
	.mwa-mini-panel__shell,
	.mwa-mini-panel__scrim {
		transition: none;
	}
}
