/* ═══════════════════════════════════════════════════════════════
   LoveCats — Adopt Page: Filter Sidebar + Cat Card Grid
   ═══════════════════════════════════════════════════════════════ */

.adopt-page {
  background: var(--c-bg);
  min-height: 100dvh;
  padding-block: 0 var(--s-20);
}

.adopt-page__header {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(var(--s-4), 5vw, var(--s-12));
  margin-bottom: var(--s-10);
  text-align: center;
  position: relative;
  padding-block: var(--s-14) var(--s-10);
}

.adopt-page__header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 65% 55% at 50% -5%,
    color-mix(in srgb, var(--c-primary) 16%, transparent) 0%,
    transparent 72%
  );
  pointer-events: none;
  border-bottom: 1px solid var(--c-border);
}

.adopt-page__header .section-eyebrow,
.adopt-page__header .section-title,
.adopt-page__header .section-desc {
  position: relative;
  z-index: 1;
}

/* Pill eyebrow — same style as sobre/api/guia heroes */
.adopt-page__header .section-eyebrow {
  padding: var(--s-2) var(--s-4);
  background: var(--c-primary-dim);
  border: 1px solid rgba(224, 117, 53, 0.28);
  border-radius: var(--r-full);
  margin-bottom: var(--s-6);
}
.adopt-page__header .section-eyebrow::before { display: none; }

/* Larger title to match guia/sobre/api heroes */
.adopt-page__header .section-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: var(--s-4);
}
.adopt-page__header .section-title em { font-style: italic; color: var(--c-primary); }

/* Layout: sidebar + main */
.adopt-layout {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(var(--s-4), 5vw, var(--s-12));
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--s-8);
  align-items: start;
}

/* ── Filters Sidebar ─────────────────────────────────────── */
.filters-panel {
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
}

.filters-panel__title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--c-text-1);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border);
}

.filter-group { display: flex; flex-direction: column; gap: var(--s-2); }

.filter-group__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
}

.filter-input,
.filter-select {
  width: 100%;
  padding: var(--s-2-5) var(--s-3);
  background: var(--c-surface-high);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-1);
  font-size: var(--text-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  appearance: none;
}
.filter-input::placeholder { color: var(--c-text-3); }
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-dim);
}

.filter-select-wrap { position: relative; }
.filter-select-wrap::after {
  content: "";
  pointer-events: none;
  position: absolute;
  right: var(--s-3);
  top: 50%;
  transform: translateY(-50%);
  width: 0.75rem;
  height: 0.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237a6858' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Toggle checkbox filters */
.filter-toggles { display: flex; flex-direction: column; gap: var(--s-2); }

.filter-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-2-5);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--c-text-2);
  user-select: none;
}
.filter-toggle input[type="checkbox"] { display: none; }

.filter-toggle__box {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.filter-toggle input:checked + .filter-toggle__box {
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.filter-toggle input:checked + .filter-toggle__box::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 5l2.5 2.5L8 2.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.filters-panel__reset {
  width: 100%;
  padding: var(--s-2-5) var(--s-3);
  background: transparent;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  color: var(--c-text-2);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.filters-panel__reset:hover {
  background: var(--c-surface-high);
  color: var(--c-text-1);
}

/* ── Cats Grid ───────────────────────────────────────────── */
.cats-area { display: flex; flex-direction: column; gap: var(--s-5); }

.cats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.cats-count {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  color: var(--c-text-2);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  padding: var(--s-1-5) var(--s-4);
  border-radius: var(--r-full);
}
.cats-count strong {
  color: var(--c-primary);
  font-size: var(--text-base);
  font-weight: 800;
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-5);
}

/* ── Cat Card ────────────────────────────────────────────── */
.cat-card {
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-base), box-shadow var(--dur-base),
              border-color var(--dur-base);
  position: relative;
}
.cat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--c-primary);
}

/* Adopted overlay */
.cat-card.is-adopted::after {
  content: "Adotado \2665";
  position: absolute;
  inset: 0;
  background: rgba(15, 13, 11, 0.72);
  display: grid;
  place-items: center;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--c-primary);
  backdrop-filter: blur(4px);
  border-radius: inherit;
  pointer-events: none;
}

.cat-card__img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.cat-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.cat-card:hover .cat-card__img-wrap img { transform: scale(1.06); }

.cat-card__badges {
  position: absolute;
  top: var(--s-2-5);
  left: var(--s-2-5);
  display: flex;
  gap: var(--s-1-5);
  flex-wrap: wrap;
}

.cat-card__body {
  padding: var(--s-5) var(--s-5) var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-2-5);
  flex: 1;
}

.cat-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-text-1);
  line-height: 1.1;
}

.cat-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1-5);
}

.cat-card__meta-item {
  font-size: var(--text-xs);
  color: var(--c-text-2);
  background: var(--c-surface-high);
  border-radius: var(--r-full);
  padding: 0.2em 0.65em;
}

