/* --- 共通スタイル (header/footer) --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding-top: 70px; /* ヘッダーの高さ分 */
    
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body > .main-container {
    flex: 1 0 auto;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
    position: fixed; /* ヘッダーを固定 */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header .logo {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    flex-shrink: 0; 
}
.site-header nav {
    display: flex; 
    flex-wrap: nowrap; 
}
.site-header nav a {
    margin-left: 15px;
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
    font-size: 0.9em;
    white-space: nowrap; 
}

.site-footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 20px;
    margin-top: 40px; 
    box-sizing: border-box;
    font-size: 0.8em;
    flex-shrink: 0; 
}
/* フッターナビ */
.site-footer .footer-nav {
    margin-bottom: 10px;
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 5px 15px; 
}
.site-footer .footer-nav a {
    color: #ddd;
    text-decoration: none;
    font-size: 1.1em;
    margin: 0; 
}
.site-footer .footer-nav a:hover {
    text-decoration: underline;
    color: #fff;
}
.site-footer .copyright {
    color: #aaa;
    font-size: 1em;
}

/* --- 共通コンテナスタイル --- */
.main-container {
    margin: 20px auto; 
    background: #ffffff;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* --- ページごとの最大幅をIDで指定 --- */
#index-container { max-width: 600px; }
#list-container { max-width: 900px; padding: 25px 10px; } 
#detail-container { max-width: 700px; }
#legal-container,
#contact-container { 
    max-width: 700px; 
}
#ranking-container {
    max-width: 900px; 
    padding: 25px 10px;
}
#features-container {
    max-width: 900px;
}


/* --- 共通コンポーネントスタイル (index, list, detail) --- */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
}
.brand-name {
    display: inline-block;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff; 
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 5px;
    text-transform: uppercase; 
}
.category-title {
    font-size: 1.3em;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    margin-top: 20px;
    margin-bottom: 15px;
    text-transform: uppercase; 
}

/* (商品カード .recommend-item 関連のスタイル - 単品リスト用) */
.recommend-item {
    display: flex; 
    align-items: center; 
    margin-bottom: 15px;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.recommend-item img {
    width: 80px;  
    height: 80px; 
    object-fit: cover; 
    margin-right: 15px;
    border-radius: 4px;
    flex-shrink: 0; 
}
.recommend-item .details { 
    flex: 1; 
    min-width: 0; 
}
.recommend-item .details a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    font-size: 1.1em;
    display: block; 
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; 
}
.recommend-item .details a:hover { text-decoration: underline; }
.recommend-item .details .pfc-details {
    display: block;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 8px; 
}
.recommend-item .details .buy-link {
    display: inline-block;
    font-size: 0.9em;
    font-weight: bold;
    color: #fff !important; 
    background-color: #28a745; 
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 5px;
}
.recommend-item .details .buy-link:hover {
    background-color: #218838;
    text-decoration: none;
}


/* --- index.php 固有スタイル --- */

#pfc-form {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px 20px; 
}
.form-group {
    margin-bottom: 0; 
}
.form-group-full {
    grid-column: 1 / -1; 
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box; 
    font-size: 16px; /* ズーム防止 */
}
button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
button:hover:not(:disabled) {
    background-color: #0056b3;
}
button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}
#result {
    margin-top: 25px;
    padding: 20px;
    background-color: #e9f5ff;
    border: 1px solid #b3d7ff;
    border-radius: 5px;
}
#result h2 {
    margin-top: 0;
    color: #0056b3;
}

/* 「任意」バッジのスタイル */
.form-group label .optional-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 600;
    background-color: #6c757d; /* グレー */
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}

/* 任意の入力欄 (背景色を少し変える) */
.form-group-optional input {
    background-color: #fcfcfc;
}

@media (max-width: 600px) {
    #pfc-form {
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 15px 20px;
    }
    .form-group {
        margin-bottom: 0; 
    }
    .form-group-full {
        grid-column: 1 / -1; 
    }
    .form-group-optional {
        grid-column: 1 / -1;
    }
}

