/* ─────────────────────────────────────────────────────────────
   핀딜 — global styles
   ───────────────────────────────────────────────────────────── */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --pd-font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Segoe UI", system-ui, sans-serif;
  --pd-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  /* Accent (overridden by Tweaks) */
  --pd-accent: #F94F3A;
  --pd-accent-soft: #FFEAE4;
  --pd-accent-ink: #C03318;
  --pd-accent-on: #FFFFFF;

  /* Surfaces */
  --pd-bg: #FFFFFF;
  --pd-surface: #F6F6F7;
  --pd-surface-2: #EEEEF0;
  --pd-line: #ECECEE;
  --pd-line-strong: #DDDDE0;

  /* Text */
  --pd-fg: #111114;
  --pd-fg-2: #5B6068;
  --pd-fg-3: #9CA1A8;
  --pd-fg-4: #C2C5CB;

  /* Semantic */
  --pd-hot: #E5341F;
  --pd-cold: #2F80ED;
  --pd-gold: #C9A24A;

  /* Layout tokens */
  --pd-header-h: 52px;
  --pd-nav-h: 64px;
  --pd-pad: 16px;
  --pd-radius-sm: 8px;
  --pd-radius: 12px;
  --pd-radius-lg: 16px;
  --pd-radius-xl: 22px;
}

/* phone shell ────────────────────────────────────────────────── */
.pd {
  font-family: var(--pd-font);
  color: var(--pd-fg);
  background: var(--pd-bg);
  height: 100%;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}
.pd, .pd * { box-sizing: border-box; }
.pd *::-webkit-scrollbar { display: none; }
.pd * { scrollbar-width: none; }

/* header ─────────────────────────────────────────────────────── */
.pd-header {
  flex: 0 0 var(--pd-header-h);
  height: var(--pd-header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--pd-bg);
  border-bottom: 1px solid transparent;
  position: relative;
  z-index: 5;
}
.pd-header__title {
  flex: 1;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.pd-header--bordered { border-bottom-color: var(--pd-line); }
.pd-header__logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.04em;
  color: var(--pd-fg);
}
.pd-header__logo em {
  color: var(--pd-accent);
  font-style: normal;
}
.pd-icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: transparent;
  border: 0; padding: 0;
  color: var(--pd-fg);
  cursor: pointer;
  position: relative;
}
.pd-icon-btn:active { background: var(--pd-surface); }
.pd-icon-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pd-accent);
  border: 2px solid var(--pd-bg);
}

/* content ────────────────────────────────────────────────────── */
.pd-content {
  flex: 1 1 auto;
  overflow-y: auto;
  background: var(--pd-bg);
  -webkit-overflow-scrolling: touch;
}

/* bottom nav ─────────────────────────────────────────────────── */
.pd-nav {
  flex: 0 0 calc(var(--pd-nav-h) + 16px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--pd-line);
  background: var(--pd-bg);
  padding-bottom: 16px;
  position: relative;
  z-index: 5;
}
.pd-nav__item {
  background: none; border: 0; padding: 9px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--pd-fg-3);
  font-family: inherit;
  cursor: pointer;
  position: relative;
}
.pd-nav__item.is-active { color: var(--pd-accent); }
.pd-nav__icon { width: 24px; height: 24px; display: grid; place-items: center; }
.pd-nav__label { font-size: 10.5px; font-weight: 600; letter-spacing: -0.02em; }
.pd-nav__badge {
  position: absolute;
  background: var(--pd-accent);
  color: var(--pd-accent-on);
  font-size: 9px; font-weight: 700;
  padding: 1px 4px; border-radius: 999px;
  min-width: 14px; text-align: center;
  transform: translate(10px, -3px);
}

/* raised circular center button (핫딜) ----------------------- */
.pd-nav__center { padding-top: 0; }
.pd-nav__center .pd-nav__circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--pd-accent);
  color: var(--pd-accent-on);
  display: grid; place-items: center;
  margin-top: -22px;
  box-shadow:
    0 8px 18px color-mix(in oklab, var(--pd-accent) 32%, transparent),
    0 0 0 5px var(--pd-bg);
  position: relative;
  transition: transform .15s;
}
.pd-nav__center.is-active .pd-nav__circle {
  transform: scale(1.04);
}
.pd-nav__center .pd-nav__label {
  color: var(--pd-fg-2);
  margin-top: 4px;
  font-weight: 700;
}
.pd-nav__center.is-active .pd-nav__label {
  color: var(--pd-accent);
}

/* primitives ─────────────────────────────────────────────────── */
.pd-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: var(--pd-surface);
  color: var(--pd-fg-2);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.pd-chip.is-active {
  background: var(--pd-fg);
  color: var(--pd-bg);
}
.pd-chip--outline {
  background: var(--pd-bg);
  border-color: var(--pd-line);
}

