/* ============================================================
   배때지 V2 · 브랜드 탐색 (brand.php)
   모바일 우선. AI 스타일 둥근 카드 / 얇은 테두리 / 밝은 배경.
   SHOP 공용 셸(.v2live-shell) 폭·헤더·하단바를 그대로 사용.
   ============================================================ */
.v2b {
    --ink: #14141a;
    --sub: #6a6a76;
    --line: #ececef;
    --card: #fff;
    --bg: #f5f5f7;
    --ac: #6f6cff;
    --ac-soft: #eef0ff;
    --ink-grad: linear-gradient(150deg, #20202b 0%, #12121a 66%);
    background: var(--bg);
    color: var(--ink);
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    -webkit-text-size-adjust: 100%;
    padding: 12px 10px calc(84px + env(safe-area-inset-bottom));
    word-break: keep-all;
}
.v2b * { box-sizing: border-box; }
.v2b a { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

/* ---------- A. 인트로 ---------- */
.v2b-intro {
    position: relative; overflow: hidden;
    padding: 22px 18px; border-radius: 18px;
    background: radial-gradient(circle at 100% 0%, rgba(111,108,255,.30), transparent 46%), var(--ink-grad);
    color: #fff;
}
.v2b-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px;
    background: rgba(255,255,255,.12); color: #aeb2ff;
    font-size: 10.5px; font-weight: 800; letter-spacing: .14em;
}
.v2b-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: #8b93ff; box-shadow: 0 0 0 3px rgba(139,147,255,.25); }
.v2b-intro h1 { margin: 12px 0 7px; font-size: 24px; font-weight: 900; letter-spacing: -.5px; color: #fff; }
.v2b-intro p { margin: 0; font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,.8); }
.v2b-intro p strong { color: #fff; font-weight: 800; }

/* ---------- B. 검색 ---------- */
.v2b-search {
    position: relative; margin-top: 14px;
    display: flex; align-items: center;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 0 44px 0 42px; height: 48px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.v2b-search:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
.v2b-search-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--sub); }
.v2b-search input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
    font-size: 15px; color: var(--ink); font-family: inherit;
}
.v2b-search input::placeholder { color: #a2a2ae; }
.v2b-search-clear {
    position: absolute; right: 8px; width: 30px; height: 30px; border: 0; cursor: pointer;
    background: #f0f0f4; color: var(--sub); border-radius: 50%; font-size: 18px; line-height: 1;
    display: grid; place-items: center;
}
.v2b-count { min-height: 18px; margin: 8px 4px 0; font-size: 12.5px; color: var(--sub); }
.v2b-count b { color: var(--ac); font-weight: 800; }

/* ---------- C. 카테고리 필터 ---------- */
.v2b-cats {
    display: flex; gap: 7px; margin-top: 12px; padding: 2px 2px 4px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.v2b-cats::-webkit-scrollbar { display: none; }
.v2b-cat {
    flex: 0 0 auto; min-height: 40px; padding: 0 15px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--line); background: var(--card); color: var(--sub);
    border-radius: 999px; font-size: 13px; font-weight: 700; font-family: inherit;
    white-space: nowrap; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.v2b-cat small { font-size: 11px; font-weight: 800; color: #b6b6c0; }
.v2b-cat.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.v2b-cat.is-active small { color: rgba(255,255,255,.7); }

/* ---------- 섹션 공통 ---------- */
.v2b-section { margin-top: 22px; }
.v2b-secttl { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 11px; }
.v2b-secttl h2 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: -.3px; }
.v2b-secttl small { font-size: 12px; color: var(--sub); }

/* ---------- D. 인기 브랜드 (카드 그리드) ---------- */
.v2b-pop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.v2b-pop-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 15px 14px; border-radius: 15px;
    background: var(--card); border: 1px solid var(--line);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.v2b-pop-mono {
    width: 42px; height: 42px; margin-bottom: 8px; border-radius: 12px;
    display: grid; place-items: center; background: var(--ink-grad); color: #fff;
    font-size: 15px; font-weight: 900; letter-spacing: .01em;
}
.v2b-pop-ko { font-size: 14.5px; font-weight: 800; line-height: 1.3; }
.v2b-pop-en { font-size: 11.5px; color: var(--sub); line-height: 1.3; }
.v2b-pop-cnt { margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--ac); }

/* ---------- E. 초성 인덱스 ---------- */
.v2b-initials {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px;
    padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.v2b-ini {
    flex: 0 0 auto; min-width: 40px; height: 40px; padding: 0 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; background: #f3f3f6; color: var(--sub);
    border-radius: 10px; font-size: 14px; font-weight: 800; font-family: inherit;
    transition: background .12s ease, color .12s ease;
}
.v2b-ini.is-active { background: var(--ac); color: #fff; }

/* ---------- F. 전체 브랜드 목록 ---------- */
.v2b-group { margin-top: 16px; }
.v2b-group-ttl {
    margin: 0 0 8px; padding: 0 4px 6px; font-size: 15px; font-weight: 900; color: var(--ac);
    border-bottom: 1px solid var(--line);
}
.v2b-list { display: grid; grid-template-columns: 1fr; gap: 7px; }
.v2b-item {
    display: flex; align-items: center; gap: 11px; min-height: 60px;
    padding: 10px 12px; border-radius: 13px;
    background: var(--card); border: 1px solid var(--line);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.v2b-item-mono {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center; background: #f2f2f6; color: #33333f;
    font-size: 13px; font-weight: 900;
}
.v2b-item-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.v2b-item-name strong { font-size: 14.5px; font-weight: 800; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2b-item-name em { font-size: 11.5px; font-style: normal; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2b-item-cnt { flex: 0 0 auto; font-size: 12px; font-weight: 800; color: var(--sub); }
.v2b-item-cnt::after { content: "개"; margin-left: 1px; font-weight: 600; color: #b6b6c0; }
.v2b-item-go { flex: 0 0 auto; font-size: 20px; color: #cfcfd8; line-height: 1; }

/* 빈 상태 */
.v2b-empty { padding: 44px 20px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.v2b-empty strong { font-size: 15px; font-weight: 800; }
.v2b-empty span { font-size: 13px; color: var(--sub); }

.v2b-group[hidden], .v2b-pop-card[hidden], .v2b-item[hidden] { display: none !important; }

/* ---------- 반응형 ---------- */
@media (min-width: 601px) {
    .v2b { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
    .v2b-intro { padding: 30px 26px; border-radius: 22px; }
    .v2b-intro h1 { font-size: 30px; }
    .v2b-intro p { font-size: 15px; }
    .v2b-pop-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .v2b-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .v2b-secttl h2 { font-size: 19px; }
}
@media (min-width: 1024px) {
    .v2b { padding: 24px 28px calc(70px + env(safe-area-inset-bottom)); }
    .v2b-intro h1 { font-size: 34px; }
    .v2b-pop-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
    .v2b-list { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .v2b-pop-card:hover { transform: translateY(-3px); border-color: var(--ac); box-shadow: 0 12px 26px rgba(111,108,255,.15); }
    .v2b-item:hover { transform: translateY(-2px); border-color: var(--ac); box-shadow: 0 8px 18px rgba(111,108,255,.12); }
}
@media (min-width: 1360px) {
    .v2b-pop-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .v2b-pop-card, .v2b-item, .v2b-cat, .v2b-ini, .v2b-search { transition: none !important; }
    .v2b-pop-card:hover, .v2b-item:hover { transform: none !important; }
}
