/* =========================================================
   製品カテゴリ一覧ページ（/pc/）
   トップ階層ジャンプリンク＋全階層表示。
   末端の枝は「グループカード（小見出し＋葉の縦リスト）」化し、
   CSS multi-column で段組して余白を詰める。
   ========================================================= */
.pc-list-box {
    margin: 10px 0;
}
.pc-list-box a {
    text-decoration: none;
}

/* ===== 上に戻るボタン（/bc/・/pc/ 共通）。右下スタック(.right-display: Hot Line + LINE)の上に配置 =====
   Hot Line 追加で .right-display が高くなった（PC=126px / モバイル≈145px 到達）ため、
   重ならないよう bottom を上げる（モバイルは Hot Line がアイコンで更に高いので別途上げる）。 */
.pc-to-top {
    position: fixed;
    right: 28px;
    bottom: 140px;
    z-index: 900;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 22px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.pc-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}
.pc-to-top:hover {
    background: rgba(0, 0, 0, 0.8);
}
/* モバイルは Hot Line が丸アイコン(57px)になりスタックが高い（≈145px）ので更に上げる */
@media screen and (max-width: 768px) {
    .pc-to-top {
        bottom: 165px;
    }
}

/* ジャンプ先の固定ヘッダー分オフセット（スムース＆位置補正はJSで実施） */
.pc-list-box [id^="pc-"],
.brand-list-box [id^="brand-"] {
    scroll-margin-top: 110px;
}
@media screen and (max-width: 640px) {
    .pc-list-box [id^="pc-"],
    .brand-list-box [id^="brand-"] {
        scroll-margin-top: 70px;
    }
}

/* ===== 絞り込み検索 ===== */
.pc-list-box .pc-search {
    margin: 0 0 18px;
}
.pc-list-box .pc-search-input {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #bfbfbf;
    border-radius: 5px;
}
.pc-list-box .pc-search-input:focus {
    outline: none;
    border-color: #e12315;
    box-shadow: 0 0 0 2px rgba(225, 35, 21, 0.15);
}
.pc-list-box .pc-search-empty {
    display: inline-block;
    margin-top: 10px;
    color: #e12315;
    font-weight: bold;
}
.pc-list-box .pc-search-empty[hidden] {
    display: none;
}
.pc-list-box .is-hidden {
    display: none !important;
}

