:root {
  --brand: #21a366;
  --ink: #111;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 16px;
  color: #222;
  background: #fafafa;
}

header,
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: 20px;
}

.muted {
  opacity: 0.7;
  font-size: 14px;
}

button,
input[type="text"],
select {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
}

button.primary {
  background: var(--brand);
  color: #fff;
  border: none;
  font-weight: 700;
}

button.link {
  border: none;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  user-select: none;
}

.thumb {
  width: 100%;
  border-radius: 8px;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
}

.thumb-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 1;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.name {
  font-size: 12px;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.select-box {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  z-index: 3;
}

.select-box input {
  transform: scale(1.1);
}

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
  color: #fff;
  padding: 12px 16px;
  z-index: 50;
}

.cart-bar .right {
  display: flex;
  gap: 8px;
}

.cart-bar button {
  border-radius: 8px;
  padding: 10px 14px;
  border: none;
}

.cart-bar .secondary {
  background: #444;
  color: #fff;
}

.cart-bar .primary {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

img,
.thumb-wrap,
.overlay {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.api-box {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  font-size: 12px;
  background: #eee;
  padding: 2px 8px;
  border-radius: 999px;
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-box label {
  font-size: 12px;
  color: #555;
}

.sold-badge {
  font-size: 10px;
  color: #555;
  background: #f2f2f2;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-footer {
  margin-top: 24px;
  padding-top: 8px;
  font-size: 11px;
  color: #777;
  text-align: right; /* 目立たせたくないので右下にひっそり */
}

.brand-logo img {
  height: 28px;
  opacity: 0.85;   /* 控えめに */
  user-select: none;
  -webkit-user-drag: none;
}

/* ヘッダ内のミニフッタ表示 */
.header-mini-footer {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
}

.header-mini-footer a {
  text-decoration: none;
}

.header-mini-footer a:hover {
  text-decoration: underline;
}

/* スマホ時はちょっと余白広め */
@media (max-width: 768px) {
  .header-mini-footer {
    margin-top: 6px;
  }
}

/* ===== スクロールヘルパーボタン ===== */
.scroll-helper {
  position: fixed;
  right: 16px;
  bottom: 80px;          /* cartBar より少し上に出す */
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(30, 30, 30, 0.9);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  opacity: 0.8;
  transition:
    opacity 0.15s ease-out,
    transform 0.12s ease-out,
    background 0.15s ease-out;
}

.scroll-helper:hover {
  opacity: 1;
  transform: translateY(-2px);
  background: rgba(45, 45, 45, 0.95);
}

.scroll-helper:active {
  transform: translateY(0);
}

/* スマホでは少し大きく & 余白も増やす */
@media (max-width: 768px) {
  .scroll-helper {
    right: 12px;
    bottom: 88px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
}

