/* -------------------- */
/* PCSP共通 */
/* -------------------- */

.gooad_close {
    display: none !important;
}

/* オーバーレイ共通 */
#gooad-pc_overlay,
#gooad-sp_overlay {
    position: fixed;
    z-index: 9999;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    background: #FFF;
    text-align: center;
}

/* オーバーレイ閉じるボタン pc or sp */
[class^="gooad_close_button_"] {
    position: absolute;
    right: 0px;
    top: -25px;
    cursor: pointer;
    height: 25px;
    width: 30px;
    background-color: #fff;
    border-radius: 10px 10px 0 0;
    padding: 5px 5px 0;
    z-index: -1;
    opacity: 0.8;
}

[class^="gooad_close_button_"]::before,
[class^="gooad_close_button_"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 21px;
    background: #999;
}

[class^="gooad_close_button_"]::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

[class^="gooad_close_button_"]::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* -------------------- */
/* PC */
/* -------------------- */

@media (min-width: 769px) {
    #gooad-badge300_1 {
        min-height: 250px;
        margin: 0 0 1em;
        line-height: 0;
        text-align: center;
    }
    
    #gooad-badge300_2 {
        min-height: 250px;
        margin: 15px auto;
        line-height: 0;
        text-align: center;
    }
    
    /* ダブレク親要素1～2 */
    [id^="gooad-wrec"] {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 1em;
        margin: 1em auto 0;
        line-height: 0;
        text-align: center;
    }
    
    /* ダブレク1～4 */
    [id^="gooad-mbadge300_"] {
        min-height: 250px;
        width: 300px;
    }

    /* 純広バナー */
    #div-gpt-ad-bcnr_purelong {
        margin: 2.5em 0 0;
        text-align: center;
    }

    /* 純広ミドル&ミニバナー300_1～5 */
    [id^="div-gpt-ad-bcnr_banner300_"] {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 1.5em 0;
        line-height: 0;
        text-align: center;
    }
    
    /* オーバーレイ */
    #gooad-pc_overlay {
        height: 90px;
    }
    
    /* フッター調整 */
    /* オーバーレイがあるときフッターに余白追加 */
    body:has(#gooad-pc_overlay) #footer:not(.gooad_footer_default_pc) {
        padding-bottom: 100px;
    }
    
    /* オーバーレイが閉じられたときフッターの余白をデフォルトにする */
    .gooad_footer_default_pc {
        padding-bottom: 0;
    }

    /* SPタグは非表示 */
    [id^="gooad-sp"] {
        display: none;
    }
}

/* -------------------- */
/* SP */
/* -------------------- */

@media (max-width: 768px) {
    /* レクタングルsp300_1～4 */
    [id^="gooad-spbadge300_"] {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 18px auto;
        line-height: 0;
        text-align: center;
    }

    #gooad-spbadge300_2,
    #gooad-spbadge300_3,
    #gooad-spbadge300_4 {
        min-height: 250px;
    }

    /* 純広ミドル&ミニバナーsp300_1～5 */
    [id^="div-gpt-ad-bcnr_spbanner300_"] {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 64px 0;
        line-height: 0;
        text-align: center;
    }

    /* オーバーレイ */
    #gooad-sp_overlay {
        transition: 0.5s;
    }

    /* PCオーバーレイは非表示 */
    #gooad-pc_overlay {
        display: none;
    }

    /* iPhone safe-area */
    @supports (padding-bottom: constant(safe-area-inset-bottom)) {
        #gooad-sp_overlay {
            padding-bottom: constant(safe-area-inset-bottom)
        }
    }

    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        #gooad-sp_overlay {
            padding-bottom: env(safe-area-inset-bottom)
        }
    }

    /* フッター調整 */
    /* オーバーレイがあるときフッターに余白追加 */
    body:has(#gooad-sp_overlay) #footer:not(.gooad_footer_default_sp) {
        padding-bottom: 100px;
    }

    /* オーバーレイが閉じられたときフッターの余白をデフォルトにする */
    .gooad_footer_default_sp {
        padding-bottom: 24px;
    }

    /* トップへ戻るボタン */
    body:has(#gooad-sp_overlay) #page_top {
        bottom: 225px;
    }

    /* ボトムメニュー表示 */
    body:has(#sp-menubar.DownSpMove) #gooad-sp_overlay {
        bottom: 50px;
    }

    /* ボトムメニュー表示＆検索バー表示 */
    body:has(#sp-menubar.DownSpMove):has(#footer-form-content.is-open) #gooad-sp_overlay {
        bottom: 112px;
    }
}
