/* Ditable Category Nav — frontend styles.
   Accent, breakpoints, columns and typography are injected as CSS custom
   properties (--dcn-*) on the .dcn wrapper. Device layout is driven by the
   .dcn-tb / .dcn-mb classes (applied by JS on the live site, and by the
   settings preview to simulate tablet / phone). */

.dcn {
	--dcn-accent: #52b148;
	--dcn-ink: #111418;
	--dcn-soft: #3a3f45;
	--dcn-line: #e5e7eb;
	--dcn-bg: #f7f9f7;
	/* Column count: desktop defaults to the --dcn-cols-dt value (rendered),
	   then .dcn-tb / .dcn-mb override it for tablet / mobile. */
	--dcn-cols: var(--dcn-cols-dt, 4);
	--dcn-radius: 12px;
	/* Typography (only the properties the renderer emits are changed). */
	font-family: var(--dcn-font-family, inherit);
	letter-spacing: var(--dcn-letter-spacing, normal);
	line-height: var(--dcn-line-height, inherit);
	box-sizing: border-box;
}
.dcn *,
.dcn *::before,
.dcn *::after {
	box-sizing: border-box;
}

/* Icons (image / emoji) */
.dcn-icon-img {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.dcn-icon-img img {
	width: 22px;
	height: 22px;
	object-fit: contain;
	border-radius: 4px;
}
.dcn-icon-emoji {
	font-size: 20px;
	line-height: 1;
}

/* Badges */
.dcn-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: .4px;
	text-transform: uppercase;
	color: #fff;
	background: var(--dcn-accent);
	border-radius: 999px;
	vertical-align: middle;
}

/* ── Grid layout ─────────────────────────────────────────────────────── */
.dcn-grid-inner {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(var(--dcn-cols, 4), minmax(0, 1fr));
}
.dcn-tile {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 20px 18px;
	background: #fff;
	border: 1px solid var(--dcn-line);
	border-radius: var(--dcn-radius, 12px);
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dcn-tile.has-icon {
	padding-top: 16px;
}
.dcn-tile:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .18);
	border-color: var(--dcn-accent);
}
.dcn-tile-name {
	font-size: var(--dcn-font-size, 16px);
	font-weight: var(--dcn-font-weight, 700);
	color: var(--dcn-menu-color, var(--dcn-ink));
}
.dcn-tile:hover .dcn-tile-name {
	color: var(--dcn-accent);
}
.dcn-tile-count {
	font-size: 12px;
	color: var(--dcn-soft);
}
.dcn-tile-children {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin-top: 4px;
}
.dcn-tile-child a {
	font-size: 12px;
	color: var(--dcn-soft);
	text-decoration: none;
}
.dcn-tile-child a:hover {
	color: var(--dcn-accent);
	text-decoration: underline;
}

/* ── Mega layout ─────────────────────────────────────────────────────── */
.dcn-mega {
	position: relative;
}
.dcn-mega-bar {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 4px;
	background: #fff;
	border: 1px solid var(--dcn-line);
	border-radius: var(--dcn-radius, 12px);
	padding: 8px;
	position: relative;
	z-index: 20;
}
.dcn-mega.sticky .dcn-mega-bar {
	position: sticky;
	top: 0;
	z-index: 9990;
}
.dcn-mega-item {
	position: relative;
}
.dcn-mega-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	border-radius: 8px;
	font-weight: var(--dcn-font-weight, 600);
	font-size: var(--dcn-font-size, 14px);
	color: var(--dcn-menu-color, var(--dcn-ink));
	text-decoration: none;
	white-space: nowrap;
	outline: none;
}
.dcn-mega-link:hover,
.dcn-mega-link:focus {
	background: var(--dcn-bg);
	color: var(--dcn-accent);
}
.dcn-mega-count {
	font-size: 11px;
	font-weight: 600;
	color: var(--dcn-accent);
	background: var(--dcn-bg);
	border-radius: 999px;
	padding: 1px 7px;
}

