/* 알리쿠폰픽 쇼핑몰 화면 (무신사 스타일): 흰 배경 · 검정 포인트 · 촘촘한 상품 그리드
   관리자 화면은 style.css 를 그대로 쓰고, 이 파일은 index.html 에서만 쓴다. */
:root {
  --ink: #111;
  --ink-2: #555;
  --ink-3: #999;
  --line: #e8e8e8;
  --bg: #fff;
  --soft: #f5f5f5;
  --red: #e5302a;
  /* 브랜드 테마: 메인 로고 색에 맞춰 히어로·요약 박스가 같은 색 계열로 바뀐다 (로고가 바뀌면 이 4줄만 바꾸면 돼요) */
  --theme: #d41f17;
  --theme-2: #ff7a3d;
  --theme-soft: #fff4f1;
  --theme-line: #f3c9c3;
  --star: #f5a623;
  --maxw: 1200px;
  --gutter: 16px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.wrap { width: min(var(--maxw), 100% - var(--gutter) * 2); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 안내 띠 */
.notice-bar b { color: var(--ink); }
.notice-bar { background: var(--soft); color: var(--ink-2); border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; padding: 9px var(--gutter); line-height: 1.5; word-break: keep-all; }

/* 헤더: 로고 + 검색 한 줄. 스크롤해도 위에 붙어 있고, 카테고리 탭은 상품 바로 위(.tabs-bar)에 따로 붙는다 */
:root { --head-h: 84px; }
.header { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: var(--head-h); }
.brand { flex: none; display: flex; align-items: center; height: 100%; }
.brand-logo { display: block; height: 70px; width: auto; }
.brand-name { font-size: 22px; font-weight: 900; letter-spacing: -.05em; }
.search { position: relative; flex: 1 1 180px; min-width: 140px; max-width: 360px; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 40px; border: 0; border-radius: 999px; background: var(--soft); font: inherit; font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: 2px solid var(--ink); outline-offset: 0; background: #fff; }
.search svg { position: absolute; left: 14px; top: 12px; color: var(--ink-2); }

/* 카테고리 탭: 배너·쿠폰 아래, 상품 바로 위. 내려가도 헤더 밑에 붙어서 따라온다 */
.tabs-bar { position: sticky; top: var(--head-h); z-index: 20; background: #fff; border-bottom: 1px solid var(--line); margin-top: 18px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; position: relative; height: 50px; padding: 0 14px; border: 0; background: none; font-size: 16px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { color: var(--ink); font-weight: 800; }
.tab-best { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; letter-spacing: -.03em; color: #6b4a42; }
.tab-best svg { color: #ff6a3d; }
.tab-best .best-chip { padding: 2px 7px 1px; border-radius: 5px; background: linear-gradient(135deg, #ff6a3d, #e8261d); color: #fff; font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif; font-size: 11.5px; font-weight: 900; letter-spacing: .04em; line-height: 1.5; }
.tab-best[aria-selected='true'] { color: var(--theme); }
.tab-best[aria-selected='true']::after { background: var(--theme); }
.tab[aria-selected='true']::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; background: var(--ink); }

/* 쿠폰·혜택 카드: 큰 제목 + 부연설명 + 코드(누르면 복사). 가로로 밀어서 보기 */
.sec-head { font-size: 17px; font-weight: 800; letter-spacing: -.02em; margin: 22px 0 10px; }
.sec-head span { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.sec-intro { --it-a: #2f7fc1; --it-b: #4aa3dc; --it-soft: #f4f9fe; --it-line: #cfe1f5; --it-shadow: rgba(53,139,198,.12); margin: 0 0 16px; border: 1px solid var(--it-line); border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 2px 10px var(--it-shadow); }
.sec-intro[data-theme="red"] { --it-a: #d41f17; --it-b: #ff7a3d; --it-soft: #fff4f1; --it-line: #f3c9c3; --it-shadow: rgba(212,31,23,.10); }
.sec-intro[data-theme="green"] { --it-a: #2f8f4e; --it-b: #5ec27f; --it-soft: #f2faf5; --it-line: #cfe9d9; --it-shadow: rgba(47,143,78,.12); }
.sec-intro[data-theme="purple"] { --it-a: #5b45c9; --it-b: #8f7bf0; --it-soft: #f6f4fe; --it-line: #dcd5f7; --it-shadow: rgba(91,69,201,.12); }
.sec-intro .it-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; background: linear-gradient(100deg, var(--it-a) 0%, var(--it-b) 100%); color: #fff; }
.sec-intro .it-head b { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.sec-intro .it-tag { flex: none; padding: 2px 9px; border-radius: 999px; background: #ffd21f; color: #5a3b00; font-size: 11.5px; font-weight: 800; }
.sec-intro .it-body { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 9px; background: linear-gradient(180deg, var(--it-soft) 0%, #fff 60%); }
.sec-intro .it { margin: 0; font-size: 13.5px; line-height: 1.65; color: #34495e; }
.sec-intro .ir { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; line-height: 1.55; }
.sec-intro .ir i { flex: none; min-width: 66px; text-align: center; padding: 2px 8px; border-radius: 6px; font-style: normal; font-weight: 800; font-size: 12px; background: #e8f2fb; color: #1d5fa8; }
.sec-intro .ir.r1 i { background: #ffe9e7; color: #d4261f; }
.sec-intro .ir.r2 i { background: #ece9fb; color: #5b45c9; }
.sec-intro .ir.r3 i { background: #e2f5ea; color: #1b8a4b; }
.sec-intro .ir span { min-width: 0; color: var(--ink); font-weight: 500; }
.sec-intro small { display: block; margin-top: 2px; padding: 9px 12px; border-radius: 8px; border-left: 4px solid #ffb800; background: #fff6d6; font-size: 12.5px; line-height: 1.55; color: #3b2d00; font-weight: 700; }
@media (max-width: 640px) { .sec-intro .ir { flex-direction: column; gap: 3px; align-items: flex-start; } }
.coupons-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding: 2px 1px 4px; }
.coupons-row::-webkit-scrollbar { display: none; }
.cp { position: relative; scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; padding: 18px 16px 14px; border: 1px solid #f0c9c7; border-radius: 10px; background: #fff7f6; text-align: center; }
.cp-nocode { border-color: #cfe1f5; background: #f1f7fd; }
.cp-badge { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 11px; font-weight: 800; }
.cp-badge.hot { background: var(--red); border-color: var(--red); color: #fff; }
.cp-title { font-size: 20px; font-weight: 900; letter-spacing: -.03em; color: var(--red); word-break: keep-all; padding: 0 22px; }
.cp-nocode .cp-title { color: #1d5fa8; }
.cp-desc { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); word-break: keep-all; }
.cp-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.cp-code { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; margin-top: 4px; border: 1px dashed #d98b87; border-radius: 6px; background: #fff; font-size: 15px; }
.cp-code:hover { border-color: var(--red); }
.cp-code .cp-label { white-space: nowrap; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.cp-code b { white-space: nowrap; font-size: 16px; font-weight: 800; letter-spacing: .04em; color: var(--ink); }
.cp-code .cp-copy { padding: 2px 8px; border-radius: 4px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; }
.cp-link { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cp-link:hover { color: var(--ink); text-decoration: underline; }
.cp-nocode .cp-link { padding: 9px 0; border-radius: 6px; background: #fff; border: 1px solid #cfe1f5; color: #1d5fa8; font-size: 13.5px; }

/* 이벤트 카드 (천원마트·빅세이브 등): 헤더 바로 아래, 모바일은 옆으로 밀어서 보기 */
.events { padding-top: 14px; }
.events-head { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.events-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
.events-row::-webkit-scrollbar { display: none; }
.ev { scroll-snap-align: start; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ev:hover { border-color: var(--ink); }
.ev-thumb { flex: none; width: 52px; height: 52px; border-radius: 6px; overflow: hidden; background: var(--soft); display: grid; place-items: center; }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ev-thumb b { font-size: 20px; font-weight: 900; color: rgba(0,0,0,.25); }
.ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-title { font-size: 15px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-badge { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 800; color: var(--ink); }
.ev-badge.hot { background: var(--red); color: #fff; }

/* 배너: 상품 목록 바로 위. 정사각형 배너가 좌우 빈 공간을 남기지 않게, 같은 이미지를 흐리게 깔아 준다 */
.top-banners { margin: 16px 0 0; }
.top-banners .tb { position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; border-radius: 8px; background: var(--soft); line-height: 0; margin-bottom: 8px; }
.top-banners .tb-bg { display: none; position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(26px) saturate(1.1); opacity: .75; transform: scale(1.1); }
.top-banners .tb img { position: relative; display: block; width: 100%; height: auto; }
.top-banners .tb-ad { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 3px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; line-height: 1.5; }

/* 세부 칩 / 행사 칩 */
.chip-area { padding-top: 14px; }
.sub-row, .promo-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sub-row::-webkit-scrollbar, .promo-row::-webkit-scrollbar { display: none; }
.promo-row { margin-bottom: 10px; align-items: center; }
.promo-label { flex: none; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.sub-chip, .promo-chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.sub-chip:hover, .promo-chip:hover { border-color: var(--ink); }
.sub-chip[aria-pressed='true'], .promo-chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sub-row { margin-bottom: 2px; }

/* 목록 머리글 */
.listbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 12px; font-size: 15px; color: var(--ink-2); }
.listbar #count b { color: var(--ink); font-weight: 800; }
.listbar .order select { height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance: none; appearance: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; }

/* 상품 그리드: 모바일 2열 → 태블릿 3~4열 → PC 5열 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 14px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.card-wrap { min-width: 0; }
.card { display: block; }
.thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 4px; overflow: hidden; background: var(--soft); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.03); }
.thumb .ph { font-size: 48px; font-weight: 900; color: rgba(0,0,0,.12); }
.thumb .tag { position: absolute; left: 8px; top: 8px; padding: 3px 7px; border-radius: 2px; background: #fff; color: var(--ink); font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.thumb .tag.pin { background: var(--ink); color: #fff; }
.thumb .go { display: none; }

.card-body { padding: 10px 2px 0; }
.card-cat { font-size: 11px; font-weight: 700; color: var(--ink); min-height: 15px; letter-spacing: -.01em; }
.card-title { margin: 3px 0 8px; font-size: 13px; font-weight: 400; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; word-break: break-all; }
.price-row { display: flex; align-items: baseline; gap: 6px; }
.pct { color: var(--red); font-weight: 800; font-size: 15px; }
.price { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.price-old { margin-top: 2px; font-size: 11px; color: var(--ink-3); text-decoration: line-through; min-height: 15px; }
.card-note { margin-top: 4px; font-size: 10.5px; color: var(--ink-3); }

.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.card-meta b { color: var(--ink); font-weight: 700; }
.card-meta .rate { display: inline-flex; align-items: center; gap: 2px; }
.card-meta .star { color: var(--star); font-size: 13px; line-height: 1; }
.card-meta .sold b { font-weight: 800; }

.skeleton .thumb { background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: sh 1.2s infinite; }
.skeleton .bar { height: 11px; border-radius: 4px; margin-top: 10px; background: #f0f0f0; }
@keyframes sh { to { background-position: -200% 0; } }

.more { display: block; margin: 32px auto 0; height: 46px; padding: 0 34px; border-radius: 4px; border: 1px solid var(--ink); background: #fff; font-weight: 700; }
.more:hover { background: var(--ink); color: #fff; }
.err, .empty { padding: 56px 0; text-align: center; color: var(--ink-2); font-size: 14px; }

/* 푸터 */
.footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--soft); padding: 28px 0 40px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.footer p { margin: 0 0 8px; max-width: 780px; }
.footer b { color: var(--ink-2); }
.footer .copy { margin-top: 14px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 480px) {
  :root { --gutter: 12px; }
  .notice-bar { font-size: 12px; text-align: left; }
  :root { --head-h: 66px; }
  .head { gap: 10px; }
  .brand-name { font-size: 19px; }
  .search input { height: 38px; font-size: 14px; }
  
  .tab { height: 46px; padding: 0 11px; font-size: 15px; }
  .tab[aria-selected='true']::after { left: 11px; right: 11px; }
  .tabs-bar { margin-top: 14px; }
  .cp-title { font-size: 18px; }
  .coupons-row { grid-auto-columns: minmax(210px, 78%); }
}

/* 상단 소개(히어로): 아래 배너·쿠폰 박스와 같은 폭의 카드. 눈이 편하게 연한 톤 */
.hero { width: min(var(--maxw), 100% - var(--gutter) * 2); margin: 14px auto 6px; border-radius: 16px; border: 1px solid var(--theme-line); background: linear-gradient(120deg, #fff1ec 0%, #ffe6dc 60%, #ffdccd 100%); color: #3a1f1a; position: relative; overflow: hidden; }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; }
.hero::before { width: 280px; height: 280px; right: -50px; top: -110px; background: rgba(238,74,42,.10); }
.hero::after { width: 170px; height: 170px; right: 200px; bottom: -95px; background: rgba(255,210,31,.28); }
.hero-in { position: relative; z-index: 1; width: auto; margin: 0; padding: 26px 30px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hero-pill { padding: 4px 12px; border-radius: 999px; background: #ffd21f; color: #5a3b00; font-size: 12.5px; font-weight: 800; }
.hero-title { margin: 2px 0 0; font-size: 28px; font-weight: 900; letter-spacing: -.04em; line-height: 1.3; }
.hero-title em { font-style: normal; color: var(--theme); }
.hero-title .m-br { display: none; }
.hero-sub { margin: 0; max-width: 620px; font-size: 14px; line-height: 1.65; color: #6b4a42; }
.hero-feats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hero-feats span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--theme-line); font-size: 13px; font-weight: 700; color: #4a3a36; }
.hero-feats b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--theme); color: #fff; font-size: 12px; font-weight: 900; }
.hero-cta { margin-top: 6px; padding: 10px 20px; border-radius: 999px; background: var(--theme); color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 3px 10px rgba(212,31,23,.22); }
.hero-cta:hover { background: #b9170f; }
.hero-art { position: absolute; z-index: 1; right: 44px; top: 50%; width: 150px; height: 150px; transform: translateY(-50%) rotate(8deg); border-radius: 36px; box-shadow: 0 12px 28px rgba(150,40,20,.22); }
@media (max-width: 860px) { .hero-art { display: none; } }
@media (max-width: 640px) { .brand-logo { height: 52px; } .hero-in { padding: 20px 18px 18px; } .hero-title { font-size: 21px; } .hero-title .m-br { display: inline; } .hero-sub { font-size: 13px; } }
@media (max-width: 640px) { .notice-bar .nb-2 { display: block; margin-top: 2px; font-weight: 700; } }

/* 카테고리 탭이 옆으로 더 있을 때: 끝에 ▶ 표시. 마우스를 올리면 자동으로 넘어가고, 누르면 한 칸씩 이동 */
.tabs-wrap { position: relative; }
.tab-arrow { position: absolute; top: 0; bottom: 0; z-index: 2; width: 54px; border: 0; padding: 0; cursor: pointer; font-size: 15px; color: var(--ink); display: flex; align-items: center; }
.tab-arrow[hidden] { display: none; }
.tab-arrow-r { right: 0; justify-content: flex-end; padding-right: 6px; background: linear-gradient(90deg, rgba(255,255,255,0), #fff 62%); }
.tab-arrow-l { left: 0; justify-content: flex-start; padding-left: 6px; background: linear-gradient(270deg, rgba(255,255,255,0), #fff 62%); }
.tab-arrow:hover { color: var(--theme, #e8261d); }
@media (max-width: 640px) { .tab-arrow { width: 40px; font-size: 13px; } }

/* 정렬 옆 "카테고리 내 검색" (불러온 상품 제목에서 바로 걸러냄) */
.lb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.infilter input { width: 190px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: inherit; font-size: 15px; color: var(--ink); }
.infilter input::placeholder { color: var(--ink-3); }
.infilter input:focus { outline: 2px solid var(--ink); outline-offset: 0; }
@media (max-width: 640px) { .listbar { flex-wrap: wrap; gap: 8px; } .lb-right { width: 100%; } .infilter { flex: 1; min-width: 0; } .infilter input { width: 100%; } }

/* 방문자 수 (푸터) */
.footer .visitors { display: inline-block; margin: 6px 0 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; color: var(--ink-2); }
.footer .visitors[hidden] { display: none; }
.footer .visitors b { color: var(--ink); font-weight: 800; }

/* 세부 칩(하단 카테고리)은 탭 바로 아래에 붙어서 스크롤해도 같이 따라온다 */
.tabs-bar .sub-wrap { padding-top: 10px; padding-bottom: 10px; }
.tabs-bar .sub-row { margin: 0; padding-bottom: 0; }
.tabs-bar .sub-row[hidden] { display: none; }
.tabs-bar .sub-wrap:has(.sub-row[hidden]) { display: none; }
@media (max-width: 640px) { .tabs-bar .sub-wrap { padding-top: 8px; padding-bottom: 8px; } .tabs-bar .sub-chip { height: 32px; } }

/* 개수·카테고리 내 검색·정렬 줄도 탭/칩과 함께 위에 붙는다 */
.tabs-bar .listbar { padding: 8px 0 10px; }
@media (max-width: 640px) {
  .tabs-bar .listbar { flex-wrap: nowrap; gap: 8px; padding: 6px 0 8px; font-size: 13px; }
  .tabs-bar .lb-right { width: auto; flex: 1; min-width: 0; }
  .tabs-bar .infilter { flex: 1; min-width: 0; }
  .tabs-bar .infilter input, .tabs-bar .listbar .order select { height: 34px; font-size: 14px; }
  .tabs-bar #count { flex: none; white-space: nowrap; }
}

/* PC: 검색창을 로고 옆에서 길게 늘려 헤더 가운데를 채운다 */
@media (min-width: 900px) {
  .head { justify-content: flex-start; gap: 0; }
  .search { flex: 1 1 auto; max-width: none; margin-left: 56px; }
  .search input { height: 46px; font-size: 15px; padding-left: 46px; }
  .search svg { left: 17px; top: 15px; width: 17px; height: 17px; }
}

/* 쿠폰 카드가 많을 때: 좌우 화살표 (탭 화살표와 같은 방식) */
.cp-wrap { position: relative; }
.cp-wrap .tab-arrow { width: 46px; }
.cp-wrap .tab-arrow-r { background: linear-gradient(90deg, rgba(255,255,255,0), #fff 62%); }
.cp-wrap .tab-arrow-l { background: linear-gradient(270deg, rgba(255,255,255,0), #fff 62%); }
main { padding-bottom: 48px; }

/* 평시: 쿠폰 줄 대신 "요즘 인기 TOP" 가로 목록 + 상시 특가 버튼 */
.top-pick[hidden] { display: none; }
.top-pick { margin-top: 6px; }
.top-row { display: grid; grid-auto-flow: column; grid-auto-columns: 176px; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 6px; }
.top-row::-webkit-scrollbar { display: none; }
@media (max-width: 640px) { .top-row { grid-auto-columns: 150px; gap: 10px; } }
.sec-intro .it-cta { display: inline-flex; align-items: center; align-self: flex-start; margin-top: 2px; padding: 9px 18px; border-radius: 999px; background: linear-gradient(100deg, var(--it-a), var(--it-b)); color: #fff; font-weight: 800; font-size: 13.5px; text-decoration: none; box-shadow: 0 3px 10px var(--it-shadow); }
.sec-intro .it-cta:hover { filter: brightness(1.06); }

/* PC 에서만 줄바꿈 (모바일은 자연스럽게 줄바꿈) */
.pc-br { display: none; }
@media (min-width: 700px) { .pc-br { display: inline; } }

/* 한글은 단어 중간에서 끊기지 않게 (긴 영문/숫자는 필요하면 끊김) */
.sec-intro, .sec-intro *, .hero, .hero *, .cp, .cp *, .sec-head, .it-head, .empty { word-break: keep-all; overflow-wrap: break-word; }
@media (max-width: 640px) { .sec-head span { display: block; margin: 3px 0 0; } }


/* 모바일에서만 줄바꿈 */
.m-br { display: none; }
@media (max-width: 699px) { .m-br { display: inline; } }

/* 맨 아래 "카테고리별 인기 상품 이름 목록" (링크 없는 글자 목록. 서버가 채워 넣어요) */
.name-index { margin-top: 48px; padding: 28px 0 8px; border-top: 1px solid var(--line); color: var(--ink-2); }
.name-index h2 { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: var(--ink); }
.name-index .ni-note { margin: 0 0 18px; font-size: 12px; color: var(--ink-3); }
.name-index .ni-cat { margin-bottom: 20px; }
.name-index h3 { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--ink); }
.name-index h4 { margin: 10px 0 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.name-index ul { margin: 0; padding: 0; list-style: none; columns: 3 280px; column-gap: 24px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.name-index li { break-inside: avoid; padding: 1px 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .name-index ul { columns: 1; } }
