*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #FFFFFF;
  --header-bg:  #FFFFFF;
  --footer-bg:  #111111;
  --accent:     #D91A2A;
  --ink:        #111111;
  --sub:        #333333;
  --muted:      #888888;
  --light:      #F5F5F5;
  --border:     #E8E8E8;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ── */
header { background: var(--header-bg); border-bottom: 1px solid var(--border); }

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: block;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  height: 60px;
  width: auto;
  display: block;
}

.header-search {
  display: flex;
  align-items: center;
  max-width: 360px;
  width: 100%;
}

.header-search input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-right: none;
  outline: none;
  background: var(--light);
  color: var(--ink);
}

.header-search input::placeholder { color: var(--muted); }
.header-search input:focus        { background: #fff; border-color: var(--accent); }

.header-search button {
  height: 36px;
  padding: 0 14px;
  background: var(--accent);
  color: #FFF;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.12s;
  white-space: nowrap;
}

.header-search button:hover { background: #b5151f; }

/* ── SECTION BAR ── */
.section-bar {
  border-top: 3px solid var(--accent);
  background: var(--light);
  padding: 0 32px;
}

.section-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-meta {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── CATEGORY NAV ── */
.cat-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
}

.cat-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-link {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sub);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.cat-link:hover,
.cat-link.is-active {
  background: var(--accent);
  color: #FFF;
  border-color: var(--accent);
}

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0;
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-inner a { color: var(--muted); text-decoration: none; }
.breadcrumb-inner a:hover { color: var(--accent); }
.bc-sep     { color: var(--border); }
.bc-current { color: var(--ink); font-weight: 500; }

/* ── MAIN ── */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 64px;
}

/* ── PAGE HEADING (カテゴリ/メーカーページ) ── */
.page-heading {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.page-heading h1 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.page-heading-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ── GRID ── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); }

/* ── CARD ── */
.card {
  padding: 22px 0;
  margin: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity 0.15s;
}

.card:hover { opacity: 0.75; }

.grid .card:nth-child(3n+1) { margin-left: 0; }
.grid .card:nth-child(3n)   { margin-right: 0; }

.card-company {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: var(--accent);
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  text-decoration: none;
}

a.card-company:hover { background: var(--ink); }

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.65;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.65rem;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.card-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
  background: var(--light);
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 48px 0 16px;
  flex-wrap: wrap;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--sub);
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  cursor: pointer;
}

.pg-btn:hover        { background: var(--accent); color: #FFF; border-color: var(--accent); }
.pg-btn.active       { background: var(--accent); color: #FFF; border-color: var(--accent); pointer-events: none; }
.pg-btn.disabled     { color: var(--border); pointer-events: none; cursor: default; }
.pg-ellipsis         { font-size: 0.82rem; color: var(--muted); padding: 0 4px; }

/* ── EMPTY ── */
.empty {
  padding: 80px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 2;
}

/* ── FOOTER ── */
footer {
  background: var(--footer-bg);
  padding: 20px 32px;
  text-align: center;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.06em;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

footer a { color: rgba(255,255,255,0.55); }

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
}

.footer-sep { color: rgba(255,255,255,0.25); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid .card:nth-child(3n)   { margin-right: 24px; }
  .grid .card:nth-child(3n+1) { margin-left: 24px; }
  .grid .card:nth-child(2n+1) { margin-left: 0; }
  .grid .card:nth-child(2n)   { margin-right: 0; }
}

@media (max-width: 768px) {
  .header-search { max-width: 220px; }
}

@media (max-width: 560px) {
  .header-inner, .section-bar, .cat-nav, .breadcrumb, main, footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .section-bar { padding: 0 20px; }
  .header-search { display: none; }
  .grid { grid-template-columns: 1fr; }
  .grid .card { margin: 0; }
}