/* Dropdown panel */
.dcn-mega-panel {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	width: max-content;
	min-width: 480px;
	max-width: 92vw;
	background: #fff;
	border: 1px solid var(--dcn-line);
	border-radius: 0 0 var(--dcn-radius, 12px) var(--dcn-radius, 12px);
	box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .2);
	padding: 16px;
	z-index: 999;
}
.dcn-mega-item:hover > .dcn-mega-panel,
.dcn-mega-item:focus-within > .dcn-mega-panel,
.dcn-mega-item.open > .dcn-mega-panel {
	display: block;
}
/* Focus still opens the panel (keyboard); hover also opens it so a click on a
   parent category name always navigates to that category page. */
.dcn.trigger-click .dcn-mega-item.open > .dcn-mega-panel,
.dcn.trigger-click .dcn-mega-item:focus-within > .dcn-mega-panel {
	display: block;
}

/* Subcategory columns inside the panel */
.dcn-mega-subs {
	display: grid;
	grid-template-columns: repeat(var(--dcn-cols, 3), minmax(0, 1fr));
	gap: 10px 22px;
}
.dcn-mega-col-item {
	position: relative;
	display: flex;
	flex-direction: column;
}
.dcn-mega-sub {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 6px 8px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--dcn-ink);
	text-decoration: none;
}
.dcn-mega-sub:hover,
.dcn-mega-sub:focus {
	background: var(--dcn-bg);
	color: var(--dcn-accent);
}
.dcn-mega-sub-count {
	font-size: 11px;
	color: var(--dcn-soft);
}

/* Nested flyouts (2+ levels deep) */
.dcn-mega-nested {
	display: none;
	position: absolute;
	left: calc(100% + 2px);
	top: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--dcn-line);
	border-radius: 8px;
	box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .18);
	padding: 6px;
	z-index: 1000;
}
.dcn-nested-item {
	position: relative;
}
.dcn-nested-item.has-nested > a::after {
	content: "›";
	margin-left: 8px;
	color: var(--dcn-soft);
}
.dcn-nested-item > a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 10px;
	font-size: 13px;
	color: var(--dcn-ink);
	text-decoration: none;
	border-radius: 5px;
	white-space: nowrap;
}
.dcn-nested-item > a:hover,
.dcn-nested-item > a:focus {
	background: var(--dcn-bg);
	color: var(--dcn-accent);
}
.dcn-nested-item:hover > .dcn-mega-nested,
.dcn-nested-item:focus-within > .dcn-mega-nested {
	display: block;
}
.dcn-nested-count {
	font-size: 11px;
	color: var(--dcn-soft);
}

/* Panel extras: featured products + custom content */
.dcn-featured {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--dcn-line);
}
.dcn-featured-title {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: var(--dcn-soft);
	margin: 0 0 8px;
}
.dcn-featured-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}
.dcn-featured-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-decoration: none;
	font-size: 12px;
	color: var(--dcn-ink);
}
.dcn .dcn-featured-item img {
	width: 100%;
	max-width: var(--dcn-featured-size, 100%);
	height: auto;
	margin: 0 auto 4px;
	border-radius: 6px;
}
.dcn-featured-name {
	font-weight: 600;
	line-height: 1.3;
}
.dcn-featured-price {
	color: var(--dcn-accent);
	font-weight: 600;
}
.dcn-panel-content {
	margin-top: 12px;
	font-size: 14px;
}

/* Cart + search in the bar */
.dcn-cart,
.dcn-search {
	margin-left: auto;
	display: flex;
	align-items: center;
}
.dcn-cart-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 10px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--dcn-ink);
}
.dcn-cart-link:hover {
	background: var(--dcn-bg);
	color: var(--dcn-accent);
}
.dcn-cart-icon {
	font-size: 20px;
}
.dcn-cart-count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
	color: #fff;
	background: var(--dcn-accent);
	border-radius: 999px;
}
.dcn-search form {
	margin: 0;
	display: flex;
}
.dcn-search input {
	max-width: 160px;
}

/* Drawer button (mobile) */
.dcn-drawer-btn {
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 4px;
	width: 40px;
	height: 40px;
	margin-left: 4px;
	border: none;
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
}
.dcn-drawer-btn span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--dcn-ink);
	border-radius: 2px;
}

