/*
Theme Name: 4x4 Parts Lab
Theme URI: https://4x4partslab.com/
Author: 4x4 PARTS LAB
Description: ジムニーパーツの検索・比較に特化した四駆パーツラボ公式テーマ。
Version: 0.1.0
Text Domain: fourfour-parts-lab
*/

:root {
  --sand: #d1c59e;
  --olive: #666a4f;
  --olive-dark: #4e523c;
  --charcoal: #282828;
  --ink: #20211f;
  --muted: #696b66;
  --line: #deded8;
  --paper: #f6f6f2;
  --white: #fff;
  --ok: #416d4f;
  --warn: #9c6f27;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(35, 36, 31, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.site-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(40,40,40,.1);
  backdrop-filter: blur(12px);
}
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { width: 226px; height: auto; display: block; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 24px; font-weight: 700; font-size: .9rem; }
.main-nav a { padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a:focus { color: var(--olive-dark); border-color: var(--olive); }
.nav-cta { padding: 10px 16px !important; color: #fff; background: var(--charcoal); border-radius: 7px; border: 0 !important; }

.hero {
  position: relative; overflow: hidden;
  color: #fff; background: var(--charcoal);
  padding: 74px 0 68px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .22;
  background:
    radial-gradient(ellipse at 8% 72%, transparent 0 28px, rgba(209,197,158,.6) 29px 34px, transparent 35px),
    radial-gradient(ellipse at 82% 20%, transparent 0 42px, rgba(209,197,158,.35) 43px 50px, transparent 51px),
    repeating-linear-gradient(115deg, transparent 0 68px, rgba(255,255,255,.05) 69px 74px, transparent 75px 132px);
}
.hero::after { content: ""; position: absolute; right: -120px; bottom: -95px; width: 430px; height: 230px; border: 24px dashed rgba(209,197,158,.12); border-radius: 50%; transform: rotate(-12deg); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .75fr; gap: 64px; align-items: end; }
.eyebrow { margin: 0 0 14px; color: var(--sand); letter-spacing: .16em; font-weight: 800; font-size: .8rem; }
.hero h1 { margin: 0; max-width: 790px; font-size: clamp(2.2rem, 5.5vw, 4.6rem); line-height: 1.06; letter-spacing: -.035em; }
.hero h1 strong { color: var(--sand); font-weight: 900; }
.hero-copy { margin: 22px 0 0; max-width: 650px; color: #deded8; font-size: 1.05rem; }
.hero-stat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hero-stat div { padding: 17px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); border-radius: 9px; }
.hero-stat b { display: block; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: 2rem; letter-spacing: .03em; }
.hero-stat span { color: #c8c8c1; font-size: .78rem; }

.model-jump { position: relative; z-index: 2; margin-top: -25px; }
.model-bar { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 10px; padding: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.model-label { display: flex; align-items: center; padding: 0 13px; font-weight: 800; font-size: .82rem; color: var(--muted); }
.model-button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 12px 14px; color: var(--charcoal); font-weight: 900; }
.model-button span { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); }
.model-button:hover, .model-button.is-active { color: #fff; border-color: var(--olive); background: var(--olive); }
.model-button.is-active span { color: #eef0e7; }

.section { padding: 78px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-kicker { margin: 0 0 5px; color: var(--olive); font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; letter-spacing: .1em; }
.section h2 { margin: 0; font-size: clamp(1.65rem, 3.2vw, 2.6rem); line-height: 1.25; }
.section-desc { margin: 8px 0 0; color: var(--muted); }
.text-link { color: var(--olive-dark); font-weight: 800; border-bottom: 1px solid var(--olive); }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.category-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 16px rgba(35,36,31,.04); }
.category-card summary { list-style: none; display: flex; align-items: center; gap: 14px; min-height: 82px; padding: 17px 19px; cursor: pointer; }
.category-card summary::-webkit-details-marker { display: none; }
.cat-number { display: grid; place-items: center; min-width: 40px; height: 40px; color: #fff; background: var(--charcoal); border-radius: 50%; font-family: Impact, sans-serif; }
.cat-title { flex: 1; }
.cat-title b { display: block; font-size: 1rem; }
.cat-title small { color: var(--muted); }
.category-card summary::after { content: "+"; color: var(--olive); font-size: 1.5rem; font-weight: 300; }
.category-card[open] summary::after { content: "−"; }
.category-children { padding: 0 18px 18px 72px; }
.category-children h3 { margin: 13px 0 6px; font-size: .84rem; color: var(--muted); }
.category-children button { display: inline-flex; align-items: center; gap: 6px; margin: 0 5px 6px 0; padding: 6px 9px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; font-size: .76rem; }
.category-children button:hover { color: #fff; background: var(--olive); border-color: var(--olive); }

.catalog-section { background: #ecece6; }
.catalog-layout { display: grid; grid-template-columns: 268px 1fr; gap: 22px; align-items: start; }
.filters { position: sticky; top: 94px; padding: 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.filters h3 { margin: 0 0 17px; font-size: 1.1rem; }
.filter-field { display: block; margin-bottom: 15px; }
.filter-field > span { display: block; margin-bottom: 5px; font-size: .78rem; color: var(--muted); font-weight: 800; }
.filter-field input, .filter-field select { width: 100%; min-height: 44px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #cfcfc7; border-radius: 7px; }
.filter-reset { width: 100%; padding: 10px; border: 1px solid var(--charcoal); color: var(--charcoal); background: transparent; border-radius: 7px; font-weight: 800; }
.filter-reset:hover { color: #fff; background: var(--charcoal); }
.filter-note { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }

.catalog-main { min-width: 0; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 14px; }
.result-count { font-weight: 900; }
.result-count strong { color: var(--olive-dark); font-size: 1.25rem; }
.sort-select { min-height: 40px; padding: 7px 34px 7px 10px; border: 1px solid #cfcfc7; border-radius: 7px; background: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.product-card { position: relative; display: flex; flex-direction: column; min-height: 350px; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: transform .18s ease, box-shadow .18s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card[hidden] { display: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.category-path { overflow: hidden; color: var(--olive-dark); font-size: .7rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.verified { flex: 0 0 auto; padding: 3px 7px; color: var(--ok); background: #edf5ef; border-radius: 4px; font-size: .66rem; font-weight: 800; }
.product-card h3 { margin: 14px 0 5px; font-size: 1.07rem; line-height: 1.45; }
.maker { margin: 0 0 14px; color: var(--muted); font-size: .78rem; }
.fit-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; }
.fit-badge { padding: 7px 4px; background: var(--paper); border-radius: 6px; text-align: center; font-size: .72rem; }
.fit-badge b { display: block; font-size: .9rem; }
.fit-badge.fit-ok b { color: var(--ok); }
.fit-badge.fit-conditional b { color: var(--warn); }
.fit-badge.fit-unknown b { color: #888; }
.price-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.price small { display: block; color: var(--muted); font-size: .66rem; }
.price strong { font-size: 1.3rem; letter-spacing: -.02em; }
.price span { font-size: .7rem; }
.compare-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--charcoal); border-radius: 6px; font-size: .74rem; font-weight: 900; }
.compare-toggle input { accent-color: var(--olive); }
.card-link { position: absolute; inset: 0; z-index: 1; }
.compare-toggle { position: relative; z-index: 2; }
.empty-state { padding: 50px 20px; background: #fff; border-radius: var(--radius); text-align: center; }

.compare-bar { position: fixed; left: 50%; bottom: 18px; z-index: 100; width: min(720px, calc(100% - 28px)); transform: translateX(-50%); display: none; align-items: center; gap: 16px; padding: 12px 14px 12px 18px; color: #fff; background: var(--charcoal); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; box-shadow: 0 14px 44px rgba(0,0,0,.28); }
.compare-bar.is-visible { display: flex; }
.compare-bar p { margin: 0; flex: 1; font-size: .86rem; }
.compare-open { padding: 9px 16px; color: var(--charcoal); background: var(--sand); border: 0; border-radius: 6px; font-weight: 900; }
.compare-clear { color: #fff; background: transparent; border: 0; text-decoration: underline; font-size: .75rem; }
.compare-panel { position: fixed; inset: 0; z-index: 110; display: none; background: rgba(20,20,18,.75); padding: 34px 18px; overflow: auto; }
.compare-panel.is-open { display: block; }
.compare-box { width: min(1100px, 100%); margin: 0 auto; padding: 24px; background: #fff; border-radius: 14px; }
.compare-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.compare-head h2 { margin: 0; }
.compare-close { width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 50%; font-size: 1.5rem; }
.compare-scroll { overflow-x: auto; }
.compare-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .84rem; }
.compare-table th, .compare-table td { padding: 13px; border: 1px solid var(--line); vertical-align: top; }
.compare-table th { width: 125px; text-align: left; background: var(--paper); }
.compare-table tr:first-child td { font-weight: 900; font-size: 1rem; }

.trust-section { color: #fff; background: var(--olive-dark); }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.trust-item { padding-left: 17px; border-left: 3px solid var(--sand); }
.trust-item b { display: block; margin-bottom: 5px; }
.trust-item p { margin: 0; color: #e1e4d9; font-size: .86rem; }

.site-footer { padding: 42px 0 90px; color: #c9c9c3; background: #1d1e1b; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; }
.footer-brand img { width: 230px; filter: brightness(0) invert(1); opacity: .9; }
.footer-brand p { max-width: 570px; margin: 17px 0 0; font-size: .78rem; }
.footer-links { display: flex; justify-content: flex-end; gap: 18px; font-size: .8rem; }
.copyright { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .7rem; }

.single-wrap { padding: 54px 0 90px; }
.breadcrumbs { margin: 0 0 18px; color: var(--muted); font-size: .75rem; }
.single-card { padding: clamp(22px, 5vw, 52px); background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.single-card h1 { margin: 12px 0 7px; font-size: clamp(1.8rem,4vw,3.2rem); line-height: 1.25; }
.single-intro { color: var(--muted); }
.single-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 32px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.spec-table th, .spec-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec-table th { width: 36%; color: var(--muted); font-weight: 700; }
.shop-links { display: grid; gap: 9px; }
.shop-button { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; color: #fff; background: var(--charcoal); border-radius: 7px; font-weight: 800; }
.shop-button.official { background: var(--olive); }
.fine-print { color: var(--muted); font-size: .72rem; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 35px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; display: grid; grid-template-columns: repeat(2,1fr); gap: 0 12px; }
  .filters h3, .filter-reset, .filter-note { grid-column: 1 / -1; }
  .single-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-shell { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 62px; }
  .brand img { width: 174px; }
  .main-nav a:not(.nav-cta) { display: none; }
  .nav-cta { padding: 8px 11px !important; font-size: .76rem; }
  .hero { padding: 54px 0 52px; }
  .hero-copy { font-size: .92rem; }
  .hero-stat { grid-template-columns: repeat(2,1fr); }
  .model-bar { grid-template-columns: repeat(3,1fr); }
  .model-label { grid-column: 1 / -1; padding: 0; }
  .model-button { padding: 9px 4px; font-size: .82rem; }
  .section { padding: 56px 0; }
  .section-head { align-items: start; flex-direction: column; }
  .category-grid, .product-grid, .trust-grid { grid-template-columns: 1fr; }
  .category-card summary { min-height: 70px; }
  .filters { grid-template-columns: 1fr; }
  .filters h3, .filter-reset, .filter-note { grid-column: auto; }
  .product-card { min-height: 325px; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .compare-bar { gap: 8px; flex-wrap: wrap; }
  .compare-bar p { flex-basis: 50%; }
  .compare-box { padding: 17px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; flex-wrap: wrap; }
}

