/*
 * ABN Mega Menu — front-end styles.
 *
 * Written with logical properties so the same rules work in both LTR and
 * RTL. The breakpoint is applied by JavaScript (it comes from the plugin
 * settings), which adds .abn-mm-mobile to the menu instead of a media query.
 */

.abn-mm-nav .abn-mm-item {
	position: relative;
}

/* ---------------------------------------------------------------- panel */

.abn-mm-panel {
	position: absolute;
	z-index: 9999;
	top: 100%;
	inset-inline-start: 0;
	width: max-content;
	max-width: calc(100vw - 32px);
	box-sizing: border-box;
	padding: 0;
	margin: 0;
	color: var(--abn-mm-text, #1d1d1f);
	background: var(--abn-mm-bg, #fff);
	border: 1px solid var(--abn-mm-border, #e6e6e9);
	border-radius: var(--abn-mm-radius, 10px);
	box-shadow: var(--abn-mm-shadow, 0 18px 40px -12px rgba(0, 0, 0, .22));
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
	pointer-events: none;
	text-align: start;
}

.abn-mm-panel--width-custom {
	width: var(--abn-mm-panel-width, 900px);
}

.abn-mm-panel--account,
.abn-mm-panel--cart {
	width: min(360px, calc(100vw - 32px));
}

.abn-mm-panel__inner {
	padding: 22px 24px;
	max-height: min(80vh, 760px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Open state. */
.abn-mm-item.is-open > .abn-mm-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}

/* Without JavaScript, plain hover still opens the panel. */
.abn-mm-nav:not(.abn-mm-js) .abn-mm-item:hover > .abn-mm-panel,
.abn-mm-nav:not(.abn-mm-js) .abn-mm-item:focus-within > .abn-mm-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}

/* The panel belongs to the mega item, so a theme's own dropdown CSS
   should not also try to show it. */
.abn-mm-item > .sub-menu {
	display: none;
}

/* ----------------------------------------------------------------- grid */

.abn-mm-grid {
	display: grid;
	grid-template-columns: repeat(var(--abn-mm-cols, 4), minmax(0, 1fr));
	gap: 26px 32px;
	align-items: start;
}

.abn-mm-section {
	grid-column: span var(--abn-mm-span, 1);
	min-width: 0;
}

.abn-mm-section__heading {
	display: block;
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--abn-mm-border, #e6e6e9);
	font-size: .78rem;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--abn-mm-heading, #8f8f94);
	text-decoration: none;
}

a.abn-mm-section__heading:hover,
a.abn-mm-section__heading:focus {
	color: var(--abn-mm-accent, #d2232a);
}

/* ----------------------------------------------------- vertical tabs */

.abn-mm-vtabs {
	display: grid;
	grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
	gap: 0;
	align-items: stretch;
	/* Exactly one row of tiles — measured by JS into --abn-mm-row. */
	min-height: var( --abn-mm-row, 216px );
}

.abn-mm-vtabs__rail {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-inline-end: 18px;
	border-inline-end: 1px solid var(--abn-mm-border, #e6e6e9);
}

.abn-mm-vtabs__tab {
	appearance: none;
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	font-size: .94rem;
	font-weight: 600;
	line-height: 1.6;
	text-align: start;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.abn-mm-vtabs__tab:hover {
	background: color-mix(in srgb, var(--abn-mm-border, #e6e6e9) 45%, transparent);
}

.abn-mm-vtabs__tab.is-active {
	color: var(--abn-mm-accent, #d2232a);
	background: color-mix(in srgb, var(--abn-mm-accent, #d2232a) 10%, transparent);
}

.abn-mm-vtabs__tab:focus-visible {
	outline: 2px solid var(--abn-mm-accent, #d2232a);
	outline-offset: 2px;
}

.abn-mm-vtabs__chev {
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	opacity: .45;
	/* Points at the panes: left in RTL, right in LTR. */
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
}

[dir="rtl"] .abn-mm-vtabs__chev {
	border-right: 0;
	border-left: 2px solid currentColor;
	transform: rotate(-45deg);
}

.abn-mm-vtabs__tab.is-active .abn-mm-vtabs__chev {
	opacity: 1;
}

.abn-mm-vtabs__panes {
	padding-inline-start: 24px;
}

.abn-mm-vtabs__pane {
	display: none;
}

.abn-mm-vtabs__pane.is-active {
	display: block;
	animation: abn-mm-fade .18s ease;
}

@keyframes abn-mm-fade {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: none; }
}

.abn-mm-vtabs__all {
	display: inline-block;
	margin-top: 16px;
	font-size: .86rem;
	font-weight: 700;
	color: var(--abn-mm-accent, #d2232a);
	text-decoration: none;
}

.abn-mm-vtabs__all:hover {
	text-decoration: underline;
}

/* Stack the rail above the panes once there is no room beside them. */
.abn-mm-nav.abn-mm-mobile .abn-mm-vtabs {
	grid-template-columns: minmax(0, 1fr);
	min-height: 0;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-vtabs__rail {
	flex-direction: row;
	flex-wrap: wrap;
	padding-inline-end: 0;
	padding-bottom: 12px;
	border-inline-end: 0;
	border-bottom: 1px solid var(--abn-mm-border, #e6e6e9);
}

.abn-mm-nav.abn-mm-mobile .abn-mm-vtabs__tab {
	width: auto;
	padding: 8px 12px;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-vtabs__chev {
	display: none;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-vtabs__panes {
	padding-inline-start: 0;
	padding-top: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.abn-mm-vtabs__pane.is-active {
		animation: none;
	}
}

/* ---------------------------------------------------------------- links */

.abn-mm-links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.abn-mm-links li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.abn-mm-links a {
	display: block;
	padding: 6px 0;
	font-size: .92rem;
	line-height: 1.7;
	color: inherit;
	text-decoration: none;
	transition: color .14s ease;
}

.abn-mm-links a:hover,
.abn-mm-links a:focus {
	color: var(--abn-mm-accent, #d2232a);
}

/* Any third level inside a section reads as a sub-list. */
.abn-mm-links .sub-menu {
	margin: 2px 0 6px;
	padding-inline-start: 12px;
	list-style: none;
	border-inline-start: 1px solid var(--abn-mm-border, #e6e6e9);
}

.abn-mm-links .sub-menu a {
	font-size: .86rem;
	opacity: .85;
}

/* ----------------------------------------------------- category tiles */

.abn-mm-cats {
	margin: 0;
	padding: 0;
	list-style: none;
}

.abn-mm-cats--grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
	gap: 24px 21px;
}

.abn-mm-cats--grid .abn-mm-cats__item {
	margin: 0;
	list-style: none;
}

.abn-mm-cats__link {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
	text-align: center;
	color: inherit;
	text-decoration: none;
}

.abn-mm-cats--list .abn-mm-cats__link {
	flex-direction: row;
	text-align: start;
	padding: 6px 0;
}

.abn-mm-cats__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: color-mix(in srgb, var(--abn-mm-border, #e6e6e9) 45%, transparent);
	border-radius: calc(var(--abn-mm-radius, 10px) - 2px);
}

.abn-mm-cats__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .25s ease;
}

.abn-mm-cats__link:hover .abn-mm-cats__thumb img {
	transform: scale(1.05);
}

.abn-mm-cats__name {
	display: block;
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.55;
}

.abn-mm-cats__link:hover .abn-mm-cats__name,
.abn-mm-cats__link:focus .abn-mm-cats__name {
	color: var(--abn-mm-accent, #d2232a);
}

/* Visible to screen readers only. */
.abn-mm-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Image-only tiles: no label row, so the gap goes too. */
.abn-mm-cats--imageonly .abn-mm-cats__link {
	gap: 0;
}

.abn-mm-cats__count {
	font-size: .88rem;
	font-weight: 400;
	opacity: .55;
}

/* --------------------------------------------------------- product list */

.abn-mm-products {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 12px;
}

.abn-mm-products__item {
	margin: 0;
	list-style: none;
}

.abn-mm-products__link {
	display: flex;
	gap: 12px;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

.abn-mm-products__thumb {
	flex: 0 0 84px;
	width: 84px;
}

.abn-mm-products__thumb img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.abn-mm-products__name {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
}

.abn-mm-products__price {
	display: block;
	margin-top: 4px;
	font-size: .94rem;
	color: var(--abn-mm-accent, #d2232a);
}

.abn-mm-products__link:hover .abn-mm-products__name {
	color: var(--abn-mm-accent, #d2232a);
}

/* --------------------------------------------------------------- banner */

.abn-mm-banner {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: calc(var(--abn-mm-radius, 10px) - 2px);
	text-decoration: none;
}

.abn-mm-banner__img {
	display: block;
	width: 100%;
	height: auto;
}

.abn-mm-banner__text {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: 20px 14px 12px;
	font-size: .9rem;
	font-weight: 700;
	line-height: 1.5;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent);
}

/* -------------------------------------------------------------- account */

.abn-mm-account__hello {
	margin: 0 0 12px;
	font-size: .95rem;
}

.abn-mm-account__logout {
	display: inline-block;
	margin-top: 10px;
	font-size: .86rem;
	color: var(--abn-mm-accent, #d2232a);
	text-decoration: none;
}

.abn-mm-account__note {
	margin: 0 0 12px;
	font-size: .88rem;
	opacity: .8;
}

.abn-mm-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--abn-mm-border, #e6e6e9);
}

.abn-mm-tabs__tab {
	appearance: none;
	padding: 8px 14px;
	font: inherit;
	font-size: .9rem;
	font-weight: 600;
	color: var(--abn-mm-heading, #8f8f94);
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	cursor: pointer;
}

.abn-mm-tabs__tab.is-active {
	color: var(--abn-mm-text, #1d1d1f);
	border-bottom-color: var(--abn-mm-accent, #d2232a);
}

.abn-mm-tabs__panel {
	display: none;
}

.abn-mm-tabs__panel.is-active {
	display: block;
}

.abn-mm-form__row {
	margin: 0 0 12px;
}

.abn-mm-form__row--inline {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: space-between;
	font-size: .82rem;
}

.abn-mm-form__label {
	display: block;
	margin-bottom: 4px;
	font-size: .82rem;
	font-weight: 600;
	color: var(--abn-mm-heading, #8f8f94);
}

.abn-mm-form input[type="text"],
.abn-mm-form input[type="email"],
.abn-mm-form input[type="password"] {
	box-sizing: border-box;
	width: 100%;
	padding: 9px 12px;
	font: inherit;
	font-size: .92rem;
	color: inherit;
	background: #fff;
	border: 1px solid var(--abn-mm-border, #e6e6e9);
	border-radius: 7px;
}

.abn-mm-form input:focus {
	border-color: var(--abn-mm-accent, #d2232a);
	outline: 0;
}

.abn-mm-form__check {
	display: inline-flex;
	gap: 5px;
	align-items: center;
}

.abn-mm-form__lost {
	color: var(--abn-mm-accent, #d2232a);
	text-decoration: none;
}

.abn-mm-btn {
	display: inline-block;
	width: 100%;
	padding: 11px 16px;
	font: inherit;
	font-size: .94rem;
	font-weight: 700;
	color: #fff;
	text-align: center;
	text-decoration: none;
	background: var(--abn-mm-accent, #d2232a);
	border: 0;
	border-radius: 7px;
	cursor: pointer;
	transition: filter .15s ease;
}

.abn-mm-btn:hover,
.abn-mm-btn:focus {
	filter: brightness(.92);
	color: #fff;
}

.abn-mm-btn[disabled] {
	opacity: .6;
	cursor: default;
}

.abn-mm-form__msg {
	margin-top: 10px;
	font-size: .84rem;
	line-height: 1.6;
}

.abn-mm-form__msg.is-error {
	color: #b3261e;
}

.abn-mm-form__msg.is-success {
	color: #1b7f3b;
}

/* ----------------------------------------------------------------- cart */

.abn-mm-cart .widget_shopping_cart_content {
	font-size: .9rem;
}

.abn-mm-cart ul.cart_list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* WooCommerce's mini cart ships almost no layout of its own, so the panel
   gives it one: a small fixed thumbnail with the text beside it. */
.abn-mm-cart ul.cart_list li {
	position: relative;
	margin: 0;
	padding: 12px 0;
	padding-inline-start: 58px;
	padding-inline-end: 22px;
	list-style: none;
	border-bottom: 1px solid var(--abn-mm-border, #e6e6e9);
}

.abn-mm-cart ul.cart_list li::before,
.abn-mm-cart ul.cart_list li::after {
	content: none;
}

.abn-mm-cart ul.cart_list li img {
	position: absolute;
	inset-inline-start: 0;
	top: 12px;
	width: 46px;
	height: auto;
	margin: 0;
	float: none;
	border-radius: 6px;
}

.abn-mm-cart ul.cart_list li a {
	display: block;
	font-size: .87rem;
	font-weight: 600;
	line-height: 1.6;
	color: inherit;
	text-decoration: none;
}

.abn-mm-cart ul.cart_list li a:hover {
	color: var(--abn-mm-accent, #d2232a);
}

.abn-mm-cart ul.cart_list li .quantity {
	display: block;
	margin-top: 2px;
	font-size: .82rem;
	font-weight: 400;
	opacity: .7;
}

.abn-mm-cart ul.cart_list li a.remove,
.abn-mm-cart ul.cart_list li a.remove_from_cart_button {
	position: absolute;
	inset-inline-end: 0;
	top: 12px;
	width: 20px;
	height: 20px;
	font-size: 15px;
	line-height: 20px;
	text-align: center;
	color: var(--abn-mm-heading, #8f8f94);
	border-radius: 50%;
}

.abn-mm-cart ul.cart_list li a.remove:hover {
	color: #fff;
	background: var(--abn-mm-accent, #d2232a);
}

.abn-mm-cart .woocommerce-mini-cart__empty-message {
	margin: 6px 0;
	font-size: .9rem;
	opacity: .75;
}

.abn-mm-cart .total {
	margin: 14px 0 12px;
	padding-top: 12px;
	font-size: .92rem;
	border-top: 1px solid var(--abn-mm-border, #e6e6e9);
}

.abn-mm-cart .total strong {
	font-weight: 600;
}

.abn-mm-cart .buttons {
	display: flex;
	gap: 8px;
	margin: 0;
}

.abn-mm-cart .buttons a {
	flex: 1 1 0;
	padding: 10px 12px;
	font-size: .86rem;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	border-radius: 7px;
	color: inherit;
	border: 1px solid var(--abn-mm-border, #e6e6e9);
}

.abn-mm-cart .buttons a.checkout {
	color: #fff;
	background: var(--abn-mm-accent, #d2232a);
	border-color: var(--abn-mm-accent, #d2232a);
}

.abn-mm-cart-count {
	display: inline-flex;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	font-size: .72rem;
	font-weight: 700;
	line-height: 20px;
	color: #fff;
	align-items: center;
	justify-content: center;
	background: var(--abn-mm-accent, #d2232a);
	border-radius: 999px;
	vertical-align: middle;
}

.abn-mm-cart-count.is-empty {
	display: none;
}

/* -------------------------------------------------------------- overlay */

.abn-mm-overlay {
	position: fixed;
	inset: 0;
	z-index: 9990;
	background: rgba(0, 0, 0, .34);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s;
	pointer-events: none;
}

.abn-mm-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}

/* ------------------------------------------------------- mobile / small */

.abn-mm-nav.abn-mm-mobile .abn-mm-panel {
	position: static;
	width: auto;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .22s ease;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-item.is-open > .abn-mm-panel {
	grid-template-rows: 1fr;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-panel__inner {
	overflow: hidden;
	min-height: 0;
	max-height: none;
	padding: 0;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-item.is-open > .abn-mm-panel > .abn-mm-panel__inner {
	padding: 12px 0 16px;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-grid {
	grid-template-columns: 1fr;
	gap: 18px;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-section {
	grid-column: auto;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-cats--grid {
	grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
	gap: 16px 14px;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-cats__name {
	font-size: .88rem;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-cats__link {
	gap: 8px;
}

/* A toggle button is added by JavaScript next to mega items on mobile. */
.abn-mm-toggle-btn {
	appearance: none;
	display: none;
	width: 34px;
	height: 34px;
	padding: 0;
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
}

.abn-mm-nav.abn-mm-mobile .abn-mm-toggle-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.abn-mm-toggle-btn::before {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform .2s ease;
}

.abn-mm-item.is-open > .abn-mm-toggle-btn::before {
	transform: rotate(225deg) translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.abn-mm-panel,
	.abn-mm-overlay,
	.abn-mm-cats__thumb img,
	.abn-mm-toggle-btn::before {
		transition: none;
	}
}
