/* --- 変数 ＆ 基本設定 --- */
:root {
    --primary: #bf0000;
    --primary-dark: #800000;
    --text-main: #2d2d2d;
    --text-sub: #666666;
    --bg-body: #f8f8f6;
    --bg-card: #ffffff;
    --border: #eeeeee;
}

* { box-sizing: border-box; }
body {
    margin: 0; padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
}

.inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; height: auto; display: block; }

/* --- ヘッダー --- */
.global-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000;
    height: 64px; display: flex; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.header-inner {
    max-width: 1200px; width: 100%; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px;
}
.brand-logo img { height: 32px; width: auto; }

/* --- 専門ショップ一覧（横5列） --- */
.site-nav { padding: 40px 0; }
.site-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 確実に5列 */
    gap: 15px;
    margin-bottom: 40px;
}

.site-card {
    background: #1a1a1a;
    color: #fff;
    padding: 20px 15px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}
.site-card:hover {
    background: var(--primary);
    transform: translateY(-3px);
}
.shop-tag { font-size: 10px; font-weight: bold; opacity: 0.5; display: block; margin-bottom: 4px; }
.site-card h3 { margin: 0; font-size: 16px; font-weight: 900; line-height: 1.2; }

/* --- 商品グリッド（横4列） --- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 確実に4列 */
    gap: 25px;
    margin: 20px 0;
}

.item-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: #ddd;
}

/* --- 画像エリア ＆ 重なるバッジ --- */
.img-box {
    aspect-ratio: 1/1;
    position: relative; /* バッジの基準点 */
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #f9f9f9;
    display: flex; align-items: center; justify-content: center;
}
.img-box img { width: 100%; height: 100%; object-fit: contain; }

.category-badge {
    position: absolute; /* 画像の上に重ねる */
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 10;
}

/* --- カード内情報 --- */
.info-box { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.update-label { font-size: 10px; color: #999; margin: 0 0 5px; font-weight: bold; }
.post-title {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    color: #111;
    margin: 0 0 12px;
    height: 6em; /* 2行分に固定 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-row { margin-top: auto; font-size: 18px; font-weight: 900; color: var(--primary); }
.price-row small { font-size: 10px; margin-left: 2px; color: #999; }

.btn-fake {
    margin-top: 12px;
    background: #fdfdfd;
    color: #666;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #eee;
}
.item-card:hover .btn-fake { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- 記事詳細ページ --- */
.main-content { padding: 40px 0 100px; }
.breadcrumb { font-size: 11px; color: #999; margin-bottom: 30px; }
.post-header { text-align: center; margin-bottom: 50px; }
.post-header h1 { font-size: 32px; font-weight: 900; line-height: 1.3; margin: 15px 0; }

.product-intro-row { display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 60px; align-items: start; }
.gallery-col { flex: 1.2; min-width: 300px; }
.cta-col { flex: 1; min-width: 300px; }

.main-img-wrap { background: #fff; border: 1px solid #eee; border-radius: 16px; padding: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.02); }
.thumb-grid { display: flex; gap: 10px; margin-top: 15px; overflow-x: auto; padding-bottom: 10px; }
.thumb-img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }

/* Sticky購入カード */
.sticky-card {
    position: sticky; top: 100px;
    background: #fff; border: 1px solid #eee;
    border-radius: 24px; padding: 35px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.05);
    text-align: center;
}
.buy-button {
    display: block; background: var(--primary); color: #fff;
    font-weight: 900; font-size: 20px; padding: 20px;
    border-radius: 50px; box-shadow: 0 6px 0 #800000;
}
.buy-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #800000; }

/* 本文装飾 (Astro版完全移植) */
.entry-body { max-width: 850px; margin: 0 auto; background: #fff; padding: 50px; border-radius: 30px; border: 1px solid #eee; }
.prose h2 { font-size: 26px; font-weight: 900; border-left: 8px solid var(--primary); padding-left: 15px; margin: 50px 0 25px; }
.prose h3 { font-size: 21px; font-weight: 800; background: #fdf2f2; padding: 12px 15px; border-radius: 8px; margin-top: 35px; }
.prose p { margin-bottom: 25px; line-height: 2.0; font-size: 18px; color: #444; }

/* 最終CTA */
.final-cta-box {
    margin-top: 80px; padding: 70px 20px; border-radius: 30px; text-align: center;
    background: linear-gradient(135deg, #bf0000 0%, #800000 100%); color: #fff;
}

/* --- フッター --- */
.global-footer { background: #111; color: #888; padding: 60px 0; text-align: center; margin-top: 100px; }
.copyright { font-size: 11px; margin-top: 20px; color: #555; }

/* --- レスポンシブ (900px以下) --- */
@media (max-width: 900px) {
    .site-grid { grid-template-columns: repeat(2, 1fr); } /* ショップは2列 */
    .post-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; } /* 商品も2列 */
    .gallery-col, .cta-col { flex: none; width: 100%; }
    .post-title { font-size: 13px; }
    .entry-body { padding: 30px 20px; border-radius: 0; border: none; }
}
/* --- 検索オーバーレイの制御（修正版） --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none !important; /* ★初期状態を強制非表示 */
    align-items: center;
    justify-content: center;
}

/* クラスが付与された時だけ表示 */
.search-overlay.is-active {
    display: flex !important;
}

/* 検索アイコンボタンの調整 */
.search-trigger {
    background: transparent;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.search-trigger:hover {
    background: #f9f9f9;
}
.search-trigger svg {
    stroke: #333;
}