/* 入札会システム — fmv.bz のデザイントークンを踏襲 */
:root {
  --bg: #ffffff;
  --fg: #333333;
  --primary: #ffbb00;          /* hsl(44 100% 50%) */
  --primary-fg: #333333;
  --secondary: #fef6d2;        /* hsl(49 95% 91%) */
  --muted: #f1f5f9;
  --muted-fg: #6b7280;
  --border: #d9d9d9;
  --input: #999999;
  --danger: #d9534f;
  --success: #2e8b57;
  --radius: 4px;
  --shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --header-h: 80px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, system-ui, sans-serif;
  font-size: 16px; line-height: 1.6; padding-top: var(--header-h);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo img { width: 160px; height: auto; max-height: 56px; object-fit: contain; }
.menu-btn { background: none; border: 0; padding: 8px; cursor: pointer; color: var(--fg); border-radius: 8px; }
.site-nav { display: none; }
.site-nav a { padding: 8px 20px; font-size: 14px; border-right: 1px solid var(--border); white-space: nowrap; }
.site-nav a:last-child { border-right: 0; }
.site-nav a:hover { background: rgba(241,245,249,.5); text-decoration: underline; text-underline-offset: 4px; }
.site-nav .nav-cta { margin-left: 12px; border: 0; }
.site-nav .nav-cta:hover { text-decoration: none; }
@media (max-width: 1023px) {
  .site-nav.is-open {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: 8px 16px 16px;
  }
  .site-nav.is-open a { border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 8px; font-size: 16px; }
  .site-nav.is-open .nav-cta { margin: 12px 0 0; border-bottom: 0; text-align: center; }
}
@media (min-width: 1024px) {
  .menu-btn { display: none; }
  .site-nav { display: flex; align-items: center; }
  /* 項目名が長いため 1024〜1279px では詰めて表示 */
  .site-nav a { font-size: 14px; padding: 8px 12px; }
  .site-nav .nav-cta { margin-left: 8px; padding: 0 12px; }
}
@media (min-width: 1280px) {
  .site-nav a { font-size: 16px; padding: 8px 20px; }
  .site-nav .nav-cta { margin-left: 12px; padding: 0 16px; }
}

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  font-size: 14px; font-weight: 700; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s, box-shadow .15s; white-space: nowrap; font-family: inherit;
}
@media (min-width: 768px) { .btn { font-size: 16px; } }
.btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.btn-primary:hover { background: #e6a800; }
.btn-outline { background: #fff; color: var(--fg); border-color: var(--primary); }
.btn-outline:hover { background: var(--secondary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px !important; }
select, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=url], textarea {
  font: inherit; color: var(--fg); background: #fff; border: 1px solid var(--input); border-radius: var(--radius);
  padding: 8px; height: 43px; width: 100%;
}
textarea { height: auto; min-height: 120px; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---------- page head / filters ---------- */
.page-head { padding: 32px 0 16px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: .1em; }
@media (min-width: 768px) { .page-head h1 { font-size: 30px; } }
.lead { font-size: 13px; color: var(--muted-fg); margin: 8px 0 0; }
.filter-panel { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.filter-row { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 768px) {
  .filter-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .filter-row select { width: auto; min-width: 160px; }
  .search-input { width: 100%; max-width: 32rem; }
}
.result-bar { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 16px 0 8px; }
.result-count { margin: 0; color: var(--muted-fg); font-size: 14px; }
.result-count strong { font-size: 22px; color: var(--fg); margin-right: 4px; }
.sync-time { margin: 0; font-size: 12px; color: var(--muted-fg); }
.empty { text-align: center; padding: 64px 16px; color: var(--muted-fg); }
.empty h1 { font-size: 22px; margin-bottom: 12px; color: var(--fg); }
.empty .btn { margin-top: 16px; }

/* ---------- lot grid / card ---------- */
.lot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) { .lot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .lot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lot-card {
  display: flex; flex-direction: column; border: 1px solid var(--border); background: #fff; overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.lot-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.lot-card.is-ended { opacity: .7; }
.lot-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--muted); overflow: hidden; }
.lot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-image-ph, .lot-thumb.no-image::after {
  content: "写真準備中"; display: flex; align-items: center; justify-content: center; position: absolute; inset: 0;
  color: var(--muted-fg); font-size: 13px; background: var(--muted);
}
.no-image-ph { position: static; aspect-ratio: 4 / 3; }
.badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 10px; font-size: 12px; font-weight: 700; border-radius: 999px;
  background: var(--primary); color: var(--primary-fg); box-shadow: 0 1px 2px rgb(0 0 0 / .2);
}
.badge-bid { background: var(--danger); color: #fff; }
.badge-ended { background: #555; color: #fff; left: auto; right: 8px; }
.lot-no { background: var(--secondary); text-align: center; font-weight: 700; font-size: 18px; padding: 6px 8px; }
.lot-no span { font-size: 12px; font-weight: 400; margin-right: 6px; }
.lot-body { padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lot-title { font-size: 15px; font-weight: 700; margin: 4px 0 6px; }
@media (min-width: 768px) { .lot-title { font-size: 18px; } }
.lot-meta { margin: 0; font-size: 13px; color: var(--muted-fg); }
.lot-meta b { color: var(--muted-fg); }
.lot-spec { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.lot-cat { font-size: 12px; }
.lot-remaining {
  margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px;
}
.rem-label { font-size: 11px; color: var(--muted-fg); }
.rem-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.rem-end { font-size: 11px; color: var(--muted-fg); width: 100%; }
.state-soon .rem-value { color: var(--danger); }
.state-ended .rem-value { color: #555; }
.state-none .rem-value { color: var(--muted-fg); font-weight: 400; }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 32px 0; flex-wrap: wrap; }
.pg-num, .pg-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; font-weight: 700; border-radius: var(--radius); }
.pg-num:hover, .pg-btn:hover { background: var(--secondary); }
.pg-num.is-current { border: 1px solid var(--primary); box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.pg-ellipsis { padding: 0 4px; color: var(--muted-fg); }

/* ---------- detail ---------- */
.breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--muted-fg); padding: 20px 0 8px; flex-wrap: wrap; }
.breadcrumb a:hover { text-decoration: underline; }
.detail-head { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; }
.lot-no-lg { display: inline-block; padding: 6px 20px; font-size: 22px; align-self: flex-start; }
.detail-title { font-size: 22px; font-weight: 700; }
@media (min-width: 768px) { .detail-title { font-size: 28px; } }
.detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-badges .badge { position: static; font-size: 13px; }
.detail-badges .lot-remaining { margin: 0; padding: 0; font-size: 16px; }
.detail-badges .rem-end { width: auto; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 3fr 2fr; align-items: start; } }
.gallery-main { position: relative; background: var(--muted); aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--border); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.85); color: var(--fg); font-size: 28px; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
}
.gal-nav:hover { background: var(--primary); }
.gal-prev { left: 8px; } .gal-next { right: 8px; }
.gal-counter { position: absolute; right: 12px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-top: 8px; }
.gal-thumb { padding: 0; border: 2px solid transparent; background: var(--muted); aspect-ratio: 4 / 3; overflow: hidden; cursor: pointer; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-thumb.is-active, .gal-thumb:hover { border-color: var(--primary); }
.gal-thumb.is-hidden { display: none; }
.gallery-note { font-size: 13px; color: var(--muted-fg); }
.spec-title { font-size: 18px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--primary); margin-bottom: 8px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.spec-table th { width: 38%; font-weight: 700; color: var(--muted-fg); white-space: nowrap; background: #fafafa; }
.bid-cta { margin-top: 20px; padding: 16px; background: var(--secondary); border-radius: var(--radius); font-size: 14px; }
.bid-cta p { margin: 0 0 12px; }
.detail-nav { display: flex; justify-content: space-between; gap: 8px; padding: 32px 0; flex-wrap: wrap; }

/* ---------- guide ---------- */
.guide h1 { font-size: 26px; padding: 8px 0 16px; letter-spacing: .1em; }
.download-box { padding: 20px; background: var(--secondary); border-radius: var(--radius); margin-bottom: 24px; }
.download-box p { margin: 0 0 12px; }
.guide-body { line-height: 1.9; padding-bottom: 32px; }
.guide-body h2 { font-size: 20px; border-left: 6px solid var(--primary); padding-left: 12px; margin: 28px 0 12px; }
.guide-body h3 { font-size: 17px; margin: 20px 0 8px; }
.guide-body table { border-collapse: collapse; width: 100%; }
.guide-body th, .guide-body td { border: 1px solid var(--border); padding: 8px; }
.guide-body a { color: #1d6fa5; text-decoration: underline; }

/* ---------- footer ---------- */
.site-footer { background: #000; color: #9ca3af; margin-top: 48px; padding-bottom: 16px; font-size: 12px; }
.footer-bar { height: 8px; background: var(--primary); }
.footer-note { text-align: center; margin: 12px 0 24px; }
.footer-cols { display: flex; flex-direction: column; gap: 24px; align-items: center; }
.footer-corp { text-align: center; }
.footer-corp p { margin: 2px 0; }
.footer-corp img { margin: 0 auto 16px; width: 160px; }
.footer-links { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.footer-links a { display: flex; flex-direction: column; align-items: center; }
.footer-links span { color: #e5e7eb; font-size: 14px; font-weight: 600; }
.footer-links small { color: #4b5563; font-size: 12px; }
.footer-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; border-top: 1px solid #374151; margin-top: 24px; padding-top: 16px; }
.footer-bottom p { margin: 0; }
@media (min-width: 768px) {
  .footer-cols { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .footer-corp, .footer-links a { text-align: left; align-items: flex-start; }
  .footer-corp img { margin-left: 0; }
  .footer-links { flex-direction: row; gap: 32px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* ---------- 表示切替（タイル / リスト） ---------- */
.result-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-toggle a {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  font-size: 13px; font-weight: 700; color: var(--muted-fg); background: #fff; white-space: nowrap;
}
.view-toggle a + a { border-left: 1px solid var(--border); }
.view-toggle a svg { fill: currentColor; }
.view-toggle a:hover { background: var(--muted); }
.view-toggle a.is-active { background: var(--primary); color: var(--primary-fg); }

/* グリッド時は lot-main を透過させ、従来のレイアウトを維持 */
.lot-main { display: contents; }

/* ---------- リスト表示 ---------- */
.lot-grid.is-list { display: block; border-top: 1px solid var(--border); }
.lot-grid.is-list .lot-card {
  flex-direction: row; align-items: stretch; border: 0; border-bottom: 1px solid var(--border);
}
.lot-grid.is-list .lot-card:hover { box-shadow: none; background: #fcfcfc; }
.lot-grid.is-list .lot-thumb { flex: 0 0 120px; width: 120px; aspect-ratio: 4 / 3; align-self: center; margin: 8px 0 8px 0; }
.lot-grid.is-list .lot-thumb .badge { font-size: 10px; padding: 2px 7px; top: 4px; left: 4px; }
.lot-grid.is-list .lot-thumb .badge-ended { left: auto; right: 4px; }
.lot-grid.is-list .lot-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; padding: 8px 4px 8px 12px; }
.lot-grid.is-list .lot-no {
  align-self: flex-start; padding: 1px 10px; font-size: 14px; border-radius: 3px; margin-bottom: 4px;
}
.lot-grid.is-list .lot-body { padding: 0; gap: 1px; }
.lot-grid.is-list .lot-title { font-size: 15px; margin: 0 0 4px; }
.lot-grid.is-list .lot-remaining { padding-top: 6px; }
.lot-grid.is-list .rem-end { width: auto; }
@media (min-width: 768px) {
  .lot-grid.is-list .lot-thumb { flex-basis: 160px; width: 160px; }
  .lot-grid.is-list .lot-title { font-size: 18px; }
  .lot-grid.is-list .lot-body { display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 16px; }
  .lot-grid.is-list .lot-title { grid-column: 1 / -1; }
  .lot-grid.is-list .lot-remaining { grid-column: 2; grid-row: 2 / span 4; margin-top: 0; align-content: start; text-align: right; display: block; min-width: 190px; }
  .lot-grid.is-list .lot-remaining .rem-label { margin-right: 6px; }
}
@media (max-width: 767px) {
  .lot-grid.is-list .lot-thumb { flex-basis: 104px; width: 104px; }
  .lot-grid.is-list .lot-cat { display: none; }
  .lot-grid.is-list .lot-spec { -webkit-line-clamp: 1; line-clamp: 1; }
}
