/* Timbershacks */

:root {
	--ts-tan:        #a86f38;
	--ts-brown:      #5a321c;
	--ts-deep-brown: #24170f;
	--ts-cream:      #f3ebdd;
}

/* Overlay wrapper */
.mega-menu-overlay {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	z-index: 9999;
	background: var(--ts-deep-brown);
	border-top: 3px solid var(--ts-tan);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
	padding: 0;
}

.mega-menu-overlay.is-open {
	display: block;
	animation: megaFadeUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes megaFadeUp {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Inner grid — single row, full width */
.mega-menu-inner {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 0;
}

/* Individual card */
.mega-menu-card {
	padding: 30px 22px;
	border-right: 1px solid rgba(243, 235, 221, 0.1);
	transition: background 0.18s ease;
	text-decoration: none;
	display: flex;
	flex-direction: column;
	color: inherit;
}

.mega-menu-card:last-child {
	border-right: none;
}

.mega-menu-card:hover,
.mega-menu-card:focus-visible {
	background: rgba(168, 111, 56, 0.14);
}

.mega-menu-card:focus-visible {
	outline: 2px solid var(--ts-tan);
	outline-offset: -2px;
}

/* Category name */
.mega-menu-card__label {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--ts-cream);
	margin: 0 0 10px 0;
	line-height: 1.3;
}

/* Description */
.mega-menu-card__desc {
	font-size: 13px;
	line-height: 1.65;
	color: rgba(243, 235, 221, 0.72);
	margin: 0 0 18px 0;
	flex-grow: 1;
}

/* Shop link */
.mega-menu-card__link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
	color: var(--ts-cream);
	text-decoration: none;
	letter-spacing: 0.03em;
	border-bottom: 1px solid rgba(168, 111, 56, 0.6);
	padding-bottom: 2px;
	transition: color 0.15s ease, border-color 0.15s ease;
	align-self: flex-start;
	margin-top: auto;
}

.mega-menu-card:hover .mega-menu-card__link,
.mega-menu-card:focus-visible .mega-menu-card__link {
	color: var(--ts-tan);
	border-bottom-color: var(--ts-tan);
}

.mega-menu-card__link::after {
	content: '\2192';
	transition: transform 0.15s ease;
}

.mega-menu-card:hover .mega-menu-card__link::after {
	transform: translateX(3px);
}

/* Backdrop */
.mega-menu-backdrop {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9998;
	background: rgba(36, 23, 15, 0.35);
	cursor: default;
}

.mega-menu-backdrop.is-open {
	display: block;
}

/* Active nav item */
.shop-mega-menu--active > .menu-link,
.shop-mega-menu--active > a {
	color: var(--ts-tan) !important;
}

/* Trigger chevron (desktop header only) — points down, flips up while open */
#ast-desktop-header .shop-mega-menu > a::after {
	content: '' !important;
	display: inline-block !important;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	vertical-align: middle;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.25s ease;
}

#ast-desktop-header .shop-mega-menu--active > a::after {
	transform: translateY(2px) rotate(225deg);
}

/* Tablet: 3 cols */
@media (max-width: 1024px) {
	.mega-menu-inner {
		grid-template-columns: repeat(3, 1fr);
	}

	.mega-menu-card {
		border-right: 1px solid rgba(243, 235, 221, 0.1);
		border-bottom: 1px solid rgba(243, 235, 221, 0.1);
	}

	.mega-menu-card:nth-child(3n) { border-right: none; }
	.mega-menu-card:nth-child(4),
	.mega-menu-card:nth-child(5),
	.mega-menu-card:nth-child(6)  { border-bottom: none; }
}

/* Mobile: hide */

@media (max-width: 768px) {
	.mega-menu-overlay,
	.mega-menu-backdrop {
		display: none !important;
	}
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
	.mega-menu-overlay.is-open { animation: none; }
	.mega-menu-card,
	.mega-menu-card__link,
	.mega-menu-card__link::after,
	#ast-desktop-header .shop-mega-menu > a::after { transition: none; }
}