/* member-header.css: shared desktop member header + mega menu */

@media (min-width: 981px){
  .mheader{
    --header-h: 84px;
    --menu-fs: 15px;
    --menu-color: #1a1a1a;
    --sep-w: 2px;
    --sep-h: 36px;
    --sep-color: #c9c9c9;
    --btn-w: 128px;
    --btn-h: 36px;
    --btn-blue: #3fa6f2;
    --btn-fs: 15px;
    --mega-fade-dur: 0.26s;
    --mega-move-dur: 0.34s;
    --mega-ease: cubic-bezier(0.22, 1, 0.36, 1);

    position: sticky;
    top: 0;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 1000;
  font-family: "Noto Sans JP", sans-serif;
  }

  .mheader a,
  .mheader a:hover,
  .mheader a:focus,
  .mheader a:active,
  .mheader a:visited{
    text-decoration: none;
  }

  .mheader__inner{
    max-width: 1400px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 0;
    box-sizing: border-box;
  }

  .mheader__logo{
    flex: 0 0 auto;
    margin-right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .mheader__logo img{
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
  }

  .mheader__logo-text{
    display: block;
    margin-top: 3px;
    font-size: 9px;
    font-weight: 400;
    line-height: 1;
    color: #333;
    white-space: nowrap;
    text-align: right;
  }

  .mheader__toggle,
  .mheader__burger,
  .mheader__mega-toggle,
  .mheader__mega-trigger--mobile{
    display: none;
  }

  .mheader__menu{
    margin-left: 49px;
    width: 1090px;
    min-width: 1090px;
    max-width: 1090px;
    flex: 0 0 1090px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
  }

  .mheader__nav{
    display: flex;
    align-items: center;
    margin-left: 0;
    gap: 0;
    color: var(--menu-color);
    font-size: var(--menu-fs);
    font-weight: 400;
    line-height: 1;
  }

  .mheader__mega-trigger--desktop{
    display: inline-flex;
  }

  .mheader__member,
  .mheader__mega-trigger--desktop{
    position: relative;
    display: inline-flex;
    align-items: center;
    height: var(--sep-h);
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    font-weight: 400;
    letter-spacing: 0.14em;
  }

  .mheader__member{
    color: #2428A6;
    font-size: 20px;
    font-weight: 500;
    padding: 0 44px 0 0;
  }

  .mheader__mega{
    position: static;
    padding-left: 0;
  }

  .mheader__mega::before{
    content: none;
  }

  .mheader__mega-trigger--desktop{
    padding: 0 44px;
  }

  .mheader__mega-trigger--desktop::before{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: calc((var(--header-h) - var(--sep-h)) / 2 + 1px);
  }

  .mheader__member::after,
  .mheader__mega-trigger--desktop::after{
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: var(--sep-w);
    height: var(--sep-h);
    transform: translateY(-50%);
    background: var(--sep-color);
  }

  .mheader__cta{
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 0;
  }

  .mheader__pill{
    width: var(--btn-w);
    min-width: 0;
    height: var(--btn-h);
    padding: 0;
    border-radius: 18px;
    background: var(--btn-blue);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--btn-fs);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-decoration: none;
  }

  .mheader__pill.is-active{
    background: var(--btn-blue);
  }

  .mheader__pill:hover,
  .mheader__pill:focus,
  .mheader__pill:active{
    background: var(--btn-blue);
    color: #fff;
  }

  .mheader__right{
    margin-left: 0;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: 20px 36px;
    column-gap: 0;
    row-gap: 4px;
    align-items: center;
    font-size: 14px;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1;
  }

  .mheader__mypage,
  .mheader__logout{
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--sep-h);
    padding: 0 22px;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
  }

  .mheader__mypage{
    grid-column: 1;
    grid-row: 2;
  }

  .mheader__logout{
    grid-column: 2;
    grid-row: 2;
  }

  .mheader__user-text{
    display: inline-block;
    transform: translateY(-4px);
  }

  .mheader__mypage::before,
  .mheader__mypage::after,
  .mheader__logout::after{
    content: "";
    position: absolute;
    top: 50%;
    width: var(--sep-w);
    height: var(--sep-h);
    transform: translateY(-50%);
    background: var(--sep-color);
  }

  .mheader__mypage::before{
    left: 0;
  }

  .mheader__mypage::after,
  .mheader__logout::after{
    right: 0;
  }

  .mheader__mypage::before,
  .mheader__mypage::after,
  .mheader__logout::after{
    width: 1px;
    height: 16px;
    background: #1a1a1a;
    top: auto;
    bottom: 13px;
    transform: none;
  }

  .mheader__top{
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 4px;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
  }

  .mheader__top-ico{
    width: 16px;
    height: 16px;
    display: inline-block;
    flex: 0 0 auto;
    background: url("../img/14/14_menu_icon.svg") center / 16px 16px no-repeat;
  }

  .mheader__top-ico::after{
    content: none;
  }

  .mheader__mega-panel{
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--header-h) + 1px);
    background: #fff;
    border-top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    transition:
      opacity var(--mega-fade-dur) ease,
      visibility 0s linear var(--mega-fade-dur);
    z-index: 700;
    min-width: 0;
    padding: 0;
    box-shadow: none;
    will-change: opacity;
  }

  .mheader__mega-panel--ingredients{
    background: rgba(255, 255, 255, 0.9);
    height: 282px;
    padding: 0;
  }

  .mheader__mega-panel--support{
    background: rgba(255, 255, 255, 0.9);
    height: 282px;
    padding: 0;
  }

  .mheader__mega:hover > .mheader__mega-panel,
  .mheader__mega:focus-within > .mheader__mega-panel{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition:
      opacity var(--mega-fade-dur) ease,
      visibility 0s;
  }

  .mheader__mega-panel-inner{
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 28px;
    padding: 50px 0 52px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity var(--mega-fade-dur) ease 0.03s,
      transform var(--mega-move-dur) var(--mega-ease) 0.03s;
  }

  .mheader__mega-panel--support .mheader__mega-panel-inner{
    max-width: 1040px;
    padding-top: 50px;
    padding-bottom: 52px;
  }

  .mheader__mega-visual{
    width: 200px;
    height: 150px;
    background: #edf2f8;
    border: 1px solid #ececec;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0;
    transform: translateY(6px) scale(0.992);
    transition:
      opacity var(--mega-fade-dur) ease 0.04s,
      transform var(--mega-move-dur) var(--mega-ease) 0.04s;
  }

  .mheader__mega-panel--ingredients .mheader__mega-visual{
    width: 200px;
    height: 150px;
    background-image: url("../img/14/14_menu_img01.webp");
  }

  .mheader__mega-panel--support .mheader__mega-visual{
    width: 200px;
    height: 150px;
    background-image: url("../img/14/14_menu_img02.webp");
  }

  .mheader__mega-cols{
    display: grid;
    column-gap: 30px;
  }

  .mheader__mega-cols--ingredients{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mheader__mega-cols--support{
    width: 602px;
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mheader__mega-col{
    min-width: 0;
    opacity: 0;
    transform: translateY(6px);
    transition:
      opacity var(--mega-fade-dur) ease,
      transform var(--mega-move-dur) var(--mega-ease);
  }

  .mheader__mega-col:nth-child(1){ transition-delay: 0.05s; }
  .mheader__mega-col:nth-child(2){ transition-delay: 0.08s; }
  .mheader__mega-col:nth-child(3){ transition-delay: 0.11s; }
  .mheader__mega-col:nth-child(4){ transition-delay: 0.14s; }

  .mheader__mega-col-title{
    margin: 0 0 8px;
    padding: 0 0 5px;
    border-bottom: 1px solid #2f2f2f;
    width: 180px;
    color: #1f1f1f;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
  }

  .mheader__mega-col-title-link{
    display: block;
    color: inherit;
    text-decoration: none;
  }

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

  .mheader__mega-links li{
    margin: 0;
  }

  .mheader__mega-links-heading{
    display: block;
    margin: 0;
    padding-top: 15px;
    padding-bottom: 3px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.8;
    color: #1f1f1f;
  }

  .mheader__mega-links a{
    display: block;
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 400;
    color: #1f1f1f;
    line-height: 2.4;
    white-space: nowrap;
    text-decoration: none;
    background: transparent;
  }

  .mheader__mega-links a:hover,
  .mheader__mega-links a:focus-visible{
    color: #1f1f1f;
    background: transparent;
  }

  .mheader.is-preview-open-ingredients .mheader__mega--ingredients > .mheader__mega-panel,
  .mheader.is-preview-open-support .mheader__mega--support > .mheader__mega-panel{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .mheader__mega:hover > .mheader__mega-panel .mheader__mega-panel-inner,
  .mheader__mega:focus-within > .mheader__mega-panel .mheader__mega-panel-inner,
  .mheader.is-preview-open-ingredients .mheader__mega--ingredients > .mheader__mega-panel .mheader__mega-panel-inner,
  .mheader.is-preview-open-support .mheader__mega--support > .mheader__mega-panel .mheader__mega-panel-inner{
    opacity: 1;
    transform: translateY(0);
  }

  .mheader__mega:hover > .mheader__mega-panel .mheader__mega-visual,
  .mheader__mega:focus-within > .mheader__mega-panel .mheader__mega-visual,
  .mheader.is-preview-open-ingredients .mheader__mega--ingredients > .mheader__mega-panel .mheader__mega-visual,
  .mheader.is-preview-open-support .mheader__mega--support > .mheader__mega-panel .mheader__mega-visual{
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .mheader__mega:hover > .mheader__mega-panel .mheader__mega-col,
  .mheader__mega:focus-within > .mheader__mega-panel .mheader__mega-col,
  .mheader.is-preview-open-ingredients .mheader__mega--ingredients > .mheader__mega-panel .mheader__mega-col,
  .mheader.is-preview-open-support .mheader__mega--support > .mheader__mega-panel .mheader__mega-col{
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 981px) and (prefers-reduced-motion: reduce){
  .mheader__mega-panel,
  .mheader__mega-panel-inner,
  .mheader__mega-visual,
  .mheader__mega-col{
    transition: none;
    transform: none;
  }
}

@media (max-width: 980px){
  .mheader{
    --header-h: 66px;
    --menu-fs: 15px;
    --menu-color: #1a1a1a;
    --sep-color: #c9c9c9;
    --btn-blue: #3fa6f2;

    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-family: "Noto Sans JP", sans-serif;
  }

  .mheader :where(*, *::before, *::after){
    box-sizing: border-box;
  }

  .mheader a{
    color: inherit;
    text-decoration: none;
  }

  .mheader__inner{
    max-width: 1400px;
    margin: 0 auto;
    min-height: var(--header-h);
    height: var(--header-h);
    padding: 0 20px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
  }

  .mheader__logo{
    flex: 0 0 auto;
    margin-right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .mheader__logo img{
    width: 210px;
    max-width: 220px;
    height: auto;
    display: block;
  }

  .mheader__logo-text{
    display: block;
    margin-top: 2px;
    font-size: 8px;
    font-weight: 400;
    line-height: 1;
    color: #333;
    white-space: nowrap;
    text-align: right;
  }

  .mheader__toggle{
    display: none;
  }

  .mheader__burger{
    display: block;
    position: absolute;
    right: 20px;
    top: 16px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
  }

  .mheader__burger span{
    position: absolute;
    left: 3px;
    width: 28px;
    height: 2px;
    margin: 0;
    background: #202934;
    transform-origin: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .mheader__burger span:nth-child(1){ top: 8px; }
  .mheader__burger span:nth-child(2){ top: 15px; }
  .mheader__burger span:nth-child(3){ top: 22px; }

  .mheader__burger::after{
    content: "MENU";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: -4px;
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.08em;
    color: #202934;
    font-weight: 500;
    white-space: nowrap;
  }

  .mheader__toggle:checked + .mheader__burger span:nth-child(1){
    transform: translateY(7px) rotate(45deg);
  }

  .mheader__toggle:checked + .mheader__burger span:nth-child(2){
    opacity: 0;
  }

  .mheader__toggle:checked + .mheader__burger span:nth-child(3){
    transform: translateY(-7px) rotate(-45deg);
  }

  .mheader__toggle:checked + .mheader__burger::after{
    display: none;
  }

  .mheader__menu{
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    border-top: 1px solid #bdbee4;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.10);
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 1200;
  }

  .mheader__toggle:checked ~ .mheader__menu{
    display: flex;
  }

  .mheader__nav{
    display: contents;
    color: var(--menu-color);
    font-size: var(--menu-fs);
    line-height: 1;
  }

  .mheader__member{
    order: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #2428A6;
    font-size: 15px;
    font-weight: 400;
    width: 100%;
    min-height: 58px;
    height: 58px;
    padding: 0 44px 0 22px;
    line-height: 58px;
    background: #f7f7f7;
    border-bottom: 1px solid #bdbee4;
    position: relative;
  }

  .mheader__mega{
    position: static;
    width: 100%;
    padding-left: 0;
  }

  .mheader__mega--ingredients{
    order: 1;
  }

  .mheader__mega--support{
    order: 3;
  }

  .mheader__mega::before{
    content: none;
  }

  .mheader__mega-toggle{
    display: none;
  }

  .mheader__mega-trigger--desktop{
    display: none;
  }

  .mheader__mega-trigger--mobile{
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 58px;
    height: 58px;
    line-height: 58px;
    padding: 0 44px 0 22px;
    font-weight: 400;
    font-size: 15px;
    color: var(--menu-color);
    background: #f7f7f7;
    border-bottom: 1px solid #bdbee4;
    position: relative;
    cursor: pointer;
  }

  .mheader__mega-trigger--mobile::after,
  .mheader__mypage::after,
  .mheader__logout::after{
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 12px;
    background: url("../img/top/arrow_b.svg") center / contain no-repeat;
  }

  .mheader__mega-toggle:checked + .mheader__mega-trigger--mobile::after{
    transform: translateY(-50%) rotate(90deg);
  }

  .mheader__cta{
    order: 2;
    margin-left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .mheader__pill{
    width: 100%;
    height: 52px;
    border-radius: 0;
    padding: 0 44px 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    background: var(--btn-blue);
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    position: relative;
  }

  .mheader__cta .mheader__pill:first-of-type{
    background: var(--btn-blue);
    color: #fff;
  }

  .mheader__cta .mheader__pill:first-of-type::after{
    background: url("../img/top/arrow_w.svg") center / contain no-repeat;
  }

  .mheader__pill:visited{
    color: #fff;
  }

  .mheader__pill.is-active,
  .mheader__pill:hover,
  .mheader__pill:focus,
  .mheader__pill:active{
    background: var(--btn-blue);
    color: #fff;
  }

  .mheader__pill::after{
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 12px;
    background: url("../img/top/arrow_w.svg") center / contain no-repeat;
  }

  .mheader__right{
    order: 4;
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 52px 58px;
    align-items: stretch;
    gap: 0;
    color: var(--menu-color);
    font-size: 15px;
    line-height: 1;
  }

  .mheader__mypage,
  .mheader__logout,
  .mheader__top{
    width: auto;
    min-height: 52px;
    height: 52px;
    padding: 0 44px 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    background: #f7f7f7;
    border-bottom: 1px solid #bdbee4;
    position: relative;
    font-size: 15px;
  }

  .mheader__mypage{
    grid-column: 1;
    grid-row: 1;
  }

  .mheader__logout{
    grid-column: 2;
    grid-row: 1;
    border-left: 1px solid #bdbee4;
  }

  .mheader__mypage,
  .mheader__logout{
    justify-content: center;
    padding: 0 12px;
    text-align: center;
  }

  .mheader__top{
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-height: 58px;
    height: 58px;
  }

  .mheader__mypage::before,
  .mheader__mypage::after,
  .mheader__logout::after{
    content: none;
  }

  .mheader__top{
    gap: 6px;
  }

  .mheader__top-ico{
    width: 16px;
    height: 16px;
    display: inline-block;
    flex: 0 0 auto;
    background: url("../img/14/14_menu_icon.svg") center / 16px 16px no-repeat;
  }

  .mheader__top-ico::after{
    content: none;
  }

  .mheader__mega-panel{
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    min-width: 0;
    max-width: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    display: none;
    padding: 0;
  }

  .mheader__mega-panel-inner{
    max-width: none;
    display: block;
    padding: 0;
  }

  .mheader__mega-visual{
    display: none;
  }

  .mheader__mega-toggle:checked ~ .mheader__mega-panel{
    display: block;
    border-top: 1px solid #bdbee4;
  }

  .mheader__mega-col-title{
    margin: 0;
    padding: 12px 22px 8px;
    border-bottom: 1px solid #bdbee4;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    background: #fff;
  }

  .mheader__mega-col-title-link{
    display: block;
    color: inherit;
    text-decoration: none;
  }

  .mheader__mega-panel--ingredients .mheader__mega-col-title{
    margin: 0;
    padding: 0;
    border-bottom: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    background: transparent;
  }

  .mheader__mega-panel--ingredients .mheader__mega-col-title-link{
    display: block;
    min-height: 58px;
    padding: 14px 44px 14px 22px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    color: var(--menu-color);
    background: #e8f2fd;
    border-bottom: 1px solid #bdbee4;
    position: relative;
  }

  .mheader__mega-panel--ingredients .mheader__mega-col-title-link::after{
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 12px;
    background: url("../img/top/arrow_b.svg") center / contain no-repeat;
  }

  .mheader__mega-panel--ingredients .mheader__mega-links{
    display: none;
  }

  .mheader__mega-panel--support .mheader__support-link--order,
  .mheader__mega-panel--support .mheader__support-link--request{
    display: none;
  }

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

  .mheader__mega-links a{
    display: block;
    min-height: 58px;
    padding: 14px 44px 14px 22px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    color: var(--menu-color);
    background: #e8f2fd;
    border-bottom: 1px solid #bdbee4;
    position: relative;
  }

  .mheader__mega-links a::after{
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 12px;
    background: url("../img/top/arrow_b.svg") center / contain no-repeat;
  }
}

@media (max-width: 768px){
  .mheader__inner{
    padding: 0 20px;
  }

  .mheader__logo img{
    width: 210px;
  }

  .mheader__member{
    font-size: 15px;
  }
}
