/* select.css - お位牌一覧ページ用スタイル
   style.css (旧サイト) より抽出 */

/* ---- ページタイトル ---- */
#pageTtl {
    background: #fff;
  border-top: 1px solid #e6dfd0;
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid #e6dfd0;
    margin-bottom: 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}
#pageTtl h1 {
    font-size: 1.4rem;
    color: #563211;
    margin: 0;
}

/* ---- メッセージ ---- */
.mess {
    text-align: center;
    font-weight: bold;
}

/* ---- カテゴリ選択カード ---- */
.select-categories {
    padding: 1.5em 0 0.5em;
}
.select-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1em;
}
.select-category-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e8e1d3;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 200ms, transform 200ms;
}
.select-category-card:hover {
    box-shadow: 0 4px 16px rgba(198, 162, 97, 0.25);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.select-category-img-wrap {
    background: #fff;
  border-top: 1px solid #e6dfd0;
    text-align: center;
    padding: 1em 0.5em;
}
.select-category-img-wrap img {
    max-height: 120px;
    width: auto;
    display: block;
    margin: 0 auto;
}
.select-category-info {
    padding: 0.8em 1em;
}
.select-category-info h3 {
    font-size: 1rem;
    font-weight: bold;
    color: #563211;
    margin: 0 0 0.3em;
}
.select-category-info p {
    font-size: 0.8rem;
    color: #666;
    margin: 0 0 0.4em;
    line-height: 1.5;
}
.select-category-price {
    font-size: 0.95rem;
    font-weight: bold;
    color: #cc2200;
}
@media (max-width: 575.98px) {
    #pageTtl {
        height: 59px;
    }
    .select-categories-grid {
        grid-template-columns: 1fr;
        gap: 0.8em;
    }
    .select-category-card {
        display: flex;
        align-items: center;
    }
    .select-category-img-wrap {
        flex-shrink: 0;
        width: 140px;
        padding: 1.5em 0.8em;
    }
    .select-category-img-wrap img {
        max-height: 100px;
        width: 100%;
        object-fit: cover;
    }
}

/* ---- カテゴリカード（compact版：カテゴリページ用） ---- */
.select-categories.compact {
    padding: 0.8em 0 0.4em;
}
/* 一覧上部のコンパクト版だけスクロール固定（JSで .pinned 切替）
   祖先に overflow-x:hidden があり position:sticky が効かないため、JS で fixed に切替。
   pinned 時はヘッダーは隠してよい仕様なので top:0 / z-index で site-header(100) より手前。 */
section.select-categories.compact.pinned {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.select-categories.compact .select-categories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5em;
}
.select-categories.compact .select-category-card {
    border-radius: 6px;
}
.select-categories.compact .select-category-img-wrap {
    padding: 0.4em 0.3em;
}
.select-categories.compact .select-category-img-wrap img {
    max-height: 60px;
}
.select-categories.compact .select-category-info {
    padding: 0.3em 0.5em 0.5em;
    text-align: center;
}
.select-categories.compact .select-category-info h3 {
    font-size: 0.8rem;
    margin: 0;
}
.select-categories.compact .select-category-price {
    font-size: 0.7rem;
}
.select-categories.compact .select-category-card.active {
    border-color: #c6a261;
    background: #fdf8ee;
    pointer-events: none;
}
.select-categories.compact .select-category-card.active h3 {
    color: #c6a261;
}
@media (max-width: 575.98px) {
    .select-categories.compact .select-categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3em;
    }
    .select-categories.compact .select-category-card {
        display: block;
    }
    .select-categories.compact .select-category-img-wrap {
        width: auto;
        padding: 0.3em 0.2em;
    }
    .select-categories.compact .select-category-img-wrap img {
        max-height: 48px;
        width: auto;
        object-fit: contain;
    }
    .select-categories.compact .select-category-info h3 {
        font-size: 0.7rem;
    }
    .select-categories.compact .select-category-price {
        font-size: 0.65rem;
    }
}

