/* 할인킹 사이트 공통 스타일. 색은 themes/theme.css의 변수로만 쓴다. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15px; line-height: 1.45; overflow-x: hidden; }
a { color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 머리 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 6px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; flex: 0 0 auto; }
.logo img { width: 52px; height: 52px; display: block; }
.brand { font-size: 29px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); white-space: nowrap; }
.brand b { color: var(--primary); font-weight: 800; }   /* "할인"은 본문색, "킹"만 주색 */
.alarm { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
  text-decoration: none; background: var(--alarm-bg); color: var(--alarm-text); white-space: nowrap; flex: 0 0 auto; }
.alarm-icon { width: 20px; height: 20px; display: block; flex: 0 0 auto; }  /* 카카오 TALK 심볼(사용자 구매 파일, 모양·색 그대로) */
.alarm { padding-top: 6px; padding-bottom: 6px; }

/* 수수료 고지 */
.disclosure { font-size: 12px; color: var(--muted); padding: 4px 0 10px; border-bottom: 1px solid var(--border); }
.disclosure p { margin: 2px 0; }

/* 오늘의 딜 + 마감 알약(제목 오른쪽, 색은 시간과 관계없이 고정) */
.today { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 4px; }
.today h1 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -0.3px; white-space: nowrap; }
.pill { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 11px; border: 0; border-radius: 999px; white-space: nowrap;
  background: var(--primary); color: var(--on-primary); font: inherit; font-size: 12px; font-weight: 700; flex: 0 1 auto; min-width: 0; }
button.pill { cursor: pointer; }
button.pill:disabled { cursor: default; opacity: 1; color: var(--on-primary); }
.pill .time { color: var(--ribbon-num); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; }
/* 굴러가는 시계(fix-184): 숫자 칸마다 9~0 세로 띠를 위로 굴림. 칸 폭 고정이라 알약 폭이 안 흔들림 */
.pill .time .dg { display: inline-block; width: .62em; height: 1.15em; line-height: 1.15em; overflow: hidden; vertical-align: bottom; text-align: center; }
.pill .time .st { display: block; transition: transform .26s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.pill .time .st i { display: block; font-style: normal; height: 1.15em; }
.pill .time .dg:nth-last-child(-n+2) .st { transition-duration: .07s; }  /* 100분의 1초 두 칸은 아주 빠르게 */
.pill .time .sep { display: inline-block; width: .32em; text-align: center; }
.pill.urgent { animation: beat 1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.07); } 30% { transform: scale(1); } 45% { transform: scale(1.04); } }
.pill.tight .until { display: none; }  /* 알약이 한 줄에 안 들어갈 때만 "· 마감까지"를 뺀다(app.js fitPill) */

/* 검색 */
.search { position: relative; margin: 12px 0; }
.search input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px 12px 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); }
.search input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.search::before { content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .7; }

/* 가로로 밀리는 줄: 오른쪽 끝 흐림 + › */
.scroller { position: relative; margin: 0 -16px; }
.scroller .row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 32px 2px 16px;
  scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
.scroller .row::-webkit-scrollbar { display: none; }
.scroller::after { content: "›"; position: absolute; top: 0; right: 0; bottom: 0; width: 40px; display: flex; align-items: center;
  justify-content: flex-end; padding-right: 8px; font-size: 20px; color: var(--muted); pointer-events: none;
  background: linear-gradient(to right, transparent, var(--bg) 70%); }
.scroller.at-end::after { opacity: 0; }

.tabs { margin-bottom: 10px; }
.tab { flex: 0 0 auto; scroll-snap-align: start; padding: 11px 14px; border-radius: 14px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--card); color: var(--text); font: inherit; white-space: nowrap; }
.tab strong { display: block; font-size: 14px; }
.tab .n { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.tab[aria-pressed="true"] { background: var(--sel-bg); border-color: var(--sel-border); color: var(--sel-text); }
.tab[aria-pressed="true"] .n { color: var(--text); }

.tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; min-height: 32px; }
.basis { font-size: 12px; color: var(--muted); }
.views { display: flex; gap: 4px; margin-left: auto; }
.view { width: 36px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--muted);
  font-size: 15px; cursor: pointer; }
.view[aria-pressed="true"] { color: var(--sel-text); border-color: var(--sel-border); background: var(--sel-bg); }

/* 딜 카드 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; min-width: 0; }
.photo { position: relative; aspect-ratio: 1 / 1; background: var(--photo); overflow: hidden; }
/* 사진 칸은 어떤 사진이 와도 정사각형(fix-184): 사진이 칸 크기를 늘리지 않게 칸 위에 얹고 넘치는 부분은 잘림 */
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.since { background: var(--yellow); color: var(--on-yellow); }
.badge.top { background: var(--lilac); color: var(--on-lilac); }
.badge.new { background: var(--new-bg); color: var(--on-new); animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 70%, 100% { transform: scale(1); filter: brightness(1); } 80% { transform: scale(1.12); filter: brightness(1.25); } }
/* 구성 배지(v57, 시안 A): 사진 왼쪽 아래 큰 노랑 알약 */
.pack { position: absolute; left: 8px; bottom: 8px; display: flex; flex-direction: column; align-items: flex-start; padding: 5px 12px 6px;
  border-radius: 999px; background: var(--yellow); color: var(--on-yellow); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); line-height: 1.05; max-width: calc(100% - 16px); }
