/* Megamenú de categorías WooCommerce — personaliza con las variables de abajo. */
.wcch-panel,
.wcch-drawer {
	--wcch-bg: #fff;
	--wcch-fg: #1d2327;
	--wcch-muted: #50575e;
	--wcch-line: #e5e7eb;
	--wcch-hover: #f3f4f6;
	--wcch-accent: #2271b1;
	--wcch-radius: 8px;
	--wcch-parents-width: 270px;
	box-sizing: border-box;
	background: var(--wcch-bg);
	color: var(--wcch-fg);
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
}
.wcch-panel *,
.wcch-drawer * { box-sizing: border-box; }
.wcch-panel a,
.wcch-drawer a { color: inherit; text-decoration: none; }
.wcch-panel button,
.wcch-drawer button {
	appearance: none; background: none; border: 0; box-shadow: none; margin: 0;
	padding: 0; min-height: 0; width: auto; color: inherit; font: inherit;
	letter-spacing: normal; text-transform: none; cursor: pointer; line-height: inherit;
}
.wcch-panel ul,
.wcch-drawer ul { list-style: none; margin: 0; padding: 0; }
.wcch-panel[hidden],
.wcch-drawer[hidden] { display: none !important; }

/* Flecha en el elemento del menú */
.wcch-mega-trigger > a::after {
	content: ""; display: inline-block; width: .38em; height: .38em; margin: 0 0 .22em .5em;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg); transition: none;
}

/* ---------- Escritorio ---------- */
.wcch-panel {
	position: fixed; z-index: 99999; display: flex; flex-direction: column;
	border: 1px solid var(--wcch-line); border-radius: 0 0 var(--wcch-radius) var(--wcch-radius);
	box-shadow: 0 16px 40px rgba(0, 0, 0, .14); overflow: hidden;
}
.wcch-top { flex: none; padding: 12px 16px; border-bottom: 1px solid var(--wcch-line); }
.wcch-body { flex: 1; min-height: 0; display: flex; }
.wcch-panel.is-searching .wcch-parents li.is-active > a { background: none; color: inherit; }

/* ---------- Buscador ---------- */
.wcch-search { position: relative; }
.wcch-search .wcch-search-input {
	display: block; width: 100%; max-width: none; height: 40px; margin: 0;
	padding: 0 40px 0 14px; border: 1px solid var(--wcch-line); border-radius: 999px;
	background: var(--wcch-hover); color: var(--wcch-fg); font: inherit; font-size: 14px;
	box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
}
.wcch-search .wcch-search-input:focus { border-color: var(--wcch-accent); background: var(--wcch-bg); }
.wcch-search .wcch-search-input::-webkit-search-cancel-button { display: none; }
.wcch-search .wcch-search-clear {
	position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
	width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
	border-radius: 50%; color: var(--wcch-muted); font-size: 14px;
}
.wcch-search .wcch-search-clear:hover { background: var(--wcch-line); }
.wcch-search .wcch-search-clear[hidden] { display: none; }
.wcch-results .wcch-result > a { display: block; padding: 8px 10px; border-radius: 6px; }
.wcch-results .wcch-result > a:hover,
.wcch-results .wcch-result > a:focus-visible { background: var(--wcch-hover); }
.wcch-path { display: block; font-size: 12px; color: var(--wcch-muted); margin-top: 2px; }
.wcch-hl { background: none; color: var(--wcch-accent); font-weight: 700; padding: 0; }
.wcch-path .wcch-hl { font-weight: 600; }
.wcch-dsearch { padding: 10px 12px; border-bottom: 1px solid var(--wcch-line); flex: none; }
.wcch-dlist.wcch-results li { display: block; }
.wcch-dlist.wcch-results .wcch-result > a { padding: 12px 18px; border-radius: 0; }
.wcch-parents {
	flex: none; width: var(--wcch-parents-width); overflow-y: auto; overscroll-behavior: contain;
	border-right: 1px solid var(--wcch-line); padding: 8px 0;
}
.wcch-parents li > a {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 18px;
}
.wcch-parents li > a::after {
	content: ""; flex: none; width: .4em; height: .4em; opacity: .45;
	border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg);
}
.wcch-parents li.is-active > a,
.wcch-parents li > a:hover,
.wcch-parents li > a:focus-visible { background: var(--wcch-hover); color: var(--wcch-accent); }
.wcch-parents li.is-active > a::after { opacity: 1; }

.wcch-children { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px; }
.wcch-head {
	display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; padding-bottom: 10px;
	border-bottom: 1px solid var(--wcch-line);
}
.wcch-title { font-size: 17px; font-weight: 700; }
.wcch-all { margin-left: auto; color: var(--wcch-accent) !important; white-space: nowrap; }
.wcch-back { color: var(--wcch-accent); white-space: nowrap; }
.wcch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 28px; }
.wcch-card-title { font-weight: 600; display: block; }
.wcch-card-title:hover,
.wcch-card li a:hover { color: var(--wcch-accent); }
.wcch-card ul { margin-top: 6px; }
.wcch-card li a { display: block; padding: 2px 0; color: var(--wcch-muted); }
.wcch-more { margin-top: 4px; color: var(--wcch-accent); font-size: 13px; }

/* ---------- Carga progresiva ---------- */
.wcch-foot { display: flex; justify-content: center; padding: 14px 8px; min-height: 8px; }
.wcch-foot:empty { padding: 0; }
.wcch-foot .wcch-btn {
	padding: 8px 16px; border: 1px solid var(--wcch-line); border-radius: 999px; color: var(--wcch-accent);
}
.wcch-foot .wcch-btn:hover { background: var(--wcch-hover); }
.wcch-msg { color: var(--wcch-muted); }
.wcch-spin {
	width: 22px; height: 22px; border-radius: 50%;
	border: 2px solid var(--wcch-line); border-top-color: var(--wcch-accent);
	animation: wcch-spin .7s linear infinite;
}
@keyframes wcch-spin { to { transform: rotate(360deg); } }

/* ---------- Móvil: niveles a pantalla completa ---------- */
html.wcch-lock, html.wcch-lock body { overflow: hidden !important; }
.wcch-drawer { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; }
.wcch-dhead {
	display: flex; align-items: center; gap: 8px; padding: 10px 8px;
	border-bottom: 1px solid var(--wcch-line); flex: none;
}
.wcch-dhead button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.wcch-dtitle { flex: 1; font-weight: 700; font-size: 16px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcch-dbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.wcch-dlist li { display: flex; border-bottom: 1px solid var(--wcch-line); }
.wcch-dlist li > a { flex: 1; padding: 15px 18px; }
.wcch-dlist li.wcch-dall > a { color: var(--wcch-accent); font-weight: 600; }
.wcch-dlist .wcch-drill { flex: none; width: 56px; border-left: 1px solid var(--wcch-line); font-size: 22px; }
