@charset "utf-8";

/* ===============================
   header responsive
================================= */
.hamburger-btn{
    display: none;
    appearance: none;
    border: none;
    background: transparent;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
    z-index: 10020;
}

.hamburger-btn__line{
    display: block;
    width: 24px;
    height: 2px;
    background: #222;
    border-radius: 999px;
    position: absolute;
    left: 10px;
    transition: transform .25s ease, opacity .25s ease, top .25s ease;
}

.hamburger-btn__line:nth-child(1){
    top: 13px;
}
.hamburger-btn__line:nth-child(2){
    top: 21px;
}
.hamburger-btn__line:nth-child(3){
    top: 29px;
}

.hamburger-btn.is-open .hamburger-btn__line:nth-child(1){
    top: 21px;
    transform: rotate(45deg);
}
.hamburger-btn.is-open .hamburger-btn__line:nth-child(2){
    opacity: 0;
}
.hamburger-btn.is-open .hamburger-btn__line:nth-child(3){
    top: 21px;
    transform: rotate(-45deg);
}

/* ===============================
   smartphone only
================================= */
@media screen and (max-width: 767px){

    header{
        position: sticky;
        top: 0;
        z-index: 10000;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,.06);
    }

    #top-gNavi{
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        min-height: 72px;
    }

    /* スマホ通常時はグローバルナビ本体を隠す */
    #p-globalNav{
        display: none;
    }

    /* ハンバーガー */
    .hamburger-btn{
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        order: 1;
    }

    /* 右側 */
    #headerSub-flex{
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        flex: 1 1 auto;
        min-width: 0;
        order: 2;
        margin-left: 8px;
    }

    #headerSub{
        display: flex;
        align-items: center;
        min-width: 0;
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    #headerSub .searchBox{
        position: relative;
        display: flex;
        align-items: center;
        width: clamp(150px, 42vw, 220px);
    }

    #search_box{
        width: 100%;
        height: 42px;
        padding: 6px 48px 6px 14px;
        font-size: 15px;
        box-sizing: border-box;
        border: 2px solid #d8d8d8;
        border-radius: 10px;
        background-color: #fff;
    }

    #search_box:focus{
        outline: none;
        border-color: #02ab2f;
        box-shadow: 0 0 0 3px rgba(2, 171, 47, 0.12);
    }

    #search_button{
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
    }

    #header_sub{
        display: flex;
        align-items: center;
        gap: 2px;
        margin: 0;
        padding: 0;
        list-style: none;
        flex: 0 0 auto;
    }

    #header_sub > li{
        display: flex;
        align-items: center;
        height: 36px;
    }

    #header_sub > li > a{
        height: 36px;
        line-height: 36px;
        padding: 0 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    #login,
    #register{
        padding: 0;
    }

    .header-icon-link{
        width: 40px;
        height: 40px;
    }

    .header-icon-link svg{
        width: 28px;
        height: 28px;
    }

    .header-notify-badge{
        top: 3px;
        right: 3px;
        width: 14px;
        height: 14px;
        font-size: 9px;
    }

    .userMenu__btn{
        width: 36px;
        height: 36px;
    }

    .userMenu__icon_img{
        width: 30px;
        height: 30px;
    }

    .userMenu__panel{
        top: 42px;
        right: 0;
        min-width: 180px;
        max-width: min(72vw, 260px);
        padding: 8px;
    }

    .userMenu__list a{
        padding: 10px 8px;
        font-size: 14px;
    }

    /* 開閉メニュー */
    #p-globalNav.is-mobile-open{
        display: flex;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        z-index: 9990;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 8px 20px rgba(0,0,0,.08);
        padding: 12px 16px 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    #p-globalNav.is-mobile-open .p-globalNav_link{
        display: block;
        padding: 0;
        border-bottom: 1px solid #eee;
    }

    /* 先頭のindexリンクもスマホメニュー内で表示する */
    #p-globalNav.is-mobile-open .p-globalNav_link--home{
        display: block;
    }

    #p-globalNav.is-mobile-open .p-globalNav_link a{
        display: block;
        padding: 14px 4px;
        font-size: 15px;
        text-decoration: none;
        color: #222;
        font-weight: 700;
    }

    #p-globalNav.is-mobile-open .p-globalNav_link--home a{
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 10px 4px 14px;
    }

    #p-globalNav.is-mobile-open .p-globalNav_link--home img{
        height: 42px;
        width: auto;
        display: block;
    }
}

