.etac-footer-mega-menu {
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--etac-text, #0b1220);
}

.etac-footer-mega-menu__inner {
  width: min(1234px, 100%);
  margin: 0 auto;
  padding: 0 28px 28px 28px;
}

.etac-footer-mega-menu__intro {
  margin: 0;
  padding-top: calc(var(--wp--preset--spacing--large, 32px) + var(--wp--preset--spacing--large, 32px));
  padding-bottom: var(--wp--preset--spacing--large, 32px);
  border-top: 1px solid rgba(11, 18, 32, 0.12);
  border-bottom: 1px solid rgba(11, 18, 32, 0.12);
}

.etac-footer-mega-menu__intro-content {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: var(--wp--preset--spacing--x-large, 48px);
  justify-items: center;
}

.etac-footer-mega-menu__intro-text {
  min-width: 0;
  order: 2;
  width: 100%;
  margin-bottom: var(--wp--preset--spacing--large, 32px);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 20px 0;
  align-items: start;
  text-align: left;
}

.etac-footer-mega-menu__intro-heading {
  margin: 0;
  color: var(--wp--preset--color--primary);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  white-space: pre-line;
}

.etac-footer-mega-menu__intro-body {
  margin: 0;
  max-width: 920px;
}

.etac-footer-mega-menu__intro-media {
  margin: 0;
  order: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 0;
  box-sizing: border-box;
}

.etac-footer-mega-menu__intro-image {
  display: block;
  flex: 0 1 284px;
  width: auto;
  min-width: 0;
  max-width: 284px;
  height: 52px;
  object-fit: contain;
  object-position: center;
}

.etac-footer-mega-menu__breadcrumbs {
  margin: 14px 0;
}

.etac-footer-mega-menu__inner > .yoast-breadcrumbs {
  margin: 14px 0;
  height: auto;
  padding-left: 0;
  padding-right: 0;
}

