/**
 * Wapu Megamenu · Frontend CSS
 *
 * Estilos para los 3 layouts del dropdown · classic-icons / image-grid / tabs-featured.
 * Todas las variables son --wm-* y se inyectan inline en .wm-dropdown desde el
 * renderer PHP. El theme puede override-arlas en su propio CSS.
 *
 * @since 7.43.0
 */

/* ─── Defaults (fallbacks por si el inline no inyectó) ─────────────── */
.wm-dropdown {
	--wm-primary: #1a1a1a;
	--wm-accent: #c8102e;
	--wm-surface: #ffffff;
	--wm-surface-alt: #f5f0e6;
	--wm-text: #1a1a1a;
	--wm-text-muted: #6b7280;
	--wm-font-heading: "Playfair Display", Georgia, serif;
	--wm-font-body: "Inter", system-ui, sans-serif;
	--wm-radius: 18px;
	--wm-chip-bg: #f5f0e6;
	--wm-cols: 4;
	--wm-featured-w: 240px;
}

/* ─── Panel base ───────────────────────────────────────────────────── */
.wm-dropdown {
	background: var(--wm-surface);
	color: var(--wm-text);
	font-family: var(--wm-font-body);
	border-radius: var(--wm-radius);
	box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.18), 0 8px 24px -12px rgba(0, 0, 0, 0.08);
	padding: 28px 32px;
	max-width: 1200px;
	width: 100%;
	box-sizing: border-box;
	line-height: 1.4;
}

/* ─── Grid de columnas ─────────────────────────────────────────────── */
.wm-dropdown__grid {
	display: grid;
	grid-template-columns: repeat(var(--wm-cols), minmax(0, 1fr));
	gap: 28px 32px;
	align-items: start;
}

/* Si hay featured, fijar su ancho via última columna. */
.wm-dropdown__grid > .wm-dropdown__col--featured {
	max-width: var(--wm-featured-w);
	min-width: 220px;
}

.wm-dropdown__col {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

/* ─── Section title (eyebrow) ──────────────────────────────────────── */
.wm-section {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wm-section-title {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wm-text-muted);
	margin: 0;
}

.wm-section__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ─── Item link base ───────────────────────────────────────────────── */
.wm-item__link {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	text-decoration: none;
	color: var(--wm-text);
	padding: 6px 6px;
	margin: -6px;
	border-radius: 10px;
	transition: background 160ms ease, color 160ms ease;
}

.wm-item__link:hover,
.wm-item__link:focus-visible {
	background: var(--wm-surface-alt);
	color: var(--wm-text);
	outline: none;
}

.wm-item__link:focus-visible {
	box-shadow: 0 0 0 2px var(--wm-primary);
}

.wm-item__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.wm-item__label {
	font-size: 14px;
	font-weight: 500;
	color: var(--wm-text);
	line-height: 1.3;
}

.wm-item__subtitle {
	font-size: 11.5px;
	color: var(--wm-text-muted);
	line-height: 1.35;
}

/* ─── Section · simple (texto plano) ──────────────────────────────── */
.wm-section--simple .wm-section__list {
	gap: 8px;
}

.wm-section--simple .wm-item__link {
	padding: 4px 0;
	margin: 0;
	display: block;
}

.wm-section--simple .wm-item__link:hover {
	background: transparent;
	color: var(--wm-primary);
}

.wm-section--simple .wm-item__label {
	font-weight: 400;
	font-size: 13.5px;
}

/* ─── Item · rich (chip + label + subtitle) ───────────────────────── */
.wm-chip {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--wm-chip-bg);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
}

/* ─── Item · image (image-grid layout) ────────────────────────────── */
.wm-section__list--images {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.wm-section__list--two-col {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wm-item--image .wm-item__link {
	flex-direction: column;
	gap: 8px;
	padding: 0;
	margin: 0;
	background: transparent;
}

.wm-item--image .wm-item__link:hover .wm-item__label,
.wm-item--image .wm-item__link:focus-visible .wm-item__label {
	color: var(--wm-primary);
}

.wm-item__image {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	overflow: hidden;
	background: var(--wm-surface-alt);
	position: relative;
}

.wm-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 240ms ease;
}

.wm-item--image .wm-item__link:hover .wm-item__image img {
	transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
	.wm-item__link,
	.wm-item__image img {
		transition: none;
	}
}

/* ─── Featured card ───────────────────────────────────────────────── */
.wm-featured {
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: var(--wm-surface-alt);
	border-radius: 14px;
	padding: 14px;
	max-width: var(--wm-featured-w);
}

.wm-featured__media {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 10px;
	overflow: hidden;
	background: var(--wm-surface-alt);
}

.wm-featured__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wm-featured__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0 2px 4px;
}

.wm-featured__eyebrow {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	background: var(--wm-text);
	color: var(--wm-surface);
	padding: 4px 10px;
	border-radius: 999px;
}

.wm-featured__title {
	font-family: var(--wm-font-heading);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--wm-text);
}

.wm-featured__subtitle {
	font-size: 12.5px;
	color: var(--wm-text-muted);
	line-height: 1.4;
}

.wm-featured__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	background: var(--wm-text);
	color: var(--wm-surface);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 9px 16px;
	border-radius: 999px;
	text-decoration: none;
	margin-top: 4px;
	transition: opacity 160ms ease, transform 160ms ease;
}

.wm-featured__cta:hover,
.wm-featured__cta:focus-visible {
	opacity: 0.88;
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	.wm-featured__cta {
		transition: none;
	}
}

/* ─── Tabs layout ─────────────────────────────────────────────────── */
.wm-dropdown--tabs-featured {
	padding-top: 0;
}

.wm-tabs {
	display: flex;
	gap: 24px;
	padding: 14px 4px 18px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	margin-bottom: 22px;
	flex-wrap: wrap;
}

.wm-tab {
	background: transparent;
	border: 0;
	padding: 6px 2px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--wm-text-muted);
	cursor: pointer;
	position: relative;
	letter-spacing: 0.02em;
	transition: color 160ms ease;
}

.wm-tab:hover,
.wm-tab:focus-visible {
	color: var(--wm-text);
	outline: none;
}

.wm-tab--active {
	color: var(--wm-text);
	font-weight: 600;
}

.wm-tab--active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -19px;
	height: 2px;
	background: var(--wm-text);
	border-radius: 2px;
}

.wm-tabs__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--wm-featured-w);
	gap: 32px;
	align-items: start;
}

.wm-tabs__panes {
	min-width: 0;
}

.wm-tab-pane {
	display: none;
}

.wm-tab-pane.is-active {
	display: block;
}

.wm-tab-pane > .wm-section__list + .wm-section__list {
	margin-top: 18px;
}

.wm-tabs__featured {
	min-width: 0;
}

/* ─── Responsive · mobile ─────────────────────────────────────────── */
@media (max-width: 768px) {
	.wm-dropdown {
		padding: 20px;
		border-radius: 14px;
	}

	.wm-dropdown__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.wm-dropdown__grid > .wm-dropdown__col--featured {
		max-width: 100%;
		min-width: 0;
	}

	.wm-featured {
		max-width: 100%;
	}

	.wm-section__list--images {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wm-tabs__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.wm-tabs {
		gap: 16px;
		overflow-x: auto;
		flex-wrap: nowrap;
	}

	.wm-tab {
		flex-shrink: 0;
	}
}