/* Off-canvas drawer */
.dcn-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(360px, 92vw);
	background: #fff;
	box-shadow: -20px 0 40px rgba(0, 0, 0, .15);
	transform: translateX(100%);
	transition: transform .25s ease;
	z-index: 9999;
	overflow-y: auto;
}
.dcn.drawer-open .dcn-drawer {
	transform: translateX(0);
}
.dcn-drawer-inner {
	padding: 24px 16px;
}
.dcn-drawer-inner .dcn-mega-item {
	position: static;
}
.dcn-drawer-inner .dcn-mega-link {
	white-space: normal;
	width: 100%;
	justify-content: space-between;
}
.dcn-drawer-inner .dcn-mega-panel,
.dcn-drawer-inner .dcn-mega-nested {
	position: static;
	display: block;
	min-width: 0;
	width: 100%;
	box-shadow: none;
	border: none;
	border-left: 2px solid var(--dcn-line);
	border-radius: 0;
	margin-left: 8px;
	padding-left: 8px;
}
body.dcn-lock {
	overflow: hidden;
}

/* ── Tabs layout ─────────────────────────────────────────────────────── */
.dcn-tabs {
	display: flex;
	align-items: stretch;
}
.dcn-tabs-nav {
	display: flex;
	flex-direction: column;
	flex: 0 0 220px;
	background: var(--dcn-bg);
	border: 1px solid var(--dcn-line);
	border-radius: var(--dcn-radius, 12px) 0 0 var(--dcn-radius, 12px);
	padding: 8px;
}
.dcn-tab-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 12px;
	border: none;
	border-radius: 8px;
	background: transparent;
	text-align: left;
	font-size: var(--dcn-font-size, 14px);
	font-weight: var(--dcn-font-weight, 600);
	color: var(--dcn-menu-color, var(--dcn-ink));
	cursor: pointer;
}
.dcn-tab-item:hover,
.dcn-tab-item:focus {
	background: #fff;
	color: var(--dcn-accent);
	outline: none;
}
.dcn-tab-item.active {
	background: #fff;
	color: var(--dcn-accent);
	box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .2);
}
.dcn-tab-name {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	text-decoration: none;
	outline: none;
	cursor: pointer;
}
.dcn-tabs-body {
	flex: 1;
	border: 1px solid var(--dcn-line);
	border-left: none;
	border-radius: 0 var(--dcn-radius, 12px) var(--dcn-radius, 12px) 0;
	background: #fff;
	padding: 20px;
	min-height: 220px;
}
.dcn-tabs-panel {
	display: none;
}
.dcn-tabs-panel.active {
	display: block;
}
.dcn-tabs-panel.active .dcn-mega-subs {
	display: grid;
	grid-template-columns: repeat(var(--dcn-cols, 3), minmax(0, 1fr));
	gap: 12px 24px;
}

/* ── Pills layout ────────────────────────────────────────────────────── */
.dcn-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.dcn-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	background: #fff;
	border: 1px solid var(--dcn-line);
	border-radius: 999px;
	font-size: var(--dcn-font-size, 14px);
	font-weight: var(--dcn-font-weight, 600);
	color: var(--dcn-menu-color, var(--dcn-ink));
	text-decoration: none;
	transition: border-color .15s ease, background .15s ease;
}
.dcn-pill:hover {
	border-color: var(--dcn-accent);
	background: var(--dcn-bg);
	color: var(--dcn-accent);
}
.dcn-pill-count {
	font-size: 11px;
	font-weight: 600;
	color: var(--dcn-accent);
	background: var(--dcn-bg);
	border-radius: 999px;
	padding: 1px 7px;
}

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes dcn-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes dcn-slide {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: translateY(0); }
}
.dcn.anim-fade .dcn-mega-panel,
.dcn.anim-fade .dcn-mega-nested {
	animation: dcn-fade .18s ease;
}
.dcn.anim-slide .dcn-mega-panel,
.dcn.anim-slide .dcn-mega-nested {
	animation: dcn-slide .18s ease;
}

/* Vertical orientation */
.dcn.orientation-vertical .dcn-mega-bar {
	flex-direction: column;
	align-items: stretch;
	width: max-content;
	min-width: 220px;
}
.dcn.orientation-vertical .dcn-mega-link {
	justify-content: space-between;
	width: 100%;
}
.dcn.orientation-vertical .dcn-mega-panel {
	left: calc(100% + 4px);
	top: 0;
	border-radius: 0 var(--dcn-radius, 12px) var(--dcn-radius, 12px) 0;
}