/* --- index.php 結果表示の改善 --- */
#result .total-calorie-display {
    font-size: 2.2em;
    font-weight: 700;
    color: #d9534f;
    text-align: center;
    margin-bottom: 15px;
}
#result .total-calorie-display span {
    font-size: 0.5em;
    font-weight: 600;
    color: #333;
    margin-left: 5px;
}
#result .pfc-balance-bar {
    margin: 10px auto;
}
#result .pfc-calories {
    margin-top: 15px;
}
#result .pfc-info {
    font-size: 1.3em;
    font-weight: bold;
    color: #0056b3;
    text-align: center;
    background: #fff; 
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0 0 0;
    border: 1px solid #b3d7ff; 
}
#result .pfc-info span {
    margin: 0 10px;
}
.detail-subtitle {
    font-size: 1.3em;
    color: #2c3e50;
    border-bottom: 2px solid #eee; 
    padding-bottom: 5px;
    margin-top: 25px;
    margin-bottom: 15px;
}
#result .detail-subtitle {
    border-bottom: 2px solid #b3d7ff;
    text-align: center;
}

#pfc-result-day span {
    font-size: 1.2em;
    font-weight: bold;
    margin-right: 15px;
}
#pfc-result-meal span {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 10px;
}
.error {
    color: #d9534f;
    font-size: 0.9em;
    display: none; 
    margin: 0; 
}
#suggestion ul { list-style-type: none; padding-left: 0; }

/* index.php「もっと見る」ボタン */
.see-more-category-link {
    display: block;
    width: 95%; 
    margin: 5px auto 25px auto; 
    padding: 8px;
    background-color: #f8f9fa; 
    color: #007bff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s;
}
.see-more-category-link:hover {
    background-color: #e9ecef;
    color: #0056b3;
    border-color: #ccc;
    text-decoration: none;
}


/* --- product_list.php 固有スタイル --- */
.filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column; 
    gap: 15px; 
}
.filter-group, .sort-group, .pfc-sort-group {
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
    align-items: center;
}
.filter-group label {
    margin-right: 10px; 
    font-weight: 600;
}
.sort-group, .pfc-sort-group {
    width: 100%; 
}
.sort-group select, .pfc-sort-group select {
    padding: 5px;
    width: 100%; 
    font-size: 16px; /* ズーム防止 */
}

/* PC用のグリッドスタイル */
#list-container .product-list,
#ranking-container .product-list {
    list-style-type: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* カードスタイル */
#list-container .product-list .recommend-item,
#ranking-container .product-list .recommend-item {
    flex-direction: column; 
    padding: 0; 
    overflow: hidden; 
    align-items: stretch; 
    margin-bottom: 0; 
}
#list-container .product-list .recommend-item img,
#ranking-container .product-list .recommend-item img {
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
    margin-right: 0;
    border-radius: 0;
}
#list-container .product-list .recommend-item .details,
#ranking-container .product-list .recommend-item .details {
    padding: 15px;
    flex: 1; 
    display: flex;
    flex-direction: column;
}
#list-container .product-list .recommend-item .details .buy-link,
#ranking-container .product-list .recommend-item .details .buy-link {
    margin-top: auto; 
    text-align: center;
}


/* --- detail.php 固有スタイル --- */
.product-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    border-radius: 8px;
}
.product-price {
    text-align: center; 
    font-size: 1.5em; 
    font-weight: bold; 
    color: #d9534f; 
    margin: 10px 0 20px 0;
}
.pfc-info {
    font-size: 1.3em;
    font-weight: bold;
    color: #0056b3;
    text-align: center;
    background: #e9f5ff;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}
.pfc-info span {
    margin: 0 10px;
}
.action-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease;
}
.action-button:hover {
    background-color: #218838;
}
.back-link {
    display: block;
    margin-top: 20px;
    text-align: center;
}
.product-region {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}
.product-region h2 { 
    font-size: 1.2em;
    color: #333;
    margin-top: 0;
    margin-bottom: 5px;
}
.product-region p {
    margin: 0;
    line-height: 1.7;
}

