/* =============================================================================
   실속플러스 V2.1 (Preview) — Silsok+ PET 모바일 목록 1열 개선
   · 첫 화면: 짧은 대표 카피 → 반려종 탭·카테고리 필터 → 혜택 목록.
     390×844 에서 스크롤 없이 첫 두 혜택의 이름·구매 조건이 함께 읽히게 한다.
   · 마스코트는 상단 PET 헤더에만. 목록 카드에는 이미지·이미지 자리를 두지 않는다.
   · 목록 한 줄: 혜택명 → 비용·필수 조건(말줄임 금지) → 출처·마감, 오른쪽에 저장 44×44.
     저장은 카드 위에 겹치지 않고 오른쪽 전용 칸(44px)에 둔다.
   · 필터 탭·칩에는 숫자를 두지 않고 결과 제목에서만 총수를 한 번 센다.
   · 터치 타깃은 모두 44px 이상. 모든 그리드는 minmax(0,1fr) 로 가로 넘침을 막는다.
   ========================================================================== */

/* ---------------------------------------------------------------- 히어로 */
.pet-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  min-height: 84px;
  padding: 10px 104px 10px 14px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 150% at 94% 6%, rgba(233, 196, 120, 0.28) 0%, rgba(233, 196, 120, 0) 62%),
    linear-gradient(120deg, #faf5ed 0%, #f7efe2 62%, #f3e8d6 100%);
  border: 1px solid #efe3d0;
  overflow: hidden;
}
.pet-hero-copy { min-width: 0; }
.pet-hero-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: #2459ee;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.pet-hero h1 {
  margin: 5px 0 0;
  font-size: 17px;
  line-height: 1.28;
  letter-spacing: -0.035em;
  font-weight: 900;
  color: var(--ink);
  word-break: keep-all;
}
.pet-hero-sub {
  margin: 3px 0 0;
  font-size: var(--fs-12);
  line-height: 1.35;
  font-weight: 600;
  color: #6b5c45;
}
/* 마스코트는 오른쪽에 작게 — 정보가 아니라 장식이라 자리만 차지하지 않게 */
.pet-hero-art {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: auto;
  height: calc(100% - 14px);
  max-width: 92px;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}
.pet-hero.is-skeleton { min-height: 84px; }

/* ---------------------------------------------------------------- 종류 탭 */
.pet-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 10px 0 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.pet-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.pet-tabs button[aria-selected="true"] {
  background: #faf5ed;
  color: #1b46c4;
  box-shadow: var(--shadow-1);
  border: 1px solid #efe3d0;
}

