.container {
  max-width: 1250px !important;
  background: #ffffff;
  padding: 0 1.2rem;
  padding-bottom: 2rem;
}

/* =========================================
   パンくずリスト
========================================= */
.breadcrumb {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 36px 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(21, 32, 51, 0.1);
  color: #8a95a3;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.8;
  text-align: left;
  overflow-wrap: anywhere;
}

.breadcrumb a {
  color: #0d3b91 !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(13, 59, 145, 0.35) !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.breadcrumb a:hover {
  color: #0d3b91 !important;
  text-decoration-color: rgba(13, 59, 145, 0.9) !important;
}

.breadcrumb span {
  color: #203047;
  text-decoration: none;
}

.breadcrumb + .sec-title {
  margin-top: 5px;
}

.products-page .breadcrumb + .sec-title {
  display: block;
  width: 100%;
  text-align: center;
}

.products-page .breadcrumb + .sec-title::before {
  display: none;
}

.products-page .sec-title .product-title-paren {
  display: block;
  margin-top: .08em;
  margin-left: 0;
  color: #334155;
  font-size: .72em;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.12;
}

/* =========================================
   商品カード
========================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  justify-content: center;
  gap: 0;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 185px;
  padding: 1.5rem;
  background: transparent;
  border-radius: 12px;
  box-shadow: none;
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transform: translateY(-3px);
}

.product-card img {
  display: block;
  width: 100%;
  height: 150px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  padding-top: 10px;
}

.product-card h3 {
  height: 40px;
  margin: 1px;
  font-size: 0.9em;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* =========================================
   タブ切替 UI
========================================= */
.tab-buttons {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0;
  border-bottom: 2px solid #e5e5e5;
}

.tab-btn {
  padding: 0.8rem 1.6rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: #444;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  background: #f2f2f2;
}

.tab-btn.active {
  background: #333;
  color: #fff;
}

.indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: #333;
  border-radius: 1px;
  transition: all 0.25s ease;
}

.tab-content {
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* =============================================================
   カテゴリナビ
================================================================ */
.category-nav {
  position: sticky;
  top: 82px;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0.4rem 1rem;
  background: var(--bg) url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  background-size: cover;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  transition: top 0.3s ease;
}

.category-nav::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: inherit;
  pointer-events: none;
}

body.header-hidden .category-nav {
  top: 0 !important;
}

.category-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-nav ul::-webkit-scrollbar {
  display: none;
}

.category-nav a {
  padding: 0.4rem 1.2rem;
  border-radius: 8px;
  color: #333;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.category-nav a:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* =========================================
   カテゴリタイトル
========================================= */
.products-page .category-title {
  margin-left: 0;
  padding-left: 1.5rem;
  text-align: left;
  scroll-margin-top: 140px;
}

.products-page .product-card {
  scroll-margin-top: 140px;
}

.material-title {
  margin-bottom: 20px;
  scroll-margin-top: 140px;
}

.search-page .category-title{
  border-top: 1px solid #bcc4d4;
  padding-top: 28px;
  margin: 72px auto 46px;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: .08em;
  padding-left: 0;
}

.search-page .search-sub-title{
  border-left: 4px solid #1e3a8a;
  padding-left: 14px;
  margin: 0 0 20px;
  color: var(--kv-ink);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.8;
  letter-spacing: .02em;
}

/* =========================================
   検索
========================================= */
.search-area {
  display: grid;
  grid-template-columns: minmax(180px, 420px) 80px 150px;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.search-box {
  box-sizing: border-box;
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

.search-input-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
}

.recent-search-list {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px 0;
  border: 1px solid rgba(21, 32, 51, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(21, 32, 51, 0.14);
  text-align: left;
}

.recent-search-list[hidden] {
  display: none;
}

.recent-search-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: #152033;
  font-family: "Manrope", "Zen Kaku Gothic New", sans-serif;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
}

.recent-search-item:hover,
.recent-search-item:focus-visible {
  background: #eef5ff;
  outline: none;
}

.search-btn {
  height: 44px;
  padding: 0 1.2rem;
  background: #333;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.search-btn:hover {
  background: #000;
  transform: translateY(-1px);
}

/* ===============================================
   フィルター
================================================== */

.filter-global-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 1rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease;
}

.filter-global-toggle:hover {
  background: #f7f7f7;
}

.filter-global-toggle span::after {
  content: " ▼";
  font-size: 0.75rem;
  margin-left: 0.2rem;
}

.filter-global-toggle.open span::after {
  content: " ▲";
}

/* フィルター本体 */
.search-filter {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 900px;
  justify-self: center;
  margin: 1rem 0 0;
  padding: 1.2rem;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: #fff;
  text-align: left;
}

/* 初期非表示 */
.search-filter.is-closed {
  display: none;
}

.filter-all {
  margin-bottom: 0.8rem;
}

.filter-main-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.filter-clear-btn {
  display: none;
}

.filter-block {
  border-bottom: 1px solid #e5e5e5;
  padding: 0.6rem 0;
}

.filter-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filter-toggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.5rem;
}

