/* ==========================================================================
   Mega menu products panel (Max Mega Menu widget)
   ========================================================================== */

.almax-mega-products {
  --almax-mega-bg: #ececea;
  --almax-mega-surface: #f7f7f5;
  --almax-mega-hover: #ffffff;
  --almax-mega-link-hover: #f4f4f1;
  --almax-mega-line: rgba(37, 40, 45, 0.12);
  --almax-mega-radius: 10px;
  --almax-mega-cut: var(--almax-clip-corner, 19px);
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  width: 100%;
  max-width: 880px;
  padding: 20px;
  background: transparent;
  border-radius: var(--almax-mega-radius) 0 var(--almax-mega-radius) var(--almax-mega-radius);
  clip-path: polygon(
    0 0,
    calc(100% - var(--almax-mega-cut)) 0,
    100% var(--almax-mega-cut),
    100% 100%,
    0 100%
  );
  color: var(--color-text);
  line-height: 1.4;
  white-space: normal;
  text-align: left;
}

.almax-mega-products::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--almax-mega-bg);
  border-radius: var(--almax-mega-radius) 0 var(--almax-mega-radius) var(--almax-mega-radius);
}

.almax-mega-products a {
  color: inherit;
  text-decoration: none;
}

.almax-mega-products *,
.almax-mega-products *::before,
.almax-mega-products *::after {
  box-sizing: border-box;
}

.almax-mega-products__body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  column-gap: 20px;
  align-items: stretch;
}

.almax-mega-products__featured {
  display: flex;
  flex-direction: column;
  width: 280px;
  min-width: 0;
  overflow: visible;
}

.almax-mega-products__card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 14px;
  overflow: visible;
  color: inherit;
  text-decoration: none;
}

.almax-mega-products__card:hover,
.almax-mega-products__card:focus-visible {
  color: inherit;
  text-decoration: none;
  outline: none;
}

.almax-mega-products__card-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.almax-mega-products__card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

.almax-mega-products__card-sub {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--color-muted, #4d4d4d);
}

.almax-mega-products__card-media {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 140px;
  overflow: visible;
}

.almax-mega-products__card-media::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 100%;
  height: 140px;
  background: #e0e1de;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    var(--almax-mega-cut) 100%,
    0 calc(100% - var(--almax-mega-cut))
  );
  pointer-events: none;
}

.almax-mega-products__card-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  object-position: center bottom;
}

.almax-mega-products__rule {
  display: block;
  width: 100%;
  height: 1px;
  margin: 2px 0 15px;
  background: var(--almax-mega-line);
}

.almax-mega-products__links {
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--almax-mega-line);
  padding-left: 10px;
}

.almax-mega-products__links.has-l3 {
  padding-right: calc(50% + 6px);
}

.almax-mega-products__l2 {
  min-width: 0;
}

.almax-mega-products__l2-group {
  display: flex;
  flex-direction: column;
}

.almax-mega-products__l2-item {
  position: static;
}

.almax-mega-products__l3 {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  padding-left: 12px;
  overflow: auto;
  border-left: 1px solid var(--almax-mega-line);
}

.almax-mega-products__l2-item.is-open > .almax-mega-products__l3 {
  display: block;
}

.almax-mega-products__rule--links {
  margin: 10px 0 12px;
}

.almax-mega-products__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  color: inherit;
  text-decoration: none;
  transition: background-image 0.2s ease;
}

.almax-mega-products__link:hover,
.almax-mega-products__link:focus-visible {
  text-decoration: none;
  outline: none;
}

.almax-mega-products__link:hover::before,
.almax-mega-products__link:focus-visible::before,
.almax-mega-products__l2-item.is-open > .almax-mega-products__link::before {
  content: "";
  position: absolute;
  left: -3px;
  width: calc(100% - 6px);
  min-height: 40px;
  height: 100%;
  background: var(--almax-mega-link-hover, #f4f4f1);
  border-radius: 5px;
  pointer-events: none;
}

.almax-mega-products__icon {
  position: relative;
  z-index: 2;
  flex: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--color-accent, #F26722);
}

.almax-mega-products__icon img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.almax-mega-products__icon.is-fallback::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  background: var(--color-accent, #F26722);
}

.almax-mega-products__link-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.almax-mega-products__link-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
}

