/* =========================================
   detailページ専用レイアウトリセット
   index-style.css の影響を完全に無効化
========================================= */

/* section の巨大余白を無効化 */
.product-detail,
.page-hero {
    padding: 0 !important;
}

/* page-hero の白背景を縮める（巨大な白帯を消す） */
.page-hero {
    background: #fff !important;
    margin: 0 !important;
    padding-top: 2rem !important;
    padding-bottom: 1rem !important;
    text-align: center;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 1;
}

/* page-hero 内の文字色を黒に戻す */
.page-hero h1,
.page-hero p {
    color: #1a1a1a !important;
}

/* container の flex/grid を無効化し、左右ズレを修正 */
.product-detail.container {
    display: block !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 2rem !important;
}

/* overflow hidden を解除（画像が隠れるのを防ぐ） */
.product-detail *,
.slider-container *,
.slider-wrapper *,
.slide * {
    overflow: visible !important;
}

/* =========================================
   商品画像（画面高さ30%）
========================================= */

.product-detail-image-wrap {
    text-align: center;
    margin-bottom: 2rem;
}

.product-detail-image {
    max-height: 30vh !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    cursor: zoom-in;
    position: relative !important;
    z-index: 2 !important;
}

/* =========================================
   スライダー（1枚だけ表示）
========================================= */

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden !important; /* ← 前後の画像を隠す */
    text-align: center;
    margin-bottom: 2rem;
}

.slider-wrapper {
    display: flex !important;
    width: 100%;
    transition: transform 0.3s ease;
}

.slide {
    width: 100% !important; /* ← 1枚を画面幅いっぱいに */
    flex-shrink: 0 !important;
    text-align: center;
}

.slide img {
    max-height: 30vh !important;
    width: auto !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    cursor: zoom-in;
    position: relative !important;
    z-index: 2 !important;
}

/* ボタン */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    font-size: 32px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 10;
}

.prev { left: 10px; }
.next { right: 10px; }

/* インジケーター */
.slider-dots {
    text-align: center;
    margin-top: 10px;
}

.slider-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 4px;
    cursor: pointer;
}

.slider-dots .active {
    background: #333;
}

/* =========================================
   商品情報
========================================= */

.product-detail-info {
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.price-main {
    font-size: 2rem;
    font-weight: bold;
    color: var(--green-deep);
}

.price-sub {
    color: #666;
    margin-top: 0.5rem;
}

.category {
    margin-top: 1rem;
    font-weight: bold;
    color: var(--green-mid);
}

/* =========================================
   商品説明（TinyMCE）
========================================= */

.product-detail-body {
    margin-top: 2rem;
    line-height: 1.8;
    color: #333 !important;
}

.product-detail-body p {
    margin-bottom: 1rem;
    color: #333 !important;
}

.product-detail-body h2,
.product-detail-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #222 !important;
}

.product-detail-body ul,
.product-detail-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: #333 !important;
}

/* =========================================
   戻るリンク
========================================= */

.back-link {
    margin-top: 3rem;
    margin-bottom: 4rem; /* ← 余白追加 */
    text-align: center;
}

/* =========================================
   モーダル（画像拡大）
========================================= */

.img-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

/* ============================
   商品タイトルを緑背景＋白文字に変更
============================ */
.page-hero {
    background: var(--green-mid) !important;
    padding-top: 2.5rem !important;
    padding-bottom: 2rem !important;
}

.page-hero h1,
.page-hero p {
    color: #fff !important;
}

/* ============================
   商品情報の背景を白に
============================ */
.product-detail-info {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* =========================================
   商品詳細全体を白背景カードで囲む（強制適用版）
========================================= */
.product-detail-card {
    background: #fff !important;
    padding: 2rem !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
    margin-bottom: 3rem !important;
}

/* 商品情報の個別の白背景を削除（カード内に溶け込ませる） */
.product-detail-info {
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* ============================
   PC表示時：商品情報と説明に左インデント
============================ */
@media (min-width: 768px) {
    .product-detail-info,
    .product-detail-body {
        padding-left: 5rem !important; /*
        padding-right: 2rem !important;
    }
}

/* 商品タグのサイズ変更 */
.product-tags .tag-badge {
    font-size: 17px;
    padding: 5px 12px;
    border-radius: 999px;
    display: inline-block;
}

.tag-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* 商品編集画面：画像プレビューを画面の高さ20%に制限 */
.preview-box img {
    max-height: 20vh;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

