/* ========================================
   商品一覧ページ専用CSS
======================================== */
.fwd-page-products {
    min-height: 100vh;
    background-color: #FCFCF2;
    background-image: url('../../images/background_pattern.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% auto;
}

/* ナビゲーションメニュー - ヘッダーの下に配置 */
.fwd-page-products .fwd-main-menu {
    position: static;
    /* frontend.cssのposition: absoluteを上書き */
}

/* ナビゲーションメニュー */
.fwd-page-products .fwd-nav {
    background: #000000;
    padding: 0;
}

.fwd-page-products .nav-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

.fwd-page-products .nav-item {
    flex: 1;
    text-align: center;
    border-bottom: 5px solid transparent;
    transition: all 0.3s ease;
}

.fwd-page-products .nav-item.active {
    background: #333333;
    border-bottom-color: #a2000d;
}

.fwd-page-products .nav-item a {
    display: block;
    padding: 20px;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Zen Old Mincho', serif;
    font-size: 16px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.fwd-page-products .nav-item:hover {
    background: #333333;
}

.fwd-page-products .nav-item a:hover {
    opacity: 0.8;
}

/* メインコンテンツ */
.fwd-page-products .fwd-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* 商品セクション */
.products-section {
    max-width: 1004px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.products-section h1 {
    font-family: 'Zen Old Mincho', serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 24px;
    color: #000000;
    text-align: center;
    margin: 0 0 58px 0;
}

/* 大きい商品グリッド（320x320） - 横3列 */
.products-grid-large {
    display: grid;
    grid-template-columns: repeat(3, 320px);
    gap: 22px;
    margin: 0 auto 40px;
    max-width: 1004px;
    justify-content: center;
}

/* 小さい商品グリッド（192x192） - 横5列 */
.products-grid-small {
    display: grid;
    grid-template-columns: repeat(5, 192px);
    gap: 11px;
    margin: 0 auto 60px;
    max-width: 1004px;
    justify-content: center;
}

/* 商品アイテム共通 */
.product-item {
    position: relative;
}

.product-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 大きい商品（320x320） */
.product-item--large .product-image {
    width: 320px;
    height: 320px;
    aspect-ratio: 1;
    background: #d9d9d9;
    position: relative;
    margin-bottom: 8px;
}

.product-item--large .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* デフォルト画像プレースホルダー（画像がない場合） */
.product-item--large .product-image .post-image--default {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 小さい商品（192x192） */
.product-item--small .product-image {
    width: 192px;
    height: 192px;
    aspect-ratio: 1;
    background: #d9d9d9;
    position: relative;
    margin-bottom: 8px;
}

.product-item--small .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* デフォルト画像プレースホルダー（画像がない場合） */
.product-item--small .product-image .post-image--default {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* NEWバッジ */
.new-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    padding: 13px 0 0 8px;
    background: #a2000d;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Noto Sans', sans-serif;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: flex-start;
    clip-path: polygon(
        0 0,        /* 左上角 */
        100% 0,     /* 右上角 */
        0 100%      /* 左下角 */
    );
}

/* 商品名 */
.product-name {
    font-family: 'Zen Old Mincho', serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 24px;
    color: #000000;
    text-align: left;
}

/* 価格表示 */
.product-price {
    font-family: 'Zen Old Mincho', serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 24px;
    color: #000000;
    text-align: left;
}

/* タブレット・モバイル（1024px以下）- メニューページと同様の仕様 */
@media (max-width: 1024px) {
    .fwd-page-products .fwd-main {
        padding: 40px 0;
    }

    .fwd-page-products .nav-items {
        flex-direction: column;
    }

    .fwd-page-products .nav-item {
        border-bottom: 1px solid #333333;
    }

    .fwd-page-products .nav-item.active {
        border-left: 5px solid #a2000d;
        border-bottom: 1px solid #333333;
    }

    .products-section {
        max-width: 710px;
    }

    /* タイトル: Figma 42px (@2x) → 21px (@1x) */
    .products-section h1 {
        font-size: 21px;
        line-height: 24px;
        margin-bottom: 40px;
    }

    /* PC版3カラム用（large）: モバイルでは全幅表示 710x394 (@2x) */
    .products-grid-large {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 30px;
        max-width: 710px;
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }

    /* Large: 710x394 (@2x) → 355x197 (@1x), aspect-ratio 710/394 ≈ 1.8 */
    .product-item--large .product-image {
        width: 100%;
        height: auto;
        aspect-ratio: 710 / 394;
        margin: 0 0 8px 0;
    }

    /* Large用NEWバッジ: 130px (@2x) → 65px (@1x) */
    .product-item--large .new-badge {
        width: 65px;
        height: 65px;
        padding: 16px 0 0 10px;
        font-size: 14px;
    }

    /* PC版5カラム用（small）: モバイルでは2カラムで正方形表示 350x350 (@2x) */
    .products-grid-small {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 40px;
        max-width: 710px;
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }

    /* Small: 350x350 (@2x) → 175x175 (@1x), 正方形 */
    .product-item--small .product-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        margin: 0 0 8px 0;
    }

    /* Small用NEWバッジ: 60px (@2x) → 30px (@1x) */
    .product-item--small .new-badge {
        width: 30px;
        height: 30px;
        padding: 6px 0 0 4px;
        font-size: 8px;
    }

    /* 商品名: Figma 26px / 40px (@2x) → 13px / 20px (@1x) */
    .product-name {
        font-size: 13px;
        font-weight: 600;
        line-height: 20px;
        text-align: left;
    }

    .product-price {
        font-size: 13px;
        line-height: 20px;
    }
}

/* 小型スマホ（375px以下）- 全て1カラム表示 */
@media (max-width: 375px) {
    .products-grid-large,
    .products-grid-small {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    /* Large: 全幅、アスペクト比維持 */
    .product-item--large .product-image {
        aspect-ratio: 710 / 394;
    }

    /* Small: 全幅、正方形維持 */
    .product-item--small .product-image {
        aspect-ratio: 1;
    }

    .products-section h1 {
        font-size: 18px;
    }

    .product-name {
        font-size: 12px;
        line-height: 18px;
    }

    .product-price {
        font-size: 12px;
        line-height: 18px;
    }
}

/* ========================================
   吉丸の商品が選ばれるワケ - PC版（元のデザイン）
======================================== */
.commitment-teaser {
    max-width: 1000px;
    margin: 60px auto;
    display: flex;
}

/* PC版: 表示 / モバイル版: 非表示 */
.commitment-content--pc {
    display: flex;
}

.commitment-content--mobile {
    display: none;
}

.commitment-content--pc {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    width: 100%;
    background-color: #FFFFFF;
    height: 100%;
}

/* 左側: 画像 200x200 */
.commitment-content--pc .commitment-image {
    width: 200px;
    height: 200px;
    min-width: 200px;
}

.commitment-content--pc .commitment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 右側: テキストコンテンツ */
.commitment-text {
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    flex: 1;
}

.commitment-text h2 {
    font-family: 'Zen Old Mincho', serif;
    font-size: 24px;
    font-weight: 600;
    color: #000000;
    display: block;
    margin: 0 0 16px 0;
}

.commitment-text p {
    font-family: 'Zen Old Mincho', serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.8;
    color: #000000;
    max-width: 689px;
    margin: 0;
    flex: 1;
}

/* ボタンラッパー: 右寄せ */
.commitment-btn-wrapper {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
}

.commitment-btn-wrapper .fwd-btn {
    width: 220px;
    padding: 10px 40px;
    font-size: 14px;
}

/* ========================================
   吉丸の商品が選ばれるワケ - モバイル版（新デザイン）
======================================== */
.commitment-content--mobile {
    flex-direction: column;
    gap: 24px;
    width: 100%;
    background-color: #FFFFFF;
    box-sizing: border-box;
}

/* ヘッダー部分: 画像とタイトルを横並び */
.commitment-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.commitment-content--mobile .commitment-image {
    width: 16vw;
    flex-shrink: 0;
}

.commitment-content--mobile .commitment-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.commitment-header h2 {
    font-family: 'Zen Old Mincho', serif;
    font-size: 20px;
    font-weight: 600;
    color: #000000;
    margin: 0;
}

/* 本文 */
.commitment-description {
    font-family: 'Zen Old Mincho', serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.8;
    color: #000000;
    margin: 0;
}

/* ========================================
   全商品一覧 - Figma仕様（830px、5カラムグリッド）
======================================== */
.products-all {
    max-width: 1004px;
    margin: 0 auto;
    padding: 0;
}

.products-all__container {
    background: #FFFFFF;
    padding: 60px 24px 60px 24px;
}

.products-all__title {
    font-family: 'Zen Old Mincho', serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 24px;
    color: #000000;
    text-align: center;
    margin: 60px 0 40px 0;
}

.products-all__container {
    margin-bottom: 40px;
}

/* 5カラムグリッド: 176px × 5列 = 880px、gap含めると830px */
.products-all__grid {
    display: grid;
    grid-template-columns: repeat(5, 176px);
    gap: 40px 0;
    justify-content: center;
}

/* サブカテゴリー */
.products-subcategory {
    margin-bottom: 0;
}

.products-subcategory__title {
    font-family: 'Zen Old Mincho', serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    color: #000000;
    margin: 0 0 10px 0;
}

.products-subcategory__items {
    font-family: 'Zen Old Mincho', serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 26px;
    color: #000000;
}

.products-subcategory__items p {
    margin: 0;
}

/* 商品注文CTA */
.products-cta {
    text-align: center;
    margin-top: 60px;
}

/* タブレット・モバイル（1024px以下）- 吉丸の商品が選ばれるワケ */
@media (max-width: 1024px) {
    /* PC版: 非表示 / モバイル版: 表示 */
    .commitment-content--pc {
        display: none;
    }

    .commitment-content--mobile {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .commitment-teaser {
        max-width: 710px;
        margin: 40px auto 0 auto;
        padding: 0 20px;
        box-sizing: border-box;
    }

    .commitment-description {
        padding: 0 24px;
    }

    .commitment-btn-wrapper {
        padding-bottom: 24px;
        justify-content: center;
    }

    .commitment-btn-wrapper .fwd-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* タブレット・モバイル（1024px以下）- 全商品一覧 */
@media (max-width: 1024px) {
    .products-all {
        max-width: 710px;
        padding: 0 20px;
        margin-top: 60px;
    }

    .products-all__title {
        font-size: 36px;
        font-weight: 700;
        line-height: 24px;
        margin-bottom: 40px;
    }

    .products-all__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .products-subcategory__title {
        font-size: 16px;
        font-weight: 700;
        line-height: 24px;
        margin-bottom: 15px;
    }

    .products-subcategory__items {
        font-size: 14px;
        font-weight: 700;
        line-height: 26px;
    }
}

/* 小型スマホ（375px以下）- 吉丸の商品が選ばれるワケ */
@media (max-width: 375px) {
    .commitment-teaser {
        padding: 0 15px;
    }

    .commitment-content--mobile {
        padding: 20px;
        gap: 16px;
    }

    .commitment-header h2 {
        font-size: 16px;
    }

    .commitment-description {
        font-size: 12px;
        line-height: 1.7;
    }
}

/* 小型スマホ（375px以下）- 全商品一覧 */
@media (max-width: 375px) {
    .products-all__title {
        font-size: 18px;
    }

    .products-all__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .products-subcategory__title {
        font-size: 14px;
    }

    .products-subcategory__items {
        font-size: 12px;
        line-height: 20px;
    }
}
