/* Shared public top bar. */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  /* One centred cluster — brand, links, account, search — rather than a bar
     stretched between the two edges. */
  justify-content: center;
  gap: 18px;
  /* Compact: the tallest child (brand mark, links, account button) is 32px,
     so 6px of padding plus a 48px floor keeps it tight without clipping.
     `border-box` is essential — this element did not inherit it, so
     `min-height` was measured on the *content* box and the bar rendered
     12px + 1px taller than asked. */
  box-sizing: border-box;
  min-height: 48px;
  padding: 6px 20px;

  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  font-family: "Fredoka", system-ui, sans-serif;
}

/* The bar carries the page accent: a wash at the top fading into the bar's own
   dark fill, plus a tinted bottom edge. On a pet or egg page the accent is that
   item's colour, so the bar follows it.
   `body` prefix: glass.v1.css loads later and paints `.site-nav` with the shared
   glass fill, which would otherwise win. */
body .site-nav {
  position: sticky;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-accent) 30%, rgba(255, 255, 255, 0.05));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--ui-accent) 18%, rgba(14, 17, 24, 0.92)),
      rgba(14, 17, 24, 0.92) 82%
    );
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  /* A soft white halo, in the same spirit as the demand.gg pet art. `filter:
     drop-shadow` follows the image's rounded shape rather than boxing it.
     Kept at 10% so it reads as a lift off the dark bar, not a glow. */
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}

.site-links {
  display: flex;
  align-items: center;
  gap: 3px;
}

.site-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #a8b1c2;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.site-links a > svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: currentColor;
  stroke: none;
  opacity: 0.75;
}

.site-links a[aria-current="page"] > svg {
  opacity: 1;
}

.site-links a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

/* The current page carries the accent, with a soft glow underneath. */
.site-links a[aria-current="page"] {
  background: color-mix(in srgb, var(--ui-accent) 22%, rgba(255, 255, 255, 0.05));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 32%, transparent),
    0 0 22px -10px var(--ui-accent-glow);
  color: #fff;
}

.site-links a[aria-current="page"]:hover {
  background: color-mix(in srgb, var(--ui-accent) 24%, transparent);
}

.site-account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.site-signin {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #f2f4f8;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.site-signin:hover {
  background: rgba(255, 255, 255, 0.08);
}

.site-user {
  display: flex;
  align-items: center;
  gap: 7px;
}

.site-user[hidden] {
  display: none;
}

.site-user img {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.site-user span {
  max-width: 130px;
  overflow: hidden;
  color: #e8ebf2;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  /* The bar is flush with the viewport edges on a phone, so the shared glass
     ring — a 1px border on all four sides plus its specular ::before — reads
     as a hard outline, and the left/right lines have nothing covering them.
     Keep only the accent bottom edge that separates the bar from the page. */
  body .site-nav {
    border: 0;
    border-bottom: 1px solid
      color-mix(in srgb, var(--ui-accent) 30%, rgba(255, 255, 255, 0.05));
    box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.7);
  }

  .site-nav::before {
    display: none;
  }

  .site-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px;
  }

  .site-brand {
    flex: none;
  }

  .site-brand span {
    display: none;
  }

  .site-brand img {
    width: 28px;
    height: 28px;
  }

  .site-profile-search {
    min-width: 60px;
    max-width: 170px;
    margin-left: auto;
    flex: 0 1 170px;
  }

  .site-search-field {
    width: 100%;
    min-width: 0;
    padding: 0 7px;
    gap: 4px;
  }

  .site-search-input::placeholder {
    color: transparent;
  }

  /* Section names collapse to their icons, keeping every destination on one
     line with the logo, search field, and account button. */
  .site-links {
    flex: none;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0;
    border: 0;
    overflow: visible;
  }

  .site-links a {
    gap: 0;
    padding: 4px;
    font-size: 0;
    line-height: 0;
  }

  .site-links a > svg {
    display: block;
    width: 17px;
    height: 17px;
  }

  .site-account {
    flex: none;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .site-account-button {
    gap: 2px;
    padding: 2px;
  }

  .site-user span {
    display: none;
  }
}

.site-user form {
  margin: 0;
}

.site-signout {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8ebf2;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.site-signout:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-account {
  position: relative;
}

.site-account-button {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  padding: 4px 7px 4px 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #e8ebf2;
  font: inherit;
  cursor: pointer;
}

.site-account-button:hover,
.site-account-button[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.site-account-button img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.site-account-button span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-account-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #7f889a;
  stroke-width: 2;
  stroke-linecap: round;
}

.site-dropdown a[hidden] {
  display: none;
}

.site-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 218px;
  padding: 6px;
  border: 1px solid var(--popup-border);
  border-radius: var(--popup-radius);
  background: var(--popup-bg);
  box-shadow: var(--popup-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.site-dropdown[hidden] {
  display: none;
}

.site-dropdown-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.site-dropdown-head img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.site-dropdown-head b,
.site-dropdown-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-dropdown-head b {
  color: #fff;
  font-size: 12px;
}

.site-dropdown-head span {
  color: #737d90;
  font-size: 9px;
}

.site-dropdown a,
.site-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #cfd5e0;
  font: inherit;
  font-size: 11px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.site-dropdown a:hover,
.site-dropdown button:hover {
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
}

.site-dropdown svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-dropdown form {
  margin: 0;
}

.site-dropdown-sep {
  height: 1px;
  margin: 4px 7px;
  background: rgba(255, 255, 255, 0.08);
}

/* Compact profile search: an icon that expands into a field. */
.site-profile-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}

.site-search-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #9aa4b6;
  cursor: pointer;
}

