/* ── AdoptaPet · Public CSS ─────────────────────────────────
   Light, clean, modern. Totalmente autónomo.
   ──────────────────────────────────────────────────────────── */

:root {
  /* ── Color ─────────────────────────────────────────────── */
  /*--ap-accent:        #f97316;
  --ap-accent-h:      #ea6800;
  --ap-accent-50:     #fff7ed;
  --ap-accent-100:    #ffedd5;
  --ap-accent-grad:   linear-gradient(135deg, #fb923c 0%, #f97316 60%, #ea6800 100%);
  --ap-accent-ring:   rgba(249, 115, 22, .22);

  --ap-bg:            #ffffff;
  --ap-surface:       #f7f8fa;
  --ap-surface-2:     #f3f4f6;
  --ap-border:        #e6e8ec;
  --ap-border-strong: #d1d5db;
  --ap-text:          #0f172a;
  --ap-text-muted:    #6b7280;

  --ap-ok:            #16a34a;
  --ap-ok-bg:         #dcfce7;
  --ap-warn:          #b45309;
  --ap-warn-bg:       #fef3c7;
  --ap-err:           #dc2626;
  --ap-err-bg:        #fee2e2;*/

  /* ── Glass / overlays ─────────────────────────────────── */
  --ap-glass:         rgba(255, 255, 255, .72);
  --ap-glass-strong:  rgba(255, 255, 255, .82);
  --ap-glass-border:  rgba(255, 255, 255, .6);
  --ap-overlay:       rgba(15, 23, 42, .48);

  /* ── Radius ───────────────────────────────────────────── */
  --ap-radius-sm:     8px;
  --ap-radius:        12px;
  --ap-radius-md:     14px;
  --ap-radius-lg:     18px;
  --ap-radius-xl:     22px;

  /* ── Shadows (soft, layered) ──────────────────────────── */
  --ap-shadow-xs:     0 1px 2px rgba(15,23,42,.05);
  --ap-shadow-sm:     0 1px 2px rgba(15,23,42,.04), 0 2px 6px rgba(15,23,42,.04);
  --ap-shadow:        0 2px 4px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --ap-shadow-md:     0 4px 8px rgba(15,23,42,.05), 0 12px 32px rgba(15,23,42,.08);
  --ap-shadow-lg:     0 8px 16px rgba(15,23,42,.06), 0 24px 48px rgba(15,23,42,.12);
  --ap-shadow-h:      var(--ap-shadow-md);
  --ap-shadow-ring:   0 0 0 4px var(--ap-accent-ring);
  --ap-shadow-glow:   0 8px 24px rgba(249,115,22,.28);

  /* ── Motion ───────────────────────────────────────────── */
  --ap-ease:          cubic-bezier(.4, 0, .2, 1);
  --ap-ease-out:      cubic-bezier(.22, 1, .36, 1);
  --ap-trans:         .18s var(--ap-ease);
  --ap-trans-slow:    .28s var(--ap-ease);
}

/* ── Reset mínimo ──────────────────────────────────────────── */
.ap-grid-wrapper *, .ap-widget-wrapper *, .ap-modal * {
  box-sizing: border-box;
}

/* ── Loading ───────────────────────────────────────────────── */
.ap-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px;
  color: var(--ap-text-muted);
  font-size: 14px;
  justify-content: center;
}
.ap-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--ap-border);
  border-top-color: var(--ap-accent);
  border-radius: 50%;
  animation: ap-spin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* ── Layout (filtros arriba, lista abajo) ──────────────────── */
.ap-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ap-sidebar {
  width: 100%;
  background: var(--ap-glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-md);
  padding: 14px 18px;
  box-shadow: var(--ap-shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 12px;
  z-index: 50;
}
/* Sombra reforzada cuando entra en modo "stuck" */
.ap-sidebar { transition: box-shadow var(--ap-trans), border-color var(--ap-trans); }
.ap-sidebar-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ap-text-muted);
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
}
.ap-main {
  width: 100%;
  min-width: 0;
}

