:root {
  --pet-blue: #0675a9;
  --pet-aqua: #6dd5ed;
  --pet-ink: #183447;
  --pet-muted: #587080;
  --pet-cream: #f8f3eb;
  --pet-paper: #fffdfa;
  --pet-coral: #ff705d;
  --pet-red: #d32f2f;
  --pet-green: #16834a;
  --pet-line: rgba(24, 52, 71, 0.14);
  --pet-shadow-sm: 0 6px 18px rgba(24, 52, 71, 0.09);
  --pet-shadow-lg: 0 18px 50px rgba(24, 52, 71, 0.16);
}

html {
  scroll-behavior: smooth;
  background: var(--pet-cream);
}

body.home-pet-shell {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--pet-ink);
  background: var(--pet-cream);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body.home-pet-shell::selection {
  color: #fff;
  background: var(--pet-blue);
}

body.home-pet-shell a,
body.home-pet-shell button,
body.home-pet-shell input {
  -webkit-tap-highlight-color: transparent;
}

body.home-pet-shell button,
body.home-pet-shell input {
  font: inherit;
}

body.home-pet-shell :focus-visible {
  outline: 3px solid rgba(0, 139, 207, 0.48);
  outline-offset: 3px;
}

.pet-topbar {
  position: relative;
  z-index: 2100;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(76px, 7vw, 116px);
  color: var(--pet-ink);
  background: rgba(255, 253, 250, 0.97);
  box-shadow: 0 1px 0 var(--pet-line);
}

.pet-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--pet-blue);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.pet-brand:hover {
  color: #006fa6;
}

.pet-brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--pet-blue);
  border-radius: 12px 12px 12px 4px;
}

.pet-brand-tagline {
  margin: 0;
  color: var(--pet-muted);
  font-size: 0.88rem;
}

.pet-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pet-top-actions a {
  color: var(--pet-ink);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
}

.pet-top-actions a:hover {
  background: #edf8fc;
  color: #006fa6;
}

.home-pet-shell > .menu-toggle,
.home-pet-shell > .nav-drawer,
.home-pet-shell > .nav-overlay {
  display: none !important;
}

.pet-header-language {
  margin-left: auto;
}

.pet-header-language .home-lang-switch {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pet-header-language .home-lang-select {
  width: auto;
  min-width: 116px;
  min-height: 44px;
  border-color: var(--pet-line);
  border-radius: 12px;
  color: var(--pet-ink);
  background-color: #fff;
  box-shadow: none;
}

.pet-header-language + .pet-top-actions {
  margin-left: 0;
}

.home-pet-shell .menu-toggle {
  top: 14px;
  left: 18px;
  z-index: 4300;
  color: var(--pet-ink);
  background: #fff;
  border: 1px solid var(--pet-line);
  box-shadow: var(--pet-shadow-sm);
}

.pet-home-main {
  width: min(100%, 1600px);
  margin: 0 auto;
}

.pet-hero {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  isolation: isolate;
}

.pet-hero picture,
.pet-hero-photo,
.pet-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pet-hero picture {
  display: block;
  z-index: -2;
}

.pet-hero-photo {
  object-fit: cover;
  object-position: center;
}

.pet-hero-shade {
  z-index: -1;
  background: linear-gradient(90deg, rgba(16, 38, 54, 0.08), rgba(255, 250, 242, 0.08) 35%, rgba(255, 250, 242, 0.1) 65%, rgba(16, 38, 54, 0.08));
}

.pet-hero-content {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 28px 20px 34px;
}

.pet-hero h1 {
  max-width: 660px;
  margin: 0;
  color: #102e45;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 3.2vw, 3.55rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 2px 20px rgba(255, 253, 250, 0.92);
}

.pet-search {
  width: min(780px, calc(100% - 32px));
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr 58px;
  align-items: center;
  gap: 0;
  padding: 7px 8px 7px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--pet-shadow-lg);
}

.pet-search-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 2px 16px 2px 4px;
  cursor: text;
}