/* サブカテゴリ */
.filter-sub {
  display: none;
  width: 100%;
  min-width: 0;
  padding: 0.6rem 0 0 1.2rem;
}

/* ← スマホと同じ挙動をPCにも */
.filter-block.open .filter-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 0;
}

.filter-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  line-height: 1;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

/* checkbox非表示 */
.filter-label input {
  display: none;
}

/* hover */
.filter-label:hover {
  border-color: #333;
  transform: translateY(-1px);
}

/* checked */
.filter-label:has(input:checked) {
  background: #08245c;
  border-color: #08245c;
  color: #fff;
}

@media (max-width: 543px) {

  .search-area {
    grid-template-columns: minmax(0, 1fr) 50px 110px;
    width: 100%;
  }

  .search-box {
    font-size: 0.95rem;
  }

  .search-btn,
  .filter-global-toggle {
    height: 42px;
    padding: 0 0.7rem;
    font-size: 0.8rem;
  }

  /* スマホだけ表記短縮 */
  .filter-global-toggle span {
    font-size: 0;
  }

  .filter-global-toggle span {
    font-size: 0.8rem;
  }

  .filter-global-toggle span::before {
    content: none;
  }

  .filter-global-toggle span::after {
    content: " ▼";
    font-size: 0.7rem;
    margin-left: 0.15rem;
  }

  .filter-global-toggle.open span::after {
    content: " ▲";
  }

  .search-filter {
    max-width: 100%;
    padding: 1rem;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
  }

  .filter-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .filter-block {
    margin-bottom: 0.5rem;
    padding: 0.2rem 0;
  }

  .filter-clear-btn {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
  }

  .filter-main-label {
    font-size: 0.9rem;
  }

  .filter-toggle {
    font-size: 0.8rem;
    padding: 0.2rem;
  }

  .filter-sub {
    display: none;
    padding-left: 0.6rem;
  }

  .filter-block.open .filter-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .filter-label {
    font-size: 0.8rem;
    margin: 0 0.5rem 0.3rem 0;
  }

  .filter-main-label,
  .filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
  }

  .filter-main-label input,
  .filter-label input {
    margin: 0;
    flex-shrink: 0;
  }

}


/* ===============================================
   検索結果
================================================== */
.search-message,
.no-result {
  text-align: center;
  margin: 1.5rem 0;
}

.search-message {
  color: #555;
  font-size: 0.95rem;
}

#searchResults .no-result {
  font-size: 1.2rem;
  color: #666;
}

#searchResults .product-grid {
  width: 100%;
  max-width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(220px, 240px));
  justify-content: center;
  gap: 18px;
  margin-left: auto;
  margin-right: auto;
}

#searchResults .product-card.is-more-hidden {
  display: none;
}

.search-main-section {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.search-result-section {
  width: min(100%, 1160px);
  margin: 0 auto 54px;
}

.search-sub-title {
  text-align: left;
}

.search-sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 18px;
  padding-left: 14px;
}