.almax-mega-products__link-sub {
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-muted, #4d4d4d);
}

.almax-mega-products__footer {
  margin-top: 14px;
}

.almax-mega-products__browse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--almax-mega-surface);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.almax-mega-products__browse:hover,
.almax-mega-products__browse:focus-visible {
  color: var(--color-text);
  text-decoration: none;
  background: var(--almax-mega-hover);
  outline: none;
}

.almax-mega-products__browse-arrow {
  font-weight: 500;
}

/* Max Mega Menu wrapper resets */
.wp-theme-almax-theme #mega-menu-wrap-primary #mega-menu-primary .mega-sub-menu {
  white-space: normal;
}

.wp-theme-almax-theme #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu:has(.almax-mega-products) {
  width: min(880px, calc(100vw - 48px));
  max-width: none;
  padding: 0;
  margin-top: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  z-index: 10;
  margin-top: 28px;
}

.wp-theme-almax-theme #mega-menu-wrap-primary .mega-sub-menu:has(.almax-mega-products) > li,
.wp-theme-almax-theme #mega-menu-wrap-primary .mega-sub-menu:has(.almax-mega-products) .mega-menu-column,
.wp-theme-almax-theme #mega-menu-wrap-primary .mega-sub-menu:has(.almax-mega-products) .mega-menu-row {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  list-style: none;
  background: transparent;
}

.wp-theme-almax-theme #mega-menu-wrap-primary .almax-mega-products-widget,
.wp-theme-almax-theme #mega-menu-wrap-primary .widget_almax_mega_products {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.wp-theme-almax-theme #mega-menu-wrap-primary .almax-mega-products-widget > .widget-title,
.wp-theme-almax-theme #mega-menu-wrap-primary .almax-mega-products-widget > h2,
.wp-theme-almax-theme #mega-menu-wrap-primary .almax-mega-products-widget > h4,
.wp-theme-almax-theme #mega-menu-wrap-primary .mega-block-title:has(+ .almax-mega-products),
.wp-theme-almax-theme #mega-menu-wrap-primary li.mega-menu-item-type-widget:has(.almax-mega-products) > .mega-menu-link {
  display: none;
}

.site-header__col--nav {
  z-index: 30;
}

@media (max-width: 860px) {
  .almax-mega-products {
    padding: 20px;
  }

  .almax-mega-products__body {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 16px;
  }

  .almax-mega-products__featured {
    width: 100%;
  }

  .almax-mega-products__links {
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
    border-top: 1px solid var(--almax-mega-line);
    padding-top: 12px;
  }

  .almax-mega-products__links.has-l3 {
    padding-right: 0;
  }

  .almax-mega-products__l3 {
    position: static;
    width: 100%;
    padding-left: 12px;
    border-left: 0;
    margin: 4px 0 8px;
  }
}

html[data-prc-theme="dark"] .almax-mega-products {
  --almax-mega-bg: #2a2d33;
  --almax-mega-surface: #32363d;
  --almax-mega-hover: #515357;
  --almax-mega-link-hover: #515357;
  --almax-mega-line: rgba(248, 250, 252, 0.12);
}

html[data-prc-theme="dark"] .almax-mega-products__card-title,
html[data-prc-theme="dark"] .almax-mega-products__link-title,
html[data-prc-theme="dark"] .almax-mega-products__browse {
  color: var(--text-primary);
}

html[data-prc-theme="dark"] .almax-mega-products__card-sub,
html[data-prc-theme="dark"] .almax-mega-products__link-sub {
  color: var(--text-secondary);
}

html[data-prc-theme="dark"] .almax-mega-products__card-media::before {
  background: var(--bg-canvas);
}

html[data-prc-theme="dark"] .almax-mega-products__browse:hover,
html[data-prc-theme="dark"] .almax-mega-products__browse:focus-visible {
  color: var(--text-primary);
}
