/**
 * ブランド検索 UI（TOP / brands 共通）
 */

.brand-search {
  --brand-search-ink: var(--top-ink, var(--color-navy));
}

.brand-search__filters,
.top-search-filters.brand-search__filters {
  margin-bottom: 2.75rem;
}

.brand-search .top-search-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 2.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid #231815;
  padding-bottom: 0.85rem;
}

.brand-search .top-search-tab {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.35rem 0;
  font-family: var(--font-en);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-optical-sizing: none;
  font-variation-settings: "opsz" 20, "wght" 500;
  -webkit-text-stroke: 0.4px currentColor;
  color: #9aa3ad;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.brand-search .top-search-tab:hover {
  color: var(--brand-search-ink);
}

.brand-search .top-search-tab.is-active {
  color: var(--brand-search-ink);
}

.brand-search .top-search-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.9rem;
  height: 2px;
  background: var(--brand-search-ink);
}

.brand-search .top-search-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5em;
  margin-bottom: 1.75rem;
  max-width: 60rem;
  margin-inline: auto;
}

.brand-search .top-search-chip {
  appearance: none;
  position: relative;
  z-index: 0;
  overflow: hidden;
  border: 0;
  background: #f1f2f4;
  color: var(--brand-search-ink);
  font-family: var(--font-base);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.55rem 3rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.4s ease, background-color 0s;
}

.brand-search .top-search-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--brand-search-ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease;
}

.brand-search .top-search-chip:hover {
  color: #fff;
}

.brand-search .top-search-chip:hover::before {
  transform: scaleX(1);
}

.brand-search .top-search-chip.is-active {
  background: var(--brand-search-ink);
  color: #fff;
}

.brand-search .top-search-chip.is-active::before {
  transform: scaleX(1);
}

.brand-search .top-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  border: 1px solid #c5cad1;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  background: #fff;
}

.brand-search .top-search-bar svg {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  color: #8b939c;
}

.brand-search .top-search-bar input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--brand-search-ink);
  min-width: 0;
}

.brand-search .top-search-bar input::placeholder {
  color: #b0b6bd;
}

.brand-search__submit {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

.brand-search .top-brand-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3.2vw, 2.5rem);
  row-gap: clamp(2.5rem, 5vw, 3.5rem);
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .brand-search .top-brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .brand-search .top-brand-grid {
    grid-template-columns: 1fr;
  }
}

/* カード共通（TOP / brands）— ホバー：白半調＋中央ロゴ */
.brand-search .top-brand-card {
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.brand-search .top-brand-card__media {
  position: relative;
  overflow: hidden;
  background: #f3f5f7;
  margin-bottom: 1.1rem;
  aspect-ratio: 340 / 250;
  width: 100%;
}

.brand-search .top-brand-card__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease, filter 0.35s ease;
}

.brand-search .top-brand-card__media > picture {
  display: contents;
}

.brand-search .top-brand-card__photo--placeholder {
  background: #cfd4da;
  object-fit: unset;
}

.brand-search .top-brand-card:hover .top-brand-card__photo,
.brand-search .top-brand-card:focus-visible .top-brand-card__photo,
.brand-search .top-brand-card__media:hover .top-brand-card__photo {
  transform: scale(1.03);
  filter: brightness(1.05) contrast(0.95);
}

.brand-search .top-brand-card__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  pointer-events: none;
}

.brand-search .top-brand-card__logo,
.brand-search .top-brand-card__logo-text {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  pointer-events: none;
}

.brand-search .top-brand-card__logo {
  width: auto;
  height: auto;
  max-width: min(70%, 12rem);
  max-height: 42%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.4));
}