/* ── Filtros (en barra horizontal) ─────────────────────────── */
.ap-filtros {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  align-items: center;
}
.ap-sidebar .ap-search {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.ap-sidebar .ap-filtro-select {
  width: auto;
  min-width: 160px;
}

@media (max-width: 560px) {
  .ap-sidebar { padding: 12px 14px; }
  .ap-sidebar-heading { width: 100%; }
  .ap-sidebar .ap-search,
  .ap-sidebar .ap-filtro-select { width: 100%; max-width: none; flex: 1 1 100%; }
}
.ap-filtro-btn {
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--ap-border);
  background: var(--ap-bg);
  color: var(--ap-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--ap-trans);
  font-family: inherit;
  line-height: 1;
}
.ap-filtro-btn:hover {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
  background: var(--ap-accent-50);
}
.ap-filtro-btn.active {
  border-color: transparent;
  background: var(--ap-accent-grad);
  color: #fff;
  box-shadow: var(--ap-shadow-glow);
}
.ap-filtro-select {
  padding: 8px 12px;
  border-radius: var(--ap-radius-sm);
  border: 1.5px solid var(--ap-border);
  background: var(--ap-bg);
  color: var(--ap-text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color var(--ap-trans), box-shadow var(--ap-trans);
}
.ap-filtro-select:focus { border-color: var(--ap-accent); box-shadow: var(--ap-shadow-ring); }

.ap-search {
  padding: 8px 14px;
  border-radius: var(--ap-radius-sm);
  border: 1.5px solid var(--ap-border);
  background: var(--ap-bg);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  flex: 1;
  max-width: 260px;
  min-width: 160px;
  transition: border-color var(--ap-trans), box-shadow var(--ap-trans);
}
.ap-search:focus { border-color: var(--ap-accent); box-shadow: var(--ap-shadow-ring); }

/* ── Grid ──────────────────────────────────────────────────── */
.ap-grid {
  display: grid;
  grid-template-columns: repeat(var(--ap-cols, 3), 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .ap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ap-grid { grid-template-columns: 1fr; } }

/* ── Tarjeta ───────────────────────────────────────────────── */
.ap-card {
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-md);
  overflow: hidden;
  box-shadow: var(--ap-shadow-sm);
  transition: box-shadow var(--ap-trans), transform var(--ap-trans), border-color var(--ap-trans);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.ap-card:hover {
  box-shadow: var(--ap-shadow-md);
  border-color: var(--ap-border-strong);
  transform: translateY(-3px);
}

/* ── Card horizontal (foto izq + info der) en desktop ──────
   En viewport ≥ 700px, las cards de la vista grid pasan a
   layout 2-columnas. La foto llena toda la columna izquierda
   (alto completo) usando object-fit: cover. El recorte se
   ajusta vía object-position desde el punto focal guardado. ── */
@media (min-width: 700px) {
  .ap-grid .ap-card {
    display: grid;
    grid-template-columns: 42% 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
      "img body"
      "img footer";
    min-height: 280px;
  }
  .ap-grid .ap-card-img {
    grid-area: img;
    aspect-ratio: auto;
    align-self: stretch;
    height: auto;
    min-height: 100%;
    position: relative;
  }
  .ap-grid .ap-card-img > img,
  .ap-grid .ap-card-img > .ap-card-img-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .ap-grid .ap-card-body   { grid-area: body; }
  .ap-grid .ap-card-footer { grid-area: footer; }
}

.ap-card-img {
  aspect-ratio: auto;
  overflow: hidden;
  background: var(--ap-surface);
  position: relative;
  display: block;
}
.ap-card-img img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform .4s ease;
}
.ap-card:hover .ap-card-img img { transform: scale(1.04); }

.ap-card-img-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ap-border);
  font-size: 48px;
}

