/* ===================================
   BLUELOCK02 共通スタイル（ご当地ブルーロック リニューアル）
   ベース：naruto02_style.css
   変更点：TOPは1枚画像（スライダーなし）／CTAは画像ボタン／
           詳細は「テキスト見出し＋白カード（画像1点＋タイトル＋説明文）」
   =================================== */

/* 🔧 ページ背景色（TOP画像の地色・旧ブルーロックページと同色） */
.bluelock02-top,
.bluelock02-detail {
    background-color: #00439a;
}

/* 共通設定 */
#bluelock02-wrapper,
#bluelock02-detail-wrapper {
    width: 100%;
    min-height: 100vh;
    padding-top: 120px; /* ヘッダーとの距離 */
    padding-bottom: 0;
    box-sizing: border-box;
}

/* ===================================
   トップページ スタイル
   =================================== */

.bluelock02-top {
    padding: 40px 20px;
}

/* トップページのフッターとの下部余白 */
#bluelock02-wrapper {
    padding-bottom: 60px; /* 🔧 フッターとの距離 */
}

/* トップ画像（1枚・枠線付き） */
.top-visual-wrapper {
    max-width: 1000px;
    margin: 0 auto 50px; /* 🔧 画像下の余白 */
}

.top-visual-frame {
    /* 白枠線は先方依頼により削除（2026-10-08） */
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}

.top-main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

/* 注意書き画像 */
.ec-notice-wrapper {
    max-width: 1000px;
    margin: 0 auto 40px;
    padding: 0 20px;
    text-align: center;
}

.ec-notice-image {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 520px; /* 🔧 注意書き画像の表示幅 */
    height: auto;
}

/* 海賊バザール（購入ページ）CTA：支給画像ボタン */
.shop-cta-wrapper {
    max-width: 1000px;
    margin: 0 auto 60px; /* 🔧 ボタン下の余白 */
    padding: 0 20px;
    text-align: center;
    box-sizing: border-box;
}

.shop-cta-image-link {
    display: inline-block;
    line-height: 0;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.shop-cta-image-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.shop-cta-image {
    display: block;
    width: 440px; /* 🔧 CTA画像の表示幅 */
    max-width: 100%;
    height: auto;
}

/* 地域選択セクション */
.region-selection-wrapper {
    max-width: 1000px;
    margin: 0 auto 50px;
    display: flex;
    align-items: center;
    gap: 60px;
}

/* 左側エリア（地域から探す） */
.region-left-wrapper {
    flex-shrink: 0;
}

.region-title-image {
    width: 220px; /* 🔧 「地域から探す」画像の表示幅 */
    height: auto;
    display: block;
}

/* 右側のコンテンツエリア（ボタン） */
.region-content-wrapper {
    flex: 1;
}

.region-buttons-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 地域ボタン */
.region-button {
    background-color: #ffffff;
    color: #333333;
    border: none;
    border-radius: 999px;
    padding: 14px 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 1.4;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    text-align: center;
    width: 100%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.region-button:hover,
.region-button.active {
    background-color: #111111; /* 🔧 選択中／ホバー色（カンプの黒） */
    color: #ffffff;
}

/* カテゴリ一覧エリア（スポットボタン） */
.product-list-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px 40px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-item {
    background-color: transparent;
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-link {
    display: block;
    text-decoration: none;
    line-height: 0;
}

/* スポットボタン画像（正方形・角丸は画像側に含まれる） */
.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ===================================
   詳細ページ スタイル
   =================================== */

/* 詳細ページのフッター手前の余白
   ※共通設定の #bluelock02-detail-wrapper{padding-bottom:0}（ID指定）がクラス指定の余白を打ち消し、
     最後のセクション/カードの margin-bottom がラッパー外へ突き抜けて（マージン相殺）
     フッター手前に背景色の無い白帯が出ていたため、ID指定で余白を持たせ、flow-root で相殺を防ぐ */
#bluelock02-detail-wrapper {
    padding-bottom: 80px; /* 🔧 最後の商品カードとフッターの距離 */
    display: flow-root;   /* 子要素のmarginをラッパー内に閉じ込める */
}

.bluelock02-detail .type-section:last-child {
    margin-bottom: 0; /* 最後のセクション下の余白は上の padding-bottom に一本化 */
}

/* 詳細トップ画像（地方バナー） */
.detail-top-image-wrapper {
    max-width: 1000px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.detail-top-image {
    width: 100%;
    height: auto;
    display: block;
    /* 白枠線は先方依頼により削除（2026-10-08） */
    box-sizing: border-box;
}

/* 商品種別セクション（見出し＋カード群） */
.type-section {
    max-width: 1000px;
    margin: 0 auto 70px;
    padding: 0 20px;
    box-sizing: border-box;
}

/* セクション見出し（テキスト）
   下線：左が緑→右へ背景色に溶けるグラデーション＋左端の小さな緑三角 */
.type-heading {
    position: relative;
    margin: 0 0 36px;
    padding: 0 0 12px 12px;
    color: #ffffff !important;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.5;
    letter-spacing: 0.02em;
    border: none;
    background: none;
}

.type-heading::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #6ab82e 0%, #6ab82e 25%, rgba(106, 184, 46, 0) 100%); /* 🔧 下線色 */
}

.type-heading::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 10px 10px;
    border-color: transparent transparent #6ab82e transparent; /* 🔧 左端の三角 */
}

/* 商品カード */
.product-section {
    margin: 0 0 20px;
    background-color: #ffffff;
    padding: 20px;
    box-sizing: border-box;
}

.product-content {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

/* 商品画像（1点・左側） */
.product-main-image-wrapper {
    flex: 0 0 32%;
}

.product-main-image-wrapper.is-noimage {
    aspect-ratio: 1 / 1;
    background-color: #cdcdcd;
    border-radius: 10px;
}

.product-main-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    background-color: #f2f2f2; /* 🔧 商品画像の下地（透過PNGのため薄いグレーを敷く） */
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.product-main-image:hover {
    opacity: 0.85;
}

/* タイトル＋説明文（右側） */
.product-description {
    flex: 1;
    min-width: 0;
    color: #222222;
}

.product-title {
    margin: 0 0 16px;
    padding: 0 0 12px;
    border-bottom: 1px solid #00439a; /* 🔧 タイトル下の区切り線 */
    color: #111111 !important;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.6;
}

.product-text {
    color: #222222;
}

/* 本文（最初の【見出し】まで） */
.product-lead {
    font-size: 15px;
    line-height: 1.9;
    margin-bottom: 14px;
}

/* 仕様欄（【サイズ】【仕様】【原材料名】） */
.product-spec {
    font-size: 12.5px;
    line-height: 1.8;
    color: #333333;
}

/* エラーメッセージ */
.error-message {
    max-width: 600px;
    margin: 100px auto;
    padding: 40px;
    text-align: center;
    background-color: #f8f8f8;
    border-radius: 8px;
}

.error-message p {
    margin: 10px 0;
    font-size: 16px;
    line-height: 1.6;
}

.error-message a {
    color: #00439a;
    text-decoration: underline;
}

/* 準備中（テキスト表示・白） */
.preparing-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px 80px;
    text-align: center;
}

.preparing-text {
    margin: 0;
    color: #ffffff !important; /* 🔧 準備中テキスト色 */
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 0.1em;
    line-height: 1.6;
}

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

.image-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease, background-color 0.3s ease;
}