.cat-card__location {
  font-size: var(--text-xs);
  color: var(--c-text-3);
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.cat-card__location svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-contact {
  margin-top: auto;
  padding-top: var(--s-3);
  width: 100%;
  display: flex;
  gap: var(--s-2);
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--s-20) var(--s-8);
  color: var(--c-text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
}
.empty-state svg {
  width: 3.5rem;
  height: 3.5rem;
  stroke: var(--c-text-3);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
}
.empty-state__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-text-2);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .adopt-layout { grid-template-columns: 1fr; }
  .filters-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--s-4);
    align-items: start;
  }
  .filters-panel__title,
  .filters-panel__reset { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .cats-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   Cat Detail Modal
   ═══════════════════════════════════════════════════════════════ */
.cat-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: var(--s-4); }
.cat-modal[hidden] { display: none; }

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2xl);
  width: 100%;
  max-width: 780px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-in 240ms var(--ease-out) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: var(--c-surface-high);
  color: var(--c-text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 10;
  transition: border-color 150ms, color 150ms;
}
.modal__close:hover { border-color: var(--c-primary); color: var(--c-primary); }
.modal__close svg { width: 16px; height: 16px; }

.modal__body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
}

.modal__photo {
  position: relative;
  border-radius: var(--r-2xl) 0 0 var(--r-2xl);
  overflow: hidden;
  min-height: 260px;
}

.modal__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal__badges {
  position: absolute;
  bottom: var(--s-3);
  left: var(--s-3);
  display: flex;
  gap: var(--s-1-5);
  flex-wrap: wrap;
}

.modal__content {
  padding: var(--s-8) var(--s-7) var(--s-7);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.modal__name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-text-1);
  padding-right: var(--s-10);
}

.modal__info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.modal__info-table th,
.modal__info-table td {
  padding: var(--s-1-5) var(--s-2);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.modal__info-table th {
  color: var(--c-text-3);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  width: 38%;
}
.modal__info-table td { color: var(--c-text-1); font-weight: 500; }

.modal__desc-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-primary);
  margin-bottom: calc(var(--s-1) * -1);
}

.modal__description {
  font-size: var(--text-sm);
  color: var(--c-text-2);
  line-height: 1.75;
}

.modal__adopt-btn {
  align-self: flex-start;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

@media (max-width: 580px) {
  .modal__body { grid-template-columns: 1fr; }
  .modal__photo { min-height: 200px; border-radius: var(--r-2xl) var(--r-2xl) 0 0; }
  .modal__content { padding: var(--s-5) var(--s-5) var(--s-6); }
}

/* ── Modal Secondary Actions Row ───────────────────────────── */
.modal__secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}

/* ── Informações Importantes link (pill) ────────────────────── */
.modal__safety-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: hsl(38 90% 55%);
  padding: var(--s-2) var(--s-3);
  border: 1px solid hsl(38 90% 55% / 0.4);
  border-radius: var(--r-full);
  align-self: flex-start;
  transition: background 150ms, border-color 150ms;
}
.modal__safety-btn:hover,
.modal__safety-btn:focus-visible {
  background: hsl(38 90% 55% / 0.09);
  border-color: hsl(38 90% 55% / 0.7);
  outline: none;
}
.modal__safety-btn svg { flex-shrink: 0; }

/* ── Ver Documentação button (pill) ────────────────────────── */
.modal__docs-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: hsl(200 75% 62%);
  padding: var(--s-2) var(--s-3);
  border: 1px solid hsl(200 75% 50% / 0.4);
  border-radius: var(--r-full);
  transition: background 150ms, border-color 150ms;
}
.modal__docs-btn:hover,
.modal__docs-btn:focus-visible {
  background: hsl(200 75% 50% / 0.09);
  border-color: hsl(200 75% 50% / 0.7);
  outline: none;
}
.modal__docs-btn svg { flex-shrink: 0; }
.modal__docs-btn[hidden] { display: none !important; }

.modal__safety-panel {
  border: 1px solid hsl(38 90% 55% / 0.32);
  background: hsl(38 90% 55% / 0.06);
  border-radius: var(--r-lg);
  padding: var(--s-4);
}
.modal__safety-panel[hidden] { display: none !important; }

.modal__safety-panel__title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(38 90% 55%);
  margin-bottom: var(--s-3);
}

.modal__safety-panel ul {
  padding-left: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
}

.modal__safety-panel li {
  font-size: var(--text-sm);
  color: var(--c-text-2);
  line-height: 1.65;
}

.modal__safety-link {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: hsl(38 90% 55%);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Donor chip on cat cards ───────────────────────────────── */
.cat-card__donor-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-full);
  margin-bottom: var(--s-2);
}
.cat-card__donor-chip--resgate {
  background: hsl(220 12% 50% / 0.15);
  color: hsl(220 12% 68%);
  border: 1px solid hsl(220 12% 50% / 0.25);
}
.cat-card__donor-chip--protetor {
  background: hsl(200 75% 50% / 0.13);
  color: hsl(200 75% 62%);
  border: 1px solid hsl(200 75% 50% / 0.25);
}
.cat-card__donor-chip--ong {
  background: hsl(265 65% 58% / 0.13);
  color: hsl(265 65% 70%);
  border: 1px solid hsl(265 65% 58% / 0.25);
}

/* ── Modal docs section ───────────────────────────────────── */
.modal__docs[hidden] { display: none !important; }

.modal__docs {
  border: 1px solid color-mix(in srgb, var(--c-primary) 30%, transparent);
  background: color-mix(in srgb, var(--c-primary) 5%, var(--c-surface));
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.modal__docs-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-primary);
}

.modal__docs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.modal__doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--c-text-2);
  background: var(--c-border);
  border-radius: var(--r-full);
  padding: 3px 10px;
}

.modal__docs-hint {
  font-size: var(--text-xs);
  color: var(--c-text-3);
  font-style: italic;
}

/* ONG button variant — same style as adopt-btn */
.modal__ong-btn[hidden] { display: none !important; }
.modal__adopt-btn[hidden] { display: none !important; }
