/* ============================================================================
   PetSeñal — Detalle de aviso · estilos del diseño Inmersivo
   Mecánica (overlay, galería deslizable, botones) + colores por estado.
   Piel "Inmersivo": foto fija al fondo, ficha que sube encima, chips de datos.
   Usa únicamente variables que ya existen en styles.css y respeta
   body.theme-dark. Los nombres empiezan con "pd-" para no chocar con nada.
   ========================================================================== */

/* --- Color por estado: encontrado = verde de la marca, perdido = arcilla --- */
.pd {
  --pd-acc: var(--green);
  --pd-acc-ink: var(--green-ink);
  --pd-acc-soft: var(--green-soft);
  --pd-on: var(--on-accent);
  --pd-glass: rgba(255, 255, 255, 0.84);
  --pd-glass-ink: #1d2a29;
  position: relative;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.pd--lost {
  --pd-acc: #b5462a;
  --pd-acc-ink: #8f3519;
  --pd-acc-soft: #f7e6df;
  --pd-on: #ffffff;
}
body.theme-dark .pd {
  --pd-glass: rgba(16, 42, 46, 0.78);
  --pd-glass-ink: #f1efe8;
}
body.theme-dark .pd--lost {
  --pd-acc: #e68c72;
  --pd-acc-ink: #f3b09d;
  --pd-acc-soft: #3a2521;
  --pd-on: #2b130c;
}

/* --- Reseteo local --- */
.pd *,
.pd *::before,
.pd *::after {
  box-sizing: border-box;
}
:where(.pd) h2,
:where(.pd) h3,
:where(.pd) p,
:where(.pd) dl,
:where(.pd) dt,
:where(.pd) dd,
:where(.pd) ul,
:where(.pd) figure {
  margin: 0;
  padding: 0;
}
:where(.pd) ul {
  list-style: none;
}
:where(.pd) h2,
:where(.pd) h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
:where(.pd) .ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:where(.pd) button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pd button:focus-visible,
.pd .pd-track:focus-visible,
.pd textarea:focus-visible {
  outline: 3px solid var(--pd-acc);
  outline-offset: 2px;
}

/* --- Overlay (solo en la app; en el lienzo no hay #pet-detail) --- */
#pet-detail {
  position: fixed;
  inset: 0;
  z-index: var(--z-ventana, 1200);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: pd-entrar 240ms cubic-bezier(0.2, 0.6, 0.3, 1);
}
#pet-detail.hidden {
  display: none;
}
@keyframes pd-entrar {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Barra superior: dos botones flotantes (volver / compartir) --- */
.pd-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 0;
  pointer-events: none;
}
.pd-btn {
  pointer-events: auto;
}
.pd-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pd-glass);
  color: var(--pd-glass-ink);
  box-shadow: var(--shadow-xs);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.pd-bar-title {
  display: none;
}

/* --- Galería: carrusel horizontal con imán --- */
.pd-gallery {
  position: relative;
  overflow: hidden;
}
.pd-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pd-track::-webkit-scrollbar {
  display: none;
}
.pd-slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  background: var(--paper-2);
}
.pd-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Sin foto: el avatar ilustrado de la app (RAZAS_API.renderAnimalSVG) */
.pd-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--ink-faint);
  background: var(--paper-2);
}
.pd-ph .animal-svg {
  width: 62%;
  max-height: 80%;
  height: auto;
}
.pd-ph .ic {
  width: 72px;
  height: 72px;
  stroke-width: 1.2;
}
.pd-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--pd-acc);
  color: var(--pd-on);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pd-count {
  position: absolute;
  z-index: 2;
  min-height: 28px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--pd-glass);
  color: var(--pd-glass-ink);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pd-dots {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.pd-dots i {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.45;
  transition:
    width 160ms ease,
    opacity 160ms ease;
}
.pd-dots i.is-on {
  width: 18px;
  opacity: 1;
}

/* --- Datos --- */
.pd-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pd-fact dt {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.pd-fact dd {
  font-weight: 600;
}
.pd-collar {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--surface);
}
.pd-sec h3 {
  font-size: 18px;
}
.pd-where-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.pd-where-list strong {
  display: block;
  font-weight: 600;
}
.pd-where-list small {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
}
.pd-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pd-acc-soft);
  color: var(--pd-acc-ink);
}

