/* ===========================================================
   商品検索（リアルタイム絞り込み）
   カラー: ピンク var(--yk-pink-deep) / ホワイト / ロゴの青 var(--yk-navy)（child_style.css で定義）
   =========================================================== */

.ps-wrap {
    --ps-red: var(--yk-pink-deep);
    --ps-blue: var(--yk-navy);
    --ps-white: #ffffff;
    --ps-gray: #f4f5f8;
    --ps-border: #d9dce3;
    position: relative;
}

/* ---- 検索結果カード（商品アーカイブ用の既存見た目を踏襲） ---- */
.image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    padding-bottom: 100%;
}

.image-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: auto;
    transform: translate(-50%, -50%);
}

.cate_color {
    border: thin solid var(--ps-blue);
    color: var(--ps-blue);
    font-weight: 600;
    padding: 0.1rem 0.5rem 0.1rem 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
    letter-spacing: 0.4rem;
}

.archive_box3 {
    font-weight: 400;
    background-color: var(--yk-yellow-light);
    font-size: 0.9rem;
    text-align: center;
    padding: 0 0.6rem 0 0.6rem;
    display: inline-block;
    margin-top: 0.5rem;
    margin-right: 1rem;
}

.archive_box2 {
    display: inline-block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    margin-right: 1rem;
}

.archive_ttl {
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    display: block;
    border-left: 8px solid var(--ps-blue);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.archive_ttl:hover {
    color: var(--yk-yellow);
}

.tensen {
    width: 100%;
    border: 1px dashed #ccc;
    margin: 1.5rem 0;
}

/* ---- 表示件数セレクト ---- */
.sele {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.sele::after {
    position: absolute;
    right: 15px;
    width: 10px;
    height: 7px;
    background-color: #535353;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    content: '';
    pointer-events: none;
}

.sele select {
    appearance: none;
    min-width: 100px;
    height: 2.8em;
    padding: 0.4em calc(0.8em + 30px) 0.4em 0.8em;
    border: none;
    border-bottom: 2px dotted var(--yk-yellow);
    background-color: var(--ps-white);
    color: #333333;
    font-size: 1em;
    cursor: pointer;
}

.sele select:focus {
    outline: none;
}

/* ---- キーワード ---- */
.ps-keyword {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    background: var(--ps-white);
    border: 1px solid var(--ps-border);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}

.ps-keyword label {
    font-weight: 600;
    color: var(--ps-blue);
    white-space: nowrap;
}

.ps-keyword input[type="text"],
.ps-keyword input[type="number"] {
    flex: 1 1 220px;
    min-width: 160px;
    padding: 0.6em 0.8em;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    font-size: 1rem;
}

.ps-keyword input[type="number"] {
    flex: 0 1 160px;
}

.ps-keyword input[type="text"]:focus,
.ps-keyword input[type="number"]:focus {
    outline: none;
    border-color: var(--ps-blue);
}

/* ---- 件数バッジ（右上固定） ---- */
.ps-count-bar {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    pointer-events: none;
}

.ps-count-badge {
    pointer-events: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4em;
    background: var(--yk-grad-main);
    color: var(--ps-white);
    border-radius: 999px;
    padding: 0.6em 1.4em;
    box-shadow: 0 4px 14px rgba(var(--yk-navy-rgb), 0.3);
    font-weight: 600;
}

.ps-count-badge__num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--yk-yellow);
}

.ps-count-badge.is-updating {
    opacity: 0.6;
}

/* ---- セクション ---- */
.ps-section {
    background: var(--ps-white);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.2rem;
}

.ps-section__title {
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ps-blue);
    border-left: 6px solid var(--ps-red);
    padding-left: 0.7em;
    margin-bottom: 1rem;
}

/* ---- ボタングリッド共通 ---- */
.ps-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.9rem;
    padding: 0 6px 6px 0;
}

.ps-btn-grid--text {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.ps-btn {
    position: relative;
}

.ps-btn input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.ps-btn__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 0.7em 0.5em;
    border: 2px solid var(--ps-border);
    border-radius: 10px;
    background: var(--ps-gray);
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.ps-btn__label:hover {
    border-color: var(--ps-blue);
}

.ps-btn input:checked + .ps-btn__label {
    border-color: transparent;
    background: var(--yk-grad-accent);
    color: var(--ps-white);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(var(--yk-pink-rgb), 0.35);
}

.ps-btn input:focus-visible + .ps-btn__label {
    outline: 2px solid var(--ps-blue);
    outline-offset: 2px;
}

/* 画像ボタン（カテゴリー） */
.ps-btn--image .ps-btn__label {
    aspect-ratio: 1 / 1;
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center 12%;
    padding-top: 0.5em;
    justify-content: flex-end;
}

/* 選択中も画像を拡大しない（上の :checked の background 指定で大きさ・位置が初期値に戻るため指定し直す） */
.ps-btn--image input:checked + .ps-btn__label {
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center 12%;
}

.ps-btn--image .ps-btn__label span {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 6px;
    padding: 0.15em 0.5em;
    width: 100%;
}

.ps-btn input:checked + .ps-btn__label span {
    background: rgba(255, 255, 255, 0.95);
    color: var(--ps-red);
}

/* アイコンボタン（車輪溝形状） */
.ps-btn--icon .ps-btn__label img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.ps-btn input:checked + .ps-btn--icon-label img,
.ps-btn--icon .ps-btn__label img {
    background: var(--ps-white);
    border-radius: 6px;
}

/* ---- 検索実行バー ---- */
.ps-final-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 70%, rgba(255, 255, 255, 0));
    padding: 1rem 0 0.6rem;
}

