body { background-color: #f8f9fa; }

.header-institucional {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  padding: 14px 0 16px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: padding .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.header-institucional::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #d71920 0%, #c4161c 40%, #d71920 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-brand .logo {
  max-height: 54px;
  max-width: min(280px, 58vw);
  height: auto;
  width: auto;
  display: block;
  transition: max-height .22s ease, max-width .22s ease;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  align-items: flex-start;
}

.header-section {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #d71920;
  line-height: 1;
}

.header-title {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 700;
  margin: 0;
  color: #222;
  line-height: 1.18;
  max-width: 760px;
}

.header-home-link {
  color: inherit;
  text-decoration: none;
}

.header-home-link:hover {
  color: #b4161c;
}

.header-institucional.scrolled {
  padding: 9px 0 10px 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.header-institucional.scrolled .header-brand .logo {
  max-height: 44px;
  max-width: min(240px, 52vw);
}

@media (max-width: 768px) {
  .header-inner {
    align-items: flex-start;
    gap: 10px;
  }

  .header-brand .logo {
    max-height: 46px;
    max-width: min(240px, 72vw);
  }

  .header-title {
    font-size: 0.96rem;
  }

  .header-institucional.scrolled .header-brand .logo {
    max-height: 40px;
    max-width: min(210px, 68vw);
  }
}

@media (max-width: 480px) {
  .header-institucional {
    padding: 12px 0 14px 0;
  }

  .header-title {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .header-section {
    font-size: 0.68rem;
    letter-spacing: 1.2px;
  }
}