/* おすすめタグ */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}
.tag {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}
.tag:nth-child(2n) { background-color: #28a745; }
.tag:nth-child(3n) { background-color: #fd7e14; }
.tag:nth-child(4n) { background-color: #d9534f; }

/* 総カロリー表示 */
.total-calorie-display {
    font-size: 2.5em;
    font-weight: 700;
    color: #d9534f;
    text-align: center;
    margin: 10px 0;
}
.total-calorie-display span {
    font-size: 0.5em;
    font-weight: 600;
    color: #333;
    margin-left: 5px;
}

/* PFCバランスバー */
.pfc-balance-bar {
    display: flex;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #e9ecef;
    margin: 15px 0;
}
.pfc-balance-bar span {
    display: block;
    height: 100%;
    transition: width 0.5s ease;
}
.pfc-balance-bar .bar-p { background-color: #007bff; }
.pfc-balance-bar .bar-f { background-color: #fd7e14; }
.pfc-balance-bar .bar-c { background-color: #28a745; }

/* PFCカロリー内訳 */
.pfc-calories {
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 10px;
}
.pfc-calories div {
    flex: 1;
}
.pfc-calories .label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 2px;
}
.pfc-calories .value {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
}
.pfc-calories .percent {
    font-size: 0.9em;
    color: #555;
}
.pfc-calories .label.p { color: #007bff; }
.pfc-calories .label.f { color: #fd7e14; }
.pfc-calories .label.c { color: #28a745; }


/* --- 特集記事一覧ページ (features.php) 用 --- */
.feature-list {
    list-style-type: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.feature-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.feature-item:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.feature-item a {
    display: block;
    text-decoration: none;
    color: #333;
}
.feature-item .feature-image-wrapper {
    width: 100%;
    height: 160px;
    background-color: #f0f0f0; 
}
.feature-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.feature-item .feature-details {
    padding: 15px 20px;
}
.feature-item .feature-details h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #007bff;
}
.feature-item .feature-details p {
    margin-bottom: 0;
    font-size: 0.9em;
    line-height: 1.6;
    color: #555;
}

/* --- 規約・フォームページ共通 --- */
#legal-container h2,
#contact-container h2 {
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-top: 30px;
}
#legal-container p,
#legal-container ol,
#legal-container ul,
#contact-container p {
    line-height: 1.8;
}
#legal-container ol,
#legal-container ul {
    padding-left: 25px;
}
/* お問い合わせフォーム用 */
#contact-container .form-group {
    margin-bottom: 20px;
}
#contact-container .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
#contact-container .form-group input[type="text"],
#contact-container .form-group input[type="email"],
#contact-container .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box; 
    font-size: 16px; 
}
#contact-container button {
    margin-top: 10px;
}

/* フォーム送信後のメッセージ */
.form-message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}
.form-message.success {
    background-color: #e9f5ff;
    border: 1px solid #b3d7ff;
    color: #0056b3;
}
.form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}


/* --- ページネーション --- */
#pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
}
#pagination-controls ul {
    list-style-type: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}
#pagination-controls ul li {
    margin: 0;
}
#pagination-controls ul li a,
#pagination-controls ul li span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}
#pagination-controls ul li a:hover {
    background-color: #f4f4f4;
    border-color: #ccc;
}
#pagination-controls ul li span.current-page {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: bold;
}
#pagination-controls ul li span.dots {
    border: none;
    background: none;
    color: #555;
    padding: 8px 5px;
}


/* --- メディアクエリ (PC/タブレット) --- */

@media (min-width: 768px) {
    .filters {
        flex-direction: row;
        align-items: center;
    }
    .filter-group {
        flex-wrap: nowrap; 
    }
    .sort-group, .pfc-sort-group {
        width: auto; 
    }
    .sort-group select, .pfc-sort-group select {
        width: auto; 
    }
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }
    .filter-group {
        flex-wrap: wrap; 
    }
    .sort-group, .pfc-sort-group {
        width: 100%; 
    }
    .sort-group select, .pfc-sort-group select {
        width: 100%; 
    }
}


