/* 共通ヘッダー・商品一覧用。ショップサーブの既存CSSより後に読み込み。 */


#searchPopup, #searchPopup * {
    box-sizing: border-box;
}

#searchPopup[hidden] {
    display: none !important;
}

#searchPopup {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: 32px 24px;
    overflow: auto;
    overscroll-behavior: contain;
    align-items: center;
    justify-content: center;
}

#searchPopup.show {
    display: flex;
    opacity: 1;
    z-index: 10000;
}

#searchPopup .popup-inner {
    position: relative;
    z-index: 1;
    flex: 0 1 836px;
    width: 836px;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    overflow: visible;
    margin: auto;
    padding: 48px 50px 50px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 8px #0003;
    color: #444;
    text-align: left;
}

#searchPopup form {
    margin: 0;
    padding: 0;
}

#searchPopup #searchLabel, #searchPopup .search-keywords-title {
    display: block;
    margin: 0 0 12px;
    padding: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: .08em;
}

#searchPopup .searchbox {
    display: block;
    width: 100%;
    max-width: none;
    height: 54px;
    padding: 10px 14px;
    margin: 0;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    color: #333;
    box-shadow: none;
    font: inherit;
    font-size: 16px;
    appearance: none;
}

#searchPopup .search-keywords {
    margin-top: 30px;
}

#searchPopup #keyword {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    float: none;
    width: auto;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

#searchPopup #keyword li {
    display: block;
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
    background: none;
}

#searchPopup #keyword a {
    display: block;
    padding: 6px 15px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    color: #444;
    background: #fff;
    font-size: 14px;
    line-height: 1.35;
    letter-spacing: .04em;
    text-decoration: none;
    overflow-wrap: anywhere;
}

#searchPopup #keyword a:hover {
    background: #f1f4f7;
    border-color: #0b233f;
    color: #0b233f;
}

#searchPopup .btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 350px;
    max-width: 100%;
    height: 68px;
    margin: 38px auto 0;
    padding: 12px 58px;
    border: 1px solid #0b233f;
    border-radius: 999px;
    background: #0b233f;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .1em;
    cursor: pointer;
}

#searchPopup .btn:hover, #searchPopup .btn:focus {
    background: #173b60;
    color: #fff;
    margin-bottom: 0;
    transform: none;
}

#searchPopup .btn img {
    position: absolute;
    right: 32px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    filter: brightness(0) invert(1);
}

#searchPopup #searchClose {
    position: absolute;
    top: -16px;
    right: -16px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0b233f;
    color: #fff;
    font: 30px/1 Arial, sans-serif;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px #0003;
}

#searchPopup .black-background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #252b30;
}

#searchPopup.show .black-background {
    opacity: .62;
    z-index: 0;
}

#searchPopup :focus-visible, .gmd-list-ui #pager-bm a:focus-visible, .gmd-list-ui #pager-top select:focus-visible {
    outline: unset;
    /* outline-offset: 4px; */
}

/* 一覧のDOMをJSで確認できたページだけに適用。商品カードは変更しない。 */
.gmd-list-ui #main-column > section > .header_area {
    max-width: 990px;
    width: 100%;
    margin: 0 auto 20px;
    padding: 0 15px;
    box-sizing: border-box;
}

.gmd-list-ui #main-column > section > .header_area h1 {
    margin: 0;
    padding: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.5;
}

.gmd-list-ui #bread-crumb {
    max-width: 990px;
}

.gmd-list-ui #itemList_wrap #pager-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 990px;
    width: 100%;
    margin: 0 auto 24px;
    padding: 0 15px;
    box-sizing: border-box;
    overflow: visible;
}

.gmd-list-ui #itemList_wrap #pager-top .quantity {
    order: 0;
    float: none;
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
}

.gmd-list-ui #itemList_wrap #pager-top .selectbox {
    order: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    float: none;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.gmd-list-ui #itemList_wrap #pager-top .selectbox .normal-sort {
    width: 150px;
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #e1e1e1;
    border-radius: 0;
    background-color: #fff;
    color: #333;
    font: inherit;
}

.gmd-list-ui #itemList_wrap #pager-top .pagerlist, .gmd-list-ui #itemList_wrap #pager-top #TypeKey, .gmd-list-ui #itemList_wrap #pager-top .stock-sort, .gmd-list-ui #itemList_wrap #pager-top .gmd-filter-hidden, .gmd-list-ui #itemList_wrap #pager-bm .quantity, .gmd-list-ui #itemList_wrap #pager-bm .selectbox, .gmd-list-ui #itemList_wrap #pager-bm .gmd-page-edge {
    display: none !important;
}