.brand-search .top-brand-card__logo-text {
  max-width: 82%;
  margin: 0;
  font-family: var(--font-en, "Bodoni Moda", "Times New Roman", serif);
  font-size: clamp(1rem, 2.6vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
  color: #111;
  text-transform: uppercase;
  word-break: break-word;
}

/* サムネイル（またはカード）ホバーでロゴ表示 */
.brand-search .top-brand-card:hover .top-brand-card__veil,
.brand-search .top-brand-card:focus-visible .top-brand-card__veil,
.brand-search .top-brand-card__media:hover .top-brand-card__veil,
.brand-search .top-brand-card:hover .top-brand-card__logo,
.brand-search .top-brand-card:focus-visible .top-brand-card__logo,
.brand-search .top-brand-card__media:hover .top-brand-card__logo,
.brand-search .top-brand-card:hover .top-brand-card__logo-text,
.brand-search .top-brand-card:focus-visible .top-brand-card__logo-text,
.brand-search .top-brand-card__media:hover .top-brand-card__logo-text {
  opacity: 1;
  visibility: visible;
}

.brand-search .top-brand-card__company {
  font-family: var(--font-ja);
  font-size: 0.8rem;
  font-weight: var(--font-ja-weight);
  letter-spacing: 0.02em;
  margin: 0;
}

.brand-search .top-brand-card__name {
  font-family: var(--font-ja);
  font-size: clamp(1.2rem, 1.2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-search-ink);
  margin: 0 0 1rem;
  line-height: 1.25;
}

.brand-search .top-brand-card__tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
}

.brand-search .top-brand-card__tags li {
  font-family: var(--font-ja);
  font-size: 0.6875rem;
  font-weight: var(--font-ja-weight);
  letter-spacing: 0.04em;
  color: var(--brand-search-ink);
  border: 1px solid #a1a1a1;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  line-height: 1.35;
  background: #fff;
}

.brand-search .top-brand-card.is-filtered-out,
.brand-search .top-brand-card.is-page-hidden {
  display: none;
}

.brand-search__empty {
  margin: 2rem 0 0;
  text-align: center;
  color: #6b7280;
}

.brand-search__pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 4rem;
}

.brand-search__pagination-link {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  font: inherit;
  font-weight: 700;
  color: #9ca3af;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.brand-search__pagination-link:hover {
  border-color: var(--color-navy);
  color: var(--color-navy);
}

.brand-search__pagination-link.is-active {
  color: var(--color-navy);
  border-color: var(--color-navy);
}

/* =========================================================
   SP：SEARCH（添付カンプ準拠）
   ========================================================= */
@media (max-width: 767px) {
  .brand-search__filters,
  .top-search-filters.brand-search__filters {
    margin-bottom: 2rem;
  }

  .brand-search .top-search-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: 1px solid #d8d8d8;
  }

  .brand-search .top-search-tab {
    width: 100%;
    padding: 0.65rem 0 0.75rem;
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
    font-weight: 500;
    -webkit-text-stroke: 0.7px currentColor;
    font-variation-settings: "opsz" 14, "wght" 500;
    color: #9aa3ad;
    text-align: center;
  }

  .brand-search .top-search-tab.is-active {
    color: var(--brand-search-ink);
  }

  .brand-search .top-search-tab.is-active::after {
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
  }

  /* 種類チップ：2列グリッド */
  .brand-search .top-search-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem 0.75rem;
    margin-bottom: 1.35rem;
    max-width: none;
  }

  .brand-search .top-search-chip {
    width: 100%;
    padding: 0.7rem 0.5rem;
    font-family: var(--font-ja);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: #f2f2f2;
    color: #1a1a1a;
  }

  .brand-search .top-search-chip.is-active {
    background: var(--brand-search-ink);
    color: #fff;
  }

  .brand-search .top-search-bar {
    max-width: none;
    padding: 0.75rem 1.1rem;
    border-color: #d1d1d1;
  }

  .brand-search .top-search-bar input {
    font-family: var(--font-ja);
    font-size: 0.8125rem;
  }

  .brand-search .top-brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.85rem;
    row-gap: 1.75rem;
  }

  .brand-search .top-brand-card__media {
    aspect-ratio: 1;
    margin-bottom: 0.75rem;
  }

  .brand-search .top-brand-card__company {
    font-family: var(--font-ja);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #1a1a1a;
    margin: 0 0 0.15rem;
  }

  .brand-search .top-brand-card__name {
    font-family: var(--font-en);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 0.65rem;
  }

  .brand-search .top-brand-card__tags {
    gap: 0.35rem 0.35rem;
  }

  .brand-search .top-brand-card__tags li {
    font-size: 0.5625rem;
    padding: 0.15rem 0.45rem;
    border-color: #cfcfcf;
    border-radius: 999px;
  }
}
