.camera-viewer {
    max-width: 900px;
    margin: 10px auto;
    text-align: center;
}

.viewer-title {
    font-size: 18px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.mode-comment-area {
    margin-bottom: 40px;
    min-height: 4.5em;
}

.mode-comment {
    margin: 0;
    line-height: 1.6;
}

.image-box {
    width: 100%;
    margin-bottom: 0px;
}

.image-box img {
    width: 100%;
    height: auto;
    display: block;
}

.controls {
    position: relative;
    width: 100%;
    border-top: 1px solid #333; 
    margin-top: 5px !important;
    height: 80px;
    clear: both;
}

.labels {
    position: relative;
    width: 100% !important;
    margin: 0 auto;
    height: 60px;
    padding: 0;
    list-style: none;
}

.labels li {
    position: absolute;
    top: 20px !important;
    transform: translateX(-50%);
    font-size: 11px;
    line-height: 1.5;
    color: #999;
    cursor: pointer;
    white-space: nowrap;
}

.labels li.active {
    color: #000;
    font-weight: bold;
}

.pointer {
    position: absolute;
    top: 5px !important;
    left: 0;
    transform: translateX(-50%);
    font-size: 10px;
    line-height: 1;
    color: #000;
    z-index: 10;
}

/* ギャラリー部分への干渉防止 */
.photo-panel-grid {
    display: block;
    column-count: 3;
    column-gap: 5px;
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 3px;
    clear: both;
}

.panel-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 0px;
    break-inside: avoid;
}

.panel-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- PHOTO GALLERY専用：縦の隙間を詰め、下を段々にする --- */
.masonry-layout {
    display: block !important;   /* Flexを解除して段組みモードにする */
    column-count: 3;             /* 3列に設定 */
    column-gap: 3px;             /* 横の隙間を3pxに固定 */
}

.masonry-layout .panel-item {
    display: block;              /* 縦に流れるように設定 */
    width: 100%;
    margin-bottom: 3px;          /* 縦の隙間を3pxに固定 */
    break-inside: avoid;         /* 画像が途中で途切れるのを防ぐ */
}

/* --- 画像の配置を中央に強制する --- */
.pswp__img {
    /* padding設定を活かしつつ、上下中央に配置されるように調整 */
    object-fit: contain !important;
}

/* スライド移動のアニメーションを滑らかにする */
.pswp__container {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* スライドの動きを滑らかにするイージングの設定 */
.pswp__scroll-wrap {
    /* 
       Swiperに近い滑らかな加速・減速（ease-out系）を指定。
       クリックした時の「スッ」と動く質感が向上します。
    */
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Exifエリア・矢印のスタイル（既存のものを維持） */
.custom-exif-area {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-size: 16px !important;
    z-index: 99999 !important;
    pointer-events: none;
    text-align: center;
}

/* 上部の「×」ボタンなどの背景を消して、画像と被りにくくする */
.pswp__top-bar {
    background: none !important;
    height: 60px !important; /* 上の余白（padding-top）に収める */
}

/* --- スマホ・PC共通：矢印を強制的に表示する --- */
.pswp__button--arrow {
    display: block !important; /* スマホでも隠さない */
    opacity: 1 !important;     /* 常に表示させる（または0.5などで控えめに） */
    visibility: visible !important;
}


/* --- 中央の垂直区切り線（PCサイズ 1200px以上で表示） --- */
@media screen and (min-width: 1200px) {
    /* 親要素に基準線を引き、高さを100%にする準備 */
    #product_buy .l-panelGrid {
        position: relative !important;
        display: flex !important;
        justify-content: center !important;
        align-items: stretch !important; /* 左右の要素の高さを揃える */
        gap: 0 !important;
    }

    /* 垂直線の描画設定（上から下まで） */
    #product_buy .l-panelGrid::after {
        content: "" !important;
        display: block !important;
        position: absolute !important;
        left: 50% !important;
        top: 0 !important;      /* 要素の最上部から */
        bottom: 0 !important;   /* 要素の最下部まで */
        width: 1px !important;  /* ご指定の太さ */
        background-color: #e9e9e8 !important; /* ご指定の色 */
        transform: translateX(-50%) !important;
        z-index: 1 !important;
    }

    /* 製品カードが線に被らないよう左右の余白を調整 */
    #product_buy .m-productCard {
        width: 50% !important;
        max-width: 550px !important;
        padding: 0 40px !important;
        box-sizing: border-box !important;
    }
}

