/* Warsha Category Menu — mobile-first accordion
   Colors come from CSS variables set by the Elementor style controls. */

.wcm-menu {
	--wcm-accent: #e8611a;
	--wcm-text: #1f2937;
	--wcm-bg: #ffffff;
	--wcm-sub-bg: #f7f7f8;
	--wcm-border: #eaeaec;
	--wcm-radius: 12px;

	width: 100%;
	background: var(--wcm-bg);
	border: 1px solid var(--wcm-border);
	border-radius: var(--wcm-radius);
	overflow: hidden;
	font-size: 16px;
	-webkit-tap-highlight-color: transparent;
}

.wcm-title {
	margin: 0;
	padding: 16px;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #fff;
	background: var(--wcm-accent);
}

.wcm-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wcm-item + .wcm-item {
	border-top: 1px solid var(--wcm-border);
}

/* Row = link + optional toggle button side by side */
.wcm-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	min-height: 48px; /* comfortable tap target */
}

.wcm-link {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
	color: var(--wcm-text);
	text-decoration: none;
	font-weight: 500;
	line-height: 1.35;
}

.wcm-link:hover .wcm-name,
.wcm-link:focus-visible .wcm-name {
	color: var(--wcm-accent);
}

.wcm-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
	transition: color 0.15s ease;
}

.wcm-count {
	flex: 0 0 auto;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1;
	color: var(--wcm-text);
	opacity: 0.55;
	background: var(--wcm-sub-bg);
	border: 1px solid var(--wcm-border);
	border-radius: 999px;
	padding: 4px 9px;
}

/* Category thumbnails (optional) */
.wcm-thumb {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--wcm-sub-bg);
	border: 1px solid var(--wcm-border);
}

.wcm-thumb-placeholder {
	display: inline-block;
}

/* Expand/collapse button — separate from the link so tapping the
   name navigates and tapping the arrow expands. */
.wcm-toggle {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -8px -8px -8px 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-left: 1px solid var(--wcm-border);
	border-radius: 0;
	color: var(--wcm-text);
	cursor: pointer;
}

.wcm-toggle:focus-visible {
	outline: 2px solid var(--wcm-accent);
	outline-offset: -2px;
}

.wcm-chevron {
	transition: transform 0.25s ease;
}

.wcm-toggle[aria-expanded="true"] {
	color: var(--wcm-accent);
}

.wcm-toggle[aria-expanded="true"] .wcm-chevron {
	transform: rotate(180deg);
}

/* Submenus */
.wcm-sub {
	position: relative;
	background: var(--wcm-sub-bg);
	border-top: 1px solid var(--wcm-border);
	overflow: hidden;
	/* Indentation lives on the nested list itself, so the Elementor
	   "Item padding" control (which targets .wcm-row) can't override it.
	   Each deeper level nests another <ul>, so indentation stacks up
	   automatically. */
	padding-left: 18px;
}

.wcm-sub .wcm-link {
	font-weight: 400;
	font-size: 0.95em;
}

/* Guide line sits inside the list's own padding, safely left of the text */
.wcm-sub::before {
	content: "";
	position: absolute;
	left: 8px;
	top: 6px;
	bottom: 6px;
	width: 2px;
	border-radius: 2px;
	background: var(--wcm-border);
}

.wcm-item.wcm-open > .wcm-sub::before {
	background: var(--wcm-accent);
}

/* Shop link on top */
.wcm-shop-link {
	font-weight: 700;
	color: var(--wcm-accent);
}

/* Open/close animation (JS animates max-height; this is the fallback state) */
.wcm-sub.wcm-animating {
	transition: max-height 0.28s ease;
}

/* Slightly larger targets on very small screens */
@media (max-width: 480px) {
	.wcm-menu {
		border-left: 0;
		border-right: 0;
		border-radius: 0;
	}
}

/* =====================================================================
   Drawer mode: hamburger button in the header + panel sliding in
   from the LEFT with a dark overlay.
   ===================================================================== */

.wcm-widget {
	--wcm-drawer-width: 340px;
}

.wcm-mode-drawer {
	display: inline-block;
}

/* --- Trigger button (lives in the header) --- */
.wcm-drawer-btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 10px 14px;
	min-height: 44px;
	background: #e8611a;
	color: #fff;
	border: 0;
	border-radius: 8px;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.wcm-drawer-btn:hover { filter: brightness(1.08); }
.wcm-drawer-btn:active { transform: scale(0.97); }
.wcm-drawer-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.wcm-burger { flex: 0 0 auto; }

/* --- Overlay --- */
.wcm-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(15, 18, 25, 0.55);
	opacity: 0;
	transition: opacity 0.28s ease;
}

.wcm-overlay.wcm-visible { opacity: 1; }

/* --- Drawer panel --- */
.wcm-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 99999;
	width: min(var(--wcm-drawer-width), 88vw);
	background: #fff;
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
	transform: translateX(-102%);
	transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1);
	display: flex;
	flex-direction: column;
	overscroll-behavior: contain;
}

.wcm-drawer.wcm-visible { transform: translateX(0); }

/* The menu fills the drawer and scrolls internally */
.wcm-drawer .wcm-menu {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	border: 0;
	border-radius: 0;
}

/* Sticky title bar inside the drawer, with room for the close button */
.wcm-drawer .wcm-title {
	position: sticky;
	top: 0;
	z-index: 2;
	padding-right: 60px;
}

/* --- Close button --- */
.wcm-drawer-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.wcm-drawer-close:hover { background: rgba(255, 255, 255, 0.3); }
.wcm-drawer-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* If there's no title bar, give the close button a dark color */
.wcm-drawer .wcm-menu:first-child ~ .wcm-drawer-close,
.wcm-drawer.wcm-no-title .wcm-drawer-close {
	background: rgba(0, 0, 0, 0.06);
	color: #1f2937;
}

/* Lock page scroll while the drawer is open */
html.wcm-scroll-lock,
html.wcm-scroll-lock body {
	overflow: hidden !important;
	height: 100%;
}

@media (prefers-reduced-motion: reduce) {
	.wcm-chevron,
	.wcm-sub.wcm-animating,
	.wcm-drawer,
	.wcm-overlay {
		transition: none;
	}
}