.ap-card-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--ap-accent-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: var(--ap-shadow-sm), 0 4px 12px rgba(249,115,22,.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.ap-badge-adoptado  { background: #6b7280;          box-shadow: var(--ap-shadow-sm); }
.ap-badge-proceso   { background: var(--ap-warn);   box-shadow: var(--ap-shadow-sm), 0 4px 12px rgba(180,83,9,.28); }
.ap-badge-reservado { background: #7c3aed;          box-shadow: var(--ap-shadow-sm), 0 4px 12px rgba(124,58,237,.28); }
.ap-badge-acogida   { background: #0891b2;          box-shadow: var(--ap-shadow-sm), 0 4px 12px rgba(8,145,178,.28); }

.ap-card-destacado {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--ap-glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border: 1px solid var(--ap-glass-border);
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: var(--ap-shadow-sm);
}

.ap-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ap-card-nombre {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ap-text);
  line-height: 1.2;
  margin: 0;
}
.ap-card-nombre a {
  color: inherit;
  text-decoration: none;
}
.ap-card-nombre a:hover { color: var(--ap-accent); }

.ap-card-ref {
  font-size: 11px;
  color: var(--ap-text-muted);
  font-family: monospace;
  white-space: nowrap;
}

.ap-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ap-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ap-text-muted);
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: 6px;
  padding: 3px 8px;
  line-height: 1;
}
.ap-chip-icon { font-size: 11px; }

.ap-card-desc {
  font-size: 1.2rem;
  color: var(--ap-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-card-sanidad {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ap-sanidad-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: var(--ap-ok-bg);
  color: var(--ap-ok);
}

.ap-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--ap-border);
  display: flex;
  gap: 8px;
}

.ap-btn-primary, .ap-btn-secondary {
  flex: 1;
  padding: 1rem!important;
  border-radius: var(--ap-radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--ap-trans), box-shadow var(--ap-trans), background var(--ap-trans), border-color var(--ap-trans), filter var(--ap-trans);
  border: 1.5px solid;
  text-align: center;
  line-height: 1;
}
.ap-btn-primary {
  background: var(--ap-accent-grad);
  border-color: transparent;
  color: #fff;
  /*box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, var(--ap-shadow-glow);*/
}
.ap-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); /*box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 12px 28px rgba(249,115,22,.35);*/ }
.ap-btn-primary:active { transform: translateY(0); filter: brightness(.98); }
.ap-btn-secondary {
  background: transparent;
  border-color: var(--ap-border);
  color: var(--ap-text);
}
.ap-btn-secondary:hover { border-color: var(--ap-accent); color: var(--ap-accent); background: var(--ap-accent-50); }

/* ── Vista Lista ───────────────────────────────────────────── */
.ap-lista {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ap-lista .ap-card {
  flex-direction: row;
}
.ap-lista .ap-card-img {
  width: 160px;
  min-width: 160px;
  aspect-ratio: unset;
}
@media (max-width: 560px) {
  .ap-lista .ap-card { flex-direction: column; }
  .ap-lista .ap-card-img { width: 100%; aspect-ratio: 16/9; }
}

/* ── Vista Carousel ────────────────────────────────────────── */
.ap-carousel-wrapper {
  position: relative;
  overflow: hidden;
}
.ap-carousel-track {
  display: flex;
  gap: 20px;
  transition: transform .35s ease;
}
.ap-carousel-track .ap-card {
  min-width: 280px;
  flex-shrink: 0;
}
.ap-carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: var(--ap-glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid var(--ap-glass-border);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--ap-shadow);
  z-index: 10;
  font-size: 16px;
  color: var(--ap-text);
  transition: all var(--ap-trans);
}
.ap-carousel-btn:hover { border-color: var(--ap-accent); color: var(--ap-accent); transform: translateY(-50%) scale(1.06); box-shadow: var(--ap-shadow-md); }
.ap-carousel-btn.prev { left: 0; }
.ap-carousel-btn.next { right: 0; }