.ps-final-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--ps-white);
    border: 1px solid var(--ps-border);
    border-radius: 999px;
    padding: 0.6rem 0.8rem 0.6rem 1.4rem;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
}

.ps-final-bar__count {
    font-weight: 700;
    color: var(--ps-blue);
    white-space: nowrap;
}

.ps-final-bar__count strong {
    font-size: 1.3rem;
    color: var(--ps-red);
    margin: 0 0.15em;
}

.ps-search-btn {
    background: var(--yk-grad-accent);
    color: var(--ps-white);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.15em;
    border: none;
    border-radius: 999px;
    padding: 0.85em 2.2em;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.ps-search-btn:hover {
    filter: brightness(1.1);
}

.ps-search-btn:active {
    transform: scale(0.98);
}

.ps-clear-btn {
    display: inline-block;
    color: var(--ps-blue);
    font-weight: 600;
    text-decoration: none;
    padding: 0.6em 1em;
    border: 1px solid var(--ps-blue);
    border-radius: 999px;
    white-space: nowrap;
}

.ps-clear-btn:hover {
    background: var(--ps-blue);
    color: var(--ps-white);
}

/* ---- 結果表示件数セレクト ---- */
.ps-display-count {
    display: flex;
    align-items: center;
    gap: 0.6em;
    justify-content: flex-end;
    margin-bottom: 0.8rem;
}

.ps-display-count select {
    border: 1px solid var(--ps-border);
    border-radius: 6px;
    padding: 0.4em 0.8em;
}

/* ---- 結果一覧 ---- */
.ps-results-wrap {
    margin-top: 2rem;
}

.ps-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.ps-results-heading__total {
    font-weight: 700;
    color: var(--ps-blue);
}

.ps-results-heading__total strong {
    color: var(--ps-red);
    font-size: 1.2rem;
    margin: 0 0.2em;
}

.ps-result {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 1rem 0;
}

.ps-result_img {
    flex: 0 0 140px;
    width: 140px;
}

.ps-result_body {
    flex: 1 1 320px;
}

.ps-empty-message,
.ps-prompt-message {
    text-align: center;
    color: var(--ps-blue);
    font-size: 1.1rem;
    padding: 2rem 0;
}

.ps-size-empty {
    grid-column: 1 / -1;
    color: #777;
    font-size: 0.9rem;
    padding: 0.6rem 0;
}

.ps-loading {
    text-align: center;
    color: var(--ps-blue);
    padding: 1.5rem 0;
}

/* ---- AJAXページネーション ---- */
.ps-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.2rem 0;
}

.ps-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.6em;
    border-radius: 50%;
    background-color: var(--yk-cyan-light);
    color: var(--ps-blue);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-pagination button.is-current {
    background-color: var(--ps-blue);
    color: var(--ps-white);
}

.ps-pagination button:hover {
    background-color: var(--ps-red);
    color: var(--ps-white);
}

.ps-pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ---- ページネーション（JS無効時のフォールバック: the_posts_pagination） ---- */
.pagination {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.pagination .nav-links {
    display: flex;
    gap: 10px;
}

.pagination .page-numbers {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    margin: 0 5px;
    border-radius: 50%;
    background-color: var(--yk-cyan-light);
    color: var(--ps-blue);
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pagination .page-numbers.current {
    background-color: var(--ps-blue);
    color: #fff;
}

.pagination .page-numbers:hover {
    background-color: var(--ps-red);
    color: #fff;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .pagination .page-numbers {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 14px;
    }
}

/* ---- レスポンシブ ---- */
@media (max-width: 767px) {
    .ps-btn-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ps-btn-grid--text {
        grid-template-columns: repeat(2, 1fr);
    }

    .ps-count-bar {
        top: 6px;
    }

    .ps-count-badge {
        padding: 0.5em 1em;
        font-size: 0.9rem;
    }

    .ps-count-badge__num {
        font-size: 1.2rem;
    }

    .ps-final-bar__inner {
        flex-direction: column;
        border-radius: 16px;
        width: 100%;
        padding: 0.9rem 1rem;
    }

    .ps-search-btn {
        width: 100%;
    }

    .ps-result_img {
        flex: 0 0 100px;
        width: 100px;
    }
}

@media (max-width: 420px) {
    .ps-btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
