*{
  box-sizing:border-box;
}

body{
  margin:0;
  min-height:100vh;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",sans-serif;
  background:#f5f7fa;
  color:#222;
}

.container{
  width:min(900px,92%);
  margin:auto;
  padding:32px 0;
}

.narrow{
  max-width:650px;
}

.card{
  background:#fff;
  border-radius:18px;
  padding:24px;
  margin-bottom:22px;
  box-shadow:0 6px 24px rgba(0,0,0,.07);
}


/* 商品一覧 */

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:18px;
}

.product-card{
  display:block;
  background:#fff;
  border-radius:16px;
  padding:14px;
  color:#222;
  text-decoration:none;
  box-shadow:0 5px 18px rgba(0,0,0,.07);
}

.product-card img{
  display:block;
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border-radius:12px;
}

.product-card h2{
  margin:10px 0 4px;
}

.product-price{
  margin:0;
  font-size:16px;
  font-weight:700;
}


/* 商品ページ */

.item-image{
  max-height:620px;
  object-fit:contain;
  margin-bottom:20px;
}

.item-images{
  display:flex;
  flex-direction:column;
  gap:16px;
  margin-bottom:20px;
  align-items:center;
}

.item-images img{
  display:block;
  width:auto;
  max-width:100%;
  max-height:400px;
  object-fit:contain;
  border-radius:12px;
}

.price{
  margin:8px 0 18px;
  font-size:24px;
  font-weight:700;
}


/* 商品画像なし */

.no-image{
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:1;
  background:#eee;
  border-radius:12px;
  color:#888;
}


/* フォーム */

label{
  display:block;
  font-weight:700;
  margin:16px 0 7px;
}

input[type=text],
input[type=password],
input[type=number],
textarea{
  width:100%;
  padding:13px;
  border:1px solid #ccc;
  border-radius:10px;
  font:inherit;
}

button{
  width:100%;
  padding:13px;
  margin-top:16px;
  border:0;
  border-radius:10px;
  background:#222;
  color:#fff;
  font-weight:700;
  cursor:pointer;
}

.vote-button{
  font-size:20px;
}


/* 削除ボタン */

.danger{
  background:#8b2b2b;
  width:auto;
  padding:7px 11px;
  margin:0;
}


/* メッセージ */

.message,
.error{
  padding:12px;
  border-radius:10px;
  margin:12px 0;
}

.message{
  background:#eef6ee;
}

.error{
  background:#fff0f0;
  color:#922;
}


/* 管理画面 */

.admin-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.admin-row{
  padding:14px 0;
  border-bottom:1px solid #eee;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.inline{
  display:inline;
}

.admin-row a{
  color:#555;
}

.back{
  display:block;
  margin-top:16px;
  color:#555;
}

.hint{
  font-size:13px;
  color:#777;
}


/* 管理画面・編集時の画像 */

.edit-images{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

.edit-images img{
  width:80px;
  height:80px;
  object-fit:cover;
  border-radius:8px;
}


/* バナー */

.site-header{
  margin-bottom:22px;
}

.site-logo{
  display:block;
  text-decoration:none;
}

.site-logo img{
  display:block;
  width:100%;
  height:auto;
  border-radius:14px;
  background:#fff;
  box-shadow:0 6px 24px rgba(0,0,0,.07);
}


/* トップページ説明 */

.lead{
  text-align:center;
  margin:0 0 22px;
  font-size:15px;
  color:#555;
}

.description{
  line-height:1.8;
}


/* スマホ */

@media(max-width:600px){

  .container{
    padding:22px 0;
  }

  .site-header{
    margin-bottom:18px;
  }


  /* 商品を2列表示 */

  .grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
  }

  .product-card{
    min-width:0;
    padding:10px;
  }

  .product-card h2{
    font-size:15px;
    margin:10px 0 4px;
    line-height:1.4;
  }

  .product-price{
    font-size:16px;
  }


  /* 商品ページの複数画像 */

  .item-images{
    gap:12px;
  }

  .item-images img{
    max-width:100%;
    max-height:400px;
  }


  /* 管理画面 */

  .admin-row>div{
    width:100%;
  }

}

/* 商品ページの画像サイズをスマホで固定 */
@media (max-width:600px){

  .item-images{
    width:100% !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    gap:12px !important;
  }

  .item-images img{
    display:block !important;
    width:300px !important;
    max-width:300px !important;
    height:auto !important;
    max-height:350px !important;
    object-fit:contain !important;
    margin:0 auto !important;
  }

}

.product-card-wrap{
  position:relative;
}

.product-card-wrap .favorite-button{
  position:absolute;
  top:18px;
  right:18px;
  z-index:10;
  width:42px;
  height:42px;
  padding:0;
  margin:0;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.95);
  color:#777;
  font-size:25px;
  line-height:42px;
  text-align:center;
  box-shadow:0 3px 10px rgba(0,0,0,.15);
}

.product-card-wrap .favorite-button.is-favorite{
  color:#e85b70;
}

@media(max-width:600px){

  .product-card-wrap .favorite-button{
    top:14px;
    right:14px;
    width:40px;
    height:40px;
    font-size:24px;
    line-height:40px;
  }

}