/* ---- 位牌一覧グリッド ---- */
.select1 .img img {
    width: 100%;
    height: auto;
}
.select1 {
    display: inline-block;
    width: 15em;
    max-width: 50%;
    background: #fff;
    border: 1px solid #fff;
    box-sizing: border-box;
    vertical-align: top;
    cursor: pointer;
    position: relative;
}
.select1 .img {
    background: linear-gradient(to bottom, #fff 0%, #ddd 80%, #fff 81%, #eee 100%);
    padding: 0.5em;
}
.select1 .kikakus {
    display: none;
}

/* ---- ポップアップ ---- */
.popupbg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background-color: rgba(0,0,0,0.5);
}
.popup {
    position: fixed;
    background-color: #fff;
    top: 4em;
    left: calc(50% - 15em);
    width: calc(100% - 2em);
    max-width: 30em;
    z-index: 99999;
    padding: 0.5em;
    font-size: 1rem;
    overflow: visible;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    animation: fadeScaleIn 0.25s ease-out;
}
.popupbg {
    animation: fadeIn 0.25s ease-out;
}
/* 閉じる時のアニメーション */
.popup.closing {
    animation: fadeScaleOut 0.2s ease-in forwards;
}
.popupbg.closing {
    animation: fadeOut 0.2s ease-in forwards;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes fadeScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeScaleOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.95); }
}
/* スワイプハンドル（デスクトップでは非表示） */
.popup-handle {
    display: none;
}

/* ポップアップヘッダー */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1em 1em 0.6em;
}
.popup-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--color-brown);
}
.popup .close {
    position: absolute;
    right: -12px;
    top: -12px;
    width: 28px;
    height: 28px;
    border: none;
    background: #fff;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    line-height: 1;
}
.popup .close:hover {
    background: #f0f0f0;
    color: #333;
}
/* スマホ: ボトムシート */
@media (max-width: 480px) {
    .popupbg {
        background-color: rgba(0,0,0,0.5);
    }
    .popup {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 75vh;
        overflow-y: auto;
        padding: 0.5em 0.5em 1.5em;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
        animation: slideUp 0.3s ease-out;
    }
    .popup .close {
        /* モバイル: 右上の縁いっぱい、縁取り無し */
        right: 2px;
        top: 2px;
        width: 32px;
        height: 32px;
        font-size: 20px;
        z-index: 2;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    .popup-handle {
        display: flex;
        justify-content: center;
        padding: 0.6em 0 0.2em;
        cursor: grab;
        touch-action: none;
    }
    .popup-handle span {
        display: block;
        width: 36px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }
    .popup.closing {
        animation: slideDown 0.2s ease-in forwards;
    }
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    @keyframes slideDown {
        from { transform: translateY(0); }
        to   { transform: translateY(100%); }
    }
}
.popup .mess {
    padding: 0 1em 0.8em;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
    border-bottom: 1px dotted #ddd;
    margin-bottom: 0.3em;
}
.popup .mess-sub {
    font-size: 0.8rem;
    color: var(--color-gold-dark);
}
/* 詳細ボタン */
.popup-detail-btn {
    padding: 0.3em 0.8em;
    border: 1.5px solid var(--color-gold);
    border-radius: 4px;
    color: var(--color-gold-dark);
    font-size: 0.75rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 200ms;
    white-space: nowrap;
    margin-left: auto;
    margin-right: 0;
}
.popup-detail-btn:hover {
    background: var(--color-gold);
    color: #fff;
    text-decoration: none;
}
.popup .note {
    padding: 0.5em;
    color: #800;
    width: 100%;
}
.popup .kikaku1 {
    width: 100%;
    border-bottom: 1px dotted #ddd;
}
.popup .kikaku1:last-child {
    border-bottom: none;
}
.popup .kikaku1:hover {
    background-color: #f8f5ef;
}
.popup .kikaku1 .size {
    display: inline-block;
    padding: 0.5em 0em 0.5em 0.5em;
    width: calc(100% - 7em);
    text-align: left;
    vertical-align: middle;
    box-sizing: border-box;
}
.popup .kikaku1[soldout='欠品'] {
    pointer-events: none;
    background-color: #ddd;
    color: #666;
}
.popup .kikaku1[soldout='欠品'] .size:after {
    content: '欠品中';
    color: #f00;
}
/* 税抜き価格は非表示（JSの計算に使うためDOMには残す） */
.popup .kikaku1 .price {
    display: none;
}
.popup .kikaku1 .tprice {
    display: inline-block;
    padding: 0.5em;
    width: 7em;
    text-align: right;
    vertical-align: middle;
    box-sizing: border-box;
    font-weight: bold;
}
.popup .kikaku1.specialprice .price,
.popup .kikaku1.specialprice .tprice {
    padding: 0.25em 0.5em;
}
.popup .kikaku1.specialprice .mprice,
.popup .kikaku1.specialprice .mtprice {
    font-size: 80%;
    color: #444;
    text-decoration: line-through;
}
.popup .kikaku1.specialprice .dprice,
.popup .kikaku1.specialprice .dtprice {
    font-weight: bold;
    color: #f22;
    text-decoration: none;
}
.url360 {
    border-top: 1px dotted #ddd;
    padding: 1.5em 0.5em 1em 0.5em;
    cursor: pointer;
}
.url360 img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}
.popup .kikaku1:last-child {
    border-bottom: 1px solid #ddd;
}

