/* Find · Cabecera pública y menú de cuenta nativo. */
:root {
  --cb-head-h: 72px;
  --cb-head-offset: 72px;
}

#cb-modern-head,
#cb-modern-head * {
  box-sizing: border-box;
}

#cb-modern-head.cb-find-head {
  position: relative;
  z-index: 30;
  width: 100%;
  height: var(--cb-head-h);
  margin: 0;
  color: var(--text, #182c30);
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-family: var(--font-sans, system-ui, sans-serif);
}

.cb-find-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  height: 100%;
  padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
}

.cb-find-head__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

#cb-modern-head .cb-find-head__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius, 14px);
  font: 700 14px/1.2 var(--font-sans, system-ui, sans-serif);
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background-color 160ms ease, border-color 160ms ease;
}

#cb-modern-head .cb-find-head__button--primary {
  color: #fff;
  background: var(--accent, #0b6b70);
  border-color: var(--accent, #0b6b70);
}

#cb-modern-head .cb-find-head__button--primary:hover {
  background: var(--accent-dark, #07575b);
  border-color: var(--accent-dark, #07575b);
}

#cb-modern-head .cb-find-head__button--secondary {
  color: inherit;
  background: #fff;
  border-color: var(--border, #e5e7eb);
}

#cb-modern-head .cb-find-head__button--secondary:hover {
  background: var(--hover, #f3f4f6);
}

#cb-modern-head .cb-find-head__brand {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

.cb-find-head__logo {
  display: block;
  width: 128px;
  max-width: 100%;
  height: 42px;
  margin: 0;
  object-fit: contain;
  object-position: left center;
}

.cb-find-head__name {
  overflow: hidden;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#cb-modern-head a:focus-visible,
#cb-modern-head summary:focus-visible {
  outline: 3px solid var(--accent, #0b6b70);
  outline-offset: 3px;
}

.cb-find-head__user {
  position: relative;
  margin: 0;
}

.cb-find-head__user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: #fff;
  color: inherit;
  list-style: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.cb-find-head__user-toggle::-webkit-details-marker {
  display: none;
}

.cb-find-head__user-toggle:hover,
.cb-find-head__user[open] > summary {
  background: var(--hover, #f3f4f6);
}

.cb-find-head__avatar {
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--hover, #f3f4f6);
}

.cb-find-head__avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-find-head__user-name {
  overflow: hidden;
  max-width: 200px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-find-head__caret {
  display: block;
  flex: 0 0 16px;
  transition: transform 160ms ease;
}

.cb-find-head__user[open] .cb-find-head__caret {
  transform: rotate(180deg);
}

.cb-find-head__user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1;
  width: min(300px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  max-height: min(70dvh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  color: var(--text, #182c30);
  background: #fff;
  box-shadow: 0 12px 34px rgba(17, 24, 39, .13);
}

#cb-modern-head .cb-find-head__user-menu > a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px;
  border-radius: 8px;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}

#cb-modern-head .cb-find-head__user-menu > a:hover {
  background: var(--hover, #f3f4f6);
}

.cb-find-head__user-menu .dashicons {
  flex: 0 0 20px;
  font-size: 19px;
}

#cb-modern-head .cb-find-head__logout {
  margin-top: 5px;
  border-top: 1px solid var(--border, #e5e7eb);
  border-radius: 0 0 8px 8px;
}

@media (max-width: 600px) {
  :root {
    --cb-head-h: 64px;
    --cb-head-offset: 64px;
  }
  .cb-find-head__inner {
    gap: 12px;
    padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  }
  .cb-find-head__actions {
    gap: 6px;
  }
  #cb-modern-head .cb-find-head__button {
    min-height: 42px;
    padding-inline: 11px;
    border-radius: 11px;
    font-size: 13px;
  }
  .cb-find-head__logo {
    width: 100px;
    height: 38px;
  }
  .cb-find-head__name {
    font-size: 22px;
  }
  .cb-find-head__user-name {
    max-width: min(130px, 30vw);
    font-size: 13px;
  }
}

@media (max-width: 359px) {
  .cb-find-head__inner {
    gap: 8px;
    padding-inline: 8px;
  }
  #cb-modern-head .cb-find-head__button {
    padding-inline: 9px;
    font-size: 12px;
  }
  .cb-find-head__logo {
    width: 82px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #cb-modern-head .cb-find-head__button,
  #cb-modern-head .cb-find-head__caret {
    transition: none;
  }
}