/* ── Vista Mapa/Compacta ───────────────────────────────────── */
.ap-mapa {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.ap-card-compact {
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all var(--ap-trans);
  box-shadow: var(--ap-shadow-sm);
}
.ap-card-compact:hover { box-shadow: var(--ap-shadow-md); transform: translateY(-2px); border-color: var(--ap-border-strong); }
.ap-card-compact-img {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ap-surface);
}
.ap-card-compact-info { min-width: 0; }
.ap-card-compact-nombre {
  font-size: 14px; font-weight: 700;
  color: var(--ap-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-card-compact-sub {
  font-size: 12px;
  color: var(--ap-text-muted);
  margin-top: 2px;
}

/* ── Modal ─────────────────────────────────────────────────── */
.ap-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--ap-overlay);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: ap-fade-in .2s var(--ap-ease-out);
}
@keyframes ap-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ap-modal {
  background: #fff;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--ap-shadow-lg), 0 32px 80px rgba(15,23,42,.18);
  animation: ap-slide-up .26s var(--ap-ease-out);
}
@keyframes ap-slide-up { from { transform: translateY(20px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.ap-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 24px 16px;
  position: relative;
}
.ap-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--ap-glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border: 1px solid var(--ap-glass-border);
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--ap-text-muted);
  box-shadow: var(--ap-shadow-sm);
  transition: all var(--ap-trans);
  z-index: 2;
}
.ap-modal-close:hover { background: var(--ap-err-bg); color: var(--ap-err); border-color: var(--ap-err); }

.ap-modal-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
}
.ap-modal-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.ap-modal-body { padding: 0 24px 24px; }

/* ── Estado destacado en el modal ─────────────────────────── */
.ap-modal-estado {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  border-radius: 100px;
  background: var(--ap-accent-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: var(--ap-shadow-sm), 0 6px 16px rgba(249,115,22,.32);
  margin-bottom: 14px;
  line-height: 1;
}
.ap-modal-estado-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.18));
  animation: ap-heartbeat 1.5s var(--ap-ease) infinite;
}
.ap-modal-estado.ap-badge-adoptado {
  background: #6b7280;
  box-shadow: var(--ap-shadow-sm);
}
.ap-modal-estado.ap-badge-adoptado .ap-modal-estado-icon { animation: none; }
.ap-modal-estado.ap-badge-proceso {
  background: var(--ap-warn);
  box-shadow: var(--ap-shadow-sm), 0 6px 16px rgba(180,83,9,.32);
}
.ap-modal-estado.ap-badge-reservado {
  background: #7c3aed;
  box-shadow: var(--ap-shadow-sm), 0 6px 16px rgba(124,58,237,.32);
}
.ap-modal-estado.ap-badge-acogida {
  background: #0891b2;
  box-shadow: var(--ap-shadow-sm), 0 6px 16px rgba(8,145,178,.32);
}

@keyframes ap-heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.22); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.18); }
  56%      { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ap-modal-estado-icon { animation: none; }
}

.ap-modal-nombre {
  font-size: 26px;
  font-weight: 800;
  color: var(--ap-text);
  margin: 0 0 4px;
}
.ap-modal-sub {
  font-size: 13px;
  color: var(--ap-text-muted);
  margin-bottom: 16px;
}
.ap-modal-section { margin-bottom: 20px; }
.ap-modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ap-text-muted);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ap-border);
}
.ap-modal-historia {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ap-text);
}
.ap-modal-contacto {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--ap-surface);
  border-radius: 10px;
  border: 1px solid var(--ap-border);
  font-size: 14px;
  color: var(--ap-text);
}

.ap-modal-galeria {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.ap-modal-galeria img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity var(--ap-trans);
}
.ap-modal-galeria img:hover { opacity: .85; }

/* ── Scrollbar custom (Firefox + WebKit) ────────────────────
   Aplica al modal y a su body cuando son scrollables. En
   desktop el body siempre muestra la barra para que el usuario
   sepa que puede hacer scroll dentro del popup. ── */
.ap-modal,
.ap-modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--ap-muted) var(--ap-surface-2);
}
.ap-modal::-webkit-scrollbar,
.ap-modal-body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.ap-modal::-webkit-scrollbar-track,
.ap-modal-body::-webkit-scrollbar-track {
  background: var(--ap-surface-2);
  border-radius: 100px;
  margin: 12px 0;
}
.ap-modal::-webkit-scrollbar-thumb,
.ap-modal-body::-webkit-scrollbar-thumb {
  background: var(--ap-muted);
  border-radius: 100px;
  border: 3px solid var(--ap-surface-2);
  background-clip: content-box;
  min-height: 40px;
  transition: background var(--ap-trans);
}
.ap-modal::-webkit-scrollbar-thumb:hover,
.ap-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--ap-accent);
  background-clip: content-box;
}