/* ---- 一覧エリア ---- */
.selectlist {
    margin-top: 2em;
    text-align: center;
}

/* ---- カテゴリタブ（非表示） ---- */
.categorys {
    display: none !important;
    position: absolute;
    z-index: 9998;
    width: 100%;
    left: 0;
    top: 5.1em;
    padding: 0.5em 0;
    background-color: #fff;
    box-sizing: border-box;
    border-top: 0.1em solid #eee;
    border-bottom: 0.1em solid #eee;
    text-align: center;
}
body.headerfixed .categorys {
    position: fixed;
    top: 0;
}
@media (max-width: 767px) {
    .categorys {
        top: 5em;
    }
    .selectlist {
        margin-top: 2em;
    }
}

.category1 {
    display: inline-block;
    padding: 0.5em 0;
    margin: 0.2em;
    width: calc(16.5% - 0.4em);
    text-align: center;
    box-sizing: border-box;
    border-radius: 0.5em;
    border-top: 0.2em solid rgba(255,255,255,0.2);
    border-left: 0.2em solid rgba(255,255,255,0.2);
    border-right: 0.2em solid rgba(0,0,0,0.2);
    border-bottom: 0.2em solid rgba(0,0,0,0.2);
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    color: inherit;
}
@media (max-width: 767px) {
    .category1 {
        font-size: 0.8em;
    }
}
.category1[category=すべての位牌] { background-color: #e6d291; color: #866231; width: calc(20% - 0.4em); }
.category1[category=塗り位牌]     { background-color: #c6a261; color: #fff;    width: calc(20% - 0.4em); }
.category1[category=唐木位牌]     { background-color: #000060; color: #fff;    width: calc(20% - 0.4em); }
.category1[category=モダン位牌]   { background-color: #dde;    color: #667;    width: calc(20% - 0.4em); }
.category1[category=会津位牌]     { background-color: #563211; color: #ffff80; width: calc(20% - 0.4em); }
.category1[category=普及品]  { background-color: #c6a261; color: #fff;    }
.category1[category=モダン]  { background-color: #dde;    color: #667;    }
.category1[category=本金粉]  { background-color: #e6d291; color: #866231; }
.category1[category=本金箔]  { background-color: #ffff80; color: #563211; }
.category1[category=黒檀]    { background-color: #000040; color: #fff;    }
.category1[category=紫檀]    { background-color: #400040; color: #fff;    }

/* ---- 位牌カード ---- */
.select1[category=普及品] .category  { background-color: #c6a261; color: #fff;    }
.select1[category=モダン] .category  { background-color: #dde;    color: #667;    }
.select1[category=本金粉] .category  { background-color: #e6d291; color: #866231; }
.select1[category=本金箔] .category  { background-color: #ffff80; color: #563211; }
.select1[category=黒檀]   .category  { background-color: #000040; color: #fff;    }
.select1[category=紫檀]   .category  { background-color: #400040; color: #fff;    }
.select1[category=会津]   .category  { background-color: #ffff80; color: #563211; }
.select1 .category {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: 0.65rem;
    font-weight: bold;
    border-radius: 3px;
    vertical-align: middle;
}
.select1 .name {
    display: inline;
    font-size: 0.85rem;
    color: #444;
    font-weight: bold;
    vertical-align: middle;
    margin-left: 0.3em;
}
.select1 .card-bottom {
    padding: 0.4em 0.5em;
    background-color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.select1 .price-from {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    color: #cc2200;
    margin-top: 0.2em;
}
.price-note {
    text-align: center;
    font-size: 0.85rem;
    color: #cc2200;
    margin: 0.4em 0 0.8em;
    padding: 0 1em;
}

/* ---- 位牌リスト（index.css より） ---- */
.ihailist {
    display: block;
}
.ihailist .ihai1 {
    display: inline-block;
}
.ihailist img {
    height: 5em;
}