/* ------------------------------------------------- 카테고리 필터(한 줄 가로 스크롤) */
.pet-cats {
  display: flex;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0 0 2px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pet-cats::-webkit-scrollbar { display: none; }
.pet-cats button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  cursor: pointer;
}
.pet-cats button .ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #faf5ed;
  color: #2459ee;
}
.pet-cats button .ic svg { width: 16px; height: 16px; }
.pet-cats button[aria-pressed="true"] {
  border-color: #2459ee;
  background: #2459ee;
  color: #fff;
}
.pet-cats button[aria-pressed="true"] .ic { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ---------------------------------------------------------------- 섹션 */
.pet-sec { margin-top: 18px; }
.pet-sec[hidden] { display: none; }
.pet-sec-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.pet-sec-head h2 {
  margin: 0;
  font-size: var(--fs-15);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.pet-sec-head .n { font-size: var(--fs-12); font-weight: 800; color: var(--muted-2); }
.pet-sec-head a {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}

/* 목록 — 가로폭 100% 1열. 같은 폭의 줄이 쌓여 이름·비용·출처를 세로로 비교한다. */
.pet-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.pet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

/* ---------------------------------------------------------------- 목록 한 줄 */
/* 혜택명 → 비용·필수 조건 → 출처·마감 (왼쪽 한 칸) + 저장 44×44 (오른쪽 한 칸).
   저장을 카드 위에 겹쳐 두지 않고 별도 칸에 두어 좁은 화면에서도 비용 문구와 겹치지 않는다. */
.pet-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.pet-card-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 11px 0 11px 13px;
  color: inherit;
  text-decoration: none;
}
.pet-name {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}
/* 비용·조건은 접거나 말줄임하지 않는다 — 배송비·최소 구매액이 잘리면 오해가 생긴다 */
.pet-cost {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.36;
  font-weight: 800;
  /* 혜택 강조 글씨 — 다크모드에서도 대비가 서는 --accent(#60a5fa) 를 쓴다 */
  color: var(--accent);
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.pet-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.pet-dday {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--pill-d1-bg);
  color: var(--pill-d1-fg);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.pet-dday.is-today { background: var(--pill-today-bg); color: var(--pill-today-fg); }
.pet-dday.is-any { background: var(--bg-3); color: var(--muted); }
.pet-src {
  font-size: 10.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 제휴/광고 — 썸네일 위가 아니라 글자 영역(출처·마감 줄)에 둔다 */
.pet-ad {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
}
/* 저장 버튼 — 오른쪽 칸에 44×44 (보이는 원은 32px, 나머지는 투명 여백) */
.pet-save {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: center;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a94a8;
  cursor: pointer;
}
.pet-save::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.pet-save svg { position: relative; z-index: 1; width: 16px; height: 16px; }
.pet-save[aria-pressed="true"] { color: #fff; }
.pet-save[aria-pressed="true"]::before { background: #2459ee; }

/* ---------------------------------------------------------------- 상세 */
.pet-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  min-height: 44px;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 700;
  cursor: pointer;
}
.pet-detail { margin-top: 10px; }
.pet-detail-art {
  border-radius: var(--r-lg);
  background: #faf5ed;
  border: 1px solid #efe3d0;
  overflow: hidden;
}
.pet-detail-art img { display: block; width: 100%; height: auto; max-height: 200px; object-fit: contain; }
.pet-detail-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: var(--fs-12);
  font-weight: 800;
  color: var(--muted-2);
}
.pet-ad--inline {
  position: static;
  height: auto;
  padding: 0 5px;
  font-size: 10px;
  line-height: 1.6;
}
.pet-detail h1 {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 1.32;
  letter-spacing: -0.035em;
  font-weight: 900;
  color: var(--ink);
  word-break: keep-all;
}
.pet-detail-value {
  margin: 10px 0 0;
  font-size: var(--fs-17);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.pet-detail-value .pet-dday { margin-left: 4px; vertical-align: 2px; }
.pet-detail-cond {
  margin: 8px 0 0;
  font-size: var(--fs-14);
  line-height: 1.55;
  font-weight: 600;
  color: var(--ink-2);
  word-break: keep-all;
}
.pet-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  font-size: var(--fs-15);
  font-weight: 800;
}
.pet-expired {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.pet-expired strong { display: block; font-size: var(--fs-14); font-weight: 800; color: var(--ink); }
.pet-expired p { margin: 4px 0 0; font-size: var(--fs-12); line-height: 1.5; color: var(--muted); }
.pet-alt, .pet-rel ul { list-style: none; margin: 8px 0 0; padding: 0; }
.pet-alt li + li, .pet-rel li + li { margin-top: 6px; }
.pet-alt a, .pet-rel a {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-bg);
  color: var(--ink-2);
  text-decoration: none;
}
.pet-alt a .t, .pet-rel a .t {
  min-width: 0;
  font-size: var(--fs-13);
  line-height: 1.4;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}
.pet-alt a .c { font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.pet-rel a .d { font-size: 11px; font-weight: 800; color: var(--muted-2); }
.pet-rel { margin-top: 18px; }
.pet-rel h2 {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.pet-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.pet-detail-actions .btn { flex: 1 1 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pet-share svg { width: 16px; height: 16px; }
.pet-detail dl {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.pet-detail dt { font-size: var(--fs-12); font-weight: 800; color: var(--muted-2); }
.pet-detail dd {
  margin: 0;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--ink-2);
  word-break: keep-all;
}
.pet-note {
  margin: 14px 0 0;
  font-size: var(--fs-11);
  line-height: 1.6;
  color: var(--muted-2);
}
.pet-empty {
  margin-top: 18px;
  padding: 28px 16px;
  border-radius: var(--r);
  border: 1px dashed var(--line-strong);
  background: var(--bg-2);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-13);
}

/* 하단 고정 CTA — 본문 CTA 가 화면 밖으로 나갔을 때만 JS 가 hidden 을 푼다 */
.pet-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  z-index: 45;
  padding: 8px var(--pad) 10px;
  background: linear-gradient(to top, var(--bg) 72%, rgba(255, 255, 255, 0));
}
.pet-sticky[hidden] { display: none; }
.pet-sticky .btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; }

/* 저장함 안의 PET 카드 — 목록과 같은 한 줄(1열) 카드 */
.pet-cards--saved { margin-top: 10px; }

/* 메인 캐러셀 크림 슬라이드 (PET) */
.promo-slide--cream {
  background:
    radial-gradient(120% 160% at 92% 45%, rgba(233, 196, 120, 0.26) 0%, rgba(233, 196, 120, 0) 62%),
    linear-gradient(100deg, #faf5ed 0%, #f6eee0 58%, #f1e6d3 100%);
}
.promo-slide--cream .promo-art {
  height: 100%;
  max-height: none;
  right: 0;
}
.promo-slide--cream .promo-badge {
  padding: 0 8px;
  border-radius: 999px;
  background: #2459ee;
  color: #ffffff;
}
.promo-slide--cream .promo-title em { color: #2459ee; }

/* ---------------------------------------------------------------- 다크 */
:root[data-theme="dark"] .pet-hero {
  background:
    radial-gradient(130% 150% at 92% 8%, rgba(36, 89, 238, 0.22) 0%, rgba(36, 89, 238, 0) 60%),
    linear-gradient(120deg, #241f18 0%, #221d16 60%, #1d1912 100%);
  border-color: #3a3125;
}
:root[data-theme="dark"] .pet-hero-sub { color: #b7a88f; }
:root[data-theme="dark"] .pet-hero h1 { color: #f4efe6; }
:root[data-theme="dark"] .pet-tabs button[aria-selected="true"] {
  background: #2f2a20;
  color: #9fb8ff;
  border-color: #423a2c;
}
:root[data-theme="dark"] .pet-cats button { border-color: #2a3145; }
:root[data-theme="dark"] .pet-cats button .ic { background: #2a2419; color: #9fb8ff; }
:root[data-theme="dark"] .pet-cats button[aria-pressed="true"] { background: #2f6bff; border-color: #2f6bff; }
:root[data-theme="dark"] .pet-cats button[aria-pressed="true"] .ic { background: rgba(255, 255, 255, 0.18); }
:root[data-theme="dark"] .pet-detail-art { background: #2a2419; border-color: #3a3125; }
:root[data-theme="dark"] .pet-save::before { background: rgba(20, 26, 40, 0.86); }
:root[data-theme="dark"] .pet-save[aria-pressed="true"]::before { background: #2f6bff; }
:root[data-theme="dark"] .pet-alt a,
:root[data-theme="dark"] .pet-rel a { border-color: #2a3145; }
:root[data-theme="dark"] .pet-sticky { background: linear-gradient(to top, var(--bg) 72%, rgba(11, 17, 32, 0)); }
:root[data-theme="dark"] .promo-slide--cream {
  background:
    radial-gradient(120% 160% at 92% 45%, rgba(36, 89, 238, 0.24) 0%, rgba(36, 89, 238, 0) 62%),
    linear-gradient(100deg, #241f18 0%, #221d16 58%, #1c1811 100%);
}

/* ---------------------------------------------------------------- 넓은 화면 */
@media (min-width: 560px) {
  .pet-hero { padding-right: 120px; min-height: 96px; }
  .pet-hero h1 { font-size: 19px; }
  .pet-hero-art { max-width: 112px; }
  .pet-hero-sub { font-size: var(--fs-13); }
  .pet-cats { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; overflow: visible; }
  .pet-name { font-size: var(--fs-15); }
  .pet-cost { font-size: var(--fs-14); }
  .pet-card-link { padding: 12px 0 12px 16px; }
  .pet-sticky { left: 50%; transform: translateX(-50%); width: min(100%, 560px); }
  .promo-slide--cream .promo-art { height: 102%; }
}
@media (min-width: 900px) {
  .pet-hero { min-height: 116px; padding-right: 200px; }
  .pet-hero h1 { font-size: 23px; }
  .pet-hero-art { max-width: 168px; }
  .pet-hero-sub { font-size: var(--fs-14); }
  .pet-sticky { width: min(100%, 640px); }
}
