
body { font-family: sans-serif; background: #f4f7f4; margin: 0; padding:0; color: #333; }

/* --- ヘッダー --- */
header { background: #fff; border-bottom: 3px solid #06c755; position: sticky; top: 0; z-index: 1000; }
.header-top { padding: 15px; text-align: center; }
.header-top h1 { margin: 0; font-size: 1.2em; color: #2c5d2c; }

nav { background: #06c755; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
nav ul li a { display: block; padding: 12px 20px; color: #fff; text-decoration: none; font-size: 0.9em; font-weight: bold; }

/* --- メインレイアウト --- */
.main-wrapper {
    max-width: 1400px;
    margin: 30px auto 0;
    display: flex;
    gap: 20px;
    padding: 0 15px; /* 少し余裕を持たせる */
    box-sizing: border-box; /* パディングを幅に含める設定 */
    width: 100%; /* 95%ではなく100%にして、paddingで内側に余白を作る */
    overflow-x: hidden; /* 念のための保険 */
}
.main-wrapper main {
    flex: 1;
    min-width: 0;
}

/* 商品グリッドのレスポンシブ設定 */
.product-grid {
    display: grid;
    /* 画面幅に合わせて自動で列数を変える（最小200px） */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;           /* カード同士の隙間 */
    padding: 10px 0;
}

.product-card { background: #fff; padding: 10px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.08); display: flex; flex-direction: column; }
top-section
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* 正方形を維持 */
    object-fit: cover;
    border-radius: 8px;
}
.top-section, .intro-box {
    width: 95%;
    max-width: 1400px; /* ここを1400pxに広げる */
    margin: 0 auto 40px auto;
}
.price { color: #bf0000; font-weight: bold; font-size: 1.1em; margin: 8px 0; display: block; }
.item-name { font-size: 0.75em; height: 3em; overflow: hidden; margin-bottom: 10px; line-height: 1.5; color: #555; }
.buy-btn { display: block; background: #06c755; color: #fff; text-decoration: none; text-align: center; padding: 8px; border-radius: 4px; font-size: 0.8em; font-weight: bold; }

/* --- PCサイドメニュー --- */
aside { width: 260px; }
.side-box { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.side-box h3 { background: #06c755; color: #fff; margin: 0; padding: 12px 15px; font-size: 1em; }
.side-box ul { list-style: none; padding: 0; margin: 0; }
.side-box ul li { border-bottom: 1px solid #f0f0f0; }
.side-box ul li a { display: block; padding: 12px 15px; color: #444; text-decoration: none; font-size: 0.85em; }

/* サイドメニューのhover強化 */
.side-menu li {
    transition: all 0.3s ease; /* アニメーションを滑らかに */
}

.side-menu li a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #444;
    border-left: 3px solid transparent; /* 左側に隠しライン */
    transition: all 0.2s ease;
}

.side-menu li a:hover {
    background-color: #f0fdf4; /* 薄い緑 */
    color: #06c755;
    padding-left: 18px; /* 少し右にずらす演出 */
    border-left: 3px solid #06c755; /* 緑のラインを出す */
}

/* --- スマホ対応（768px以下） --- */
@media (max-width: 768px) {
    #nav-open { 
        display: block; position: absolute; left: 15px; top: 15px; 
        width: 30px; height: 24px; cursor: pointer; z-index: 1100;
    }
    #nav-open span { display: block; width: 100%; height: 3px; background: #06c755; margin-bottom: 5px; border-radius: 2px; }
    
    nav { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }

    /* スマホサイドメニュー：極限までシンプルに */
    aside {
        position: fixed; top: 0; left: -65%; width: 250px; height: 100%;
        background: #fff; z-index: 2000; transition: 0.3s; overflow-y: auto;
        padding-top: 20px; /* 上部に少し余白 */
    }
    aside.active { left: 0; }
    
    /* スマホ時は枠線・背景・タイトル装飾を消す */
    .side-box { background: transparent; border-radius: 0; box-shadow: none; }
    .side-box h3 { 
        background: transparent; color: #2c5d2c; 
        padding: 0 20px 10px 20px; font-size: 1.1em; font-weight: bold;
    }
    .side-box ul {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    display: flex;
    justify-content: start;
    flex-wrap: wrap;
    }
    .side-box ul li {
        border: none;
        width: 50%;
    }
    .side-box ul li a { 
        padding: 6px 20px; /* 上下を詰める（12px -> 6px） */
        color: #555; font-size: 0.9em; 
    }

    #nav-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 1500; }
    #nav-overlay.active { display: block; }
}

/* スマホ (480px以下) の時は2列固定で見やすくする */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .top-section {
        width: 98%;      /* スマホはさらに端まで使う */
    }
}

/* --- フッター装飾 --- */
footer {
    text-align: center;
    padding: 40px 0;
    color: #888;
    font-size: 0.8em;
    background: #fff;
    margin-top: 40px;
    border-top: 1px solid #eee;
}

.footer-guide-link {
    margin-top: 10px;
}

.footer-guide-link a {
    color: #06c755;
    text-decoration: none;
    font-weight: bold;
}

.footer-guide-link a:hover {
    text-decoration: underline;
}

/* 商品カード内のリンク付き画像 */
.product-card a {
    display: block;
    overflow: hidden; /* はみ出し防止 */
    border-radius: 4px;
    text-decoration: none;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block;
}

/* 画像ホバー演出 */
.product-card a:hover img {
    opacity: 0.8;
    transform: scale(1.05);
}

/* 星評価とレビュー件数 */
.review-box {
    color: #f39c12;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.rev-count {
    color: #888;
    font-size: 0.9em;
    margin-left: 3px;
}

/* 商品名のリンク */
.item-name a {
    text-decoration: none;
    color: #555;
    transition: color 0.2s;
}

.item-name a:hover {
    color: #06c755;
    text-decoration: underline;
}

/* 送料無料・別バッジ */
.badge-free {
    font-size: 0.65em;
    background: #ffeded;
    color: #bf0000;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}

.badge-sep {
    font-size: 0.65em;
    color: #888;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}

/* ソート・見出しエリア */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.sort-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* テキストガイド（texts/*.txt） */
.guide-text-box {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    font-size: 0.9em;
    line-height: 1.8;
}


/* トップページ用スタイル */
.intro-box {
    background: #fff;
    padding: 30px 20px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.intro-box h2 { color: #06c755; margin-bottom: 10px; font-size: 1.4em; }

.section-title {
    border-left: 5px solid #06c755;
    padding-left: 10px;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}
.cat-card {
    background: #06c755;
    color: #fff;
    text-align: center;
    padding: 15px 5px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: bold;
}

.rank-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #ffcc00;
    color: #333;
    padding: 2px 8px;
    font-size: 0.7em;
    font-weight: bold;
    border-radius: 3px;
    z-index: 10;
}

.guide-banner {
    background: linear-gradient(135deg, #06c755, #2c5d2c);
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    border-radius: 10px;
    margin-top: 20px;
}
.guide-btn {
    display: inline-block;
    background: #fff;
    color: #06c755;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 商品カード内のバッジ */
.product-card {
    position: relative; /* バッジを配置するための基準点 */
    overflow: hidden;
}

.item-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 8件並ぶので、PCでは4列×2段になるように調整 */
@media (min-width: 769px) {
    .product-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}



/* セクション間の余白を広げる */
.top-section {
    margin-bottom: 80px; /* ここでセクション同士の間隔を調整 */
}

/* バッジを大きく・見やすく */
.item-badge {
    position: absolute;
    top: 0;
    left: 0;
    color: #fff;
    padding: 6px 12px; /* サイズアップ */
    font-size: 13px;   /* 文字を大きく */
    font-weight: bold;
    z-index: 10;
    border-radius: 0 0 8px 0; /* 角丸の向きを変更 */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* セクションごとの色分け */
.p-badge { background: #ff3344; } /* ポイント：鮮やかな赤 */
.c-badge { background: #0099ff; } /* クーポン：信頼の青 */
.o-badge { background: #444444; } /* アウトレット：シックな黒 */

/* 商品名の高さを揃えて綺麗に */
.item-name {
    height: 3em;
    overflow: hidden;
    font-size: 0.85em;
    line-height: 1.5;
    margin: 10px 0;
}



/* ショップ紹介の横スクロール設定 */
.shop-scroll-wrapper {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.shop-card {
    min-width: 200px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.shop-card strong { color: #06c755; display: block; margin-bottom: 5px; }
.shop-card span { font-size: 0.8em; color: #666; line-height: 1.4; }





/* --- スライダー（画面横いっぱい） --- */
.main-slider.full-width-slider {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    background: transparent !important;
    padding: 30px 0 50px;
	margin-top: 0;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    overflow: hidden;
}

.main-slider .swiper-slide {
    text-align: center;
    transition: transform 0.3s;
}

.main-slider .swiper-slide:hover {
    transform: translateY(-5px);
}

.main-slider .swiper-slide img {
    width: 100%;
    max-width: 250px; /* PCでの画像の最大サイズ */
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.slider-pop {
    background: #ff3344;
    color: #fff;
    font-weight: bold;
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    margin-top: 10px;
    font-size: 0.9em;
}

/* ページネーションの色 */aside
.swiper-pagination-bullet-active {
    background: #06c755 !important;
}

/* --- メインレイアウト（サイドバーあり） --- */
#side-menu {
    width: 250px;
    flex-shrink: 0;
}

/* --- スマホ対応 --- */
@media (max-width: 900px) {
    .main-wrapper {
        flex-direction: column;
    }
    #side-menu {
        width: 65%;
        order: 2; /* サイドバーを下に */
    }
    .main-wrapper main {
        order: 1;
        margin: 0 20px;
    }
    .main-slider .swiper-slide img {
        max-width: 180px; /* スマホでは少し小さめに */
    }
}

/* 左右矢印の色とサイズ */
.main-slider .swiper-button-next,
.main-slider .swiper-button-prev {
    color: #333; /* 矢印の色 */
    background: rgba(255, 255, 255, 0.8); /* 半透明の白丸背景 */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.main-slider .swiper-button-next::after,
.main-slider .swiper-button-prev::after {
    font-size: 18px; /* 矢印自体の大きさ */
    font-weight: bold;
}

/* スライダー内の画像間の隙間を詰め、表示を最適化 */
.main-slider .swiper-slide img {
    width: 100%;
    max-width: none; /* マージンを詰めるため制限解除 */
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 5px; /* 少し角を落とす */
}


/* ランキングバッジのスタイル */
.rank-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 40px;
    height: 40px;
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.rank-1 { background: linear-gradient(45deg, #BF953F, #FCF6BA); color: #5d4a1f; } /* 金 */
.rank-2 { background: linear-gradient(45deg, #B4B4B4, #EFEFEF); color: #555; }    /* 銀 */
.rank-3 { background: linear-gradient(45deg, #A17436, #E7D192); color: #5d3a1a; } /* 銅 */
.rank-4 { background: #666; } /* 4位以降 */

.rank-container { position: relative; } /* 親要素にこれを指定 */