.gmd-list-ui #itemList_wrap #pager-bm {
    width: 100%;
    max-width: 990px;
    margin: 0 auto;
    padding: 60px 15px 64px;
    box-sizing: border-box;
    border: 0;
    overflow: visible;
}

.gmd-list-ui #itemList_wrap #pager-bm .pagerlist {
    float: none;
    margin: 0;
}

.gmd-list-ui #itemList_wrap #pager-bm ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin: 0;
    overflow: visible;
    list-style: none;
}

.gmd-list-ui #itemList_wrap #pager-bm ul li {
    float: none;
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    font-size: 16px;
    line-height: 1;
}

.gmd-list-ui #itemList_wrap #pager-bm ul li a, .gmd-list-ui #itemList_wrap #pager-bm ul li.selected {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
    border: 1px solid #e2e2e2;
    border-radius: 50%;
    background: #fff;
    color: #666;
    font-weight: 400;
    text-decoration: none;
}

.gmd-list-ui #itemList_wrap #pager-bm ul li.selected {
    background: #0b233f;
    border-color: #0b233f;
    color: #fff;
}

.gmd-list-ui #itemList_wrap #pager-bm ul li a:hover {
    border-color: #0b233f;
    color: #0b233f;
    background: #f1f4f7;
}

.gmd-list-ui #itemList_wrap #pager-bm .gmd-page-next a, .gmd-list-ui #itemList_wrap #pager-bm .gmd-page-prev a {
    font-size: 0;
}

.gmd-list-ui #pager-bm .gmd-page-next a::after, .gmd-list-ui #pager-bm .gmd-page-prev a::after {
    content: '';
    width: 7px;
    height: 7px;
    border-top: 2px solid #0b233f;
    border-right: 2px solid #0b233f;
    transform: rotate(45deg);
    margin-right: 3px;
}

.gmd-list-ui #pager-bm .gmd-page-prev a::after {
    transform: rotate(-135deg);
    margin-right: 0;
    margin-left: 3px;
}

@media (max-width: 767px) {
    #searchPopup {
        padding: 30px 20px;
    }

    #searchPopup .popup-inner {
        padding: 32px 22px;
        max-height: none;
    }

    #searchPopup #searchClose {
        top: -14px;
        right: -10px;
    }

    #searchPopup #searchLabel, #searchPopup .search-keywords-title {
        font-size: 14px;
    }

    #searchPopup .search-keywords {
        margin-top: 24px;
    }

    #searchPopup #keyword {
        gap: 8px;
    }

    #searchPopup #keyword a {
        padding: 8px 10px;
        font-size: 12px;
    }

    #searchPopup .btn {
        height: 56px;
        margin-top: 28px;
        font-size: 16px;
    }

    #searchPopup .btn img {
        right: 22px;
        width: 21px;
        height: 21px;
    }

    .gmd-list-ui #main-column > section > .header_area {
        padding: 0 20px;
        margin-bottom: 18px;
    }

    .gmd-list-ui #main-column > section > .header_area h1 {
        font-size: 20px;
    }

    .gmd-list-ui #itemList_wrap #pager-top {
        padding: 0 20px;
        gap: 12px;
        margin-bottom: 20px;
    }

    .gmd-list-ui #itemList_wrap #pager-top .quantity {
        font-size: 11px;
    }

    .gmd-list-ui #itemList_wrap #pager-top .selectbox {
        margin-left: auto;
        font-size: 11px;
    }

    .gmd-list-ui #itemList_wrap #pager-top .selectbox .normal-sort {
        width: 130px;
        height: 40px;
    }

    .gmd-list-ui #itemList_wrap #pager-bm {
        padding: 36px 16px 44px;
    }

    .gmd-list-ui #itemList_wrap #pager-bm ul {
        gap: 8px;
    }

    .gmd-list-ui #itemList_wrap #pager-bm ul li a, .gmd-list-ui #itemList_wrap #pager-bm ul li.selected {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }
}

/* 検索ポップアップ：表示・非表示のフェード（既存レイアウトを維持） */
#searchPopup.show {
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}
#searchPopup.show.is-visible {
    opacity: 1;
    pointer-events: auto;
}
#searchPopup .popup-inner {
    transform: translateY(8px);
    transition: transform 300ms ease;
}
#searchPopup.is-visible .popup-inner {
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    #searchPopup.show,
    #searchPopup .popup-inner {
        transition: none;
    }
    #searchPopup .popup-inner {
        transform: none;
    }
}

/* スクロールバーの領域を常に確保。開閉時にoverflowは変更しない。 */
html {
    scrollbar-gutter: stable;
}

/* 旧fadeOutが残したインラインdisplayの影響を避ける */
#searchPopup.show:not([hidden]) {
    display: flex !important;
}