/* Desktop: scrollbar siempre visible en el body para feedback */
@media (min-width: 760px) {
  .ap-modal:has(.ap-modal-img-wrap) .ap-modal-body {
    overflow-y: scroll;
  }
}

/* ── Lightbox / visor de galería ────────────────────────────
   Click en una thumbnail abre la imagen a tamaño completo
   con flechas, contador y soporte de teclado/swipe. ── */
.ap-modal-galeria img { cursor: zoom-in; }

.ap-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: ap-fade-in .2s var(--ap-ease-out);
}
.ap-lightbox-overlay.ap-lightbox-closing {
  animation: ap-fade-out .15s var(--ap-ease) forwards;
}
@keyframes ap-fade-out { to { opacity: 0; } }

.ap-lightbox-stage {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--ap-radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  user-select: none;
  -webkit-user-drag: none;
  animation: ap-lightbox-pop .25s var(--ap-ease-out);
}
@keyframes ap-lightbox-pop {
  from { transform: scale(.96); opacity: 0; }
  to   { transform: none;       opacity: 1; }
}

.ap-lightbox-close,
.ap-lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: all var(--ap-trans);
}
.ap-lightbox-close:hover,
.ap-lightbox-nav:hover {
  background: rgba(255, 255, 255, .28);
  border-color: rgba(255, 255, 255, .35);
}

.ap-lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 20px;
}
.ap-lightbox-close:hover { transform: scale(1.06); }

.ap-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 32px;
  z-index: 2;
}
.ap-lightbox-nav.prev { left: 20px; }
.ap-lightbox-nav.next { right: 20px; }
.ap-lightbox-nav:hover { transform: translateY(-50%) scale(1.08); }

.ap-lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .15);
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .ap-lightbox-overlay { padding: 12px; }
  .ap-lightbox-nav { width: 44px; height: 44px; font-size: 24px; }
  .ap-lightbox-nav.prev { left: 8px; }
  .ap-lightbox-nav.next { right: 8px; }
  .ap-lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 18px; }
  .ap-lightbox-counter { bottom: 14px; }
}

/* ── Modal 2-columnas en desktop ────────────────────────────
   Foto a la izquierda (alto completo) + body a la derecha
   (scrollable). Si la mascota no tiene foto, body ocupa todo. ── */
@media (min-width: 760px) {
  .ap-modal:has(.ap-modal-img-wrap) {
    max-width: 960px;
    display: grid;
    grid-template-columns: 44% 1fr;
    grid-template-rows: 1fr;
    overflow: hidden;
    height: min(90vh, 720px);
    max-height: min(90vh, 720px);
  }
  .ap-modal:has(.ap-modal-img-wrap) .ap-modal-img-wrap {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    max-height: 100%;
    align-self: stretch;
    position: relative;
  }
  .ap-modal:has(.ap-modal-img-wrap) .ap-modal-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .ap-modal:has(.ap-modal-img-wrap) .ap-modal-body {
    padding: 28px 28px 24px;
    overflow-y: auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }
  /* Close button: re-anclar dentro del body (col derecha) */
  .ap-modal:has(.ap-modal-img-wrap) .ap-modal-close {
    top: 14px;
    right: 14px;
  }
}

/* ── Empty state ───────────────────────────────────────────── */
.ap-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ap-text-muted);
}
.ap-empty-icon { font-size: 48px; margin-bottom: 12px; display: block; }
.ap-empty strong { display: block; font-size: 16px; color: var(--ap-text); margin-bottom: 6px; }

/* ── Panel preview para Elementor ─────────────────────────── */
.ap-widget-preview {
  border: 2px dashed var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 40px;
  text-align: center;
  color: var(--ap-text-muted);
  background: var(--ap-surface);
}