/* ===== トップ階層ジャンプリンク（トップページ featured-categories 風: 画像＋下に名前） ===== */
.pc-list-box .pc-list-title {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 22px;
}
@media screen and (min-width: 768px) {
    .pc-list-box .pc-list-title {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media screen and (min-width: 821px) {
    .pc-list-box .pc-list-title {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}
.pc-list-box .pc-list-title .b-item {
    margin: 0;
    border: 1px solid #ddd;
    box-shadow: none;
    text-align: center;
    background: #fff;
}
.pc-list-box .pc-list-title .b-item:hover {
    background: #f5f6f6;
}
.pc-list-box .pc-list-title .b-item a {
    display: block;
    height: auto;
    padding: 8px;
    text-decoration: none;
    color: #333;
}
.pc-list-box .pc-list-title .b-item .pc-cat-img {
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 0 auto 8px;
    aspect-ratio: 1 / 1; /* 画像が無くても正方形の枠を確保→テキスト位置が揃う */
    overflow: hidden;
}
.pc-list-box .pc-list-title .b-item .pc-cat-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pc-list-box .pc-list-title .b-item .pc-cat-name {
    display: block;
    font-size: 14px;
    line-height: 1.4;
}
@media screen and (max-width: 767px) {
    .pc-list-box .pc-list-title .b-item .pc-cat-name {
        line-height: 1.35;
    }
}

/* ===== 全幅見出し（h2=第1階層 / h3・h4=下位の“深い枝”） ===== */
.pc-list-box .pc-archive h2.pc-heading {
    margin: 25px 0 12px;
    padding: 15px;
    border-top: 2px solid #000000;
    border-bottom: 1px solid #e3e4e5;
    background: #f8f8f8;
    font-size: 24px !important;
    font-weight: 700;
}
.pc-list-box .pc-archive h3.pc-heading,
.pc-list-box .pc-archive h4.pc-heading,
.pc-list-box .pc-archive h5.pc-heading,
.pc-list-box .pc-archive h6.pc-heading {
    margin: 14px 0 10px;
    padding: 10px 0;
    border-bottom: 1px solid #222;
    background: #ffffff;
    font-size: 19px;
    font-weight: 700;
}
.pc-list-box .pc-archive .pc-heading a {
    color: #000000;
}

/* ===== グループカード群（multi-column 段組） ===== */
.pc-list-box .pc-group-grid {
    columns: 4;
    column-gap: 25px;
    margin: 10px 0 8px;
}
@media screen and (max-width: 1024px) {
    .pc-list-box .pc-group-grid {
        columns: 2;
    }
}
@media screen and (max-width: 640px) {
    .pc-list-box .pc-group-grid {
        columns: 1;
    }
}
.pc-list-box .pc-group {
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 18px;
    padding: 10px;
    background: #fafafa;
    /* 画面外カードは描画スキップして初期描画/スクロールを軽量化 */
    content-visibility: auto;
    contain-intrinsic-size: auto 220px;
}

/* グループの小見出し（末端の枝名。h4等） */
.pc-list-box .pc-group-title {
    margin: 0 0 6px;
    padding: 3px 0 6px;
    border-bottom: 1px solid #222;
    color: #111;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
}
.pc-list-box .pc-group-title a {
    color: #000;
}

/* 縦リスト（1行=1カテゴリ、アイコン左・テキスト右） */
.pc-list-box .pc-group-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pc-list-box .pc-row {
    list-style: none;
}
.pc-list-box .pc-row > a {
    display: flex;
    align-items: center;
    padding: 4px 4px;
    color: #222;
    font-size: 13px;
    line-height: 1.35;
}
.pc-list-box .pc-row > a:hover {
    background: #f5f6f6;
}
.pc-list-box .pc-row-img {
    flex: 0 0 auto;
    width: 35px;
    height: 35px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pc-list-box .pc-row-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.pc-list-box .pc-row-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* =========================================================
   Related Brands（製品カテゴリページ: 関連ブランドカテゴリへのリンク）
   ロゴ（ブランドトップ）＋その下にカテゴリ名を中央寄せ。
   ========================================================= */
.related-brands {
    margin: 20px 0 10px;
}
.related-brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
@media screen and (max-width: 640px) {
    .related-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }
}
.related-brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #ddd;
    background: #fff;
    text-decoration: none;
    color: #222;
}
/* コアの a:visited / a:hover（詳細度 0,1,1）に負けて青リンク色になるため、
   セクション内のリンク色は状態込みで固定する。 */
.related-brand-item:visited,
.related-brand-item:hover,
.related-brand-item:focus,
.related-brand-item:active,
.related-brand-item .related-brand-name {
    color: #222;
}
.related-brand-item:hover {
    background: #f5f6f6;
}
.related-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 60px;
    margin-bottom: 8px;
}
.related-brand-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.related-brand-name {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

/* =========================================================
   สินค้าแนะนำสำหรับ{カテゴリ名}（製品カテゴリページ: 関連ブランドごとの商品一覧）
   1行＝1ブランド。左にブランドロゴ、右に商品カードを横スクロール。
   カードの見た目は PDP の関連商品（.product-related-swiper）に合わせている。
   ========================================================= */
.brand-products {
    margin: 20px 0 10px;
}
.brand-products-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
    min-width: 0;
}
.brand-products-brand {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #ddd;
    background: #fff;
    text-decoration: none;
    box-sizing: border-box;
}
.brand-products-brand,
.brand-products-brand:visited,
.brand-products-brand:hover,
.brand-products-brand:focus,
.brand-products-brand:active,
.brand-products-brand .brand-products-brand-name {
    color: #222;
}
.brand-products-brand:hover {
    background: #f5f6f6;
}
.brand-products-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 60px;
    margin-bottom: 8px;
}
.brand-products-brand-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.brand-products-brand-name {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

/* 商品カード列: 横スクロール（PDP 関連商品と同じく CSS のみ・JS不要） */
.brand-products-cards {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
/* マウスドラッグでのスライド（Monet_Module/js/drag-scroll）。
   ドラッグ中はカード内のテキスト選択とリンクのドラッグを止める。 */
.brand-products-cards.is-drag-scrollable {
    cursor: grab;
}
.brand-products-cards.is-drag-scrolling {
    cursor: grabbing;
    user-select: none;
}
/* 画像・リンクを「つまんで持って行く」ネイティブ D&D を無効化。
   ドラッグ開始前から効いている必要があるので状態クラスには紐づけない。 */
.brand-products-cards a,
.brand-products-cards img {
    -webkit-user-drag: none;
    user-drag: none;
}
.brand-products-card {
    flex: 0 0 248px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    border-left-width: 0;
    background: #fff;
    box-sizing: border-box;
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.brand-products-card:first-child {
    border-left-width: 1px;
}
.brand-products-card,
.brand-products-card:visited,
.brand-products-card:hover,
.brand-products-card:focus,
.brand-products-card:active {
    color: #222;
}
.brand-products-card:hover {
    background: #f5f6f6;
}
.brand-products-card:hover img {
    filter: brightness(95%);
}
.brand-products-card:hover .brand-products-meta-row:nth-child(odd),
.brand-products-card:hover .brand-products-meta-row:nth-child(even) {
    background-color: #f5f6f6;
}
.brand-products-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding-top: 8px;
    text-align: center;
}
.brand-products-card-img img {
    width: 200px;
    max-width: 100%;
    max-height: 200px;
    height: auto;
    object-fit: contain;
}
.brand-products-card-body {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 88px;
    padding: 0 10px;
    box-sizing: border-box;
}
.brand-products-card-title {
    flex: 0 1 auto;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 12px;
    color: #222;
    margin: 8px 0 0;
    line-height: 1.35;
    max-height: calc(1.35em * 2);
}
.brand-products-card-price {
    flex-shrink: 0;
    margin-top: auto;
    padding-bottom: 4px;
}
.brand-products-meta {
    margin-top: auto;
}
.brand-products-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 10px;
    font-size: 11px;
    line-height: 1.35;
}
.brand-products-meta-row:nth-child(odd) {
    background-color: #f7f7f7;
}
.brand-products-meta-label {
    flex: 0 0 62px;
    color: #666;
}
/* 色を明示しないと、カード全体が <a> のためホバー時に親テーマの a:hover（赤）を継承する */
.brand-products-meta-value {
    flex: 1 1 auto;
    min-width: 0;
    color: #222;
    word-break: break-word;
}
.brand-products-stock-jp-line {
    display: block;
    margin-top: 5px;
}

/* 在庫バッジ。.stock-style / .stock-non は page-single-product.css にしか無く
   カテゴリページでは読み込まれないため、このセクション用に持ち込む
   （カテゴリ一覧側の同名クラスに影響しないよう .brand-products 配下に限定）。 */
.brand-products .stock-style {
    font-weight: bold;
    padding: 5px 10px;
    font-size: 15px;
    border-radius: 5px;
    display: inline-block;
}
.brand-products .stock-low,
.brand-products .stock-high {
    background-color: #004099;
    color: #fff;
}
.brand-products .stock-non {
    background-color: #969696;
    color: #fff;
}

@media screen and (max-width: 640px) {
    .brand-products-row {
        flex-direction: column;
        gap: 8px;
    }
    .brand-products-brand {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
    }
    .brand-products-brand-logo {
        width: 90px;
        height: 44px;
        margin-bottom: 0;
    }
    .brand-products-card {
        flex-basis: 200px;
    }
}
