
/* カテゴリの表示*/
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.category-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto;
    min-height: 300px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}
    .category-item img {
        width: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        object-position: top;
        border-radius: 6px;
        margin-bottom: 10px;
        height: 100%;
       /* max-height: none;*/
    }
    .category-item p {
        min-height: 40px;
        margin: 0;
    }

@media (max-width: 600px) {
    .category-item img {
        aspect-ratio: 3 / 4; /* 縦長にしたい場合はこちら */
        max-height: 240px;
    }
}

/* 商品の表示*/
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 20px;
}
.product-grid .product-item {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
    .product-grid .product-item img {
        width: 100%;
        max-width: 160px; /* 横幅の上限を設定 */
        height: auto;
        aspect-ratio: auto; /* 固定比率を解除し、画像の自然な比率に任せる */
        object-fit: contain; /* 枠内に収めて切り取りを防ぐ */
        object-position: center; /* 中央揃えで構図を安定化 */
        border-radius: 6px;
        margin: 0 auto 10px; /* 中央揃え＋下余白 */
    }

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
        .product-grid .product-item img {
            aspect-ratio: 3 / 4; /* ← PCと同じ比率を維持したいならこれ */
            max-height: 160px;
            height: auto; /* ← 明示的に高さを自動に戻す */
        }
}

/* 商品の詳細表示*/
.product-detail-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}
    .product-detail-container img {
        width: 80%;
        max-width: 500px;
        /*height: auto;*/
        /*aspect-ratio: 3 / 4;*/
        /*object-fit: cover;*/
        object-position: top;
        border-radius: 8px;
        display: block;
        margin: 0 auto;
    }

/* スマホ対応 */
@media (max-width: 600px) {
    .product-detail-container img {
        aspect-ratio: 3 / 4;
        max-width: 100%;
        max-height: 300px;
    }
}

.back-button {
    font-size: 1.0rem; /* 大きめの文字サイズ */
    padding: 12px 24px; /* ボタンの余白を広く */
    background-color: #007bff; /* 青系の背景色 */
    color: white; /* 白文字 */
    border: none; /* 枠線なし */
    border-radius: 8px; /* 角丸 */
    cursor: pointer; /* カーソルをポインターに */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2); /* 軽い影 */
    transition: background-color 0.3s;
}
    .back-button:hover {
        background-color: #0056b3; /* ホバー時に濃い青に */
    }