/*
 * 상품 카드 공통 부품 (View/CardExtras.php) — basic 포함 모든 스킨에 싣는다.
 *   .afs-pv   이미지 왼쪽 아래 판매처 배지(쿠팡·네이버). 로고 대신 이름 + 색 점.
 *   .afs-go   이미지 오른쪽 위 구매하기 버튼. 카드에 마우스를 올리면 "구매하기" 글자가 펼쳐진다.
 *
 * 30종 스킨 CSS 가 카드 안 `a`·`span` 에 크기·위치를 강제하는 일이 많아(`.카드 a{height:100%}` 등)
 * 모양을 정하는 속성은 !important 로 고정한다. 스킨별 조정은 아래 변수로만 한다(파일 맨 아래 스킨별 보정).
 *   카드 루트:   --afs-go-top, --afs-go-right   버튼 위치 / translate·rotate 로 카드 hover 이동 따라가기
 *   이미지 상자: --afs-pv-inset(왼쪽·아래), --afs-pv-bottom(아래만), --afs-pv-top(위에 붙일 때, 이때 --afs-pv-bottom:auto)
 */
:has(> .afs-pv) { position: relative; }
.afs-pv.afs-pv {
  position: absolute !important; z-index: 2 !important; margin: 0 !important; padding: 0 !important;
  left: var(--afs-pv-inset, 8px) !important; right: auto !important;
  top: var(--afs-pv-top, auto) !important; bottom: var(--afs-pv-bottom, var(--afs-pv-inset, 8px)) !important;
  display: flex !important; flex-wrap: wrap; gap: 4px; width: auto !important; height: auto !important;
  max-width: calc(100% - 16px); background: none !important; border: 0 !important; pointer-events: none;
  transition: opacity .2s ease;
}
.afs-pv__chip.afs-pv__chip {
  position: static !important; display: inline-flex !important; align-items: center; gap: 4px;
  width: auto !important; height: 20px !important; margin: 0 !important; padding: 0 7px 0 6px !important;
  border: 0 !important; border-radius: 999px !important; background: rgba(255, 255, 255, .9) !important; color: #1f2328 !important;
  -webkit-backdrop-filter: blur(6px) saturate(1.4); backdrop-filter: blur(6px) saturate(1.4);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12), inset 0 0 0 1px rgba(15, 23, 42, .06) !important;
  font: 700 10.5px/1 Pretendard, system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif !important;
  letter-spacing: -.01em !important; white-space: nowrap; text-transform: none !important; transform: none !important;
}
.afs-pv__chip.afs-pv__chip::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--afs-pv-dot, #8b929a); }
.afs-pv--coupang { --afs-pv-dot: #e52528; }
.afs-pv--naver { --afs-pv-dot: #03c75a; }

:where(article, li, div):has(> .afs-go) { position: relative; }
.afs-go.afs-go {
  position: absolute !important; z-index: 3 !important; box-sizing: border-box !important;
  top: var(--afs-go-top, 10px) !important; right: var(--afs-go-right, 10px) !important; bottom: auto !important; left: auto !important;
  display: inline-flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 0 !important;
  align-items: center !important; justify-content: center !important; line-height: 1 !important;
  width: auto !important; height: 32px !important; min-width: 32px !important; max-width: none !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 8.5px !important; border: 0 !important; border-radius: 999px !important;
  background: rgba(255, 255, 255, .92) !important; color: #16181d !important; text-decoration: none !important; opacity: 1 !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.4); backdrop-filter: blur(8px) saturate(1.4);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .14), inset 0 0 0 1px rgba(15, 23, 42, .06) !important;
  transform: none; transition: background-color .2s, color .2s, box-shadow .2s, transform .2s, translate .3s, rotate .3s;
}
.afs-go.afs-go .sf-icon { flex: none; display: block !important; width: 15px !important; height: 15px !important; margin: 0 !important; }
.afs-go__label.afs-go__label {
  display: block !important; max-width: 0; margin: 0; padding: 0 !important; overflow: hidden !important; white-space: nowrap; opacity: 0;
  color: inherit !important; background: none !important;
  font: 700 12px/1 Pretendard, system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif !important; letter-spacing: -.01em !important;
  transition: max-width .25s ease, margin .25s ease, opacity .2s ease;
}
.afs-go.afs-go:hover, .afs-go.afs-go:focus-visible {
  background: var(--brand, #16181d) !important; color: var(--on-brand, #fff) !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand, #16181d) 35%, transparent) !important;
}
.afs-go.afs-go:active { transform: scale(.96); }
@media (hover: hover) and (min-width: 641px) {
  :hover > .afs-go .afs-go__label.afs-go__label, .afs-go:focus-visible .afs-go__label.afs-go__label { max-width: 64px; margin-left: 5px; opacity: 1; }
}
@media (max-width: 640px) {
  .afs-go.afs-go {
    height: 30px !important; min-width: 30px !important; padding: 0 7.5px !important;
    top: var(--afs-go-top, 8px) !important; right: var(--afs-go-right, 8px) !important;
  }
  .afs-pv.afs-pv { left: var(--afs-pv-inset, 6px) !important; bottom: var(--afs-pv-bottom, var(--afs-pv-inset, 6px)) !important; gap: 3px; }
  .afs-pv__chip.afs-pv__chip { height: 18px !important; padding: 0 6px 0 5px !important; font-size: 10px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .afs-go.afs-go, .afs-go__label.afs-go__label, .afs-pv.afs-pv { transition: none; }
}

/* ── 스킨별 보정 ─────────────────────────────────────────────── */
/* 이미지가 카드 안쪽으로 들어간 스킨: 버튼을 이미지 모서리 안으로 */
.sk-t01-market-dense .pc { --afs-go-top: 18px; --afs-go-right: 18px; }
.sk-t10-newsletter .nl-card { --afs-go-top: 26px; --afs-go-right: 26px; }
.sk-t23-kids-pop .kp-card { --afs-go-top: 20px; --afs-go-right: 20px; }
.sk-t23-kids-pop .kp-card:has(.kp-rank) { --afs-go-top: 62px; } /* 오른쪽 위 순위 원 아래로 */
.sk-t28-retro-brutal .pc { --afs-go-top: 13px; --afs-go-right: 13px; }
.sk-t30-dark-neon .nc { --afs-go-top: 19px; --afs-go-right: 19px; }
/* 오른쪽 위 순위 칸(34px) 아래로 */
.sk-t22-cozy-home .ch-card:has(.ch-rank) { --afs-go-top: 52px; }
.sk-t22-cozy-home .ch-best .ch-card { --afs-go-right: 20px; }
.sk-t22-cozy-home .ch-best .ch-card:has(.ch-rank) { --afs-go-top: 62px; }
/* 아치형 이미지: 위 반원 곡선 안쪽(카드 폭 기준 %, margin % 는 폭을 따른다) */
.sk-t21-natural-living .nl-card > .afs-go.afs-go { top: 0 !important; margin-top: 15% !important; right: 15% !important; }
/* 이미지 아래쪽을 덮는 요소 위로 배지 올리기 / 위로 옮기기 */
.sk-t25-beauty-glow .bg-card { --afs-pv-bottom: 54px; }
.sk-t03-ranking-board .rc { --afs-pv-top: 8px; --afs-pv-bottom: auto; }
@media (max-width: 640px) { .sk-t25-beauty-glow .bg-card { --afs-pv-bottom: 44px; } }
/* hover 때 나오는 띠·글자와 겹치는 배지는 잠시 숨김 */
.sk-t02-mega-mall .gc:hover .afs-pv, .sk-t09-lookbook a:hover .afs-pv { opacity: 0; }
/* 카드가 hover 로 움직이면 버튼도 같이 */
.sk-t03-ranking-board .rc:hover > .afs-go { translate: 0 -3px; }
.sk-t05-daily-pick .dc:hover > .afs-go { translate: 0 -4px; }
.sk-t23-kids-pop .kp-card:hover > .afs-go { translate: 0 -4px; rotate: -1deg; }
.sk-t28-retro-brutal .pc:hover > .afs-go { translate: -3px -3px; }
/* 가로형 목록 보기(이미지가 왼쪽으로 가는 모드)에서는 버튼을 숨김 — 카드 상세로 들어가 구매 */
.sk-t06-editorial-mag .is-list .afs-go, .sk-t07-select-shop .is-rows .afs-go, .sk-t22-cozy-home .is-rows .afs-go,
.sk-t28-retro-brutal .is-list .afs-go, .sk-t16-review-lab .as-list .afs-go,
.sk-t18-qa-guide .as-list .afs-go, .sk-t19-versus .as-list .afs-go, .sk-t20-data-dash .as-list .afs-go { display: none !important; }
