/* BASIC css start */
/* ==========================================================================
   브랜드 페이지 (optimized)
   ========================================================================== */

body { margin: 0; padding: 0; overflow-x: hidden; }

.is-hidden { display: none !important; } /* 검색 필터용 (JS가 토글) */

/* ---------- 상단 고정 영역 (검색 + 알파벳 탭) ---------- */
.brand-index {
  --brand-index-top: 135px; /* 고정 헤더 높이 */
  position: fixed;
  top: var(--brand-index-top);
  left: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  background: #fff;
  box-sizing: border-box;
}

.brand-search { width: 100%; max-width: 400px; }
.brand-search input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.brand-result { margin-top: 6px; padding-left: 15px; font-size: 12px; color: #666; }

/* ---------- 알파벳 탭 (가로 스와이프) ---------- */
.brand-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;   /* 끝에서 페이지/뒤로가기 제스처로 번지지 않게 */
  scrollbar-width: none;
  -webkit-user-select: none;
  user-select: none;
  /* 스크롤은 브라우저 기본(네이티브 관성 스크롤)에 맡김.
     scroll-behavior: smooth 는 드래그/터치 중 끊김의 원인이라 사용하지 않음 */
}
.brand-tabs::-webkit-scrollbar { display: none; }
.brand-tabs.dragging { cursor: grabbing; }

/* 데스크탑에서 탭이 적으면 가운데 정렬, 넘치면 왼쪽부터 스크롤 (잘림 방지) */
.brand-tabs a:first-child { margin-left: auto; }
.brand-tabs a:last-child  { margin-right: auto; }

.brand-tabs a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.brand-tabs a.active { border-color: #000; background: #000; color: #fff; }

/* 터치 기기에서 hover가 눌린 채 남는 현상 방지 */
@media (hover: hover) {
  .brand-tabs { cursor: grab; }
  .brand-tabs a:hover { background: #000; color: #fff; }
}

/* ---------- 브랜드 목록 ---------- */
.brand-item-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  max-width: 1150px;
  margin: 80px auto 10px;
  padding: 20px;
  box-sizing: border-box;
}

.brand-group {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding: 5px;
  border-bottom: 1px solid #eee;
  color: #656565;
  font-size: 15px;
  font-weight: 600;
  scroll-margin-top: 250px; /* 상단 고정 영역 높이만큼 */
}

.brand-item { display: flex; flex-direction: column; align-items: center; }
.brand-item a { display: block; color: inherit; text-align: center; text-decoration: none; }

.brand-item img {
  width: 100%;
  height: 36px;
  padding: 3px 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  transition: filter .3s ease, transform .3s ease;
}

.brand-item .text-wrap p { margin-top: 3px; color: #333; font-size: 11px; font-weight: 500; text-align: center; transition: color .3s ease; }

@media (hover: hover) {
  .brand-item img:hover { filter: grayscale(100%); transform: scale(1.05); }
  .brand-item:hover .text-wrap p { color: #666; }
}

/* ---------- 반응형 ---------- */
@media (max-width: 991px) {
  .brand-index { --brand-index-top: 121px; }

  .brand-tabs { padding-left: 10px; }

  /* iOS는 16px 미만 입력창에 포커스하면 화면이 자동 확대됨 */
  .brand-search input { font-size: 16px; }
}
/* BASIC css end */