.etac-footer-mega-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.etac-footer-mega-menu__with-sub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 20px 24px;
  align-items: start;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px 24px;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-tail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-content: start;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--no-sub {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 20px 24px;
  overflow-x: auto;
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 1px solid rgba(11, 18, 32, 0.12);
  border-bottom: 1px solid rgba(11, 18, 32, 0.12);
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--no-sub + .etac-footer-mega-menu__with-sub {
  margin-top: 20px;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--no-sub > .etac-footer-mega-menu__item--depth-1 {
  flex: 0 0 auto;
}

.etac-footer-mega-menu__item {
  margin: 0;
  padding: 0;
}

.etac-footer-mega-menu__item--depth-1 {
  min-width: 0;
}

.etac-footer-mega-menu__list--depth-1 > .etac-footer-mega-menu__item--wide {
  grid-column: 1 / -1;
}

/* 製品: レベル3を横並びカラムにする */
.etac-footer-mega-menu__item--top-products > .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 > .etac-footer-mega-menu__list--depth-3 {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 20px;
  justify-content: flex-start;
}

.etac-footer-mega-menu__item--top-products > .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 > .etac-footer-mega-menu__list--depth-3 > .etac-footer-mega-menu__item--depth-3 {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  margin-top: 0;
  padding-left: 0;
  border-left: 0;
}

.etac-footer-mega-menu__item--depth-1 > .etac-footer-mega-menu__link,
.etac-footer-mega-menu__item--depth-1 > .etac-footer-mega-menu__text {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  padding: 16px 0;
  white-space: nowrap;
  color: var(--wp--preset--color--primary);
}

.etac-footer-mega-menu__list--depth-2,
.etac-footer-mega-menu__list--depth-3,
.etac-footer-mega-menu__list--depth-4,
.etac-footer-mega-menu__list--depth-5 {
  margin-top: 6px;
}

.etac-footer-mega-menu__item--depth-2,
.etac-footer-mega-menu__item--depth-3,
.etac-footer-mega-menu__item--depth-4,
.etac-footer-mega-menu__item--depth-5 {
  margin-top: 6px;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-main .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 {
  margin-top: 0;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-main .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 + .etac-footer-mega-menu__item--depth-2 {
  margin-top: 20px;
}

.etac-footer-mega-menu__item--depth-2 > .etac-footer-mega-menu__link,
.etac-footer-mega-menu__item--depth-2 > .etac-footer-mega-menu__text {
  font-size: 14px;
  font-weight: 600;
}

.etac-footer-mega-menu__item--depth-3 > .etac-footer-mega-menu__link,
.etac-footer-mega-menu__item--depth-3 > .etac-footer-mega-menu__text {
  font-size: 12px;
  font-weight: 600;
}

.etac-footer-mega-menu__item--depth-2 > .etac-footer-mega-menu__list--depth-3 {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(11, 18, 32, 0.12);
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-tail .etac-footer-mega-menu__item--heading > .etac-footer-mega-menu__text,
.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-tail .etac-footer-mega-menu__item--heading > .etac-footer-mega-menu__link {
  color: inherit;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-tail .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 {
  margin-top: 0;
}

.etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-tail .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 + .etac-footer-mega-menu__item--depth-2 {
  margin-top: 20px;
}

.etac-footer-mega-menu__item--depth-4 > .etac-footer-mega-menu__link,
.etac-footer-mega-menu__item--depth-4 > .etac-footer-mega-menu__text,
.etac-footer-mega-menu__item--depth-5 > .etac-footer-mega-menu__link,
.etac-footer-mega-menu__item--depth-5 > .etac-footer-mega-menu__text {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.etac-footer-mega-menu__link {
  color: inherit;
  text-decoration: none;
}

.etac-footer-mega-menu__link:hover,
.etac-footer-mega-menu__link:focus-visible {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.etac-footer-mega-menu__link:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

.etac-footer-mega-menu__accordion-toggle {
  display: none;
}

.etac-footer-mega-menu__copyright-wrap {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(11, 18, 32, 0.12);
}

.etac-footer-mega-menu__copyright {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(11, 18, 32, 0.72);
  text-align: right;
}

@media (max-width: 767px) {
  .etac-footer-mega-menu__inner {
    padding: 0 16px 24px 16px;
  }

  .etac-footer-mega-menu__intro {
    padding-top: calc(var(--wp--preset--spacing--small, 16px) + var(--wp--preset--spacing--small, 16px));
    padding-bottom: var(--wp--preset--spacing--small, 16px);
  }

  .etac-footer-mega-menu__intro-content {
    gap: var(--wp--preset--spacing--medium, 24px);
  }

  .etac-footer-mega-menu__intro-text,
  .etac-footer-mega-menu__intro-media {
    order: initial;
  }

  .etac-footer-mega-menu__intro-media {
    order: 1;
  }

  .etac-footer-mega-menu__intro-text {
    order: 2;
  }

  .etac-footer-mega-menu__intro-text {
    width: 100%;
    margin-bottom: var(--wp--preset--spacing--small, 16px);
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: left;
  }

  .etac-footer-mega-menu__intro-heading {
    font-size: 20px;
    line-height: 1.5;
  }

  .etac-footer-mega-menu__intro-body {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.75;
  }

  .etac-footer-mega-menu__intro-media {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
    padding: 0;
    gap: 16px 24px;
  }

  .etac-footer-mega-menu__intro-image {
    flex: 0 1 240px;
    width: auto;
    max-width: min(240px, 100%);
    height: 52px;
    object-fit: contain;
    object-position: center;
  }

  .etac-footer-mega-menu__with-sub {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .etac-footer-mega-menu__copyright-wrap {
    margin-top: 16px;
    padding-top: 12px;
  }

  .etac-footer-mega-menu__copyright {
    text-align: left;
  }

  .etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-main,
  .etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--with-sub-tail {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--no-sub {
    gap: 12px;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .etac-footer-mega-menu__list--depth-1.etac-footer-mega-menu__list--no-sub + .etac-footer-mega-menu__with-sub {
    margin-top: 12px;
  }

  .etac-footer-mega-menu__item--top-products > .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 > .etac-footer-mega-menu__list--depth-3 {
    display: block;
  }

  .etac-footer-mega-menu__item--top-products > .etac-footer-mega-menu__list--depth-2 > .etac-footer-mega-menu__item--depth-2 > .etac-footer-mega-menu__list--depth-3 > .etac-footer-mega-menu__item--depth-3 {
    width: auto;
  }

  .etac-footer-mega-menu__item--depth-1.etac-footer-mega-menu__accordion-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
  }

  .etac-footer-mega-menu__item--depth-1.etac-footer-mega-menu__accordion-item > .etac-footer-mega-menu__list--depth-2 {
    grid-column: 1 / -1;
    margin-top: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.28s ease, opacity 0.2s ease, margin-top 0.28s ease;
  }

  .etac-footer-mega-menu__item--depth-1.etac-footer-mega-menu__accordion-item.is-open > .etac-footer-mega-menu__list--depth-2 {
    margin-top: 6px;
  }

  .etac-footer-mega-menu__accordion-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .etac-footer-mega-menu__accordion-toggle:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
    border-radius: 2px;
  }

  .etac-footer-mega-menu__accordion-icon {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transform-origin: center;
    transition: transform 0.2s ease;
  }

  .etac-footer-mega-menu__item--depth-1.etac-footer-mega-menu__accordion-item.is-open .etac-footer-mega-menu__accordion-icon {
    transform: rotate(-135deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .etac-footer-mega-menu__item--depth-1.etac-footer-mega-menu__accordion-item > .etac-footer-mega-menu__list--depth-2,
  .etac-footer-mega-menu__accordion-icon {
    transition: none;
  }
}