/* Mobile: collapse to drawer (JS toggles .dcn-mobile below the breakpoint) */
.dcn.dcn-mobile .dcn-mega-bar > .dcn-mega-item {
	display: none;
}
.dcn.dcn-mobile .dcn-cart,
.dcn.dcn-mobile .dcn-search {
	display: none;
}
.dcn.dcn-mobile .dcn-drawer-btn {
	display: flex;
}
.dcn.dcn-mobile .dcn-mega-bar {
	justify-content: flex-end;
}

/* ── Device-aware columns + mobile polish ───────────────────────────────
   JS applies .dcn-tb / .dcn-mb on the live site by viewport width; the
   settings preview applies them directly to emulate tablet / phone. */
.dcn-tb {
	--dcn-cols: var(--dcn-cols-tb, 3);
}
.dcn-mb {
	--dcn-cols: var(--dcn-cols-mb, 1);
	--dcn-font-size: calc(var(--dcn-font-size, 15px) * .9);
}
.dcn-mb .dcn-mega-subs {
	gap: 6px 12px;
}
.dcn-mb .dcn-featured-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dcn-mb .dcn-tile {
	padding: 14px;
}
/* On phones, hide product counts and the featured strip to keep it clean. */
.dcn-mb .dcn-tile-count,
.dcn-mb .dcn-mega-count,
.dcn-mb .dcn-pill-count,
.dcn-mb .dcn-nested-count,
.dcn-mb .dcn-mega-sub-count {
	display: none;
}
/* Tabs stack to a horizontal scroller on phones. */
.dcn-mb .dcn-tabs {
	flex-direction: column;
}
.dcn-mb .dcn-tabs-nav {
	flex: none;
	flex-direction: row;
	align-items: center;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	border-radius: var(--dcn-radius, 12px);
	padding: 6px;
}
.dcn-mb .dcn-tabs-nav::-webkit-scrollbar {
	display: none;
}
.dcn-mb .dcn-tab-item {
	flex: 0 0 auto;
	white-space: nowrap;
	text-align: center;
	padding: 9px 14px;
	border-radius: 999px;
	border: 1px solid var(--dcn-line);
	background: var(--dcn-bg);
}
.dcn-mb .dcn-tab-item.active {
	background: var(--dcn-accent);
	border-color: var(--dcn-accent);
	color: #fff;
	box-shadow: none;
}
.dcn-mb .dcn-tab-item:hover,
.dcn-mb .dcn-tab-item:focus {
	background: var(--dcn-accent);
	border-color: var(--dcn-accent);
	color: #fff;
}
.dcn-mb .dcn-tabs-body {
	border-left: 1px solid var(--dcn-line);
	border-radius: 0 0 var(--dcn-radius, 12px) var(--dcn-radius, 12px);
	padding: 14px;
	min-height: 0;
}
.dcn-mb .dcn-tabs-panel.active .dcn-mega-subs {
	grid-template-columns: 1fr;
	gap: 4px 0;
}
.dcn-mb .dcn-tabs-panel .dcn-mega-col-item {
	padding: 8px 0;
	border-bottom: 1px solid var(--dcn-line);
}
.dcn-mb .dcn-tabs-panel .dcn-mega-col-item:last-child {
	border-bottom: none;
}
.dcn-mb .dcn-tabs-panel .dcn-featured-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

/* ── Settings preview frames ─────────────────────────────────────────── */
.dcn-preview-box.dcn-frame-tb {
	max-width: 768px;
}
.dcn-preview-box.dcn-frame-mb {
	max-width: 390px;
}

/* ── Admin preview: render the phone menu's drawer inline ────────────────
   In the settings preview the off-canvas drawer is position:fixed to the
   window, so it would fly off the page — we render it inline instead. The
   hamburger stays visible (as on the real mobile menu) and the drawer's
   sub-menus are expanded in place. Scoped to .dcn-preview-box, so the live
   site is unaffected. */
.dcn-preview-box .dcn-mb .dcn-drawer {
	position: static;
	transform: none;
	width: 100%;
	box-shadow: none;
	overflow: visible;
	max-height: none;
	margin-top: 8px;
}