/* --- 「利用マウント」を源ノゴシックにする --- */
#product_buy .f-ulJp > p {
    /* 源ノゴシックの一般的なWebフォント指定名を網羅 */
    font-family: "Source Han Sans JP", "Source Han Sans", "Noto Sans JP", "源ノゴシック", sans-serif !important;
    font-size: 14px !important;
    margin-bottom: 12px !important;
    color: #333 !important;
}



@media screen and (max-width: 768px) {
    /* コントロールエリア全体の高さを調整 */
    .controls {
        overflow-x: visible; 
        padding-top: 0 !important; 
        height: 55px; /* 不要な余白を削ってコンパクトに */
    }

    .labels {
        width: 95%; /* 左右の余白を調整 */
    }
    
    /* 1. 【線】と【▲】の間隔を 3px にする */
    .pointer {
        font-size: 8px;   /* ▲の高さ：約8px */
        top: 3px !important; 
    }

    /* 2. 【▲】と【数値】の間隔を 3px にする */
    /* 計算：線(0) + 隙間(3) + ▲高さ(8) + 隙間(3) = 14px */
    .labels li {
        top: 14px !important;
        font-size: 9px;
    }

    /* 3つ目のパーツ（MORE PHOTO）との距離も微調整 */
    .photo-panel-grid {
        display: flex;         /* 横隙間を固定するために配置方法を変更 */
        flex-wrap: wrap;       /* 折り返しを許可 */
        column-gap: 3px;       /* 横の隙間を3pxに固定 */
        row-gap: 3px;          /* 縦の隙間を3pxに固定 */
        padding: 0 3px;        /* 画面端との隙間 */
        margin-top: 20px;
    }

    .panel-item {
        /* 画面幅から隙間2分(6px)を引いて3等分する計算 */
        width: calc((100% - 6px) / 3); 
        margin-bottom: 0;      /* row-gapで制御するため0にする */
    }

    .panel-item img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;     /* 画像の端を綺麗に揃える */
    }

    .masonry-layout {
        column-count: 3;
        column-gap: 3px;
        padding: 0 3px;
    }

    .pswp__button--arrow {
        width: 50px !important;  /* スマホ用に少し幅を調整 */
        height: 80px !important;
        background: rgba(0, 0, 0, 0.2) !important; /* スマホは枠があった方が誤操作しにくいです */
    }
    .pswp__button--arrow--prev { left: 5px !important; }
    .pswp__button--arrow--next { right: 5px !important; }
    
    /* スマホでExif文字が大きすぎる場合はここで調整 */
    .custom-exif-area {
        font-size: 14px !important; /* スマホは少し小さく（14〜16px）がおすすめ */
        height: 80px !important;    /* 余白に合わせて調整 */
    }

/* 購入エリアの2カラム調整 */
#product_buy .l-grid-pc.--panel-2-pc {
    display: flex;
    justify-content: center;
    gap: 40px; /* 製品同士の間隔 */
    max-width: 1200px; /* 2つ並んだ時の最大幅 */
    margin: 0 auto;
}

#product_buy .m-productCard.--buy-style {
    flex: 1; /* 均等に幅を取る */
    max-width: 500px;
}

#product_buy .c-productOverviewBlock__body h1 {
    min-height: 3em; /* タイトルの高さを揃える */
}

}