/* ===== MEGA MENU PANELS ===== */

.mega-menu-panel {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	max-height: 480px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	z-index: 999;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.mega-menu-panel.active {
	display: block;
	opacity: 1;
}

/* Ensure nav is positioning context */
.main-nav {
	position: relative !important;
}

.mega-menu-inner {
	max-width: 1600px;
	margin: 0 auto;
	padding: 0;
}

/* Highlight active nav item */
.nav-menu > li.mega-open > a {
	color: var(--gb-gold) !important;
}

/* Hide default dropdown arrow on mega menu items */
.nav-menu > li.has-mega-menu.menu-item-has-children > a::after {
	content: ' \25BC' !important;
}


/* ──────────────────────────────────────────────
   BUY MEGA MENU
   ────────────────────────────────────────────── */

.mega-menu-buy-panel .mega-menu-inner {
	display: grid;
	grid-template-columns: 200px 1fr;
	height: 480px;
}

/* Left column: top-level categories */
.mega-menu-categories {
	display: flex;
	flex-direction: column;
	border-right: 1px solid #e5e5e5;
	background: #f8f8f8;
	padding: 0.75rem 0;
}

.mega-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1.25rem;
	color: var(--gb-text, #333);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.mega-cat::after {
	content: '\203A';
	font-size: 1.1rem;
	color: #999;
	transition: color 0.15s;
}

.mega-cat:hover,
.mega-cat.active {
	background: #fff;
	color: var(--gb-navy, #1a2744);
	font-weight: 600;
}

.mega-cat.active::after {
	color: var(--gb-navy, #1a2744);
}

/* Right area: content panes */
.mega-menu-content {
	padding: 1.25rem 1.5rem;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.mega-content-pane {
	display: none !important;
}

.mega-content-pane.active {
	display: flex !important;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

.mega-subcat-pane {
	display: none !important;
}

.mega-subcat-pane.active {
	display: block !important;
}


/* ── Layout: category WITH subcategories (e.g. Gold Coins) ── */

.mega-pane-with-subcats {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 0 1.25rem;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.mega-subcats {
	display: flex;
	flex-direction: column;
	border-right: 1px solid #e5e5e5;
	padding-right: 1rem;
	overflow-y: auto;
}

.mega-subcat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.55rem 0.65rem;
	color: var(--gb-text, #333);
	font-size: 0.85rem;
	text-decoration: none;
	border-radius: 4px;
	transition: background 0.15s, color 0.15s;
}

.mega-subcat::after {
	content: '\203A';
	font-size: 1rem;
	color: #999;
	margin-left: 0.5rem;
}

.mega-subcat:hover,
.mega-subcat.active {
	background: #f0f0f0;
	color: var(--gb-navy, #1a2744);
	font-weight: 500;
}

.mega-subcat-content {
	overflow-y: auto;
}

.mega-section-title {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--gb-navy, #1a2744);
	margin: 0 0 0.75rem 0;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--gb-gold, #c5a44e);
}


/* ── Layout: category WITHOUT subcategories (e.g. Gold Bars, Silver Bars) ── */

.mega-pane-products {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}


/* ── Product grid with thumbnails ── */

.mega-product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 0.75rem 1rem;
}

.mega-product-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none;
	padding: 0.5rem 0.25rem;
	border-radius: 4px;
	transition: background 0.15s;
}

.mega-product-card:hover {
	background: #f5f5f5;
}

.mega-product-img {
	width: 70px;
	height: 70px;
	object-fit: contain;
	margin-bottom: 0.35rem;
	display: block;
}

.mega-product-noimg {
	background: #f0f0f0;
	border-radius: 4px;
}

.mega-product-name {
	font-size: 0.75rem;
	color: var(--gb-text, #333);
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mega-product-card:hover .mega-product-name {
	color: var(--gb-gold, #c5a44e);
}


/* ── CTA button ── */

.mega-menu-cta {
	padding-top: 0.75rem;
	flex-shrink: 0;
	text-align: center;
}

.mega-cta-main {
	margin-top: auto;
	padding-top: 0.75rem;
	border-top: 1px solid #f0f0f0;
	text-align: center;
}

.mega-cta-btn {
	display: inline-block;
	padding: 0.5rem 1.25rem;
	background: var(--gb-gold, #c5a44e);
	color: #fff !important;
	font-size: 0.82rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: 3px;
	transition: background 0.2s;
}

.mega-cta-btn:hover {
	background: var(--gb-navy, #1a2744);
}


/* ──────────────────────────────────────────────
   SELL MEGA MENU
   ────────────────────────────────────────────── */

.mega-menu-sell-panel {
	max-height: none;
}

.mega-sell-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 2rem;
	padding: 1.5rem 2rem;
}

.mega-sell-col {
	text-align: left;
}

.mega-sell-image {
	margin-bottom: 0.75rem;
	border-radius: 4px;
	overflow: hidden;
}

.mega-sell-image img {
	width: 100%;
	height: 100px;
	object-fit: cover;
	display: block;
}

.mega-sell-title {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--gb-navy, #1a2744);
	margin: 0 0 0.6rem 0;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--gb-gold, #c5a44e);
}

.mega-sell-title-extra {
	margin-top: 1rem;
	font-size: 0.85rem;
}

.mega-sell-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-sell-links li {
	margin: 0;
}

.mega-sell-links a {
	display: block;
	padding: 0.4rem 0;
	color: var(--gb-text, #333);
	font-size: 0.85rem;
	text-decoration: none;
	transition: color 0.15s;
}

.mega-sell-links a:hover {
	color: var(--gb-gold, #c5a44e);
}

.mega-sell-links a.mega-sell-highlight {
	font-weight: 700;
	color: var(--gb-navy, #1a2744);
}


/* ──────────────────────────────────────────────
   MOBILE: HIDE MEGA MENU
   ────────────────────────────────────────────── */

@media (max-width: 768px) {
	.mega-menu-panel,
	.mega-menu-panel.active {
		display: none !important;
		opacity: 0 !important;
	}
}
