/* ==========================================================================
   Tiny Paws — Component library ("Fresh Modern")
   Light, photo-led, crisp. Built on the style.css token layer (coral + ink on
   warm white). Loaded after style.css.
   ========================================================================== */

/* ---------- Section header ---------- */
.tp-section-head { margin-bottom: clamp(1.6rem, 4vw, 2.75rem); }
.tp-section-head .tp-lede { margin-top: .5rem; color: var(--tp-muted); }
.tp-section-head.tp-center .tp-lede { margin-inline: auto; }
.tp-section-head h2 { letter-spacing: -.025em; }

/* ---------- Buttons: keep pill; add a soft secondary ---------- */
.btn-tp-honey {
  background: var(--tp-sage); border: 1.5px solid var(--tp-sage); color: var(--tp-ink);
  box-shadow: none;
}
.btn-tp-honey:hover { background: #f4d996; border-color: #f4d996; color: var(--tp-ink); }

/* ---------- Chips ---------- */
.tp-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--tp-body); font-weight: 600; font-size: .82rem;
  padding: .32rem .7rem; border-radius: var(--tp-r-pill);
  background: #fff; color: var(--tp-ink); border: 1px solid var(--tp-line);
  line-height: 1.1; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.tp-chip i { color: var(--tp-muted); font-size: .82em; }
