Kidnapping
Most people think of kidnapping as the taking and imprisonment of a person in order to hold them for ransom. While this certainly is the traditional definition of the crime of kidnapping, most modern kidnapping charges originate in three scenarios: Kidnapping for the purpose of committing a sex crime; as part of a domestic violence incident; or during the commission of a robbery.

The crime of kidnapping is defined in California Penal Code Section 207:

(a) Every person who forcibly, or by any other means of
instilling fear, steals or takes, or holds, detains, or arrests any
person in this state, and carries the person into another country,
state, or county, or into another part of the same county, is guilty
of kidnapping.
(b) Every person, who for the purpose of committing any act
defined in Section 288, hires, persuades, entices, decoys, or seduces
by false promises, misrepresentations, or the like, any child under
the age of 14 years to go out of this country, state, or county, or
into another part of the same county, is guilty of kidnapping.
(c) Every person who forcibly, or by any other means of instilling
fear, takes or holds, detains, or arrests any person, with a design
to take the person out of this state, without having established a
claim, according to the laws of the United States, or of this state,
or who hires, persuades, entices, decoys, or seduces by false
promises, misrepresentations, or the like, any person to go out of
this state, or to be taken or removed therefrom, for the purpose and
with the intent to sell that person into slavery or involuntary
servitude, or otherwise to employ that person for his or her own use,
or to the use of another, without the free will and consent of that
persuaded person, is guilty of kidnapping.
(d) Every person who, being out of this state, abducts or takes by
force or fraud any person contrary to the law of the place where
that act is committed, and brings, sends, or conveys that person
within the limits of this state, and is afterwards found within the
limits thereof, is guilty of kidnapping.
(e) For purposes of those types of kidnapping requiring force, the
amount of force required to kidnap an unresisting infant or child is
the amount of physical force required to take and carry the child
away a substantial distance for an illegal purpose or with an illegal
intent.
(f) Subdivisions (a) to (d), inclusive, do not apply to any of the
following:
(1) To any person who steals, takes, entices away, detains,
conceals, or harbors any child under the age of 14 years, if that act
is taken to protect the child from danger of imminent harm.
(2) To any person acting under Section 834 or 837.

While most of the section follows traditional thought about the crime of kidnapping, subsection (b)contains a serious problem for those accused of sex crimes against children. Simply persuading a child under the age of 14 to travel for the purpose of sex triggers a charge of kidnapping, and substantial additional penalties.

California Penal Code Section 208 defines the punishment for kidnapping other than for ransom:

(a) Kidnapping is punishable by imprisonment in the state
prison for three, five, or eight years.
(b) If the person kidnapped is under 14 years of age at the time
of the commission of the crime, the kidnapping is punishable by
imprisonment in the state prison for 5, 8, or 11 years. This
subdivision is not applicable to the taking, detaining, or
concealing, of a minor child by a biological parent, a natural
father, as specified in Section 7611 of the Family Code, an adoptive
parent, or a person who has been granted access to the minor child by
a court order.
(c) In all cases in which probation is granted, the court shall,
except in unusual cases where the interests of justice would best be
served by a lesser penalty, require as a condition of the probation
that the person be confined in the county jail for 12 months. If the
court grants probation without requiring the defendant to be confined
in the county jail for 12 months, it shall specify its reason or
reasons for imposing a lesser penalty.

Kidnapping for ransom is covered by a separate penal code section, Section 209:

(a) Any person who seizes, confines, inveigles, entices,
decoys, abducts, conceals, kidnaps or carries away another person by
any means whatsoever with intent to hold or detain, or who holds or
detains, that person for ransom, reward or to commit extortion or to
exact from another person any money or valuable thing, or any person
who aids or abets any such act, is guilty of a felony, and upon
conviction thereof, shall be punished by imprisonment in the state
prison for life without possibility of parole in cases in which any
person subjected to any such act suffers death or bodily harm, or is
intentionally confined in a manner which exposes that person to a
substantial likelihood of death, or shall be punished by imprisonment
in the state prison for life with the possibility of parole in cases
where no such person suffers death or bodily harm.
(b) (1) Any person who kidnaps or carries away any individual to
commit robbery, rape, spousal rape, oral copulation, sodomy, or any
violation of Section 264.1, 288, or 289, shall be punished by
imprisonment in the state prison for life with the possibility of
parole.
(2) This subdivision shall only apply if the movement of the
victim is beyond that merely incidental to the commission of, and
increases the risk of harm to the victim over and above that
necessarily present in, the intended underlying offense.
(c) In all cases in which probation is granted, the court shall,
except in unusual cases where the interests of justice would best be
served by a lesser penalty, require as a condition of the probation
that the person be confined in the county jail for 12 months. If the
court grants probation without requiring the defendant to be confined
in the county jail for 12 months, it shall specify its reason or
reasons for imposing a lesser penalty.
(d) Subdivision (b) shall not be construed to supersede or affect
Section 667.61. A person may be charged with a violation of
subdivision (b) and Section 667.61. However, a person may not be
punished under subdivision (b) and Section 667.61 for the same act
that constitutes a violation of both subdivision (b) and Section
667.61.

As shown above, the standard punishment for kidnapping for ransom is life in prison.

There is one statutory defense against an accusation of kidnapping a child – the last subsection of Section 207 states that it is not kidnapping when the act is done to protect the child from harm.

Aside from that, any defenses to kidnapping must be factual in nature, and will involve:

Consent (real or apparent) if the alleged victim agreed to be taken to another place, then there is no kidnapping.

Insufficient asportation (movement of the victim from one place to another)

Nonparticipation: mere presence at the scene of a kidnapping is not sufficient for a conviction. However, this will not stop you from being charged. If you were present at a kidnapping and were arrested, you can be certain that the police and prosecution will try to claim that you acted as a lookout.

Identification/mistaken identity: Unless you were caught in the act of a kidnapping, then identification will certainly be in issue. In this case you will need an attorney who is experienced in handling identification issues, including lineup motions.