/**
 * Andison Interactive Header Menus — hover panels.
 * Colours come from CSS custom properties set inline by the plugin.
 */

:root {
	--aihm-accent: #00d7b3;
	--aihm-text: #222;
	--aihm-bg: #fff;
	--aihm-border: #e3e3e3;
	--aihm-muted: #5b6470;
}

li.aihm-item {
	position: relative;
}

.aihm-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 9999;
	min-width: 240px;
	max-width: min(560px, 92vw);
	margin-top: 10px;
	padding: 18px 20px;
	background: var(--aihm-bg);
	color: var(--aihm-text);
	border: 1px solid var(--aihm-border);
	border-top: 3px solid var(--aihm-accent);
	border-radius: 8px;
	box-shadow: 0 12px 34px rgba(20, 27, 45, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
	text-align: left;
	line-height: 1.5;
}

li.aihm-item.aihm-open > .aihm-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}

/* Little pointer bridging the gap so hover doesn't drop. */
.aihm-panel::before {
	content: "";
	position: absolute;
	top: -10px;
	left: 0;
	right: 0;
	height: 10px;
}

.aihm-panel__title {
	font-size: 15px;
	font-weight: 700;
	color: var(--aihm-text);
	margin: 0 0 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--aihm-border);
	letter-spacing: 0.02em;
}

.aihm-panel__msg {
	margin: 0;
	font-size: 14px;
	color: var(--aihm-muted);
	max-width: 300px;
}

.aihm-panel--message {
	min-width: 260px;
}

/* Link lists */
.aihm-panel__links {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 220px;
}

.aihm-panel__links li {
	margin: 0;
	padding: 0;
}

.aihm-panel__links a {
	display: block;
	padding: 9px 10px;
	margin: 1px 0;
	font-size: 14px;
	color: var(--aihm-text);
	text-decoration: none;
	border-radius: 6px;
	transition: background 0.14s ease, color 0.14s ease, padding-left 0.14s ease;
}

.aihm-panel__links a:hover,
.aihm-panel__links a:focus {
	background: rgba(0, 0, 0, 0.04);
	color: var(--aihm-accent);
	padding-left: 15px;
}

/* Brand logo grid — exactly 5 columns LTR/TTB (Website Design BRANDS sheet). */
.aihm-panel--brands {
	width: min(1100px, 96vw);
	max-width: 96vw;
}

.aihm-brands {
	display: grid !important;
	grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
	gap: 10px 12px;
	max-height: none;
	overflow: visible;
	align-items: stretch;
}

.aihm-brands__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	padding: 10px 8px 8px;
	background: #fff;
	border: 1px solid var(--aihm-border);
	border-radius: 6px;
	min-height: 88px;
	min-width: 0;
	text-decoration: none;
	text-align: center;
	color: var(--aihm-text);
	transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.aihm-brands__item:hover,
.aihm-brands__item:focus {
	border-color: var(--aihm-accent);
	box-shadow: 0 4px 12px rgba(20, 27, 45, 0.12);
	transform: translateY(-1px);
	text-decoration: none;
	color: var(--aihm-text);
}

.aihm-brands__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
}

.aihm-brands__item img {
	max-width: 100%;
	max-height: 44px;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: none;
}

/* Combined SK + GAL Gage tile — side by side. */
.aihm-brands__item[href*="/brand/sk/"] img {
	max-height: 44px;
	max-width: 100%;
}

.aihm-brands__cap {
	display: block;
	width: 100%;
	font-size: 10px;
	line-height: 1.25;
	color: var(--aihm-muted);
	font-weight: 500;
}

/* Woodmart mobile menu: our panels are a desktop-hover enhancement only. */
@media (max-width: 768px) {
	.aihm-panel {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aihm-panel {
		transition: opacity 0.01s, visibility 0s;
		transform: none;
	}
	li.aihm-item.aihm-open > .aihm-panel {
		transform: none;
	}
	.aihm-panel__links a:hover {
		padding-left: 10px;
	}
}