.image-modal.active {
    visibility: visible;
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.9);
    transition: visibility 0s 0s, opacity 0.3s ease, background-color 0.3s ease;
}

.image-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-modal img {
    max-width: min(90vw, 900px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
    user-select: none;
}

.image-modal.active img {
    opacity: 1;
    transform: scale(1);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    user-select: none;
}

.image-modal-close:hover {
    color: #cccccc;
}

/* ===================================
   レスポンシブ対応
   =================================== */

/* タブレット（768px - 1023px） */
@media (max-width: 1023px) {
    #bluelock02-wrapper,
    #bluelock02-detail-wrapper {
        padding-top: 80px;
    }

    .region-selection-wrapper {
        flex-direction: column;
        gap: 24px;
    }

    .region-title-image {
        width: 180px;
    }

    .region-content-wrapper {
        width: 100%;
    }

    .product-grid {
        gap: 20px;
    }
}

/* ===================================
   スマートフォン（767px以下）
   🔧 ここから下がスマホ版の調整箇所です
   =================================== */
@media (max-width: 767px) {
    #bluelock02-wrapper,
    #bluelock02-detail-wrapper {
        padding-top: 80px;      /* 🔧 ヘッダーとの距離 */
        padding-bottom: 120px;  /* 🔧 フッターとの距離 */
    }

    /* ===== トップページ ===== */

    .bluelock02-top {
        padding: 20px 0;
    }

    .top-visual-wrapper {
        margin: 0 12px 30px; /* 🔧 画像左右・下の余白 */
    }

    .top-visual-frame {
        border-radius: 8px;
    }

    .ec-notice-wrapper {
        margin-bottom: 24px;
        padding: 0 16px;
    }

    .ec-notice-image {
        max-width: 92%;
    }

    .shop-cta-wrapper {
        padding: 0 16px;
        margin-bottom: 40px;
    }

    .shop-cta-image {
        width: 82%; /* 🔧 スマホ時のCTA画像幅 */
        margin: 0 auto;
    }

    .region-selection-wrapper {
        margin-bottom: 30px;
        gap: 16px;
        padding: 0;
    }

    .region-title-image {
        width: 140px; /* 🔧 「地域から探す」画像幅 */
    }

    .region-buttons-wrapper {
        gap: 8px;
        padding: 0 10px;
    }

    .region-button {
        font-size: clamp(11px, 3.4vw, 15px); /* 折り返し防止 */
        padding: 9px 4px;
        letter-spacing: -0.02em;
    }

    .product-list-wrapper {
        padding: 10px 10px 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2列表示 */
        gap: 12px;
        padding: 0 6px;
    }

    /* ===== 詳細ページ ===== */

    .detail-top-image-wrapper {
        margin-bottom: 30px;
        padding: 0;
    }


    .type-section {
        margin-bottom: 40px;
        padding: 0 12px;
    }

    .type-heading {
        font-size: 17px;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .product-section {
        padding: 16px;
        margin-bottom: 14px;
    }

    /* カードは縦積み（画像 → タイトル → 説明文） */
    .product-content {
        flex-direction: column;
        gap: 14px;
    }

    .product-main-image-wrapper {
        flex: none;
        width: 100%;
        max-width: 320px; /* 🔧 スマホ時の商品画像最大幅 */
        margin: 0 auto;
    }

    .product-title {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .product-lead {
        font-size: 14px;
        line-height: 1.8;
    }

    .product-spec {
        font-size: 12px;
    }

    .preparing-text {
        font-size: 20px;
    }

    .image-modal img {
        max-width: 95vw;
        max-height: 85vh;
    }
}