.pet-search-field > i {
  grid-row: 1 / 3;
  color: var(--pet-blue);
  font-size: 1.1rem;
}

.pet-search-field > span {
  color: var(--pet-ink);
  font-size: 0.79rem;
  font-weight: 760;
  line-height: 1.1;
}

.pet-search-field input {
  min-width: 0;
  padding: 4px 0 0;
  color: var(--pet-ink);
  font-size: 0.92rem;
  background: transparent;
  border: 0;
  outline: 0;
}

.pet-search-field input::placeholder {
  color: #5d707b;
  opacity: 1;
}

.pet-search-divider {
  width: 1px;
  height: 38px;
  background: var(--pet-line);
}

.pet-search-submit {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--pet-red);
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(211, 47, 47, 0.25);
  transition: transform 180ms ease-out, background 180ms ease-out;
}

.pet-search-submit:hover {
  background: #b92323;
  transform: translateY(-1px);
}

.pet-category-wrap {
  position: relative;
  z-index: 4;
  width: min(1240px, calc(100% - 48px));
  margin: -16px auto 0;
}

.pet-category-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(108px, 1fr)) minmax(148px, 1.18fr);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: rgba(255, 253, 250, 0.98);
  border-radius: 16px;
  box-shadow: var(--pet-shadow-sm);
  scrollbar-width: thin;
}

.pet-category {
  min-width: 108px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 8px;
  color: var(--pet-ink);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--pet-line);
  cursor: pointer;
  transition: color 180ms ease-out, background 180ms ease-out;
}

.pet-category i {
  color: var(--pet-blue);
  font-size: 1.35rem;
}

.pet-category span {
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.15;
  text-align: center;
}

.pet-category:hover,
.pet-category.is-active {
  color: #006fa6;
  background: #edf8fc;
}

.pet-category.is-active {
  box-shadow: inset 0 -3px 0 var(--pet-blue);
}

.pet-category-urgent {
  margin: 8px;
  min-height: 68px;
  color: #fff;
  background: var(--pet-red);
  border: 0;
  border-radius: 14px;
}

.pet-category-urgent i,
.pet-category-urgent:hover,
.pet-category-urgent.is-active {
  color: #fff;
}

.pet-category-urgent:hover,
.pet-category-urgent.is-active {
  background: #b92323;
  box-shadow: none;
}

.pet-lost-strip,
.pet-claim {
  width: min(1420px, calc(100% - 48px));
  margin-inline: auto;
}

.pet-lost-strip {
  margin-top: 22px;
  min-height: 70px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  color: #9d2525;
  background: #fde9e5;
  border-radius: 14px;
}

.pet-lost-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--pet-coral);
  border-radius: 13px;
}

.pet-lost-strip h2,
.pet-lost-strip p {
  margin: 0;
}

.pet-lost-strip h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.pet-lost-strip p {
  color: #8f3a33;
  font-size: 0.9rem;
}

.pet-lost-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #a12323;
  font-weight: 760;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
}

.pet-lost-action:hover {
  color: #771717;
  background: rgba(255, 255, 255, 0.5);
}

.pet-results {
  width: min(1420px, calc(100% - 48px));
  margin: 18px auto 0;
}

.pet-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pet-filter {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  color: var(--pet-ink);
  background: var(--pet-paper);
  border: 1px solid rgba(24, 52, 71, 0.2);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 680;
}

.pet-filter:hover,
.pet-filter.is-active {
  color: #006fa6;
  background: #e8f7fc;
  border-color: rgba(0, 139, 207, 0.48);
}

.pet-results-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 24px 0 12px;
}

.pet-results-head h2,
.pet-results-head p {
  margin: 0;
}

.pet-results-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--pet-ink);
  font-size: clamp(1.7rem, 2.5vw, 2.4rem);
  font-weight: 830;
  letter-spacing: -0.03em;
}

.pet-results-head h2 i {
  color: var(--pet-blue);
  font-size: 0.82em;
}

.pet-results-head p {
  color: var(--pet-muted);
  font-size: 0.9rem;
}