.search-sub-tab {
  min-height: 34px;
  padding: 0.36rem 0.95rem;
  background: #fff;
  border: 1px solid rgba(21, 32, 51, 0.18);
  border-radius: 999px;
  color: var(--kv-ink);
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(21, 32, 51, 0.04);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.search-sub-tab.active {
  background: #333;
  border-color: #333;
  color: #fff;
}

.search-sub-panel {
  display: none;
}

.search-sub-panel.active {
  display: block;
}

.more-btn {
  display: block;
  margin: 1.4rem auto 0;
  padding: 0.5rem 1.2rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 20px;
  cursor: pointer;
}

/* ===============================
   スマホ
================================ */
@media (max-width: 882px) {
  .category-nav {
    top: 67.65px !important;
  }

  body.header-hidden .category-nav {
    top: 0 !important;
  }

  .products-page .category-title {
    scroll-margin-top: 120px;
  }

  .products-page .product-card {
    scroll-margin-top: 70px;
  }

  .material-title {
    scroll-margin-top: 120px;
  }
}

@media (max-width: 700px) {
  .container {
    padding: 0 1.5rem 2rem;
  }

  .section {
    padding: 40px 0;
  }

  .tab-btn {
    padding: 0.8rem 0.2rem;
    font-size: 0.7rem;
  }

  .category-nav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.7rem;
  }

  .breadcrumb {
    margin: 20px 0 12px;
    padding-bottom: 8px;
    font-size: 0.74rem;
  }
}

@media (max-width: 543px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }

  .br::before {
    content: "\A";
    white-space: pre;
  }

}

@media (max-width: 492px) {
  .hide-492 {
    display: none;
  }
}

@media (max-width: 482px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  }

  .product-card {
    width: 165px;
    height: 145px;
    padding: 1.2rem 0.6rem;
  }

  .product-card img {
    width: auto;
    max-width: 100%;
    height: 115px;
    object-fit: contain;
  }

  .product-card h3 {
    line-height: 30px;
  }

  .product-card .card-subtext {
    font-size: 0.65rem;
  }

  .products-page .category-title {
    scroll-margin-top: 130px;
  }

  .products-page .product-card {
    scroll-margin-top: 110px;
  }

  .material-title {
    scroll-margin-top: 130px;
  }

  .filter-label {
    font-size: 0.75rem;
  }
}

@media (max-width: 438px) {
  .product-card {
    width: 150px;
  }

  .hide-438 {
    display: none;
  }
}

@media (max-width: 403px) {
  .product-card {
    width: 145px;
  }
}

@media (min-width: 401px) {
  .show-401 {
    display: none;
  }
}

@media (max-width: 400px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  }

  .hide-400 {
    display: none;
  }

  .products-page .category-title {
    padding-left: 0;
    text-align: center;
  }



}

@media (max-width: 394px) {
  .product-card {
    width: 140px;
  }

}

@media (max-width: 358px) {
  .search-sub-title {
    padding-left: 0;
    text-align: center;
  }
}

/* Keep product card blank areas pure white. */
.products-page .product-card {
  background: #fff !important;
}

.products-page .product-card img,
.products-page .product-card h3 {
  background: #fff !important;
}

@media (max-width: 640px) {
  .products-page .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  #searchResults .product-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .products-page .product-card {
    box-sizing: border-box !important;
    width: auto !important;
    min-height: 172px !important;
    height: 172px !important;
    padding: 12px 10px !important;
    justify-content: center;
    gap: 10px;
  }

  .products-page .product-card img {
    width: 100% !important;
    max-width: 128px !important;
    height: 104px !important;
    object-fit: contain;
  }

  .products-page .product-card h3 {
    display: -webkit-box;
    height: 34px !important;
    line-height: 1.28 !important;
    margin: 0 !important;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .products-page .product-card .card-subtext {
    display: none;
  }
}

@media (max-width: 400px) {
  .products-page .product-card {
    min-height: 158px !important;
    height: 158px !important;
    padding: 10px 8px !important;
    gap: 8px;
  }

  .products-page .product-card img {
    max-width: 112px !important;
    height: 92px !important;
  }

  .products-page .product-card h3 {
    height: 32px !important;
  }
}

@media (max-width: 882px) {
  html body.products-page.header-hidden .category-nav {
    top: 0 !important;
  }
}
