/* --- [基礎設定] --- */
body {
    margin: 0; padding: 0;
    background-color: #f5f5f0;
    color: #2d2d2d;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    position: relative;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

/* --- [質感ノイズ] 不透明度0.04固定 --- */
body::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04; pointer-events: none; z-index: 9998;
}

/* --- [パンくずリスト] --- */
.breadcrumb-container { 
    position: relative;
    padding: 85px 25px 20px;
    z-index: 10;
    max-width: 960px;
    margin: 0 auto;
}
.breadcrumbs { list-style: none; display: flex; padding: 0; margin: 0; font-size: 10px; letter-spacing: 0.05em; overflow-x: auto; white-space: nowrap; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin: 0 10px; color: #ccc; }
.breadcrumbs a { text-decoration: none; color: #2d2d2d; opacity: 0.5; }

/* --- [ページタイトル] --- */
.page-header { padding: 20px 25px 40px; text-align: center; position: relative; }
.page-title { font-family: 'Noto Sans JP', sans-serif; font-weight: 500; font-size: 1.3rem; letter-spacing: 0.1rem; margin: 0; color: #1a2a40; line-height: 1.6; }
.page-title span { display: block; font-size: 10px; font-family: 'Inter', sans-serif; letter-spacing: 0.3em; margin-top: 10px; opacity: 0.6; }

/* --- [アンカーメニュー & 配送案内] --- */
.anchor-nav-area { max-width: 600px; margin: 0 auto 45px; padding: 0 15px; }
.free-shipping-notice {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #bda16b;
    letter-spacing: 0.05em;
    margin-bottom: 45px;
    padding: 10px;
    border: 2px solid rgba(189, 161, 107, 0.3);
    border-radius: 2px;
    background-color: #ffffff;
}
.free-shipping-notice .fs-sub {
    font-size: 0.8em;
}
.anchor-index-card {
    background: #ffffff;
    border: 1px solid #e5e2da;
    border-radius: 16px;
    padding: 4px 18px;
}
.anchor-group { padding: 16px 0; border-bottom: 1px solid #e5e2da; }
.anchor-group:last-child { border-bottom: none; }

.anchor-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.anchor-group-icon { flex: none; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.anchor-group-icon svg { width: 16px; height: 16px; }
.anchor-group-title { font-size: 17px; font-weight: 700; color: #1a2a40; }

.anchor-group-rows { display: flex; flex-direction: column; }
.anchor-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; min-height: 44px; padding: 12px 2px 12px 31px; box-sizing: border-box;
    font-size: 15px; font-weight: 600; color: #2d2d2d;
    text-decoration: none; border-top: 1px dashed #e5e2da;
}
.anchor-group-rows .anchor-row:first-child { border-top: none; }
.anchor-row svg { flex: none; width: 13px; height: 13px; opacity: .4; }
.anchor-row:hover, .anchor-row:focus-visible { background: #f5f5f0; color: #bda16b; }
.anchor-row:hover svg, .anchor-row:focus-visible svg { opacity: .8; }
.anchor-row:active { background: #f5f5f0; }

/* --- [レイアウト共通設定] --- */
main { position: relative; z-index: 1; }
section { position: relative; width: 100%; box-sizing: border-box; }
.content-inner-wrapper { max-width: 800px; margin: 0 auto; padding: 0 15px 50px; }

/* --- [製品カード共通スタイル] --- */
.product-card-sep {
    display: flex; flex-wrap: wrap; margin-bottom: 70px; padding: 25px 10px;
    background: rgba(255,255,255); border-radius: 4px;
    border: 1px solid #e5e2da;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    align-items: flex-start; position: relative; scroll-margin-top: 100px;
}
.visual-area-sep { flex: 0 0 48%; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.pkg-frame { width: 100%; }
.img-pkg { width: 100%; height: auto; display: block; filter: drop-shadow(10px 15px 25px rgba(26, 42, 64, 0.08)); }
.grain-frame {
    width: 60%;
    display: flex;
    justify-content: center;
}
.img-grain {
    width: 125%;
    height: auto;
    display: block;
    filter: drop-shadow(5px 10px 15px rgba(0,0,0,0.06));
    margin: 0 auto;
}

.info-area-sep { flex: 0 0 52%; padding-left: 5px; box-sizing: border-box; }
.type-tag {
    display: inline-block; background: #bda16b; color: #fff; font-size: 8px; font-weight: 800;
    padding: 2px 8px; border-radius: 2px; letter-spacing: 0.1em; margin-bottom: 8px;
}
.item-h2 { font-size: 1.6rem; font-weight: 700; margin: 0 0 15px; line-height: 1.2; color: #1a2a40; }
.item-h2 .fs-mfl-suffix { font-size: 20px; }
.item-amount-text { font-size: 11px; font-weight: 600; margin: -5px 0 15px; opacity: 0.8; color: #1a2a40; }
.item-spec-text { font-size: 11px; color: #666; line-height: 1.6; margin-bottom: 10px; }
.item-note-text { font-size: 13px; color: #bda16b; line-height: 1.5; margin: 0 0 10px; }

.more-link {
    display: inline-block; font-size: 13px; color: #bda16b; text-decoration: none; font-weight: 700;
    margin-bottom: 18px; border-bottom: 1px solid rgba(189, 161, 107, 0.3); padding-bottom: 1px;
}
.price-shipping-row {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
    margin-bottom: 5px; padding-bottom: 10px;
}
.price-num { font-size: 1.4rem; font-weight: 600; font-family: 'Inter'; color: #1a2a40; }
.price-tax { font-size: 8px; opacity: 0.6; }
.shipping-fee-inline { font-size: 9px; color: #bda16b; font-weight: 700; margin-left: 2px; }

/* --- [カートボタンラッパー] --- */
.cart-btn-wrapper {
    width: 100%;
    padding: 10px 0 5px;
    /* margin-top: 10px; */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- [数量ボタン] --- */
.qty-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 12px;
    font-size: 14px;
    color: #2d2d2d;
    white-space: nowrap;
    margin-bottom: 20px;
}
.qty-wrapper > span { grid-column: 1; justify-self: end; }
.qty-wrapper > .qty-controls { grid-column: 2; }

.qty-controls { display: flex; align-items: center; }

.qty-btn {
    width: 40px; height: 40px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 14px; color: #2d2d2d;
    margin: 0; padding: 0;
    cursor: pointer; background: #f8f8f8;
    user-select: none;
    -webkit-appearance: none; appearance: none;
}

.qty-input {
    width: 40px; height: 40px;
    border: 1px solid #ccc; border-left: none; border-right: none;
    box-sizing: border-box; text-align: center;
    font-size: 14px; color: #2d2d2d;
    margin: 0; padding: 0;
    outline: none; background: #fff;
    -webkit-appearance: none; border-radius: 0;
}

.qty-btn:first-child { border-radius: 4px 0 0 4px; }
.qty-btn:last-child { border-radius: 0 4px 4px 0; }

/* --- [カートに入れるボタン] --- */
.cart-btn-jp {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a2a40;
    color: #fff;
    text-decoration: none;
    height: 64px;
    border-radius: 5px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: 0.3s;
    width: calc(100% - 60px);
    max-width: 340px;
    /* width: 80%; */
    border: none;
    cursor: pointer;
}
.cart-btn-jp svg { width: 18px; height: 18px; fill: #fff; margin-right: 8px; }
.cart-btn-jp:active { background: #bda16b; transform: scale(0.97); }

/* --- [ページ最下部の定期リンクボタン] --- */
.bottom-nav-container {
    margin-top: 40px;
    text-align: center;
    padding: 20px 0;
}
.btn-teiki-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 40px;
    background-color: #ffffff;
    color: #1a2a40;
    border: 1px solid #1a2a40;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}
.btn-teiki-link:hover, .btn-teiki-link:active {
    background-color: #1a2a40;
    color: #fff;
}

/* --- [製品タイプ別タグ色] --- */
.tag-tablet { background: #1a2a40; }
.tag-powder { background: #bda16b; }
.tag-granule { background: #b46b1f; }

/* --- [TOPへ戻るボタン] --- */
.totop-button {
    position: fixed;
    right: 20px; bottom: 20px;
    width: 68px; height: 68px;
    background-color: #bda16b;
    color: #ffffff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-size: 11.5px; font-weight: 700; line-height: 1.2;
    z-index: 9999; opacity: 0; visibility: hidden;
    transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.totop-button.is-show { opacity: 1; visibility: visible; }

/* ============================================================
   SP専用レイアウト（767px以下）
   ①商品画像は上部フル幅のまま／③ラベル・④商品名・⑤内容量の
   3行の右に②商品詳細画像を配置／⑥説明文・⑦ボタン・⑧価格・
   ⑨⑩数量とカートはフル幅・中央揃えで再配置。
   DOM構造は変えず、visual-area-sep / info-area-sep を
   display:contents にしてその子要素を product-card-sep の
   グリッドに直接配置している（768px以上は従来通り無関係）。
   ============================================================ */
@media (max-width: 767.98px) {

    .product-card-sep {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "pkg"
            "info"
            "desc"
            "more"
            "price"
            "cart";
        row-gap: 4px;
        padding: 0 0 25px;
    }

    .visual-area-sep,
    .info-area-sep {
        display: contents;
    }

    .pkg-frame {
        grid-area: pkg;
        width: 100%;
        box-sizing: border-box;
        padding: 22px 16px 14px;
        margin-bottom: 10px;
        background: #e9e9e9;
    }
    .img-pkg {
        width: 62%;
        margin: 0 auto;
        filter: drop-shadow(10px 15px 25px rgba(26, 42, 64, 0.08));
    }

    #item-mf .img-pkg {
        position: relative;
        top: -20px;
    }

    /* PC/タブレット用の中身画像はSPでは使わず、grain-frame-sp（下記）に差し替える */
    .grain-frame {
        display: none;
    }

    /* 商品説明コンテナ：左=商品名+内容量／右=中身画像。画像の高さ(116px)を基準に、
       上下10pxの余白ができるよう中央揃えにする。 */
    .item-info-row {
        grid-area: info;
        display: flex;
        align-items: stretch;
    }

    .item-text-block {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        margin: 0 0 0 20px;
        min-width: 0;
    }

    .item-h2 {
        margin: 0;
        font-size: clamp(1.4rem, 10.7vw - 1rem, 1.6rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .item-amount-text {
        margin: 0;
        font-size: 13px;
    }

    .grain-frame-sp {
        flex: 0 0 34%;
        align-self: center;
        height: 116px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 20px 0 0;
        box-sizing: border-box;
    }
    .img-grain-sp {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: drop-shadow(5px 10px 15px rgba(0,0,0,0.06));
    }

    .item-desc-group { grid-area: desc; }

    .item-spec-text {
        grid-area: desc;
        margin: 4px 20px 14px;
        font-size: 16px;
        line-height: 1.7;
        color: #555;
    }

    .item-note-text {
        margin: 0 20px 14px;
        font-size: 15px;
        line-height: 1.6;
        color: #bda16b;
    }

    .more-link {
        grid-area: more;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 200px;
        height: 47.5px;
        margin: 0 auto 18px;
        padding: 0;
        background: #d3d3d3;
        color: #1a2a40;
        font-size: 14px;
        border: 1px solid #1a2a40;
        border-radius: 26px;
    }

    .price-shipping-row {
        grid-area: price;
        justify-content: center;
        text-align: center;
        padding: 14px 24px 0px;
        margin: 0 20px;
        box-sizing: border-box;
        background: #f5f5f0;
        border: 1px solid #e5e2da;
        border-bottom: none;
        border-radius: 12px 12px 0 0;
    }
    .price-num { font-size: 30px; }
    .price-tax { font-size: 14px; }
    .shipping-fee-inline {
        display: inline-block;
        font-size: 15px;
        padding: 3px 10px;
        border-radius: 20px;
        background: rgba(189, 161, 107, 0.14);
    }

    .qty-btn {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }
    .qty-input {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }

    .cart-btn-wrapper {
        grid-area: cart;
        width: auto;
        padding: 4px 24px 20px;
        box-sizing: border-box;
        background: #f5f5f0;
        border: 1px solid #e5e2da;
        border-top: none;
        border-radius: 0 0 12px 12px;
        margin: -4px 20px 0;
    }
    .cart-btn-jp { width: 100%; }

    .btn-teiki-link {
        font-size: 16px;
    }
}

/* ============================================================
   PC・タブレット レイアウト（768px以上）
   左列：画像縦並び　右列：商品説明＋数量ボタン＋カートボタン
   ============================================================ */
@media (min-width: 768px) {

    .item-info-row,
    .item-text-block {
        display: contents;
    }

    .grain-frame-sp {
        display: none;
    }

    .breadcrumbs {
        font-size: 12px;
    }
    .page-title {
        font-size: 1.8rem;
        font-weight: 600;
    }
    .page-title span {
        font-size: 12px;
    }
    .free-shipping-notice {
        font-size: 1rem;
    }
    .btn-teiki-link {
        font-size: 18px;
        padding: 18px 60px;
    }

    .content-inner-wrapper { max-width: 960px; padding: 0 30px 60px; }
    .anchor-nav-area { max-width: 960px; padding: 0 30px; }

    .anchor-index-card {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        padding: 0;
    }
    .anchor-group {
        padding: 24px 28px;
        border-bottom: none;
        border-left: 1px solid #e5e2da;
    }
    .anchor-group:first-child {
        border-left: none;
    }

    .more-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 200px;
        height: 47.5px;
        margin-top: 40px;
        padding: 0;
        background: #d3d3d3;
        color: #1a2a40;
        font-size: 14px;
        font-weight: 700;
        border: 1px solid #1a2a40;
        border-radius: 26px;
        text-decoration: none;
    }

    .product-card-sep {
        display: grid;
        grid-template-columns: 30% 40% 30%;
        grid-template-areas: "visual info cart";
        align-items: stretch;
        padding: 40px;
        gap: 0;
        margin-bottom: 120px;
        container-type: inline-size;
        container-name: productcard;
    }

    @container productcard (max-width: 720px) {
        .product-card-sep { grid-template-columns: 24% 38% 38%; }
        .cart-btn-wrapper { padding: 16px; }
        .price-num { font-size: 24px; }
        .price-tax { font-size: 12px; }
        .shipping-fee-inline { font-size: 12px; padding: 2px 8px; }
        .qty-wrapper { gap: 6px; margin-bottom: 14px; }
        .qty-wrapper > span { font-size: 12px; }
        .qty-btn { width: 32px; height: 36px; font-size: 14px; }
        .qty-input { width: 38px; height: 36px; font-size: 13px; }
        .cart-btn-jp { height: 48px; font-size: 13px; }
        .cart-btn-jp svg { width: 15px; height: 15px; margin-right: 5px; }
        .type-tag { font-size: 10px; padding: 3px 9px; margin-bottom: 8px; }
        .item-h2 { font-size: 20px; margin-bottom: 6px; }
        .item-amount-text { font-size: 12px; margin-bottom: 10px; }
        .item-spec-text { font-size: 13.5px; line-height: 1.7; margin-bottom: 10px; }
        .more-link { font-size: 12.5px; }
    }

    .visual-area-sep {
        grid-area: visual;
        flex: none;
        padding: 0;
        position: relative;
    }

    .img-pkg {
        width: 112%;
        margin-left: -0.5%;
        margin-top: 69px;
        filter: none;
    }

    .product-card-sep:not(#item-mf) > .visual-area-sep .img-pkg {
        position: relative;
        top: -35px;
    }

    .grain-frame {
        position: absolute;
        left: -81px; bottom: -101px;
        width: 70%; aspect-ratio: 1;
        border-radius: 50%; overflow: hidden;
        border: 4px solid #ffffff;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
        background: #f5f5f0;
        display: block;
    }

    .img-grain {
        width: 100%; height: 100%;
        object-fit: cover;
        margin: 0;
        filter: none;
    }

    .info-area-sep {
        grid-area: info;
        flex: none;
        padding: 0 24px;
        box-sizing: border-box;
        margin-top: 0;
    }

    .type-tag { font-size: 12px; padding: 4px 12px; margin-bottom: 12px; }
    .item-h2 { font-size: 28px; margin: 20px 0 8px; line-height: 1.3; }
    .item-amount-text { font-size: 15px; margin: 0 0 16px; }
    .item-spec-text { font-size: 15px; line-height: 1.85; margin: 0 0 16px; }

    .cart-btn-wrapper {
        grid-area: cart;
        width: 100%;
        padding: 26px;
        margin-top: 0;
        box-sizing: border-box;
        align-items: stretch;
        background: #f5f5f0;
        border: 1px solid #e5e2da;
        border-radius: 12px;
    }

    .price-shipping-row {
        display: grid;
        grid-template-columns: auto auto;
        justify-content: start;
        column-gap: 6px;
        row-gap: 10px;
        margin-bottom: 46px;
        padding-bottom: 0;
    }
    .price-num { font-size: 32px; white-space: nowrap; }
    .price-tax { font-size: 13px; white-space: nowrap; }
    .shipping-fee-inline {
        grid-column: 1 / -1;
        justify-self: start;
        margin-left: 0;
        margin-top: 0;
        display: inline-block;
        font-size: 13px;
        padding: 3px 10px;
        border-radius: 20px;
        background: rgba(189, 161, 107, 0.14);
        width: fit-content;
    }

    .qty-wrapper {
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        gap: 10px;
        margin-bottom: 22px;
        margin-left: 0;
    }
    .qty-input::-webkit-inner-spin-button,
    .qty-input::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    .qty-input {
        -moz-appearance: textfield;
        appearance: textfield;
    }
    .qty-wrapper > span {
        font-size: 13px;
        font-weight: 700;
        color: #767066;
        letter-spacing: 0.04em;
    }
    .qty-btn { width: 42px; height: 42px; font-size: 17px; }
    .qty-input { width: 52px; height: 42px; font-size: 15px; }

    .cart-btn-jp {
        width: 100%;
        max-width: none;
        height: 60px;
        font-size: 17px;
    }
    .cart-btn-jp svg { width: 19px; height: 19px; }

    .btn-teiki-link {
        font-size: 16px;
        padding: 18px 45px;
    }
}

/* ============================================================
   タブレット専用レイアウト（768px〜1023px）
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023.98px) {

    .anchor-group {
        padding: 24px 6px;
    }
    .anchor-group-title {
        font-size: 15px;
        white-space: nowrap;
    }
    .anchor-row {
        white-space: nowrap;
    }

    /* --- Cブロック: パターン①横一列オールインワン型 --- */
    .cart-btn-wrapper {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 18px;
    }

    .price-shipping-row {
        display: grid;
        grid-template-columns: auto auto;
        justify-content: start;
        align-items: baseline;
        column-gap: 4px;
        row-gap: 2px;
        margin-bottom: 0;
    }
    .price-num {
        font-size: 23px;
    }
    .price-tax {
        font-size: 10.5px;
    }
    .shipping-fee-inline {
        grid-column: 1 / -1;
        justify-self: start;
        font-size: 10px;
        padding: 2px 8px;
        margin-left: 0;
        margin-top: 2px;
        width: fit-content;
    }

    .qty-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 0;
    }
    .qty-wrapper > span {
        font-size: 10px;
    }
    .qty-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .qty-input {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .cart-btn-jp {
        width: auto;
        height: 52px;
        padding: 0 22px;
        font-size: 13px;
        white-space: nowrap;
    }
    .cart-btn-jp svg {
        width: 16px;
        height: 16px;
        margin-right: 5px;
    }

    .product-card-sep {
        padding-left: 30px;
        padding-right: 30px;
        grid-template-columns: 30% 70%;
        grid-template-areas:
            "visual info"
            "visual cart";
        column-gap: 20px;
        row-gap: 24px;
    }

    .grain-frame {
        left: -41px;
        bottom: -90px;
        width: 80.5%;
    }

    .info-area-sep {
        position: relative;
        padding-left: 0;
    }

    .more-link {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
        width: 160px;
    }

    .img-pkg {
        margin-top: 79px;
    }

    #item-mf .img-pkg {
        margin-top: 39px;
    }

    #item-mfl .img-pkg {
        margin-top: 89px;
    }

    #item-m .img-pkg,
    #item-g .img-pkg,
    #item-gf .img-pkg {
        margin-top: 89px;
    }
}

@media (min-width: 1024px) {
    #item-mf .img-pkg {
        margin-top: 4px;
    }

    .info-area-sep {
        padding-left: 18px;
        padding-right: 18px;
    }

    .breadcrumbs {
        font-size: 12px;
    }
    .page-title {
        font-size: 1.8rem;
        font-weight: 600;
    }
    .page-title span {
        font-size: 12px;
    }
    .free-shipping-notice {
        font-size: 1rem;
    }
    .btn-teiki-link {
        font-size: 18px;
        padding: 18px 60px;
    }
}

@media (min-width: 1024px) and (hover: hover) {
    .cart-btn-jp:hover {
        background: #bda16b;
    }
}