.tp-chip--glance { background: var(--tp-cream-2); border-color: transparent; }
.tp-chip--selectable { cursor: pointer; }
.tp-chip--selectable:hover { border-color: var(--tp-raspberry); color: var(--tp-raspberry); }
.tp-chip--selected { background: var(--tp-raspberry); border-color: var(--tp-raspberry); color: #fff; }
.tp-chip--selected i { color: #fff; }
.tp-chip--removable { padding-right: .4rem; }
.tp-chip__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.3); color: inherit; font-size: .78rem; line-height: 1;
}
.tp-chip__x:hover { background: rgba(255,255,255,.55); }
.tp-glance { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Status tag (flat, minimal) ---------- */
.tp-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--tp-body); font-weight: 700; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .07em;
  padding: .32rem .6rem; border-radius: var(--tp-r-pill);
  background: #fff; color: var(--tp-ink); box-shadow: var(--tp-shadow-sm);
}
.tp-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tp-badge--ok   { color: var(--tp-ok); }
.tp-badge--new  { color: #fff; background: var(--tp-raspberry); box-shadow: none; }
.tp-badge--soon { color: var(--tp-soon); background: var(--tp-soon-soft); box-shadow: none; }
.tp-badge--sold { color: #fff; background: var(--tp-ink); box-shadow: none; }

/* ---------- Wishlist heart ---------- */
.tp-heart {
  position: absolute; top: .7rem; right: .7rem; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92); color: var(--tp-raspberry);
  box-shadow: var(--tp-shadow-sm); transition: transform .18s var(--tp-ease), background-color .18s ease;
}
.tp-heart:hover { transform: scale(1.08); background: #fff; }
.tp-heart i { font-size: .95rem; }
.tp-heart[aria-pressed="true"] { color: #fff; background: var(--tp-raspberry); }
.tp-heart[aria-pressed="true"].is-pop { animation: tp-pop .32s var(--tp-ease); }
@keyframes tp-pop { 0% { transform: scale(1); } 45% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- Puppy card extras (light) ---------- */
.tp-tag { position: relative; }
.tp-tag__badges { position: absolute; top: .7rem; left: .7rem; z-index: 3; display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.tp-tag__name { font-family: var(--tp-display); font-weight: 800; font-size: 1.35rem; color: var(--tp-ink); line-height: 1.03; letter-spacing: -.02em; margin: 0 0 .1rem; }
.tp-tag__breed-sub { font-size: .9rem; color: var(--tp-muted); margin: 0 0 .55rem; }
.tp-tag .tp-glance { margin: .1rem 0 .7rem; }
.tp-tag .tp-chip--glance { background: var(--tp-cream-2); color: var(--tp-ink); border-color: transparent; font-size: .76rem; padding: .24rem .55rem; }
.tp-tag .tp-chip--glance i { color: var(--tp-muted); }
.tp-tag__price { display: flex; align-items: baseline; gap: .5rem; }
.tp-tag__finance { display: block; font-family: var(--tp-body); font-size: .78rem; color: var(--tp-muted); font-weight: 600; margin-top: .2rem; }
.tp-tag__finance strong { color: var(--tp-ink); }
.tp-tag--adopted .tp-tag__photo img { filter: grayscale(.9) contrast(.96); }

/* ---------- Breed pill (square photo) ---------- */
.tp-rail { position: relative; }
.tp-rail__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  gap: 1rem; padding: .25rem .25rem 1rem; margin: 0; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.tp-rail__track:focus-visible { outline: 3px solid var(--tp-raspberry); outline-offset: 4px; border-radius: var(--tp-r-md); }
.tp-rail__item { scroll-snap-align: start; }
@media (min-width: 992px) { .tp-rail__track { grid-auto-columns: minmax(180px, 1fr); } }
.tp-rail__nav {
  position: absolute; top: 38%; z-index: 4; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--tp-line);
  background: #fff; color: var(--tp-ink); box-shadow: var(--tp-shadow-sm);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .18s var(--tp-ease), color .18s ease;
}
.tp-rail__nav:hover { color: var(--tp-raspberry); transform: translateY(-50%) scale(1.06); }
.tp-rail__nav--prev { left: -8px; } .tp-rail__nav--next { right: -8px; }
.tp-rail__nav[hidden] { display: none; }
@media (max-width: 767px) { .tp-rail__nav { display: none; } }

.tp-breed-pill { display: block; text-align: left; text-decoration: none; }
.tp-breed-pill__photo { display: block; aspect-ratio: 1/1; margin-bottom: .6rem; }
.tp-breed-pill__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--tp-ease); }
.tp-breed-pill:hover .tp-breed-pill__photo img { transform: scale(1.04); }
.tp-breed-pill__name { display: block; font-family: var(--tp-display); font-weight: 800; color: var(--tp-ink); font-size: 1.05rem; letter-spacing: -.02em; }
.tp-breed-pill__count { display: inline-block; margin-top: .1rem; font-size: .8rem; font-weight: 600; color: var(--tp-muted); }

/* ---------- Rating summary ---------- */
.tp-rating { display: inline-flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.tp-rating--center { justify-content: center; }
.tp-rating__num { font-family: var(--tp-display); font-weight: 800; font-size: 2.2rem; line-height: 1; color: var(--tp-ink); letter-spacing: -.02em; }
.tp-rating .tp-stars { font-size: 1rem; color: var(--tp-honey); }
.tp-rating__meta { font-size: .95rem; color: var(--tp-muted); }
.tp-stars { color: var(--tp-honey); letter-spacing: .08em; }

/* ---------- Credentials (simple, no dashed ring) ---------- */
.tp-creds { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .tp-creds { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.tp-cred { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.tp-cred__medallion {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tp-raspberry-soft); color: var(--tp-raspberry); font-size: 1.35rem;
}
.tp-cred__label { font-family: var(--tp-display); font-weight: 800; color: var(--tp-ink); font-size: 1.02rem; letter-spacing: -.01em; }
.tp-cred__detail { font-size: .86rem; color: var(--tp-muted); max-width: 22ch; }
.tp-creds--compact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .8rem; }
.tp-creds--compact .tp-cred__medallion { width: 44px; height: 44px; font-size: 1rem; }

/* ---------- Stat ---------- */
.tp-stat { text-align: center; }
.tp-stat__num { font-family: var(--tp-display); font-weight: 800; font-size: var(--tp-fs-num); line-height: 1; color: var(--tp-ink); letter-spacing: -.02em; }
.tp-stat__label { display: block; margin-top: .3rem; font-size: .9rem; color: var(--tp-muted); font-weight: 600; }

/* ---------- Finance line + panel ---------- */
.tp-finance-line { font-weight: 600; color: var(--tp-muted); }
.tp-finance-line strong { color: var(--tp-ink); }
.tp-finance-disclaimer { display: block; font-size: .72rem; color: var(--tp-muted); margin-top: .25rem; }
.tp-finance-panel { background: var(--tp-cream-2); border: 1px solid var(--tp-line); border-radius: var(--tp-r-md); padding: 1rem 1.2rem; }
.tp-finance-panel .tp-finance-amount { font-family: var(--tp-display); font-weight: 800; font-size: 1.7rem; color: var(--tp-ink); }

/* ---------- Empty state ---------- */
.tp-empty { text-align: center; max-width: 560px; margin-inline: auto; padding: clamp(2rem, 5vw, 3.5rem) 1.4rem; }
.tp-empty__art { width: 84px; height: 84px; margin: 0 auto 1rem; color: var(--tp-raspberry); font-size: 2.6rem; display: inline-flex; align-items: center; justify-content: center; background: var(--tp-raspberry-soft); border-radius: 50%; }
.tp-empty h3 { margin-bottom: .5rem; }

/* ---------- Skeleton ---------- */
.tp-skeleton { position: relative; overflow: hidden; background: var(--tp-line); border-radius: var(--tp-r-md); }
.tp-skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); transform: translateX(-100%); animation: tp-shimmer 1.3s infinite; }
.tp-skel-card { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--tp-line); border-radius: var(--tp-r-lg); overflow: hidden; }
.tp-skel-card__photo { aspect-ratio: 1/1; }
.tp-skel-card__panel { height: 140px; background: var(--tp-cream-2); }
@keyframes tp-shimmer { 100% { transform: translateX(100%); } }

/* ---------- Lightbox ---------- */
.tp-lightbox { position: fixed; inset: 0; z-index: var(--tp-z-lightbox); display: none; align-items: center; justify-content: center; background: rgba(33, 30, 27, .92); padding: clamp(1rem, 4vw, 3rem); }
.tp-lightbox.is-open { display: flex; }
.tp-lightbox__img { max-width: min(1100px, 92vw); max-height: 86vh; border-radius: var(--tp-r-md); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.tp-lightbox__btn { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255,255,255,.16); color: #fff; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; }
.tp-lightbox__btn:hover { background: rgba(255,255,255,.3); }
.tp-lightbox__prev { left: clamp(.5rem, 3vw, 2rem); } .tp-lightbox__next { right: clamp(.5rem, 3vw, 2rem); }
.tp-lightbox__close { top: clamp(.6rem, 3vw, 1.4rem); right: clamp(.6rem, 3vw, 1.4rem); transform: none; }
.tp-lightbox__count { position: absolute; bottom: clamp(.8rem, 3vw, 1.6rem); left: 50%; transform: translateX(-50%); color: #fff; font-size: .9rem; letter-spacing: .04em; }

/* ---------- Sticky mobile CTA ---------- */
.tp-sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--tp-z-sticky-cta);
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px));
  background: rgba(252,251,248,.97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--tp-line); box-shadow: 0 -6px 22px rgba(33,30,27,.08);
  transform: translateY(120%); transition: transform .32s var(--tp-ease-out);
}
.tp-sticky-cta.is-visible { transform: translateY(0); }
.tp-sticky-cta__price { font-family: var(--tp-display); font-weight: 800; color: var(--tp-ink); font-size: 1.1rem; line-height: 1; }
.tp-sticky-cta__price small { display: block; font-family: var(--tp-body); font-size: .68rem; color: var(--tp-muted); font-weight: 600; }
.tp-sticky-cta .btn { flex: 1 1 auto; }
@media (min-width: 992px) { .tp-sticky-cta { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .tp-skeleton::after, .tp-heart.is-pop { animation: none !important; }
  .tp-rail__track { scroll-behavior: auto; }
}