.pet-reset {
  padding: 8px 12px;
  color: #006fa6;
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.pet-results-status {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: var(--pet-muted);
}

.pet-results-status[hidden] {
  display: none;
}

.pet-status-pulse {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 139, 207, 0.22);
  border-top-color: var(--pet-blue);
  border-radius: 50%;
  animation: petSpin 800ms linear infinite;
}

@keyframes petSpin {
  to { transform: rotate(360deg); }
}

.pet-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(300px, auto);
  gap: 14px;
}

.pet-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 170px 1fr;
  color: var(--pet-ink);
  background: var(--pet-paper);
  border-radius: 14px;
  box-shadow: var(--pet-shadow-sm);
}

.pet-card:first-child {
  grid-row: auto;
  grid-template-rows: 170px 1fr;
}

.pet-card-media {
  position: relative;
  overflow: hidden;
  background: #dceff5;
}

.pet-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(.16, 1, .3, 1);
}

.pet-card:hover .pet-card-media img {
  transform: scale(1.025);
}

.pet-card-media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #e5f3f7;
}

.pet-card-media-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.88) contrast(0.96);
}

.pet-card-distance {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 9px;
  color: var(--pet-ink);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 760;
  box-shadow: 0 4px 12px rgba(24, 52, 71, 0.12);
}

.pet-card-body {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px 14px 14px;
}

.pet-card-copy {
  min-width: 0;
}

.pet-card h3 {
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--pet-ink);
  font-size: 1rem;
  font-weight: 790;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-card:first-child h3 { font-size: 1rem; }

.pet-card-address {
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--pet-muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  color: var(--pet-muted);
  font-size: 0.79rem;
}

.pet-card-open {
  color: var(--pet-green);
  font-weight: 730;
}

.pet-card-open::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
  background: currentColor;
  border-radius: 50%;
}

.pet-card-rating {
  color: #8d5c00;
  font-weight: 720;
}

.pet-card-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pet-card-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  color: #006fa6;
  background: #fff;
  border: 1px solid rgba(0, 139, 207, 0.48);
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.pet-card-action:hover {
  color: #fff;
  background: var(--pet-blue);
}

.pet-card-action-secondary {
  color: var(--pet-ink);
  border-color: var(--pet-line);
}

.pet-empty {
  grid-column: 1 / -1;
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--pet-muted);
  text-align: center;
  background: var(--pet-paper);
  border-radius: 14px;
}

.pet-claim {
  min-height: 92px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 90px;
  padding: 18px 24px;
  background: #e5f6fc;
  border-radius: 16px;
}

.pet-claim-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--pet-blue);
  border-radius: 14px;
  font-size: 1.25rem;
}

.pet-claim h2,
.pet-claim p {
  margin: 0;
}

.pet-claim h2 {
  font-size: 1.35rem;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.pet-claim p {
  color: var(--pet-muted);
  font-size: 0.9rem;
}

.pet-claim > a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 17px;
  color: #fff;
  background: var(--pet-blue);
  border-radius: 11px;
  font-weight: 760;
  text-decoration: none;
}

.pet-claim > a:hover {
  background: #006fa6;
}

.pet-map-toggle {
  position: fixed;
  z-index: 3000;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  min-width: 128px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  color: #fff;
  background: var(--pet-blue);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0, 83, 128, 0.28);
  font-weight: 780;
  cursor: pointer;
}

.pet-map-toggle:hover {
  background: #006fa6;
  transform: translateX(-50%) translateY(-2px);
}

.pet-map-sheet {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: grid;
  grid-template-rows: 58px 1fr;
  background: #fff;
  transform: translateY(102%);
  visibility: hidden;
  transition: transform 440ms cubic-bezier(.16, 1, .3, 1), visibility 440ms;
}

.pet-map-sheet.is-open {
  transform: translateY(0);
  visibility: visible;
}

.pet-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 24px;
  color: #fff;
  background: var(--pet-blue);
}

.pet-map-head strong {
  font-size: 1.1rem;
}

.pet-map-head button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--pet-ink);
  background: #fff;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.pet-map-sheet .map-container {
  height: calc(100dvh - 58px);
  min-height: 420px;
}

