/**
 * Merida Custom Header – Desktop Styles
 *
 * Three-row header:
 *   1. Top bar (dark utility links)
 *   2. Main header (brand + search + actions)
 *   3. Primary navigation (product nav + content nav)
 */

/* ================================================================
   CSS Custom Properties
   ================================================================ */
:root {
	--merida-header-max-width: var(--global-content-width, 1290px);
	--merida-header-side-pad: 20px;
	--merida-nav-height: 44px;
	--merida-brand-color: var(--global-palette1, #183e86);
}

/* ================================================================
   1. TOP BAR
   ================================================================ */
.merida-topbar {
	background: var(--topbar-bg, var(--global-palette3, #1a1a2e));
	color: var(--topbar-color, var(--global-palette9, #fff));
	font-size: 13px;
	line-height: 1;
	padding: 12px 0;
}

.merida-topbar__inner {
	max-width: var(--merida-header-max-width);
	margin: 0 auto;
	padding: 0 var(--merida-header-side-pad);
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 100%;
}

.merida-topbar__items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 24px;
}

.merida-topbar__item a {
	color: inherit;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: color 0.2s, transform 0.2s;
}

.merida-topbar__item a:hover {
	color: #fff;
	transform: translateY(-1px);
}

/* Top bar icons – small inline SVG-like via CSS */
.merida-topbar__icon {
	display: inline-block;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0.85;
}

.merida-topbar__icon--location {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.merida-topbar__icon--phone {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

.merida-topbar__icon--cart {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
}

/* Hide top bar on mobile */
@media (max-width: 1024px) {
	.merida-topbar {
		display: none;
	}
}

/* ================================================================
   2. MAIN HEADER
   ================================================================ */
.merida-main-header__inner {
	max-width: var(--merida-header-max-width);
	margin: 0 auto;
	padding: 24px var(--merida-header-side-pad) 16px;
	display: flex;
	align-items: center;
	gap: 32px;
}

/* Brand / Logo */
.merida-main-header__brand {
	flex-shrink: 0;
}

.merida-logo {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: var(--merida-brand-color);
}

.merida-logo svg {
	height: 42px;
	width: auto;
	display: block;
}

.merida-logo {
	position: relative;
	top: -6px;
}

/* Search */
.merida-main-header__search {
	flex: 1;
	min-width: 0;
	max-width: 474px;
}

.merida-search-field {
	display: flex;
	align-items: center;
	height: 41px;
	border: 1px solid var(--global-palette7, #d0d5dd);
	border-radius: 90px;
	overflow: hidden;
	background: var(--global-palette9, #fff);
	transition: border-color 0.2s;
}

.merida-search-field:focus-within {
	border-color: var(--merida-brand-color);
}

.merida-search-field__input {
	flex: 1;
	border: none;
	outline: none;
	padding: 8px 16px;
	font-size: 14px;
	background: transparent;
	color: var(--global-palette4, #333);
	cursor: text;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	border-radius: 0;
	margin: 0;
}

/* Reset Kadence/browser defaults on search inputs inside our header */
.merida-header input[type="search"],
.merida-header .merida-search-field__input {
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	border-radius: 0 !important;
	background: transparent !important;
}

.merida-search-field__input::placeholder {
	color: var(--global-palette6, #999);
}

.merida-search-field__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none !important;
	border: none !important;
	border-radius: 0 8px 8px 0 !important;
	padding: 8px 14px;
	cursor: pointer;
	color: var(--global-palette5, #666);
	transition: background-color 0.2s, color 0.2s;
}

.merida-search-field__btn:hover {
	background-color: var(--global-palette8, #f0f0f0) !important;
	color: var(--merida-brand-color);
}

.merida-search-field__btn:focus-visible {
	outline: 2px solid var(--merida-brand-color);
	outline-offset: -2px;
}


/* User Actions */
.merida-main-header__actions {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
	margin-left: auto;
}

.merida-action {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	height: 41px;
	color: var(--global-palette4, #333);
	transition: color 0.2s;
}

.merida-action:hover {
	color: var(--merida-brand-color);
}

/* Cart button — override Kadence's .header-cart-button base styles */
#merida-header .merida-action--cart {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: none !important;
	border: 1px solid var(--global-palette7, #d0d5dd) !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	cursor: pointer;
	padding: 0 !important;
	width: 44px !important;
	height: 44px !important;
	color: var(--global-palette4, #333) !important;
}

#merida-header .merida-action--cart:hover {
	background: none !important;
	color: var(--merida-brand-color) !important;
	box-shadow: none !important;
}

/* Cart badge — target .header-cart-total directly because WC cart fragments
   AJAX replaces the <span> and strips our custom class after ~0.3s */
#merida-header .merida-action--cart .header-cart-total {
	position: absolute !important;
	top: -2px !important;
	right: -4px !important;
	background: var(--merida-brand-color) !important;
	color: var(--global-palette9, #fff) !important;
	font-size: 10px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	min-width: 16px !important;
	height: 16px !important;
	width: auto !important;
	border-radius: 8px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 4px !important;
	margin: 0 !important;
	transition: none !important;
}

#merida-header .merida-action--cart .header-cart-is-empty-true {
	display: none !important;
}

/* Account button – override plugin styles to match header */
.merida-action--account .merida-account-btn,
.merida-action--account .merida-account-button__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 16px;
	border-radius: 90px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	height: 41px;
	box-sizing: border-box;
	background: var(--merida-btn-filled, var(--merida-brand-color));
	color: var(--global-palette9, #fff);
	border: 1px solid var(--merida-btn-filled, var(--merida-brand-color));
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.merida-action--account .merida-account-btn:hover,
.merida-action--account .merida-account-button__link:hover {
	filter: brightness(0.85);
}

.merida-action--account .merida-account-btn--logged-in,
.merida-action--account .merida-account-button__link--outline {
	background: transparent;
	color: var(--global-palette3);
	border-color: var(--global-palette3);
}

.merida-action--account .merida-account-btn--logged-in:hover,
.merida-action--account .merida-account-button__link--outline:hover {
	background: var(--global-palette3);
	color: var(--global-palette9, #fff);
}

/* Account wrapper — no extra padding, it comes from the button itself */
.merida-action--account {
	padding: 0;
}

/* Future actions (hidden in MVP) */
.merida-action--future {
	display: none;
}

/* ================================================================
   3. PRIMARY NAVIGATION
   ================================================================ */
/* Border only on the whole header bottom — mirrors old #masthead rule */
.merida-header {
	border-bottom: 1px solid var(--global-palette7, #eee);
}

.merida-primary-nav__inner {
	max-width: var(--merida-header-max-width);
	margin: 0 auto;
	padding: 0 var(--merida-header-side-pad);
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: var(--merida-nav-height);
}

/* Shared nav list reset */
.merida-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 0;
	height: 100%;
}

.merida-nav-list li {
	height: 100%;
}

#merida-header .merida-primary-nav a,
.merida-nav-list li>a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 100%;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: var(--global-palette3, #1a1a2e);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s;
}

#merida-header .merida-primary-nav a:visited {
	color: var(--global-palette3, #1a1a2e);
}

.merida-nav-list li>a:hover,
.merida-nav-list li.menu-open>a {
	color: var(--merida-brand-color);
}

/* Product nav – first item no left padding */
.merida-nav-list--products>li:first-child>a {
	padding-left: 0;
}

/* Content nav – last item no right padding */
.merida-nav-list--content>li:last-child>a {
	padding-right: 0;
}

/* Content nav links – match primary nav typography */
.merida-nav-list--content li>a {
	font-weight: 600;
	color: var(--global-palette3, #1a1a2e);
}

.merida-nav-list--content li>a:hover {
	color: var(--merida-brand-color);
}

/* ── Product nav icons (actual SVG files from assets/icons/) ── */
.merida-nav-list--products li>a::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background: no-repeat center / contain;
}

/* List icon — Wszystkie kategorie */
.merida-nav-list--products .mega-menu-shortcode>a::before {
	background-image: url(../../../../assets/icons/k/list.svg);
}

/* Merida signet — Kolekcje wyposażenia */
.merida-nav-list--products .mega-menu-collections>a::before {
	background-image: url(../../../../assets/icons/Merida-signet.svg);
}

/* 9-grid icon — Wybierz branżę */
.merida-nav-list--products .mega-menu-solutions>a::before {
	background-image: url(../../../../assets/icons/k/9grid.svg);
}

/* Items without a recognized icon class get no pseudo-element */
.merida-nav-list--products li:not(.mega-menu-shortcode):not(.mega-menu-collections):not(.mega-menu-solutions)>a::before {
	display: none;
}

/* Brighten nav icons on hover */
.merida-nav-list--products li>a:hover::before {
	filter: brightness(1.4);
}

/* ================================================================
   4. HEADER-LEVEL RESPONSIVE (Mobile handled separately)
   ================================================================ */
@media (max-width: 1024px) {

	/* Hide primary nav bar on mobile (will be in drawer) */
	.merida-primary-nav {
		display: none;
	}

	/* Adjust main header for mobile */
	.merida-main-header__inner {
		gap: 16px;
		height: auto;
		padding-top: 12px;
		padding-bottom: 12px;
		flex-wrap: wrap;
	}

	/* Search goes full width below logo+actions */
	.merida-main-header__search {
		order: 3;
		flex-basis: 100%;
		max-width: none;
	}

	.merida-main-header__brand {
		order: 1;
	}

	.merida-main-header__actions {
		order: 2;
		margin-left: auto;
	}
}

/* ================================================================
   5. UTILITY CLASSES
   ================================================================ */
@media (min-width: 1025px) {
	.merida-mobile-only {
		display: none !important;
	}
}

@media (max-width: 1024px) {
	.merida-desktop-only {
		display: none !important;
	}
}

/* ================================================================
   6. MOBILE HEADER LAYOUT
   ================================================================ */
@media (max-width: 1024px) {

	/* ── Always sticky (brand + actions) ───────────────────── */
	.merida-header {
		position: sticky;
		top: 0;
		z-index: 999;
		background: var(--global-palette9, #fff);
	}

	/* ── Search row: hidden when scrolled past top ─────────── */
	.merida-header--search-hidden .merida-main-header__search {
		display: none;
	}

	/* WP Admin bar offset */
	.admin-bar .merida-header {
		top: 46px;
	}

	/* Badge position tweak for circle cart button on mobile */
	#merida-header .merida-action--cart .header-cart-total {
		top: -4px !important;
		right: -2px !important;
	}

	/* Hamburger: minimal styling, no border */
	.merida-action--hamburger {
		display: inline-flex;
		padding: 8px;
	}

	/* WCAG focus-visible on header actions */
	.merida-action--cart:focus-visible,
	.merida-action--hamburger:focus-visible {
		outline: 2px solid var(--merida-brand-color);
		outline-offset: 2px;
	}

	/* Search cursor – not readonly anymore */
	.merida-search-field__input {
		cursor: text;
	}
}

@media (max-width: 1024px) and (min-width: 783px) {
	.admin-bar .merida-header {
		top: 32px;
	}
}


/* ================================================================
   7. DRAWER – OVERLAY & SHELL
   ================================================================ */

/* ── Kadence theme reset ───────────────────────────────────────
   Kadence injects styles on generic selectors (button, a, .site a).
   We must override them aggressively inside the drawer.
   ──────────────────────────────────────────────────────────────── */
#merida-mobile-drawer button,
#merida-mobile-drawer a {
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	text-shadow: none !important;
	text-decoration: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	font-family: inherit !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	transition: none !important;
}

#merida-mobile-drawer button:hover,
#merida-mobile-drawer button:focus,
#merida-mobile-drawer button:active,
#merida-mobile-drawer a:hover,
#merida-mobile-drawer a:focus,
#merida-mobile-drawer a:active {
	background: none !important;
	box-shadow: none !important;
	outline: none !important;
	text-decoration: none !important;
}

/* ── WCAG focus-visible states ─────────────────────────────────
   Keyboard-only focus ring — visible, high contrast, doesn't
   interfere with mouse interactions.
   ──────────────────────────────────────────────────────────────── */
#merida-mobile-drawer button:focus-visible,
#merida-mobile-drawer a:focus-visible {
	outline: 2px solid var(--merida-brand-color) !important;
	outline-offset: -2px !important;
}

/* ── Drawer shell ──────────────────────────────────────────── */
.merida-drawer {
	position: fixed;
	inset: 0;
	background: var(--global-palette9, #fff);
	z-index: 10000;
	transform: translateX(100%);
	transition: transform 250ms ease-out;
	display: flex;
	flex-direction: column;
	visibility: hidden;
}

.merida-drawer--open {
	transform: translateX(0);
	visibility: visible;
}

.merida-drawer--closing {
	transform: translateX(100%);
	visibility: visible;
}

/* Hide completely on desktop (fail-safe) */
@media (min-width: 1025px) {
	.merida-drawer {
		display: none !important;
	}
}

/* ── Drawer Header ─────────────────────────────────────────── */
.merida-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
	border-bottom: 1px solid var(--global-palette7, #eee) !important;
	flex-shrink: 0;
}

.merida-drawer__logo {
	display: flex !important;
	align-items: center;
	color: var(--merida-brand-color) !important;
}

.merida-drawer__logo svg {
	height: 36px;
	width: auto;
	display: block;
}

#merida-mobile-drawer .merida-drawer__close {
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: none !important;
	border: none !important;
	border-left: 1px solid var(--global-palette7, #eee) !important;
	border-radius: 0 !important;
	padding: 4px 0 4px 20px !important;
	margin-left: auto;
	cursor: pointer;
	color: var(--global-palette4, #333) !important;
}

#merida-mobile-drawer .merida-drawer__close:hover {
	color: var(--merida-brand-color) !important;
}

/* ================================================================
   8. DRAWER – PANEL TRANSITIONS
   ================================================================ */

/* ── Panels container ──────────────────────────────────────── */
.merida-drawer__panels {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	position: relative;
	-webkit-overflow-scrolling: touch;
}

/* ── Individual panels ─────────────────────────────────────── */
.merida-drawer__panel {
	width: 100%;
	min-height: 100%;
}

/* Hidden panels: collapsed so they don't inflate scroll area */
.merida-drawer__panel[aria-hidden="true"] {
	position: absolute;
	top: 0;
	left: 0;
	height: 0;
	overflow: hidden;
	visibility: hidden;
	pointer-events: none;
}

/* Active panel: in flow, visible */
.merida-drawer__panel--active {
	position: relative;
	visibility: visible;
	pointer-events: auto;
}

/* ── Slide animations ──────────────────────────────────────── */
/* Forward: current exits left */
.merida-drawer__panel--exiting-left {
	position: absolute !important;
	top: 0;
	left: 0;
	visibility: visible !important;
	pointer-events: none;
	animation: merida-slide-out-left 250ms ease-out forwards;
}

/* Forward: target enters from right */
.merida-drawer__panel--entering-right {
	position: absolute !important;
	top: 0;
	left: 0;
	visibility: visible !important;
	pointer-events: none;
	animation: merida-slide-in-right 250ms ease-out forwards;
}

/* Back: current exits right */
.merida-drawer__panel--exiting-right {
	position: absolute !important;
	top: 0;
	left: 0;
	visibility: visible !important;
	pointer-events: none;
	animation: merida-slide-out-right 250ms ease-out forwards;
}

/* Back: parent enters from left */
.merida-drawer__panel--entering-left {
	position: absolute !important;
	top: 0;
	left: 0;
	visibility: visible !important;
	pointer-events: none;
	animation: merida-slide-in-left 250ms ease-out forwards;
}

@keyframes merida-slide-out-left {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-100%);
	}
}

@keyframes merida-slide-in-right {
	from {
		transform: translateX(100%);
	}

	to {
		transform: translateX(0);
	}
}

@keyframes merida-slide-out-right {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(100%);
	}
}

@keyframes merida-slide-in-left {
	from {
		transform: translateX(-100%);
	}

	to {
		transform: translateX(0);
	}
}

/* ================================================================
   9. DRAWER – MENU ITEMS & CONTENT
   ================================================================ */

/* ── Panel header (back button row) ────────────────────────── */
.merida-drawer__panel-header {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--global-palette8, #f8f8f8) !important;
	border-bottom: 1px solid var(--global-palette7, #eee) !important;
}

#merida-mobile-drawer .merida-drawer__back {
	display: flex !important;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 16px 20px !important;
	background: var(--global-palette8, #f8f8f8) !important;
	border: none !important;
	border-radius: 0 !important;
	cursor: pointer;
	text-align: left;
	font-size: 24px !important;
	font-weight: 700 !important;
	color: var(--global-palette3, #1a1a2e) !important;
	line-height: 1.3;
}

#merida-mobile-drawer .merida-drawer__back svg {
	width: 32px !important;
	height: 32px !important;
	padding: 6px;
	border: 1px solid var(--global-palette7, #DADADA);
	border-radius: 50%;
	background: var(--global-palette9, #fff);
	flex-shrink: 0;
}

#merida-mobile-drawer .merida-drawer__back:hover,
#merida-mobile-drawer .merida-drawer__back:focus,
#merida-mobile-drawer .merida-drawer__back:active {
	background: var(--global-palette7, #f0f0f0) !important;
	color: var(--global-palette3, #1a1a2e) !important;
}

.merida-drawer__panel-title {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

/* ── Menu item rows ────────────────────────────────────────── */
/* ID prefix needed to beat the Kadence reset (#merida-mobile-drawer a) specificity */
#merida-mobile-drawer .merida-drawer__item {
	display: flex !important;
	align-items: center;
	width: 100%;
	padding: 16px 16px 16px 24px !important;
	border: none !important;
	border-bottom: 1px solid var(--global-palette7, #DADADA) !important;
	border-radius: 0 !important;
	background: var(--global-palette9, #fff) !important;
	text-decoration: none !important;
	color: var(--global-palette3, #1a1a2e) !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	cursor: pointer;
	text-align: left;
	gap: 10px;
	line-height: 1.4;
}

#merida-mobile-drawer .merida-drawer__item:hover {
	background: var(--global-palette8, #f8f8f8) !important;
	color: var(--global-palette3, #1a1a2e) !important;
}

#merida-mobile-drawer .merida-drawer__item:active {
	background: var(--global-palette7, #f0f0f0) !important;
	color: var(--global-palette3, #1a1a2e) !important;
}

/* Item label fills available space */
.merida-drawer__item-label {
	flex: 1;
	min-width: 0;
}

/* Forward arrow */
.merida-drawer__arrow {
	flex-shrink: 0;
	color: var(--global-palette6, #999);
}

/* ── Separator ─────────────────────────────────────────────── */
.merida-drawer__separator {
	height: 1px;
	background: var(--global-palette7, #e0e0e0);
	margin: 0;
}

/* ── Category icons (Level 2 products) ─────────────────────── */
.merida-drawer__item-icon {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--global-palette8, #f5f5f5);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}

.merida-drawer__item-icon img {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

/* Grid icon variant (for "Przejdź do kategorii") */
.merida-drawer__item-icon--grid {
	color: var(--global-palette3, #1a1a2e);
}

.merida-drawer__item-icon--grid svg {
	width: 20px;
	height: 20px;
}

/* ── Thumbnails (Level 3 subcategories / collections) ──────── */
.merida-drawer__item-thumb {
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.merida-drawer__item-thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* ── Branch & Collection thumbnails (rectangular, edge-to-edge square) ── */
#merida-mobile-drawer .merida-drawer__item--branch,
#panel-collections .merida-drawer__item {
	padding: 0 16px 0 0 !important;
	gap: 16px;
	min-height: 80px;
}

/* Specificity override to beat .merida-drawer__item-thumb width setting */
#merida-mobile-drawer .merida-drawer__item-thumb.merida-drawer__item-thumb--branch,
#panel-collections .merida-drawer__item-thumb {
	width: 80px !important;
	height: 80px !important;
	aspect-ratio: 1 / 1;
	border-radius: 0 !important;
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	/* Override for correct child image sizing */
}

.merida-drawer__item-thumb--branch img,
#panel-collections .merida-drawer__item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Bold the font specifically for Branches & Collections as in design */
#merida-mobile-drawer .merida-drawer__item--branch .merida-drawer__item-label,
#panel-collections .merida-drawer__item .merida-drawer__item-label {
	font-weight: 600 !important;
	font-size: 16px !important;
}

/* ── "Przejdź do kategorii" link ───────────────────────────── */
#merida-mobile-drawer .merida-drawer__item--goto {
	background: var(--global-palette8, #f8f8f8) !important;
	border-bottom: 1px solid var(--global-palette7, #DADADA) !important;
	font-weight: 600 !important;
	color: var(--global-palette3, #1a1a2e) !important;
}

/* ── Account button in drawer (full-width pill, matching desktop style) ── */
.merida-drawer__account {
	padding: 20px 24px;
}

#merida-mobile-drawer .merida-drawer__account .merida-account-button__link {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100% !important;
	height: auto !important;
	padding: 14px 20px !important;
	border-radius: 90px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	white-space: nowrap;
	box-sizing: border-box;
	background: var(--merida-btn-filled, var(--merida-brand-color)) !important;
	color: var(--global-palette9, #fff) !important;
	border: 1px solid var(--merida-btn-filled, var(--merida-brand-color)) !important;
	transition: filter 0.2s;
}

/* Override plugin mobile rule that hides label and forces circle */
#merida-mobile-drawer .merida-drawer__account .merida-account-button__link span {
	display: inline !important;
}

#merida-mobile-drawer .merida-drawer__account .merida-account-button__link svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

#merida-mobile-drawer .merida-drawer__account .merida-account-button__link:hover {
	filter: brightness(0.85);
}

/* Outline variant (logged in) */
#merida-mobile-drawer .merida-drawer__account .merida-account-button__link--outline {
	background: transparent !important;
	color: var(--global-palette3) !important;
	border-color: var(--global-palette3) !important;
}

#merida-mobile-drawer .merida-drawer__account .merida-account-button__link--outline:hover {
	background: var(--global-palette3) !important;
	color: var(--global-palette9, #fff) !important;
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
	.merida-drawer {
		transition: none !important;
	}

	.merida-drawer__panel--exiting-left,
	.merida-drawer__panel--entering-right,
	.merida-drawer__panel--exiting-right,
	.merida-drawer__panel--entering-left {
		animation: none !important;
	}
}

/* ================================================================
   11. KADENCE POPUP-DRAWER (cart, filters) — replaces header.min.css
   Kadence skips header.min.css when its native header is suppressed,
   so we re-declare the essential popup-drawer positioning rules.
   ================================================================ */
.popup-drawer {
	position: fixed;
	display: none;
	top: 0;
	bottom: 0;
	left: -99999rem;
	right: 99999rem;
	transition: opacity .25s ease-in, left 0s .25s, right 0s .25s;
	z-index: 100000;
}

.popup-drawer .drawer-overlay {
	background-color: rgba(0, 0, 0, .4);
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	opacity: 0;
	transition: opacity .2s ease-in-out;
}

.popup-drawer .drawer-inner {
	width: 100%;
	transform: translateX(100%);
	max-width: 90%;
	right: 0;
	top: 0;
	overflow: auto;
	background: #fff;
	color: var(--global-palette3, #1a1a2e);
	bottom: 0;
	opacity: 0;
	position: fixed;
	box-shadow: 0 0 2rem 0 rgba(0, 0, 0, .1);
	display: flex;
	flex-direction: column;
	transition: transform .3s cubic-bezier(.77, .2, .05, 1), opacity .25s cubic-bezier(.77, .2, .05, 1);
}

.popup-drawer .drawer-header {
	padding: 0 1.5em;
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: calc(1.2em + 24px);
}

.popup-drawer .drawer-header .drawer-toggle {
	background: transparent;
	border: 0;
	font-size: 24px;
	line-height: 1;
	padding: .6em .15em;
	color: inherit;
	display: flex;
	box-shadow: none;
	border-radius: 0;
	cursor: pointer;
}

.popup-drawer .drawer-content {
	padding: 0 1.5em 1.5em;
}

.popup-drawer-layout-sidepanel.popup-drawer-side-left .drawer-inner {
	transform: translateX(-100%);
	right: auto;
	left: 0;
}

.popup-drawer.show-drawer {
	display: block;
}

.popup-drawer.active {
	left: 0;
	opacity: 1;
	right: 0;
	transition: opacity .25s ease-out;
}

.popup-drawer.active .drawer-inner {
	opacity: 1;
	transform: translateX(0%);
}

.popup-drawer.active .drawer-overlay {
	opacity: 1;
	cursor: pointer;
}