.pd-divider { height: 1px; background: var(--pd-line); }
.pd-divider--thick { height: 8px; background: var(--pd-surface); }

.pd-section-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  padding: 18px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.pd-section-title .link {
  font-size: 13px;
  font-weight: 500;
  color: var(--pd-fg-3);
  display: inline-flex; align-items: center; gap: 2px;
}

/* placeholder image (Thumb) ──────────────────────────────────── */
.pd-thumb {
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--pd-surface);
  color: rgba(0,0,0,0.32);
  font-family: var(--pd-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.pd-thumb::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(0,0,0,0.04) 0 1px,
    transparent 1px 8px
  );
}
.pd-thumb__label { position: relative; z-index: 1; opacity: 0.62; }

/* deal card ──────────────────────────────────────────────────── */
.pd-deal {
  display: flex; gap: 12px;
  padding: 14px 16px;
  align-items: stretch;
  cursor: pointer;
}
.pd-deal__thumb {
  width: 92px; height: 92px;
  border-radius: var(--pd-radius);
}
.pd-deal__body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  gap: 4px;
}
.pd-deal__meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  color: var(--pd-fg-3);
}
.pd-deal__site {
  color: var(--pd-fg-2);
  background: var(--pd-surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  letter-spacing: -0.02em;
}
.pd-deal__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.38;
  color: var(--pd-fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.015em;
}
.pd-deal__price {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-top: auto;
  display: flex; align-items: baseline; gap: 6px;
}
.pd-deal__price .strike {
  font-size: 12px;
  font-weight: 500;
  color: var(--pd-fg-3);
  text-decoration: line-through;
}
.pd-deal__badges { display: flex; gap: 4px; }
.pd-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: -0.015em;
}
.pd-pill--hot { background: var(--pd-accent-soft); color: var(--pd-accent-ink); }
.pd-pill--free { background: #EAF6EE; color: #1B7A3B; }
.pd-pill--end { background: var(--pd-surface); color: var(--pd-fg-3); }

/* feature card (large hero) ─────────────────────────────────── */
.pd-feature {
  margin: 8px 16px 4px;
  border-radius: var(--pd-radius-lg);
  overflow: hidden;
  background: var(--pd-surface);
  position: relative;
}
.pd-feature__thumb { width: 100%; aspect-ratio: 16/10; }
.pd-feature__body { padding: 14px 16px 16px; }
.pd-feature__kicker {
  font-size: 11.5px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--pd-accent);
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 6px;
}
.pd-feature__title {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.pd-feature__price {
  font-size: 19px; font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 8px;
}

/* button ─────────────────────────────────────────────────────── */
.pd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--pd-fg);
  color: var(--pd-bg);
  border: 0;
  cursor: pointer;
  padding: 0 18px;
  width: 100%;
}
.pd-btn--accent { background: var(--pd-accent); color: var(--pd-accent-on); }
.pd-btn--ghost { background: var(--pd-surface); color: var(--pd-fg); }
.pd-btn--sm { height: 36px; font-size: 13px; padding: 0 14px; border-radius: 8px; width: auto; }

/* segmented control ─────────────────────────────────────────── */
.pd-segment {
  display: flex;
  background: var(--pd-surface);
  border-radius: 10px;
  padding: 3px;
  margin: 0 16px;
}
.pd-segment__btn {
  flex: 1;
  height: 34px;
  border: 0; background: transparent;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: var(--pd-fg-2);
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: -0.02em;
}
.pd-segment__btn.is-active {
  background: var(--pd-bg);
  color: var(--pd-fg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 0.5px rgba(0,0,0,0.04);
}

/* row list ───────────────────────────────────────────────────── */
.pd-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--pd-bg);
  cursor: pointer;
  min-height: 56px;
}
.pd-row + .pd-row { border-top: 1px solid var(--pd-line); }
.pd-row__label { flex: 1; font-size: 14.5px; font-weight: 500; }
.pd-row__sub { font-size: 13px; color: var(--pd-fg-3); }

/* affiliate footer notice ───────────────────────────────────── */
.pd-affiliate-notice {
  padding: 16px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--pd-fg-3);
  background: var(--pd-surface);
  border-top: 1px solid var(--pd-line);
  letter-spacing: -0.005em;
}

/* utility ────────────────────────────────────────────────────── */
.pd-stack { display: flex; flex-direction: column; }
.pd-row-flex { display: flex; align-items: center; }
.pd-spacer { flex: 1; }
.pd-mono { font-family: var(--pd-mono); }
.pd-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