/* --- メディアクエリ (スマホ: 600px以下) --- */
@media (max-width: 600px) {
    .main-container { 
        padding: 20px 15px;
        margin: 10px; 
    }
    #list-container,
    #ranking-container,
    #features-container {
        padding: 20px 10px;
    }
    
    .site-header { padding: 0 10px; }
    .site-header .logo { font-size: 1.1em; }
    .site-header nav a { 
        margin-left: 8px; 
        font-size: 0.8em; 
    }

    #pfc-form { display: block; }
    .form-group { margin-bottom: 20px; }

    #list-container .product-list,
    #ranking-container .product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    #list-container .product-list .recommend-item img,
    #ranking-container .product-list .recommend-item img { height: 140px; }
    
    #list-container .product-list .recommend-item .details,
    #ranking-container .product-list .recommend-item .details { padding: 10px; }
    
    #list-container .product-list .recommend-item .details a,
    #ranking-container .product-list .recommend-item .details a { font-size: 0.95em; white-space: normal; } 
    
    .feature-list {
        grid-template-columns: 1fr;
    }

    /* 記事内バナー調整 */
    .in-article-banner-wrapper {
        padding: 15px 10px;
    }
    .service-item-compact a.service-link-compact {
        flex-wrap: wrap;
    }
    .service-image-compact {
        flex: 0 0 70px;
        height: 70px;
        margin-right: 10px;
    }
    .service-details-compact {
        flex: 1 1 calc(100% - 90px); 
    }
    .service-cta-compact {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
        text-align: center;
    }
    .service-cta-compact span {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
}


/* --- メディアクエリ (超狭いスマホ: 400px以下) --- */
@media (max-width: 400px) {
    
    #list-container .product-list,
    #ranking-container .product-list {
        grid-template-columns: 1fr;
    }
    #list-container .product-list .recommend-item img,
    #ranking-container .product-list .recommend-item img { height: 180px; }

    .site-footer .footer-nav {
        flex-direction: column;
        gap: 8px;
    }
    
    .pfc-calories {
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
    }
    .total-calorie-display {
        font-size: 2.0em;
    }
}

/* --- ▼▼▼ 組み合わせ提案 (コンボ) 用スタイル (崩れ修正・縦積み統一版) ▼▼▼ --- */

