/**
 * Huazotl — visual desktop mega menu.
 * Playground owns the navigation tree. This file only changes storefront rendering.
 */
@media (min-width: 62rem) {
  .huazotl-megamenu .huazotl-megamenu__body {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1.25rem, 2vw, 2rem);
    width: 100%;
    min-height: 20.625rem;
    padding: clamp(1.5rem, 3vw, 2.625rem) clamp(1.5rem, 5vw, 5rem) clamp(1.875rem, 4vw, 3.25rem);
    box-sizing: border-box;
    background: var(--wapu-mega-bg, var(--wtds-surface));
  }

  .huazotl-megamenu--features-1 .huazotl-megamenu__body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .huazotl-megamenu--features-2 .huazotl-megamenu__body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .huazotl-megamenu__visual-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 16px;
    background: var(--wtds-surface-2, var(--wtds-surface));
    color: var(--wtds-on-image, #fff);
    text-decoration: none;
    isolation: isolate;
  }

  .huazotl-megamenu__visual-card > img,
  .huazotl-megamenu__visual-placeholder {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
  }

  .huazotl-megamenu__visual-card > img {
    object-fit: cover;
    object-position: center;
  }

  .huazotl-megamenu__visual-placeholder {
    background: var(--wtds-surface-2, var(--wtds-surface));
  }

  .huazotl-megamenu__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: linear-gradient(to top, rgba(0, 0, 0, .58) 0%, rgba(0, 0, 0, .12) 58%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
  }

  .huazotl-megamenu__visual-title {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    color: var(--wtds-on-image, #fff);
    font-size: var(--wtds-fs-caption-2);
    font-weight: var(--wtds-fw-heading);
    letter-spacing: var(--wtds-ls-normal);
    line-height: 1.3;
    text-transform: none;
    opacity: 0;
    transform: translateY(.35rem);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
  }

  .huazotl-megamenu__visual-card:is(:hover, :focus-visible) .huazotl-megamenu__overlay,
  .huazotl-megamenu__visual-card:is(:hover, :focus-visible) .huazotl-megamenu__visual-title {
    opacity: 1;
  }

  .huazotl-megamenu__visual-card:is(:hover, :focus-visible) .huazotl-megamenu__visual-title {
    transform: translateY(0);
  }

  .huazotl-megamenu__visual-card:focus-visible {
    outline: 2px solid var(--wapu-mega-accent, var(--wtds-accent));
    outline-offset: 3px;
  }

  .huazotl-megamenu__more {
    min-width: 0;
    align-self: start;
    padding-top: .1rem;
  }

  .huazotl-megamenu__more.wapu-megamenu-v2__group--custom > strong {
    display: flex;
    width: 100%;
  }

  .huazotl-megamenu__view-all {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: var(--wtds-border-hairline) solid var(--wtds-separator-soft);
    font-weight: var(--wtds-fw-ui);
  }

  .huazotl-megamenu__view-all svg {
    width: .875rem;
    height: .875rem;
  }
}

@media (min-width: 62rem) and (prefers-reduced-motion: reduce) {
  .huazotl-megamenu__overlay,
  .huazotl-megamenu__visual-title {
    transition: none;
  }
}
