.nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h);
    z-index: 10000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .75);
    backdrop-filter: saturate(140%) blur(6px);
    border-bottom: 1px solid var(--border);
}

.nav .brand {
    font-weight: 800;
}

.nav nav {
    margin-left: 0;
    display: flex;
    justify-content: center;
    gap: 32px;
}

.nav nav a {
    position: relative;
    padding: 6px 0;
}

.nav nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width .25s ease;
}

.nav nav a:hover::after,
.nav nav a.is-active::after {
    width: 100%;
}

.nav nav a.is-active {
    color: var(--accent);
}

.nav__toggle {
    display: none;
    margin-left: auto;
    font-size: 22px;
    background: none;
    border: 0;
    cursor: pointer;
}

/* Panel móvil */
.nav__panel {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    height: calc(100vh - var(--nav-h));
    width: min(70vw, 320px);
    background: #fff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, .16);
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 10001;
    display: flex;
    padding: 14px 18px;
}

.nav__panel nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav__panel a {
    font-weight: 600;
}

.nav__scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 10000;
}

.nav.is-open .nav__panel {
    transform: translateX(0);
}

.nav.is-open .nav__scrim {
    opacity: 1;
    pointer-events: auto;
}

/* Layout de 3 zonas: brand (izq) | nav (centro) | acciones (der) */
.nav{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

/* Centro el menú */
.nav > nav{
  justify-self: center;
}

/* Botón de acción derecha (Contactar) */
.nav__actions a{
  display:inline-block;
  padding:8px 14px;
  border-radius:10px;
  border:1.5px solid var(--txt);
  font-weight:700;
  text-decoration:none;
}
.nav__actions .btn--ghost{
  background:#fff;
}
.nav__actions .btn--accent{
  background: var(--accent);
  color:#fff;
  border-color: var(--accent);
}

/* Brand oculto y animable */
.brand--sticky{
  display:flex; align-items:center; gap:8px;
  font-weight:800; text-decoration:none;
  opacity:0; pointer-events:none;
  transform: translateY(-6px) scale(.98);
  transition: opacity .35s ease, transform .35s ease;
}
.brand--sticky img{
  width:28px; height:28px; border-radius:50%;
  object-fit:cover; border:1px solid var(--border);
  filter:grayscale(100%) contrast(1.05);
}
.nav--scrolled .brand--sticky{
  opacity:1; pointer-events:auto;
  transform: translateY(0) scale(1);
}

/* Navbar elevado al hacer scroll */
.nav--scrolled{
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 28px rgba(0,0,0,.07);
}

/* Responsive: oculta botón derecho y centra nav en móvil */
@media (max-width:760px){
  .nav{
    grid-template-columns: auto 1fr auto;
  }
  .nav > nav{ display:none; }          /* ya usas panel móvil */
  .nav__actions{ display:none; }
}

/* Breakpoints del header */
@media (min-width:761px) {

    .nav__panel,
    .nav__scrim {
        display: none;
    }
}

@media (max-width:760px) {
    .nav nav {
        display: none;
    }

    .nav__toggle {
        display: block;
    }
}