/* --- Acciones --- */
.pd-cta {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.pd-primary,
.pd-secondary,
.pd-heat,
.pd-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border-radius: var(--r-lg, 20px);
  font-weight: 700;
}
.pd-primary,
.pd-send {
  flex: 1;
  background: var(--pd-acc);
  color: var(--pd-on);
}
.pd-secondary {
  padding: 0 16px;
  border: 1.5px solid var(--pd-acc);
  color: var(--pd-acc-ink);
}
.pd-heat {
  display: none;
  width: 100%;
  border: 1.5px solid var(--pd-acc);
  color: var(--pd-acc-ink);
}
.pd-flag {
  align-self: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: underline;
}
.pd-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-contact label {
  font-weight: 600;
}
.pd-contact textarea {
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md, 14px);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.pd-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 400;
}
.pd-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--pd-acc);
}

/* Extras que solo algunas propuestas muestran */
.pd-kicker,
.pd-thumbs,
.pd-radar {
  display: none;
}

/* Escritorio: columna centrada, el resto de la pantalla queda neutro */
@media (min-width: 900px) {
  #pet-detail {
    background: var(--paper-2);
  }
  #pet-detail > * {
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  #pet-detail {
    animation: none;
  }
  .pd-dots i {
    transition: none;
  }
}
/* ============================================================================
   PROPUESTA C · "Inmersivo"
   Las fotos se ven grandes, con la siguiente asomándose para invitar a
   deslizar. La foto queda fija al fondo y la ficha sube por encima al hacer
   scroll (efecto de hoja). Chips para los datos, botón de acción en píldora.
   (la base común va en este mismo archivo)
   ========================================================================== */
.pd {
  background: var(--paper);
}
.pd-gallery {
  position: sticky;
  top: 0;
  z-index: 0;
  height: clamp(460px, 68dvh, 640px);
  padding: 64px 0 56px;
  background: linear-gradient(180deg, var(--pd-acc-soft), var(--paper));
  overflow: visible;
}
.pd-track {
  gap: 10px;
  padding-inline: 20px;
  scroll-padding-inline: 20px;
}
.pd-slide {
  flex: 0 0 calc(100% - 56px);
  border-radius: 26px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.45);
}
.pd-slide img {
  object-position: center;
}
/* Con una sola foto no hay "siguiente" que asome: se centra y ocupa más. */
.pd-gallery--single .pd-track {
  padding-inline: 24px;
  scroll-padding-inline: 24px;
}
.pd-gallery--single .pd-slide {
  flex-basis: calc(100% - 48px);
}
.pd-badge {
  left: 34px;
  bottom: 84px;
}
.pd-count {
  top: 76px;
  right: 34px;
}
.pd-dots {
  bottom: 54px;
  color: var(--ink);
}

.pd-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: -52px;
  padding: 30px 20px 26px;
  border-radius: 32px 32px 0 0;
  background: var(--card);
  box-shadow: 0 -14px 40px -18px rgba(0, 0, 0, 0.28);
}
.pd-body::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  transform: translateX(-50%);
}
.pd-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pd-time {
  color: var(--pd-acc-ink);
  font-size: 13px;
  font-weight: 600;
}
.pd-nombre {
  font-size: 38px;
  line-height: 1.02;
}
.pd-sub {
  color: var(--ink-soft);
  font-size: 16px;
}

/* Datos como chips que se acomodan solos */
.pd-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pd-fact {
  min-width: 92px;
  padding: 10px 16px 11px;
  border-radius: 18px;
  background: var(--paper-2);
}
.pd-fact dd {
  font-size: 16px;
}

.pd-sec {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-desc p {
  font-size: 16px;
  line-height: 1.62;
}
.pd-where-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: var(--pd-acc-soft);
}
.pd-where-list small {
  color: color-mix(in srgb, var(--pd-acc-ink) 78%, var(--ink-soft));
}
.pd-ico {
  background: var(--card);
}

.pd-cta {
  position: sticky;
  z-index: 5;
  background: var(--card);
  box-shadow: 0 -1px 0 var(--line-soft);
}
.pd-primary {
  min-height: 54px;
  border-radius: var(--r-pill);
  font-size: 16px;
}
.pd-secondary {
  min-height: 54px;
  border-radius: var(--r-pill);
}