.home-pet-shell .poi-panel {
  z-index: 3800;
}

.home-pet-shell .privacy-footer {
  z-index: 3700;
}

body.pet-map-open {
  overflow: hidden;
}

@media (max-width: 1050px) {
  .pet-brand-tagline,
  .pet-top-actions {
    display: none;
  }

  .pet-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(300px, auto);
  }

  .pet-card:first-child {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .pet-topbar {
    height: 60px;
    justify-content: center;
    padding: 0 62px;
  }

  .pet-brand {
    font-size: 1.35rem;
  }

  .pet-brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 10px 10px 10px 4px;
  }

  .pet-header-language {
    position: absolute;
    right: 10px;
    margin-left: 0;
  }

  .pet-header-language .home-lang-select {
    min-width: 98px;
    min-height: 42px;
    padding-left: 11px;
    padding-right: 32px;
    font-size: 0.8rem;
  }

  .home-pet-shell .menu-toggle {
    top: 10px;
    left: 10px;
  }

  .pet-hero,
  .pet-hero-content {
    min-height: 306px;
  }

  .pet-hero-photo {
    object-position: 43% center;
  }

  .pet-hero-content {
    justify-content: end;
    padding: 24px 12px 26px;
  }

  .pet-hero h1 {
    padding: 0 22px;
    color: #fff;
    font-size: clamp(1.8rem, 8vw, 2.55rem);
    line-height: 1.02;
    text-shadow: 0 3px 18px rgba(8, 30, 45, 0.72);
  }

  .pet-hero-shade {
    background: linear-gradient(180deg, rgba(9, 31, 46, 0.02) 25%, rgba(9, 31, 46, 0.72) 100%);
  }

  .pet-search {
    width: 100%;
    min-height: auto;
    grid-template-columns: 1fr 50px;
    grid-template-rows: auto auto;
    padding: 6px;
    border-radius: 15px;
  }

  .pet-search-field {
    min-height: 54px;
    padding-inline: 11px;
  }

  .pet-search-field:nth-of-type(2) {
    grid-row: 2;
    border-top: 1px solid var(--pet-line);
  }

  .pet-search-divider {
    display: none;
  }

  .pet-search-submit {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: stretch;
    width: 48px;
    height: auto;
  }

  .pet-category-wrap {
    width: 100%;
    margin-top: 0;
  }

  .pet-category-rail {
    grid-template-columns: repeat(8, 112px);
    border-radius: 0;
    box-shadow: 0 5px 18px rgba(24, 52, 71, 0.09);
  }

  .pet-category {
    min-height: 82px;
  }

  .pet-lost-strip,
  .pet-results,
  .pet-claim {
    width: calc(100% - 24px);
  }

  .pet-lost-strip {
    grid-template-columns: 40px 1fr;
    padding: 12px 14px;
  }

  .pet-lost-strip p {
    display: none;
  }

  .pet-lost-action {
    grid-column: 2;
    justify-self: start;
    padding: 4px 0;
  }

  .pet-filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 1px 0 8px;
    scrollbar-width: none;
  }

  .pet-filter {
    flex: 0 0 auto;
  }

  .pet-results-head {
    margin-top: 16px;
  }

  .pet-results-head h2 {
    font-size: 1.75rem;
  }

  .pet-card-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2px 2px 12px;
    scrollbar-width: thin;
  }

  .pet-card,
  .pet-card:first-child {
    flex: 0 0 min(84vw, 340px);
    min-height: 390px;
    grid-template-rows: 226px 1fr;
    scroll-snap-align: start;
  }

  .pet-card-body {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pet-card-actions {
    flex-direction: row;
  }

  .pet-card-action {
    flex: 1;
  }

  .pet-claim {
    grid-template-columns: 46px 1fr;
    padding: 16px;
  }

  .pet-claim-icon {
    width: 44px;
    height: 44px;
  }

  .pet-claim > a {
    grid-column: 2;
    justify-self: start;
  }

  .pet-map-toggle {
    bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