/* 組み合わせ全体 (li) */
.recommend-item.combo-item {
    display: flex;
    flex-direction: column; /* 常に縦積みにする */
    align-items: stretch;   /* 横幅いっぱいに広げる */
    padding: 20px;
    gap: 10px; 
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* 個々の商品パネル (メイン / サイド / 単品 / プラス) */
.combo-product {
    display: flex;
    flex-direction: row; /* 中身は横並び (画像+テキスト) */
    align-items: center;
    gap: 15px;
    width: 100%; 
    position: relative; 
    padding: 15px;
    box-sizing: border-box;
    border: 1px solid #eee; /* 商品ごとに枠線 */
    border-radius: 6px;
    background-color: #fdfdfd;
}

/* スマホで画面が狭い場合 */
@media (max-width: 480px) {
    .combo-product {
        padding: 10px;
        gap: 10px;
    }
    .combo-product img {
        width: 70px;
        height: 70px;
    }
}

/* 組み合わせの「+」記号 (縦積みデザインでは不要なため非表示) */
.combo-plus {
    display: none; 
}

/* 商品タイプラベル */
.combo-label {
    position: absolute;
    top: -8px;
    left: 10px;
    font-size: 0.75em;
    font-weight: bold;
    color: #fff;
    background-color: #6c757d;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 1;
}
.combo-label.main { background-color: #d9534f; } /* 赤 */
.combo-label.side { background-color: #28a745; } /* 緑 */
.combo-label.booster { background-color: #8e44ad; } /* 紫 */

/* 組み合わせの合計PFC */
.combo-total {
    text-align: center;
    margin-top: 5px;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
    font-size: 1.1em;
    color: #333;
    width: 100%;
}
.combo-total strong {
    font-weight: 600;
    margin-right: 10px;
    display: inline-block;
}
.combo-total span {
    margin: 0 5px;
    white-space: nowrap;
    display: inline-block;
}

@media (max-width: 400px) {
    .combo-total {
        font-size: 0.95em;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        line-height: 1.5;
    }
    .combo-total strong {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
}
/* --- ▲▲▲ 組み合わせ提案スタイルここまで ▲▲▲ --- */


/* --- おすすめサービスリスト (inc/footer.php のバナー) --- */

/* Strategy 2: 記事内自動挿入バナー (#dynamic-in-article-banner) */
.in-article-banner-wrapper {
    margin-top: 40px; 
    margin-bottom: 40px; 
    padding: 25px; 
    background: #f8f9fa; 
    border-radius: 8px; 
    border: 1px solid #eee;
}
.in-article-h2 {
    margin-top:0 !important;
    font-size:1.4em !important; 
    text-align:center !important; 
    margin-bottom:20px !important;
}

/* 記事内バナーのアイテム */
#dynamic-in-article-banner .service-list {
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 15px;
}
.service-item-compact {
    background:#fff; 
    border:1px solid #ddd; 
    border-radius:5px; 
    overflow:hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.service-item-compact a.service-link-compact {
    display:flex; 
    text-decoration:none; 
    color:inherit; 
    align-items:center; 
    padding:10px; 
}
.service-image-compact {
    flex:0 0 80px;
    height: 80px;
    margin-right:15px;
}
.service-image-compact img {
    width:100%; 
    height:100%;
    object-fit: cover;
    border-radius:4px;
}
.service-details-compact {
    flex:1;
    padding: 0 5px;
}
.service-details-compact h3 {
    margin:0 0 5px !important; 
    font-size:1.1em !important; 
    color:#007bff !important;
}
.service-details-compact p {
    margin:0 !important; 
    font-size:0.9em !important; 
    color:#555 !important; 
    line-height:1.4 !important;
}
.service-cta-compact {
    margin-left:10px;
    flex-shrink: 0;
}
.service-cta-compact span {
    background:#ff9900; 
    color:#fff; 
    padding:8px 12px; 
    border-radius:4px; 
    font-size:0.9em; 
    font-weight:bold; 
    white-space:nowrap;
}


/* Strategy 3: フッター手前バナー (footer-pre-banner) - カルーセルUI版 */
.footer-pre-banner {
    background: #FFFFFF; 
    color: var(--color-text-main); 
    padding: 60px 0; 
    margin-top: 60px;
}

.footer-banner-container {
    max-width: 1280px; 
    margin: 0 auto; 
    padding: 0 var(--spacing-xl);
    background: none; 
    box-shadow: none; 
}

.footer-banner-h3 {
    text-align: left; 
    margin-bottom: var(--spacing-2xl); 
    color: var(--color-text-main); 
    font-size: var(--font-size-2xl);
    font-weight: 700;
    border-bottom: none !important; 
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.footer-banner-icon {
    font-size: 1.2em;
    line-height: 1;
}

/* サービスグリッド - デスクトップ: 4カラム、モバイル: 横スクロール */
.service-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    justify-content: start;
}

@media (min-width: 1200px) {
    .service-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-service-card {
    background: #FFFFFF; 
    border-radius: 16px; 
    overflow: hidden; 
    width: 100%;
    min-width: 280px;
    color: var(--color-text-main); 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.footer-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.footer-service-link {
    text-decoration: none; 
    color: inherit; 
    display: flex;
    flex-direction: column;
    height: 100%;
}

.footer-service-image-wrapper {
    width: 100%; 
    aspect-ratio: 16 / 9;
    background: #F3F4F6; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden;
    position: relative;
}

.footer-service-image-wrapper img {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    display: block;
}

/* 画像が読み込めない場合のフォールバック（背景画像として処理） */
.footer-service-image-wrapper {
    background-color: #F3F4F6;
    background-image: linear-gradient(135deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.05) 100%);
}

.footer-service-image-wrapper img {
    background-color: transparent;
}

/* 画像が存在しない場合のプレースホルダー */
.footer-service-image-wrapper:empty::before {
    content: '📦';
    font-size: 3rem;
    color: var(--color-text-sub);
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.footer-service-details {
    padding: var(--spacing-lg);
    flex: 1; 
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-service-details h4 {
    margin: 0; 
    font-size: var(--font-size-base); 
    color: var(--color-text-main); 
    font-weight: 700;
    line-height: 1.4;
}

.footer-service-details p {
    font-size: var(--font-size-sm); 
    margin: 0; 
    color: var(--color-text-sub); 
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.footer-service-cta {
    margin-top: auto; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    color: var(--color-primary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: color 0.2s ease;
}

.footer-service-link:hover .footer-service-cta {
    color: var(--color-primary-dark);
}

.footer-service-cta-text {
    flex: 1;
}

.footer-service-cta-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.footer-service-link:hover .footer-service-cta-icon {
    transform: translateX(4px);
}
.footer-service-cta:hover {
    text-decoration: underline;
}

/* モバイル: 横スクロール（カルーセル）対応 */
@media (max-width: 768px) {
    .footer-pre-banner {
        padding: 40px 0;
    }
    
    .footer-banner-container {
        padding: 0 var(--spacing-md);
    }
    
    .footer-banner-h3 {
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-xl);
    }
    
    .service-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--spacing-md);
        padding-right: var(--spacing-md);
        padding-bottom: var(--spacing-sm);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .service-grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .footer-service-card {
        min-width: 280px;
        max-width: 320px;
        flex-shrink: 0;
    }
    
    .footer-service-image-wrapper {
        aspect-ratio: 16 / 9;
    }
}

/* --- ▼▼▼ 【新規追加】Result.php のおすすめサービスリスト用スタイル ▼▼▼ --- */

.service-list-container {
    margin-top: 40px;
}

/* リスト全体のリセットとグリッド化 */
.service-list {
    list-style: none;
    padding: 0;
    display: grid;
    /* 幅に応じて自動で列数を調整 (最小300px) */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* カードスタイルの適用 */
.service-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.service-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column; /* 画像・詳細・ボタンを縦に並べる */
    height: 100%;
}

/* 画像エリア */
.service-image {
    width: 100%;
    height: 180px; /* 高さを固定してレイアウト崩れを防ぐ */
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
    overflow: hidden;
}
.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠いっぱいにトリミングして表示 */
}

/* 詳細テキストエリア */
.service-details {
    padding: 15px;
    flex: 1; /* ボタンを最下部に押しやるために伸長 */
}
.service-details h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #007bff;
    line-height: 1.4;
}
.service-details p {
    margin: 0;
    font-size: 0.9em;
    color: #555;
    line-height: 1.6;
}

/* ボタン風リンク */
.service-button-link {
    display: block;
    background-color: #f1f8ff;
    color: #007bff;
    text-align: center;
    padding: 12px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
    border-top: 1px solid #e0e0e0;
}
.service-item a:hover .service-button-link {
    background-color: #007bff;
    color: #fff;
}

/* スマホ対応 */
@media (max-width: 600px) {
    .service-list {
        grid-template-columns: 1fr; /* 完全な1列表示 */
    }
    .service-image {
        height: 200px; /* スマホでは画像を少し大きく */
    }
}
/* --- ▲▲▲ 【新規追加】Result.php のおすすめサービスリスト用スタイル 終了 ▲▲▲ --- */


/* --- PFC日誌 (Daily Tracker) 拡張スタイル --- */
.tracker-mode-toggle {
    font-size: 0.8em;
    color: #007bff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    text-decoration: underline;
}
.tracker-mode-toggle:hover {
    color: #0056b3;
}
.tracker-meal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.tracker-meal-header h3 {
    font-size: 1.1em;
    margin: 0;
}
.pfc-direct-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}
.pfc-direct-input .form-group {
    flex: 1; 
    margin-bottom: 0;
}
.pfc-direct-input label {
    font-size: 0.8em;
    font-weight: 600;
    color: #555;
    margin-bottom: 3px;
    display: block;
}
.pfc-direct-input input {
    width: 100%;
    padding: 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; 
}

/* --- PFC日誌 / 診断 共通 --- */
.diagnosis-question {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0 20px 20px 20px;
    background: #fdfdfd;
}
.diagnosis-question h3 {
    font-size: 1.2em;
    color: #007bff;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.diagnosis-options {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px;
}
.diagnosis-options label {
    display: block;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    height: 100%; 
    box-sizing: border-box;
}
.diagnosis-options label:hover {
    background-color: #f9f9f9;
}
.diagnosis-options input[type="radio"] {
    display: none; 
}
.diagnosis-options input[type="radio"]:checked + label {
    border-color: #007bff;
    background-color: #f7fbff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.diagnosis-options .option-text {
    display: block;
    font-weight: 600;
    font-size: 1em;
    color: #333;
}
.diagnosis-options .option-pfc {
    display: block;
    font-size: 0.8em;
    color: #555;
    margin-top: 5px;
}
@media (max-width: 600px) {
    .diagnosis-options {
        grid-template-columns: 1fr;
    }
    .diagnosis-question {
        padding: 0 15px 15px 15px;
    }
}

/* --- 診断結果ページ --- */
.diagnosis-result-container {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
}
.diagnosis-result-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px 25px;
}
.diagnosis-result-box h2 {
    margin-top: 0;
    text-align: center;
    font-size: 1.3em;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
.diagnosis-result-box.current h2 { color: #d9534f; }
.diagnosis-result-box.target h2 { color: #007bff; }
.diagnosis-result-box.diff h2 { color: #28a745; }

.diff-list {
    list-style-type: none;
    padding-left: 0;
    font-size: 1.2em;
    font-weight: 600;
}
.diff-list li {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
}
.diff-list .diff-label { color: #333; }
.diff-list .diff-value { font-size: 1.2em; }
.diff-list .diff-value.plus { color: #d9534f; }
.diff-list .diff-value.minus { color: #007bff; }
.diff-list .diff-value.zero { color: #555; }

.no-target-data {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .diagnosis-result-container {
        grid-template-columns: 1fr;
    }
}
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ff6b6b; /* 目立つ色 */
    color: white;
    text-align: center;
    padding: 12px 0;
    font-weight: bold;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    text-decoration: none;
    font-size: 16px;
}

/* --- 収益化・誘導ブロック用スタイル --- */

/* コンビニvs宅食 比較ブロック */
.monetization-block {
    background: #fff0f5;
    border: 2px solid #ff6b81;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    text-align: center;
}

.monetization-title {
    color: #c0392b;
    margin-top: 0;
    font-size: 1.2em;
    font-weight: bold;
}

.monetization-text {
    text-align: left;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.comparison-box {
    background: white;
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.comparison-price {
    font-size: 1.4em;
    color: #e74c3c;
    font-weight: bold;
    margin: 5px 0;
}

.btn-affiliate-green {
    display: block;
    background: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 0 #219150;
    transition: transform 0.1s;
}

.btn-affiliate-green:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #219150;
}

.campaign-note {
    font-size: 0.7em;
    margin-top: 10px;
    color: #999;
}

/* 検索結果ゼロの場合のブロック */
.no-results-block {
    padding: 30px 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.btn-affiliate-orange {
    display: inline-block;
    margin-top: 15px;
    background: #e67e22;
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 3px 0 #d35400;
}

.product-item { list-style: none; margin-bottom: 40px; }
.combo-part { display: flex; align-items: center; margin: 10px 0; background: #fff; padding: 10px; border-radius: 8px; border: 1px solid #eee; }
.combo-product { display: flex; align-items: center; width: 100%; }
.combo-product img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; margin-right: 15px; border: 1px solid #eee; }
.combo-product .details { flex: 1; }
.combo-product .brand-name { font-size: 0.8rem; color: #888; display: block; }
.combo-product a { text-decoration: none; color: #333; font-weight: bold; font-size: 1rem; display: block; margin-bottom: 4px;}
.combo-product .pfc-details { font-size: 0.85rem; color: #666; display: block; margin-bottom: 6px; }
.buy-link { display: inline-block; background: #ff4757; color: white !important; font-size: 0.8rem; padding: 4px 10px; border-radius: 4px; }
.combo-label { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; color: white; margin-right: 8px; display: inline-block; vertical-align: text-top; }
.combo-label.main { background: #e74c3c; }
.combo-label.side { background: #f1c40f; }
.combo-label.booster { background: #8e44ad; }
.combo-plus { text-align: center; font-size: 1.5rem; color: #ccc; margin: 5px 0; }

/* 結果画面のサマリーボックス */
.result-summary-box {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    border-top: 5px solid #007bff;
}

/* 1食あたりの目標値カプセル */
.meal-target-info {
    text-align: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}
.meal-target-info h2 {
    font-size: 1rem;
    color: #888;
    margin-bottom: 10px;
}
.pfc-info-capsule {
    display: inline-flex;
    gap: 15px;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    color: #333;
}
.val-p { color: #e74c3c; }
.val-f { color: #f1c40f; }
.val-c { color: #3498db; }

/* 組み合わせコンテナ */
/* コンテナ：枠線を消し、浮き上がるようなシャドウに */
.combo-container {
    background: #fff;
    border: none; /* 枠線を消す */
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* 柔らかい影 */
    transition: transform 0.2s;
}

/* ヘッダー：シンプルに */
.combo-header {
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* 商品行：余白を広げる */
.combo-product {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
    align-items: flex-start; /* 上揃え */
}

/* 画像リンク：少し大きく */
.img-link {
    position: relative;
    width: 80px; /* サイズアップ */
    height: 80px;
    flex-shrink: 0;
}
.img-link img {
    border-radius: 8px;
    border: none; /* 画像の枠線も消す */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ラベル：フラットでマットな色に */
.type-label {
    top: -6px;
    left: -6px;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 20px; /* カプセル型 */
    box-shadow: none;
}
.bg-red { background: #ff6b6b; } /* パステル寄りの赤 */
.bg-green { background: #51cf66; } /* パステル寄りの緑 */

/* テキスト情報 */
.combo-product .name {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    display: block;
}
.combo-product .pfc {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 8px;
    background: #f8f9fa;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 購入ボタン：Amazonっぽさを減らし、クリーンなボタンに */
.btn-buy {
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid #007bff;
    color: #007bff !important;
    padding: 6px 12px;
    border-radius: 20px;
    width: auto;
    box-shadow: none;
    transition: all 0.2s;
}
.btn-buy:hover {
    background: #007bff;
    color: #fff !important;
}

/* 合計行：背景色をつけてまとめる */
.combo-total {
    background: #f1f8ff; /* 薄い青背景 */
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid #dcebfb;
}
.total-row {
    margin-bottom: 8px;
    font-size: 1.05em;
}
.price-tag {
    color: #2c3e50; /* 赤字をやめる */
    font-weight: 800;
}
.pfc-row {
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

/* 収益化ブロック（キラキラアニメーション付き） */
/* ベース：警告色をやめて、清潔感のある「比較コラム」風にする */
.monetization-block {
    background: #f8fbff; /* 薄い青背景でサイトに馴染ませる */
    border: 2px solid #e1e8ed; /* 薄いグレーの枠線 */
    border-radius: 12px;
    padding: 25px 20px;
    margin: 30px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* タイトル：赤文字をやめ、濃いグレーで説得力を出す */
.monetization-title {
    color: #2c3e50;
    margin-top: 0;
    font-size: 1.1em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
/* アイコンをCSSで装飾 */
.monetization-title::before {
    content: '💡'; /* 警告ではなく「気づき」のアイコン */
    font-size: 1.2em;
}

.monetization-text {
    text-align: center; /* 中央揃えで見やすく */
    font-size: 0.95em;
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

/* 比較ボックス：テーブル風にして「安さ」を可視化 */
.comparison-box {
    background: white;
    padding: 15px;
    margin: 15px auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    max-width: 90%;
}

/* 金額の強調：赤ではなく、少し落ち着いたアクセントカラーで */
.comparison-price {
    font-size: 1.6em;
    color: #e67e22; /* オレンジ系（ポジティブな印象） */
    font-weight: 800;
    margin: 5px 0;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

/* ボタン：グラデーションとシャドウで「押せる感」を出す */
.btn-affiliate-green {
    display: block;
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
    color: white;
    padding: 16px;
    border-radius: 50px; /* 角丸を強く */
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(39, 174, 96, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
    font-size: 1em;
    max-width: 320px;
    margin: 10px auto 0;
    position: relative;
}

.btn-affiliate-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(39, 174, 96, 0.4);
}

.btn-affiliate-green:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

/* キラキラエフェクト（控えめに） */
.shine-effect::after {
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    animation: shine 4s infinite; /* 少しゆっくりに */
}
@keyframes shine {
    0% { transform: translate(-100%, -100%) rotate(30deg); }
    20% { transform: translate(100%, 100%) rotate(30deg); }
    100% { transform: translate(100%, 100%) rotate(30deg); }
}

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
}