.site-search-btn:hover {
  border-color: rgba(255, 255, 255, 0.12);
  color: #e6eaf2;
}

.site-search-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Always-visible field: a fixed-width box in the bar, so using it changes
   nothing about the layout. */
.site-search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  width: clamp(190px, 17vw, 240px);
  min-width: 190px;
  flex: 0 0 auto;
  height: 32px;
  box-sizing: border-box;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 160ms ease, background 160ms ease;
}

.site-search-field:focus-within {
  border-color: var(--ui-accent-line);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

.site-search-field svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: #8b94a6;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.site-search-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e6eaf2;
  font: inherit;
  font-size: 12px;
}

.site-search-input::placeholder {
  color: #737d90;
}

/* The browser's own clear button sits inside the rounded field. */
.site-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.site-search-results {
  position: absolute;
  top: 40px;
  left: 50%;
  right: auto;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  transform: translateX(-50%);
  max-height: none;
  overflow: visible;
  padding: 6px;
  border: 1px solid var(--popup-border);
  border-radius: var(--popup-radius);
  /* Opaque on purpose: glass.v1.css gives this panel a frosted fill, and page
     content showing through two-line result rows made them hard to read. */
  background: var(--popup-bg);
  box-shadow: var(--popup-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body .site-search-results {
  background: var(--popup-bg);
}

/* Grouped results: a quiet caption per catalogue, then its rows. */
.site-search-group + .site-search-group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-search-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 4px;
  color: #737d90;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.site-search-group-head span:last-child {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 10px;
}

.site-search-hit-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.site-search-hit-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.site-search-hit-title .variant-icons svg {
  width: 13px;
  height: 13px;
}

.site-search-hit-copy b {
  min-width: 0;
  overflow: hidden;
  color: #e6eaf2;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-search-hit-copy small {
  overflow: hidden;
  color: #737d90;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-search-hit-meta {
  margin-left: auto;
  flex: none;
  color: #a8b1c2;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.site-search-hit {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #c3cad6;
  font-size: 12px;
  text-decoration: none;
}

.site-search-hit:hover,
.site-search-hit.is-active {
  background: rgba(var(--ui-accent-rgb), 0.14);
  color: #fff;
}

.site-search-hit img,
.site-search-initial {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  object-fit: contain;
  color: #dfe4ff;
  font-size: 12px;
  font-weight: 700;
}

/* "See all N pets" footer inside a group. */
.site-search-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 4px 4px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--ui-accent);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.site-search-more:hover,
.site-search-more.is-active {
  background: var(--ui-accent-soft);
}

.site-search-more svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-search-empty {
  padding: 10px;
  color: #7f8899;
  font-size: 11.5px;
  text-align: center;
}

@media (max-width: 760px) {
  /* The compact field is too narrow to anchor a readable result panel; use the
     viewport width below the locked bar instead. */
  .site-search-results {
    position: fixed;
    top: 56px;
    right: 8px;
    left: 8px;
    width: auto;
    transform: none;
  }
}

@media (max-width: 1100px) {
  .site-links a > svg {
    display: none;
  }

  .site-links a {
    gap: 0;
    padding: 7px 8px;
  }

  .site-search-field {
    width: 180px;
    min-width: 180px;
  }
}

@media (max-width: 860px) {
  .site-search-field {
    width: 150px;
    min-width: 150px;
  }
}

/* Nav controls share the site-wide control height. These live here rather than
   in web.v1.css because the legacy hatches page loads only site-nav + its own
   stylesheets, so a rule in web.v1.css would never reach it. */
.site-search-btn,
.site-account-button {
  height: var(--ctl-h, 32px);
  box-sizing: border-box;
}

.site-search-btn {
  width: var(--ctl-h, 32px);
}

/* The 1100px rule above hides nav icons; the mobile bar needs them back. */
@media (max-width: 760px) {
  .site-nav .site-links a > svg {
    display: block;
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 760px) {
  .site-nav .site-links a {
    gap: 0;
    padding: 4px;
    font-size: 0;
    line-height: 0;
  }
}


@media (max-width: 760px) {
  .site-signin {
    padding: 5px 8px;
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .site-nav .site-search-field {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .site-nav .site-account-button {
    justify-content: center;
    gap: 2px;
    min-width: 32px;
    padding: 2px;
  }
}