@media screen and (max-width: 520px){

    #top-gNavi{
        padding: 10px 10px;
    }

    #headerSub .searchBox{
        width: clamp(128px, 38vw, 180px);
    }

    #search_box{
        font-size: 13px;
        padding-right: 34px;
    }

    #search_button{
        width: 34px;
        height: 34px;
    }

    #header_sub > li > a{
        padding: 0 6px;
        font-size: 11px;
    }

    .header-icon-link{
        width: 36px;
        height: 36px;
    }

    .header-icon-link svg{
        width: 24px;
        height: 24px;
    }
}

/* ===============================
   iPad / tablet only
   PC版ヘッダーを無理に詰め込まず、スマホ型ヘッダーに寄せる
================================= */
@media screen and (min-width: 768px) and (max-width: 1366px) and (pointer: coarse){

    header{
        position: relative;
        top: auto;
        z-index: 10000;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,.06);
    }

    #top-gNavi{
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 24px;
        min-height: 88px;
        box-sizing: border-box;
    }

    #p-globalNav{
        display: none;
    }

    .hamburger-btn{
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 52px;
        width: 52px;
        height: 52px;
        order: 1;
    }

    #headerSub-flex{
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 14px;
        flex: 1 1 auto;
        min-width: 0;
        order: 2;
        margin-left: 18px;
    }

    #headerSub{
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        min-width: 0;
    }

    #headerSub .searchBox{
        position: relative;
        display: flex;
        align-items: center;
        width: clamp(260px, 36vw, 420px);
    }

    #search_box{
        width: 100%;
        height: 42px;
        padding: 6px 48px 6px 14px;
        font-size: 15px;
        box-sizing: border-box;
        border: 2px solid gray;
        border-radius: 10px;
        background-color: #fff;
    }

    #search_button{
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 42px;
        height: 42px;
    }

    #header_sub{
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0;
        padding: 0;
        list-style: none;
        flex: 0 0 auto;
    }

    #header_sub > li{
        display: flex;
        align-items: center;
    }

    #header_sub > li > a{
        white-space: nowrap;
    }

    .header-icon-link{
        width: 44px;
        height: 44px;
    }

    .header-icon-link svg{
        width: 30px;
        height: 30px;
    }

    .userMenu__btn{
        width: 44px;
        height: 44px;
    }

    .userMenu__icon_img{
        width: 38px;
        height: 38px;
    }

    .userMenu__panel{
        top: 52px;
        right: 0;
        min-width: 200px;
        z-index: 10050;
    }

    #p-globalNav.is-mobile-open{
        display: flex;
        position: fixed;
        top: 88px;
        left: 0;
        right: 0;
        z-index: 9990;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 8px 20px rgba(0,0,0,.08);
        padding: 16px 28px 22px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    #p-globalNav.is-mobile-open .p-globalNav_link{
        display: block;
        padding: 0;
        border-bottom: 1px solid #eee;
    }

    #p-globalNav.is-mobile-open .p-globalNav_link a{
        display: block;
        padding: 16px 4px;
        font-size: 16px;
        text-decoration: none;
        color: #222;
        font-weight: 700;
        white-space: normal;
    }

    #p-globalNav.is-mobile-open .p-globalNav_link img{
        height: 54px;
        width: auto;
    }
}
/* ===============================
   iPad / tablet only
   モーダル表示中はヘッダーを背面に回す
================================= */
@media screen and (min-width: 768px) and (max-width: 1366px) and (pointer: coarse){

    body.modal-open header{
        z-index: 1 !important;
        pointer-events: none;
    }

    body.modal-open #top-gNavi,
    body.modal-open .hamburger-btn,
    body.modal-open #p-globalNav,
    body.modal-open #p-globalNav.is-mobile-open,
    body.modal-open #headerSub-flex,
    body.modal-open .userMenu__panel{
        z-index: 1 !important;
        pointer-events: none;
    }
}

/* ===============================
   smartphone only
   ヘッダー検索ボックス・検索ボタン高さ調整
================================= */
@media screen and (max-width: 767px){

    #headerSub .searchBox{
        height: 42px;
        align-items: stretch;
    }

    #search_box{
        height: 42px;
        line-height: 42px;
        padding-top: 0;
        padding-bottom: 0;

        /* ボタン分の余白を確保 */
        padding-right: 42px;
        border-radius: 12px;
    }

    #search_button{
        top: 0;
        right: 0;
        transform: none;

        /* 検索ボックスと同じ高さの正方形にする */
        width: 42px;
        height: 42px;

        display: block;
        object-fit: cover;
        border-radius: 0 10px 10px 0;
    }
}

@media screen and (max-width: 520px){

    #search_box{
        height: 42px;
        line-height: 42px;
        padding-right: 42px;
        font-size: 13px;
    }

    #search_button{
        width: 42px;
        height: 42px;
    }
}