.header__megamenu--links {
  .childlink_megamenu--item {
    grid-column: var(--megamenu-grid-span);
  }

  .header__megamenu--parent details:not(.mega-menu) .childlink_megamenu--item {
    display: none;
  }

  .megamenu-grid--heading {
    font-size: var(--megamenu-grid-title-size);
    font-weight: var(--megamenu-grid-title-weight);
    text-transform: var(--megamenu-grid-title-case);
  }

  .megamenu-grid--layout {
    margin-block: 0;
  }

  .megamenu-layout-gap--inherit,
  .childlink_megamenu--item:has(.megamenu-layout-gap--inherit) {
    gap: inherit;
  }

  .megamenu-layout-gap--inherit {
    display: grid;
    grid-template-columns: repeat(var(--megamenu-grid-layout-columns), minmax(auto,1fr));

    & > .grid__item {
      width: 100%;
      max-width: 100%;
    }
  }

  .megamenu-card--card {
    .megamenu-card--content {
      position: absolute;
      inset: 0;
      z-index: 1;
    }

    .megamenu-card--content {
      display: flex;
      flex-wrap: wrap;
      align-items: var(--megamenu-card-content-position);
    }

    .megamenu-card--info {
      width: 100%;
      padding-block-start: var(--megamenu-card-padding-block-start);
      padding-block-end: var(--megamenu-card-padding-block-end);
      padding-inline-start: var(--megamenu-card-padding-inline-start);
      padding-inline-end: var(--megamenu-card-padding-inline-end);
    }
  }

  .megamenu-card--standard {
    padding-block-start: var(--megamenu-card-padding-block-start);
    padding-block-end: var(--megamenu-card-padding-block-end);
    padding-inline-start: var(--megamenu-card-padding-inline-start);
    padding-inline-end: var(--megamenu-card-padding-inline-end);

    .megamenu-card--content:not(:first-child) {
      margin-block-start: var(--megamenu-card-gap);
    }
  }

  .megamenu-card--media {
    .media {
      padding-top: var(--ratio-percent);
    }

    img,
    svg {
      object-fit: var(--megamenu-card-media-fit);
    }
  }

  .megamenu-card--info {
    text-align: var(--megamenu-card-align);

    & > * {
      margin-bottom: 0;
    }

    & > *:first-child {
      margin-top: 0;
    }

    & > * + * {
      margin-top: var(--megamenu-card-gap);
    }
  }

  .megamenu-card--link:empty {
    display: block;
  }

  .megamenu-card--link {
    position: absolute;
    inset: 0;
    z-index: 2;
  }

  .megamenu-card--overlay .media::after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    background: var(--megamenu-card-overlay);
    z-index: 1;
  }

  .megamenu-card--heading {
    font-size: var(--megamenu-card-title-size);
    font-weight: var(--megamenu-card-title-weight);
    text-transform: var(--megamenu-card-title-case);
  }
}