.pack b { font-size: 20px; font-weight: 900; letter-spacing: -.3px; white-space: nowrap; }
.pack small { font-size: 10px; font-weight: 700; margin-top: 2px; white-space: nowrap; }
.pack small:only-child { margin: 0; }
.grid.list .pack { left: 5px; bottom: 5px; padding: 3px 8px 4px; }
.grid.list .pack b { font-size: 14px; }
.grid.list .pack small { font-size: 9px; }
/* 카드 줄 자리 고정(v14): 토스·쿠팡 카드가 섞여도 할인가 줄과 버튼이 같은 높이에 오게, 값이 없는 줄도 높이는 그대로 */
.body { display: flex; flex-direction: column; gap: 3px; padding: 10px 10px 12px; flex: 1; }
.name { font-size: 13.5px; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; height: 2.9em; flex: 0 0 auto; }   /* 항상 2줄 높이, 넘치면 … */
.line { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto; }
.size, .rating { font-size: 11.5px; color: var(--muted); height: 17px; line-height: 17px; }
.size { display: block; }  /* 옵션 1줄(v70), 넘치면 … — 높이 고정(17px)으로 카드 줄 맞춤 */
.grid.norating .rating { display: none; }  /* 보이는 카드에 평점이 하나도 없으면 평점 줄 자리를 빼서 빈칸을 없앰(v70) */
/* 휴대폰 폭: "토스쇼핑 평점 · 리뷰"가 한 줄에 안 들어가 숫자가 잘리지 않게 두 줄 자리(모든 카드 같은 높이라 줄 맞춤 유지) */
@media (max-width: 639px) { .rating { white-space: normal; height: 34px; align-items: flex-start; } }
.was { height: 26px; line-height: 26px; }
.orig { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.rate { font-size: 19px; font-weight: 900; color: var(--primary); }
.nowrow { height: 25px; line-height: 25px; }
.now { font-size: 17px; font-weight: 800; }
.ship { font-size: 11.5px; font-weight: 700; color: var(--primary); }
.checked { font-size: 11px; font-weight: 500; color: var(--muted, #888); margin-left: 6px; white-space: nowrap; letter-spacing: 0; } /* fix-212 가격 확인 시각 — 제목 옆 한 번 */
@media (max-width: 639px) { .today h1 .checked { display: block; margin: 2px 0 0; } }  /* 휴대폰: 제목 아래 한 줄(마감 알약 자리 그대로) */
.grid.nosize .size, .grid.nowas .was { display: none; }  /* fix-212 보이는 카드에 값이 하나도 없는 줄은 자리 빼기(v70 norating과 같은 방식) */
.more { grid-column: 1 / -1; margin: 8px auto 4px; padding: 10px 22px; border: 1px solid var(--primary); border-radius: 999px; background: transparent; color: var(--primary); font-weight: 700; font-size: 14px; cursor: pointer; } /* fix-200 더 보기 */
.actions { margin-top: auto; padding-top: 8px; }
.go { display: block; text-align: center; padding: 11px 8px; border-radius: 10px; font-weight: 800; font-size: 14.5px;
  text-decoration: none; background: var(--primary); color: var(--on-primary); }
.go:active { transform: scale(.98); }
/* "상품 보러 가기" 빛(fix-184): 카드마다 시점을 다르게(--shine), 6초에 한 번 휙 */
a.go { position: relative; overflow: hidden; }
a.go::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none; will-change: transform;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-130%) skewX(-18deg);
  animation: shine 6s ease-in-out infinite; animation-delay: var(--shine, 0s); }
@keyframes shine { 0%, 82% { transform: translateX(-130%) skewX(-18deg); } 96%, 100% { transform: translateX(290%) skewX(-18deg); } }  /* transform만 움직여 휴대폰에서 가볍게 */
/* 카드: 스크롤하면 아래에서 살짝 올라오며 나타남(처음 한 번만) */
.card.rise { opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .45s ease; }
.card.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  a.go::after, .badge.new, .pill.urgent { animation: none; }
  .card.rise { opacity: 1; transform: none; transition: none; }
}
.tiprow { height: 24px; display: flex; align-items: flex-end; justify-content: center; }
.tip { font-size: 12px; color: var(--muted); text-align: center; }
.grid.notip .tiprow { display: none; }  /* 보이는 카드에 꿀팁이 하나도 없으면 꿀팁 줄 자리를 빼고(v71) */
.grid.notip .body { padding-bottom: 10px; }  /* 아래 여백 = 위 여백(10px) */

/* 목록 보기 */
.grid.list { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid.list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid.list .card { flex-direction: row; }
.grid.list .photo { width: 120px; flex: 0 0 120px; aspect-ratio: auto; }
.grid.list .name { height: auto; max-height: 2.9em; }

/* 끝난 딜: 회색으로 어둡게 */
.ended-title { font-size: 16px; margin: 28px 0 4px; }
.ended-note { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.card.ended { filter: grayscale(1); }
.card.ended .photo img { filter: brightness(.55); }
.card.ended .endtag { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 800; font-size: 16px; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.card.ended .go { background: var(--border); color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 32px 0; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 32px 0 40px; }

/* 준비 중 화면(진행 중 딜 0개) */
.soon { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; }
.soon img { width: 88px; height: 88px; }
.soon h1 { font-size: 32px; margin: 8px 0 4px; }
.soon p { margin: 8px 0; font-size: 17px; }
[hidden] { display: none !important; }
